Greenfin

Mythtv v.29 ./configure

Aug 10th, 2017
941
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 295.64 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # MythTV configure script, based on the FFmpeg configure script
  4. #
  5. # Copyright (c) 2000-2002 Fabrice Bellard
  6. # Copyright (c) 2005-2008 Diego Biurrun
  7. # Copyright (c) 2005-2008 Mans Rullgard
  8. #
  9.  
  10. # Prevent locale nonsense from breaking basic text processing.
  11. LC_ALL=C
  12. export LC_ALL
  13.  
  14. # make sure we are running under a compatible shell
  15. # try to make this part work with most shells
  16.  
  17. try_exec(){
  18. echo "Trying shell $1"
  19. type "$1" > /dev/null 2>&1 && exec "$@"
  20. }
  21.  
  22. unset foo
  23. (: ${foo%%bar}) 2> /dev/null
  24. E1="$?"
  25.  
  26. (: ${foo?}) 2> /dev/null
  27. E2="$?"
  28.  
  29. if test "$E1" != 0 || test "$E2" = 0; then
  30. echo "Broken shell detected. Trying alternatives."
  31. export FF_CONF_EXEC
  32. if test "0$FF_CONF_EXEC" -lt 1; then
  33. FF_CONF_EXEC=1
  34. try_exec bash "$0" "$@"
  35. fi
  36. if test "0$FF_CONF_EXEC" -lt 2; then
  37. FF_CONF_EXEC=2
  38. try_exec ksh "$0" "$@"
  39. fi
  40. if test "0$FF_CONF_EXEC" -lt 3; then
  41. FF_CONF_EXEC=3
  42. try_exec /usr/xpg4/bin/sh "$0" "$@"
  43. fi
  44. echo "No compatible shell script interpreter found."
  45. echo "This configure script requires a POSIX-compatible shell"
  46. echo "such as bash or ksh."
  47. echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH."
  48. echo "Instead, install a working POSIX-compatible shell."
  49. echo "Disabling this configure test will create a broken MythTV."
  50. if test "$BASH_VERSION" = '2.04.0(1)-release'; then
  51. echo "This bash version ($BASH_VERSION) is broken on your platform."
  52. echo "Upgrade to a later version if available."
  53. fi
  54. exit 1
  55. fi
  56.  
  57. test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
  58.  
  59. show_help(){
  60. cat <<EOF
  61. Usage: configure [options]
  62. Options: [defaults in brackets after descriptions]
  63.  
  64. Standard options:
  65. --help print this message
  66. --previous use previous configure parameters if possible
  67. --compile-type=CTYPE one of release, profile, debug [$compile_type]
  68. NOTE: profile is for sampling profilers
  69. --prefix=PREFIX install in PREFIX [$prefix]
  70. --runprefix=PREFIX prefix to be used at runtime (e.g. .. or /myth/latest)
  71. --libdir-name=LIBNAME search/install libraries in PREFIX/LIBNAME [$libdir_name]
  72. --disable-ccache disable compiler cache (ccache)
  73. --disable-distcc disable distributed compilation (distcc)
  74.  
  75. Advanced options (experts only):
  76. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  77. --enable-cross-compile assume a cross-compiler is used
  78. --sysroot=PATH root of cross-build tree
  79. --sysinclude=PATH location of cross-build system headers
  80. --cc=CC use C compiler CC [$cc_default]
  81. --cxx=CXX use C++ compiler CXX [$cxx_default]
  82. --ld=LD use linker LD
  83. --qmake=QMAKE use specified qmake [$qmake_default]
  84. --qmakespecs=PATH use specified mkspecs
  85. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  86. --extra-cxxflags=ECXFLAGS add ECXXFLAGS to list of flags for C++ compile
  87. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  88. --disable-symbol-visibility disables symbol visibility options
  89. --arch=ARCH select architecture [$arch]
  90. --tune=CPU tune instruction usage for a particular CPU [$tune]
  91. --cpu=CPU select the minimum required CPU (affects
  92. instruction selection, may crash on older CPUs)
  93. --disable-altivec disable AltiVec optimizations
  94. --disable-amd3dnow disable 3DNow! optimizations
  95. --disable-amd3dnowext disable 3DNow! extended optimizations
  96. --disable-mmx disable MMX optimizations
  97. --disable-mmx2 disable MMX2 optimizations
  98. --disable-sse disable SSE optimizations
  99. --disable-ssse3 disable SSSE3 optimizations
  100. --disable-avx disable AVX optimizations
  101. --disable-yasm disable use of yasm assembler
  102. --enable-pic build position-independent code
  103. --enable-proc-opt enable processor specific compilation
  104.  
  105. --disable-audio-oss disable OSS audio support
  106. --disable-audio-alsa disable ALSA audio support
  107. --disable-audio-jack disable JACK audio support
  108. --disable-audio-pulseoutput disable PulseAudio audio output support
  109. --enable-valgrind disables timeouts for valgrind memory debugging
  110. --disable-lirc disable lirc support (Infrared Remotes)
  111. --disable-joystick-menu disable joystick menu
  112. --disable-libcec disable libCEC device support
  113. --libcec-path=HDRLOC location of directory containing
  114. 'libcec/cec.h', not the directory
  115. with 'cec.h' [$libcec_path_default]
  116. --firewire-sdk specify location for mac FireWire SDK [mac only]
  117. --disable-firewire disable support for FireWire cable boxes
  118. --disable-hdhomerun disable support for HDHomeRun boxes
  119. --disable-vbox disable support for V@Box TV Gateway boxes
  120. --disable-ceton disable support for Ceton cards
  121. --disable-v4l2 disable Video4Linux support
  122. --disable-ivtv disable ivtv support (PVR-x50) req. v4l2 support
  123. --disable-hdpvr disable HD-PVR support
  124. --disable-dvb disable DVB support
  125. --dvb-path=HDRLOC location of directory containing
  126. 'linux/dvb/frontend.h', not the
  127. directory with frontend.h [$dvb_path_default]
  128. --disable-asi disable support for ASI recorder
  129. --disable-x11 disable X11 support
  130. --x11-path=X11LOC location of X11 include files [$x11_path_default]
  131. --disable-xrandr disable X11 resolution switching
  132. --disable-xv disable XVideo (X11 video output accel.)
  133. --disable-vdpau disable NVidia VDPAU hardware acceleration.
  134. --disable-crystalhd disable Broadcom CrystalHD hardware decoder support
  135. --disable-vaapi disable VAAPI hardware accelerated video decoding
  136. --disable-openmax disable OpenMAX hardware accelerated video decoding
  137. --disable-dxva2 disable hardware accelerated decoding on windows
  138. --disable-opengl-video disable OpenGL based video display
  139. --disable-opengl-themepainter disable OpenGL based theme painting
  140. --disable-libass disable libass SSA/ASS subtitle support
  141. --disable-systemd_notify disable systemd notify support
  142. --disable-systemd_journal disable systemd journal support
  143.  
  144. --enable-mac-bundle produce standalone OS X apps (e.g. mythfrontend.app)
  145.  
  146. --disable-libxml2 disable libxml2 support (disc metadata)
  147. --libxml2-path=HDRLOC location of directory containing
  148. 'libxml/parser.h', not the
  149. directory with parser.h [$libxml2_path_default]
  150. --disable-libdns-sd disable DNS Service Discovery (Bonjour/Zeroconf/Avahi)
  151. --disable-libcrypto disable use of the OpenSSL cryptographic library
  152.  
  153. --with-bindings=LIST install the bindings specified in the
  154. comma-separated list
  155. Supported bindings: perl, python, php
  156. comma-separated list
  157. --python=PATH Force a specific python executable to use [$python_default]
  158. --perl-config-opts=OPTS Additional options to pass when generating
  159. Makefile.perl for building Perl bindings.
  160. --enable-mythlogserver Enable mythlogserver logging daemon facility
  161. --enable-bdjava Enable BD-J support for Blu-ray discs
  162.  
  163. External codec library options (used for mythffmpeg and streaming transcode):
  164. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  165. --enable-libx264 enable H.264 encoding via x264 [no]
  166. --enable-libvpx enable VP8 encoding via libvpx [no]
  167. --enable-libxvid enable Xvid encoding via xvidcore,
  168. native MPEG-4/Xvid encoder exists [no]
  169. --enable-sdl2 enable Simple DirectMedia Layer (required for ffplay)
  170. EOF
  171.  
  172. #following is ffmpeg's configure help text
  173. <<EOF
  174. Help options:
  175. --help print this message
  176. --list-decoders show all available decoders
  177. --list-encoders show all available encoders
  178. --list-hwaccels show all available hardware accelerators
  179. --list-demuxers show all available demuxers
  180. --list-muxers show all available muxers
  181. --list-parsers show all available parsers
  182. --list-protocols show all available protocols
  183. --list-bsfs show all available bitstream filters
  184. --list-indevs show all available input devices
  185. --list-outdevs show all available output devices
  186. --list-filters show all available filters
  187.  
  188. Standard options:
  189. --logfile=FILE log tests and output to FILE [config.log]
  190. --disable-logging do not log configure debug information
  191. --fatal-warnings fail if any configure warning is generated
  192. --prefix=PREFIX install in PREFIX [$prefix]
  193. --bindir=DIR install binaries in DIR [PREFIX/bin]
  194. --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
  195. --docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
  196. --libdir=DIR install libs in DIR [PREFIX/lib]
  197. --shlibdir=DIR install shared libs in DIR [LIBDIR]
  198. --incdir=DIR install includes in DIR [PREFIX/include]
  199. --mandir=DIR install man page in DIR [PREFIX/share/man]
  200. --pkgconfigdir=DIR install pkg-config files in DIR [LIBDIR/pkgconfig]
  201. --enable-rpath use rpath to allow installing libraries in paths
  202. not part of the dynamic linker search path
  203. use rpath when linking programs [USE WITH CARE]
  204. --install-name-dir=DIR Darwin directory name for installed targets
  205.  
  206. Licensing options:
  207. --enable-gpl allow use of GPL code, the resulting libs
  208. and binaries will be under GPL [no]
  209. --enable-version3 upgrade (L)GPL to version 3 [no]
  210. --enable-nonfree allow use of nonfree code, the resulting libs
  211. and binaries will be unredistributable [no]
  212.  
  213. Configuration options:
  214. --disable-static do not build static libraries [no]
  215. --enable-shared build shared libraries [no]
  216. --enable-small optimize for size instead of speed
  217. --disable-runtime-cpudetect disable detecting cpu capabilities at runtime (smaller binary)
  218. --enable-gray enable full grayscale support (slower color)
  219. --disable-swscale-alpha disable alpha channel support in swscale
  220. --disable-all disable building components, libraries and programs
  221. --enable-raise-major increase major version numbers in sonames [no]
  222.  
  223. Program options:
  224. --disable-programs do not build command line programs
  225. --disable-ffmpeg disable ffmpeg build
  226. --disable-ffplay disable ffplay build
  227. --disable-ffprobe disable ffprobe build
  228. --disable-ffserver disable ffserver build
  229.  
  230. Documentation options:
  231. --disable-doc do not build documentation
  232. --disable-htmlpages do not build HTML documentation pages
  233. --disable-manpages do not build man documentation pages
  234. --disable-podpages do not build POD documentation pages
  235. --disable-txtpages do not build text documentation pages
  236.  
  237. Component options:
  238. --disable-avdevice disable libavdevice build
  239. --disable-avcodec disable libavcodec build
  240. --disable-avformat disable libavformat build
  241. --disable-swresample disable libswresample build
  242. --disable-swscale disable libswscale build
  243. --disable-postproc disable libpostproc build
  244. --disable-avfilter disable libavfilter build
  245. --enable-avresample enable libavresample build [no]
  246. --disable-pthreads disable pthreads [autodetect]
  247. --disable-w32threads disable Win32 threads [autodetect]
  248. --disable-os2threads disable OS/2 threads [autodetect]
  249. --disable-network disable network support [no]
  250. --disable-dct disable DCT code
  251. --disable-dwt disable DWT code
  252. --disable-error-resilience disable error resilience code
  253. --disable-lsp disable LSP code
  254. --disable-lzo disable LZO decoder code
  255. --disable-mdct disable MDCT code
  256. --disable-rdft disable RDFT code
  257. --disable-fft disable FFT code
  258. --disable-faan disable floating point AAN (I)DCT code
  259. --disable-pixelutils disable pixel utils in libavutil
  260.  
  261. Individual component options:
  262. --disable-everything disable all components listed below
  263. --disable-encoder=NAME disable encoder NAME
  264. --enable-encoder=NAME enable encoder NAME
  265. --disable-encoders disable all encoders
  266. --disable-decoder=NAME disable decoder NAME
  267. --enable-decoder=NAME enable decoder NAME
  268. --disable-decoders disable all decoders
  269. --disable-hwaccel=NAME disable hwaccel NAME
  270. --enable-hwaccel=NAME enable hwaccel NAME
  271. --disable-hwaccels disable all hwaccels
  272. --disable-muxer=NAME disable muxer NAME
  273. --enable-muxer=NAME enable muxer NAME
  274. --disable-muxers disable all muxers
  275. --disable-demuxer=NAME disable demuxer NAME
  276. --enable-demuxer=NAME enable demuxer NAME
  277. --disable-demuxers disable all demuxers
  278. --enable-parser=NAME enable parser NAME
  279. --disable-parser=NAME disable parser NAME
  280. --disable-parsers disable all parsers
  281. --enable-bsf=NAME enable bitstream filter NAME
  282. --disable-bsf=NAME disable bitstream filter NAME
  283. --disable-bsfs disable all bitstream filters
  284. --enable-protocol=NAME enable protocol NAME
  285. --disable-protocol=NAME disable protocol NAME
  286. --disable-protocols disable all protocols
  287. --enable-indev=NAME enable input device NAME
  288. --disable-indev=NAME disable input device NAME
  289. --disable-indevs disable input devices
  290. --enable-outdev=NAME enable output device NAME
  291. --disable-outdev=NAME disable output device NAME
  292. --disable-outdevs disable output devices
  293. --disable-devices disable all devices
  294. --enable-filter=NAME enable filter NAME
  295. --disable-filter=NAME disable filter NAME
  296. --disable-filters disable all filters
  297.  
  298. External library support:
  299.  
  300. Using any of the following switches will allow FFmpeg to link to the
  301. corresponding external library. All the components depending on that library
  302. will become enabled, if all their other dependencies are met and they are not
  303. explicitly disabled. E.g. --enable-libwavpack will enable linking to
  304. libwavpack and allow the libwavpack encoder to be built, unless it is
  305. specifically disabled with --disable-encoder=libwavpack.
  306.  
  307. Note that only the system libraries are auto-detected. All the other external
  308. libraries must be explicitly enabled.
  309.  
  310. Also note that the following help text describes the purpose of the libraries
  311. themselves, not all their features will necessarily be usable by FFmpeg.
  312.  
  313. --enable-avisynth enable reading of AviSynth script files [no]
  314. --disable-bzlib disable bzlib [autodetect]
  315. --enable-chromaprint enable audio fingerprinting with chromaprint [no]
  316. --enable-frei0r enable frei0r video filtering [no]
  317. --enable-gcrypt enable gcrypt, needed for rtmp(t)e support
  318. if openssl, librtmp or gmp is not used [no]
  319. --enable-gmp enable gmp, needed for rtmp(t)e support
  320. if openssl or librtmp is not used [no]
  321. --enable-gnutls enable gnutls, needed for https support
  322. if openssl is not used [no]
  323. --disable-iconv disable iconv [autodetect]
  324. --enable-jni enable JNI support [no]
  325. --enable-ladspa enable LADSPA audio filtering [no]
  326. --enable-libass enable libass subtitles rendering,
  327. needed for subtitles and ass filter [no]
  328. --enable-libbluray enable BluRay reading using libbluray [no]
  329. --enable-libbs2b enable bs2b DSP library [no]
  330. --enable-libcaca enable textual display using libcaca [no]
  331. --enable-libcelt enable CELT decoding via libcelt [no]
  332. --enable-libcdio enable audio CD grabbing with libcdio [no]
  333. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  334. and libraw1394 [no]
  335. --enable-libebur128 enable libebur128 for EBU R128 measurement,
  336. needed for loudnorm filter [no]
  337. --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
  338. --enable-libflite enable flite (voice synthesis) support via libflite [no]
  339. --enable-libfontconfig enable libfontconfig, useful for drawtext filter [no]
  340. --enable-libfreetype enable libfreetype, needed for drawtext filter [no]
  341. --enable-libfribidi enable libfribidi, improves drawtext filter [no]
  342. --enable-libgme enable Game Music Emu via libgme [no]
  343. --enable-libgsm enable GSM de/encoding via libgsm [no]
  344. --enable-libiec61883 enable iec61883 via libiec61883 [no]
  345. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  346. --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
  347. --enable-libmodplug enable ModPlug via libmodplug [no]
  348. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  349. --enable-libnut enable NUT (de)muxing via libnut,
  350. native (de)muxer exists [no]
  351. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  352. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  353. --enable-libopencv enable video filtering via libopencv [no]
  354. --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
  355. --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
  356. --enable-libopenmpt enable decoding tracked files via libopenmpt [no]
  357. --enable-libopus enable Opus de/encoding via libopus [no]
  358. --enable-libpulse enable Pulseaudio input via libpulse [no]
  359. --enable-librubberband enable rubberband needed for rubberband filter [no]
  360. --enable-librtmp enable RTMP[E] support via librtmp [no]
  361. --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
  362. --enable-libshine enable fixed-point MP3 encoding via libshine [no]
  363. --enable-libsmbclient enable Samba protocol via libsmbclient [no]
  364. --enable-libsnappy enable Snappy compression, needed for hap encoding [no]
  365. --enable-libsoxr enable Include libsoxr resampling [no]
  366. --enable-libspeex enable Speex de/encoding via libspeex [no]
  367. --enable-libssh enable SFTP protocol via libssh [no]
  368. --enable-libtesseract enable Tesseract, needed for ocr filter [no]
  369. --enable-libtheora enable Theora encoding via libtheora [no]
  370. --enable-libtwolame enable MP2 encoding via libtwolame [no]
  371. --enable-libv4l2 enable libv4l2/v4l-utils [no]
  372. --enable-libvidstab enable video stabilization using vid.stab [no]
  373. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  374. --enable-libvorbis enable Vorbis en/decoding via libvorbis,
  375. native implementation exists [no]
  376. --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
  377. --enable-libwavpack enable wavpack encoding via libwavpack [no]
  378. --enable-libwebp enable WebP encoding via libwebp [no]
  379. --enable-libx264 enable H.264 encoding via x264 [no]
  380. --enable-libx265 enable HEVC encoding via x265 [no]
  381. --enable-libxavs enable AVS encoding via xavs [no]
  382. --enable-libxcb enable X11 grabbing using XCB [autodetect]
  383. --enable-libxcb-shm enable X11 grabbing shm communication [autodetect]
  384. --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect]
  385. --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
  386. --enable-libxvid enable Xvid encoding via xvidcore,
  387. native MPEG-4/Xvid encoder exists [no]
  388. --enable-libzimg enable z.lib, needed for zscale filter [no]
  389. --enable-libzmq enable message passing via libzmq [no]
  390. --enable-libzvbi enable teletext support via libzvbi [no]
  391. --disable-lzma disable lzma [autodetect]
  392. --enable-decklink enable Blackmagic DeckLink I/O support [no]
  393. --enable-mediacodec enable Android MediaCodec support [no]
  394. --enable-netcdf enable NetCDF, needed for sofalizer filter [no]
  395. --enable-openal enable OpenAL 1.1 capture support [no]
  396. --enable-opencl enable OpenCL code
  397. --enable-opengl enable OpenGL rendering [no]
  398. --enable-openssl enable openssl, needed for https support
  399. if gnutls is not used [no]
  400. --disable-schannel disable SChannel SSP, needed for TLS support on
  401. Windows if openssl and gnutls are not used [autodetect]
  402. --disable-sdl2 disable sdl2 [autodetect]
  403. --disable-securetransport disable Secure Transport, needed for TLS support
  404. on OSX if openssl and gnutls are not used [autodetect]
  405. --enable-x11grab enable X11 grabbing (legacy) [no]
  406. --disable-xlib disable xlib [autodetect]
  407. --disable-zlib disable zlib [autodetect]
  408.  
  409. The following libraries provide various hardware acceleration features:
  410. --disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
  411. --enable-cuda enable dynamically linked Nvidia CUDA code [no]
  412. --enable-cuvid enable Nvidia CUVID support [autodetect]
  413. --disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
  414. --disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
  415. --enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
  416. --enable-libnpp enable Nvidia Performance Primitives-based code [no]
  417. --enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
  418. --disable-nvenc disable Nvidia video encoding code [autodetect]
  419. --enable-omx enable OpenMAX IL code [no]
  420. --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
  421. --disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
  422. --disable-vda disable Apple Video Decode Acceleration code [autodetect]
  423. --disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
  424. --disable-videotoolbox disable VideoToolbox code [autodetect]
  425.  
  426. Toolchain options:
  427. --arch=ARCH select architecture [$arch]
  428. --cpu=CPU select the minimum required CPU (affects
  429. instruction selection, may crash on older CPUs)
  430. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  431. --progs-suffix=SUFFIX program name suffix []
  432. --enable-cross-compile assume a cross-compiler is used
  433. --sysroot=PATH root of cross-build tree
  434. --sysinclude=PATH location of cross-build system headers
  435. --target-os=OS compiler targets OS [$target_os]
  436. --target-exec=CMD command to run executables on target
  437. --target-path=DIR path to view of build directory on target
  438. --target-samples=DIR path to samples directory on target
  439. --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
  440. --toolchain=NAME set tool defaults according to NAME
  441. --nm=NM use nm tool NM [$nm_default]
  442. --ar=AR use archive tool AR [$ar_default]
  443. --as=AS use assembler AS [$as_default]
  444. --ln_s=LN_S use symbolic link tool LN_S [$ln_s_default]
  445. --strip=STRIP use strip tool STRIP [$strip_default]
  446. --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
  447. --yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
  448. --cc=CC use C compiler CC [$cc_default]
  449. --cxx=CXX use C compiler CXX [$cxx_default]
  450. --objcc=OCC use ObjC compiler OCC [$cc_default]
  451. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  452. --ld=LD use linker LD [$ld_default]
  453. --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
  454. --pkg-config-flags=FLAGS pass additional flags to pkgconf []
  455. --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
  456. --doxygen=DOXYGEN use DOXYGEN to generate API doc [$doxygen_default]
  457. --host-cc=HOSTCC use host C compiler HOSTCC
  458. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  459. --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
  460. --host-ld=HOSTLD use host linker HOSTLD
  461. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  462. --host-libs=HLIBS use libs HLIBS when linking for host
  463. --host-os=OS compiler host OS [$target_os]
  464. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  465. --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
  466. --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
  467. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  468. --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
  469. --extra-ldlibflags=ELDFLAGS add ELDFLAGS to LDLIBFLAGS [$LDLIBFLAGS]
  470. --extra-libs=ELIBS add ELIBS [$ELIBS]
  471. --extra-version=STRING version string suffix []
  472. --optflags=OPTFLAGS override optimization-related compiler flags
  473. --build-suffix=SUFFIX library name suffix []
  474. --bdj-type=TYPE Specify the type of BD-J implementation (j2se,
  475. j2me) [$bdj_type]
  476. --enable-pic build position-independent code
  477. --enable-thumb compile for Thumb instruction set
  478. --enable-lto use link-time optimization
  479. --env="ENV=override" override the environment variables
  480.  
  481. Advanced options (experts only):
  482. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  483. --custom-allocator=NAME use a supported custom allocator
  484. --disable-symver disable symbol versioning
  485. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  486. --disable-safe-bitstream-reader
  487. disable buffer boundary checking in bitreaders
  488. (faster, but may crash)
  489. --enable-memalign-hack emulate memalign, interferes with memory debuggers
  490. --sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
  491.  
  492. Optimization options (experts only):
  493. --disable-asm disable all assembly optimizations
  494. --disable-altivec disable AltiVec optimizations
  495. --disable-vsx disable VSX optimizations
  496. --disable-power8 disable POWER8 optimizations
  497. --disable-amd3dnow disable 3DNow! optimizations
  498. --disable-amd3dnowext disable 3DNow! extended optimizations
  499. --disable-mmx disable MMX optimizations
  500. --disable-mmxext disable MMXEXT optimizations
  501. --disable-sse disable SSE optimizations
  502. --disable-sse2 disable SSE2 optimizations
  503. --disable-sse3 disable SSE3 optimizations
  504. --disable-ssse3 disable SSSE3 optimizations
  505. --disable-sse4 disable SSE4 optimizations
  506. --disable-sse42 disable SSE4.2 optimizations
  507. --disable-avx disable AVX optimizations
  508. --disable-xop disable XOP optimizations
  509. --disable-fma3 disable FMA3 optimizations
  510. --disable-fma4 disable FMA4 optimizations
  511. --disable-avx2 disable AVX2 optimizations
  512. --disable-aesni disable AESNI optimizations
  513. --disable-armv5te disable armv5te optimizations
  514. --disable-armv6 disable armv6 optimizations
  515. --disable-armv6t2 disable armv6t2 optimizations
  516. --disable-vfp disable VFP optimizations
  517. --disable-neon disable NEON optimizations
  518. --disable-inline-asm disable use of inline assembly
  519. --disable-yasm disable use of nasm/yasm assembly
  520. --disable-mipsdsp disable MIPS DSP ASE R1 optimizations
  521. --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
  522. --disable-msa disable MSA optimizations
  523. --disable-mipsfpu disable floating point MIPS optimizations
  524. --disable-mmi disable Loongson SIMD optimizations
  525. --disable-fast-unaligned consider unaligned accesses slow
  526.  
  527. Developer options (useful when working on FFmpeg itself):
  528. --disable-debug disable debugging symbols
  529. --enable-debug=LEVEL set the debug level [$debuglevel]
  530. --disable-optimizations disable compiler optimizations
  531. --enable-extra-warnings enable more compiler warnings
  532. --disable-stripping disable stripping of executables and shared libraries
  533. --assert-level=level 0(default), 1 or 2, amount of assertion testing,
  534. 2 causes a slowdown at runtime.
  535. --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
  536. --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
  537. leaks and errors, using the specified valgrind binary.
  538. Cannot be combined with --target-exec
  539. --enable-ftrapv Trap arithmetic overflows
  540. --samples=PATH location of test samples for FATE, if not set use
  541. \$FATE_SAMPLES at make invocation time.
  542. --enable-neon-clobber-test check NEON registers for clobbering (should be
  543. used only for debugging purposes)
  544. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  545. should be used only for debugging purposes)
  546. --enable-random randomly enable/disable components
  547. --disable-random
  548. --enable-random=LIST randomly enable/disable specific components or
  549. --disable-random=LIST component groups. LIST is a comma-separated list
  550. of NAME[:PROB] entries where NAME is a component
  551. (group) and PROB the probability associated with
  552. NAME (default 0.5).
  553. --random-seed=VALUE seed value for --enable/disable-random
  554. --disable-valgrind-backtrace do not print a backtrace under Valgrind
  555. (only applies to --disable-optimizations builds)
  556.  
  557. NOTE: Object files are built at the place where configure is launched.
  558. EOF
  559. exit 0
  560. }
  561.  
  562. quotes='""'
  563. if test -t 1 && which tput >/dev/null 2>&1; then
  564. ncolors=$(tput colors)
  565. if test -n "$ncolors" && test $ncolors -ge 8; then
  566. bold_color=$(tput bold)
  567. warn_color=$(tput setaf 3)
  568. error_color=$(tput setaf 1)
  569. reset_color=$(tput sgr0)
  570. fi
  571. # 72 used instead of 80 since that's the default of pr
  572. ncols=$(tput cols)
  573. fi
  574. : ${ncols:=72}
  575.  
  576. log(){
  577. echo "$@" >> $logfile
  578. }
  579.  
  580. log_file(){
  581. log BEGIN $1
  582. pr -n -t $1 >> $logfile
  583. log END $1
  584. }
  585.  
  586. warn(){
  587. log "WARNING: $*"
  588. WARNINGS="${WARNINGS}WARNING: $*\n"
  589. }
  590.  
  591. die(){
  592. log "$@"
  593. echo "$error_color$bold_color$@$reset_color"
  594. cat <<EOF
  595.  
  596. If you think configure made a mistake, make sure that you are using the latest
  597. version of MythTV from git. If the latest version fails, report the problem to the
  598. mythtv-dev@mythtv.org mailing list or IRC #mythtv on irc.freenode.net
  599. EOF
  600. if disabled logging; then
  601. cat <<EOF
  602. Rerun configure with logging enabled (do not use --disable-logging), and
  603. include the log this produces with your report.
  604. EOF
  605. else
  606. cat <<EOF
  607. Include the log file "$logfile" produced by configure as this will help
  608. solve the problem.
  609. EOF
  610. fi
  611. exit 1
  612. }
  613.  
  614. # Avoid locale weirdness, besides we really just want to translate ASCII.
  615. toupper(){
  616. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  617. }
  618.  
  619. tolower(){
  620. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  621. }
  622.  
  623. c_escape(){
  624. echo "$*" | sed 's/["\\]/\\\0/g'
  625. }
  626.  
  627. sh_quote(){
  628. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  629. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  630. echo "$v"
  631. }
  632.  
  633. cleanws(){
  634. echo "$@" | sed 's/^ *//;s/[[:space:]][[:space:]]*/ /g;s/ *$//'
  635. }
  636.  
  637. filter(){
  638. pat=$1
  639. shift
  640. for v; do
  641. eval "case $v in $pat) echo $v ;; esac"
  642. done
  643. }
  644.  
  645. filter_out(){
  646. pat=$1
  647. shift
  648. for v; do
  649. eval "case $v in $pat) ;; *) echo $v ;; esac"
  650. done
  651. }
  652.  
  653. map(){
  654. m=$1
  655. shift
  656. for v; do eval $m; done
  657. }
  658.  
  659. add_suffix(){
  660. suffix=$1
  661. shift
  662. for v; do echo ${v}${suffix}; done
  663. }
  664.  
  665. set_all(){
  666. value=$1
  667. shift
  668. for var in $*; do
  669. eval $var=$value
  670. done
  671. }
  672.  
  673. set_weak(){
  674. value=$1
  675. shift
  676. for var; do
  677. eval : \${$var:=$value}
  678. done
  679. }
  680.  
  681. sanitize_var_name(){
  682. echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
  683. }
  684.  
  685. set_safe(){
  686. var=$1
  687. shift
  688. eval $(sanitize_var_name "$var")='$*'
  689. }
  690.  
  691. get_safe(){
  692. eval echo \$$(sanitize_var_name "$1")
  693. }
  694.  
  695. pushvar(){
  696. for pvar in $*; do
  697. eval level=\${${pvar}_level:=0}
  698. eval ${pvar}_${level}="\$$pvar"
  699. eval ${pvar}_level=$(($level+1))
  700. done
  701. }
  702.  
  703. popvar(){
  704. for pvar in $*; do
  705. eval level=\${${pvar}_level:-0}
  706. test $level = 0 && continue
  707. eval level=$(($level-1))
  708. eval $pvar="\${${pvar}_${level}}"
  709. eval ${pvar}_level=$level
  710. eval unset ${pvar}_${level}
  711. done
  712. }
  713.  
  714. enable(){
  715. set_all yes $*
  716. }
  717.  
  718. disable(){
  719. set_all no $*
  720. }
  721.  
  722. enable_weak(){
  723. set_weak yes $*
  724. }
  725.  
  726. disable_weak(){
  727. set_weak no $*
  728. }
  729.  
  730. enable_safe(){
  731. for var; do
  732. enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  733. done
  734. }
  735.  
  736. disable_safe(){
  737. for var; do
  738. disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  739. done
  740. }
  741.  
  742. do_enable_deep(){
  743. for var; do
  744. enabled $var && continue
  745. eval sel="\$${var}_select"
  746. eval sgs="\$${var}_suggest"
  747. pushvar var sgs
  748. enable_deep $sel
  749. popvar sgs
  750. enable_deep_weak $sgs
  751. popvar var
  752. done
  753. }
  754.  
  755. enable_deep(){
  756. do_enable_deep $*
  757. enable $*
  758. }
  759.  
  760. enable_deep_weak(){
  761. for var; do
  762. disabled $var && continue
  763. pushvar var
  764. do_enable_deep $var
  765. popvar var
  766. enable_weak $var
  767. done
  768. }
  769.  
  770. enabled(){
  771. test "${1#!}" = "$1" && op='=' || op=!=
  772. eval test "x\$${1#!}" $op "xyes"
  773. }
  774.  
  775. disabled(){
  776. test "${1#!}" = "$1" && op='=' || op=!=
  777. eval test "x\$${1#!}" $op "xno"
  778. }
  779.  
  780. enabled_all(){
  781. for opt; do
  782. enabled $opt || return 1
  783. done
  784. }
  785.  
  786. disabled_all(){
  787. for opt; do
  788. disabled $opt || return 1
  789. done
  790. }
  791.  
  792. enabled_any(){
  793. for opt; do
  794. enabled $opt && return 0
  795. done
  796. }
  797.  
  798. disabled_any(){
  799. for opt; do
  800. disabled $opt && return 0
  801. done
  802. return 1
  803. }
  804.  
  805. set_default(){
  806. for opt; do
  807. eval : \${$opt:=\$${opt}_default}
  808. done
  809. }
  810.  
  811. is_in(){
  812. value=$1
  813. shift
  814. for var in $*; do
  815. [ $var = $value ] && return 0
  816. done
  817. return 1
  818. }
  819.  
  820. do_check_deps(){
  821. for cfg; do
  822. cfg="${cfg#!}"
  823. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  824. disabled ${cfg}_checking && continue
  825. enable ${cfg}_checking
  826. append allopts $cfg
  827.  
  828. eval dep_all="\$${cfg}_deps"
  829. eval dep_any="\$${cfg}_deps_any"
  830. eval dep_sel="\$${cfg}_select"
  831. eval dep_sgs="\$${cfg}_suggest"
  832. eval dep_ifa="\$${cfg}_if"
  833. eval dep_ifn="\$${cfg}_if_any"
  834.  
  835. pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  836. do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
  837. popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  838.  
  839. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  840. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  841. enabled_all $dep_all || disable $cfg
  842. enabled_any $dep_any || disable $cfg
  843. disabled_any $dep_sel && disable $cfg
  844.  
  845. if enabled $cfg; then
  846. enable_deep $dep_sel
  847. enable_deep_weak $dep_sgs
  848. fi
  849.  
  850. disable ${cfg}_checking
  851. done
  852. }
  853.  
  854. check_deps(){
  855. unset allopts
  856.  
  857. do_check_deps "$@"
  858.  
  859. for cfg in $allopts; do
  860. enabled $cfg || continue
  861. eval dep_extralibs="\$${cfg}_extralibs"
  862. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  863. done
  864. }
  865.  
  866. print_config(){
  867. pfx=$1
  868. files=$2
  869. shift 2
  870. map 'eval echo "$v \${$v:-no}"' "$@" |
  871. awk "BEGIN { split(\"$files\", files) }
  872. {
  873. c = \"$pfx\" toupper(\$1);
  874. v = \$2;
  875. sub(/yes/, 1, v);
  876. sub(/no/, 0, v);
  877. for (f in files) {
  878. file = files[f];
  879. if (file ~ /\\.h\$/) {
  880. printf(\"#define %s %d\\n\", c, v) >>file;
  881. } else if (file ~ /\\.asm\$/) {
  882. printf(\"%%define %s %d\\n\", c, v) >>file;
  883. } else if (file ~ /\\.mak\$/) {
  884. n = -v ? \"\" : \"!\";
  885. printf(\"%s%s=yes\\n\", n, c) >>file;
  886. } else if (file ~ /\\.texi\$/) {
  887. pre = -v ? \"\" : \"@c \";
  888. yesno = \$2;
  889. c2 = tolower(c);
  890. gsub(/_/, \"-\", c2);
  891. printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
  892. }
  893. }
  894. }"
  895. }
  896.  
  897. print_enabled(){
  898. suf=$1
  899. shift
  900. for v; do
  901. enabled $v && printf "%s\n" ${v%$suf}
  902. done
  903. }
  904.  
  905. append(){
  906. var=$1
  907. shift
  908. eval "$var=\"\$$var $*\""
  909. }
  910.  
  911. prepend(){
  912. var=$1
  913. shift
  914. eval "$var=\"$* \$$var\""
  915. }
  916.  
  917. unique(){
  918. var=$1
  919. uniq_list=""
  920. for tok in $(eval echo \$$var); do
  921. uniq_list="$(filter_out $tok $uniq_list) $tok"
  922. done
  923. eval "$var=\"${uniq_list}\""
  924. }
  925.  
  926. add_cppflags(){
  927. append CPPFLAGS "$@"
  928. }
  929.  
  930. add_cflags(){
  931. append CFLAGS $($cflags_filter "$@")
  932. }
  933.  
  934. add_cxxflags(){
  935. append ECXXFLAGS "$@"
  936. }
  937.  
  938. add_asflags(){
  939. append ASFLAGS $($asflags_filter "$@")
  940. }
  941.  
  942. add_objcflags(){
  943. append OBJCFLAGS $($objcflags_filter "$@")
  944. }
  945.  
  946. add_ldflags(){
  947. append LDFLAGS $($ldflags_filter "$@")
  948. }
  949.  
  950. add_ldexeflags(){
  951. append LDEXEFLAGS $($ldflags_filter "$@")
  952. }
  953.  
  954. add_ldlibflags(){
  955. append LDLIBFLAGS $($ldflags_filter "$@")
  956. }
  957.  
  958. add_stripflags(){
  959. append ASMSTRIPFLAGS "$@"
  960. }
  961.  
  962. add_extralibs(){
  963. prepend extralibs $($ldflags_filter "$@")
  964. }
  965.  
  966. add_host_cppflags(){
  967. append host_cppflags "$@"
  968. }
  969.  
  970. add_host_cflags(){
  971. append host_cflags $($host_cflags_filter "$@")
  972. }
  973.  
  974. add_host_ldflags(){
  975. append host_ldflags $($host_ldflags_filter "$@")
  976. }
  977.  
  978. add_compat(){
  979. append compat_objs $1
  980. shift
  981. map 'add_cppflags -D$v' "$@"
  982. }
  983.  
  984. check_cmd(){
  985. log "$@"
  986. "$@" >> $logfile 2>&1
  987. }
  988.  
  989. check_stat(){
  990. log check_stat "$@"
  991. stat "$1" >> $logfile 2>&1
  992. }
  993.  
  994. cc_o(){
  995. eval printf '%s\\n' $CC_O
  996. }
  997.  
  998. cc_e(){
  999. eval printf '%s\\n' $CC_E
  1000. }
  1001.  
  1002. check_cc(){
  1003. log check_cc "$@"
  1004. cat > $TMPC
  1005. log_file $TMPC
  1006. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  1007. }
  1008.  
  1009. check_cxx(){
  1010. log check_cxx "$@"
  1011. cat > $TMPCPP
  1012. log_file $TMPCPP
  1013. check_cmd $cxx $CPPFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
  1014. }
  1015.  
  1016. check_ecxx(){
  1017. log check_cxx "$@"
  1018. cat > $TMPCPP
  1019. log_file $TMPCPP
  1020. check_cmd $cxx $CPPFLAGS $CXXFLAGS $ECXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
  1021. }
  1022.  
  1023. check_objcc(){
  1024. log check_objcc "$@"
  1025. cat > $TMPM
  1026. log_file $TMPM
  1027. check_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM
  1028. }
  1029.  
  1030. check_cpp(){
  1031. log check_cpp "$@"
  1032. cat > $TMPC
  1033. log_file $TMPC
  1034. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  1035. }
  1036.  
  1037. as_o(){
  1038. eval printf '%s\\n' $AS_O
  1039. }
  1040.  
  1041. check_as(){
  1042. log check_as "$@"
  1043. cat > $TMPS
  1044. log_file $TMPS
  1045. check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
  1046. }
  1047.  
  1048. check_inline_asm(){
  1049. log check_inline_asm "$@"
  1050. name="$1"
  1051. code="$2"
  1052. shift 2
  1053. disable $name
  1054. check_cc "$@" <<EOF && enable $name
  1055. void foo(void){ __asm__ volatile($code); }
  1056. EOF
  1057. }
  1058.  
  1059. check_inline_asm_flags(){
  1060. log check_inline_asm_flags "$@"
  1061. name="$1"
  1062. code="$2"
  1063. flags=''
  1064. shift 2
  1065. while [ "$1" != "" ]; do
  1066. append flags $1
  1067. shift
  1068. done;
  1069. disable $name
  1070. cat > $TMPC <<EOF
  1071. void foo(void){ __asm__ volatile($code); }
  1072. EOF
  1073. log_file $TMPC
  1074. check_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
  1075. enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
  1076. }
  1077.  
  1078. check_insn(){
  1079. log check_insn "$@"
  1080. check_inline_asm ${1}_inline "\"$2\""
  1081. echo "$2" | check_as && enable ${1}_external || disable ${1}_external
  1082. }
  1083.  
  1084. check_yasm(){
  1085. log check_yasm "$@"
  1086. echo "$1" > $TMPS
  1087. log_file $TMPS
  1088. shift 1
  1089. check_cmd $yasmexe $YASMFLAGS -Werror "$@" -o $TMPO $TMPS
  1090. }
  1091.  
  1092. ld_o(){
  1093. eval printf '%s\\n' $LD_O
  1094. }
  1095.  
  1096. check_ld(){
  1097. log check_ld "$@"
  1098. type=$1
  1099. shift 1
  1100. flags=$(filter_out '-l*|*.so' $@)
  1101. libs=$(filter '-l*|*.so' $@)
  1102. check_$type $($cflags_filter $flags) || return
  1103. flags=$($ldflags_filter $flags)
  1104. libs=$($ldflags_filter $libs)
  1105. check_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
  1106. }
  1107.  
  1108. print_include(){
  1109. hdr=$1
  1110. test "${hdr%.h}" = "${hdr}" &&
  1111. echo "#include $hdr" ||
  1112. echo "#include <$hdr>"
  1113. }
  1114.  
  1115. check_code(){
  1116. log check_code "$@"
  1117. check=$1
  1118. headers=$2
  1119. code=$3
  1120. shift 3
  1121. {
  1122. for hdr in $headers; do
  1123. print_include $hdr
  1124. done
  1125. echo "int main(void) { $code; return 0; }"
  1126. } | check_$check "$@"
  1127. }
  1128.  
  1129. check_cppflags(){
  1130. log check_cppflags "$@"
  1131. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  1132. int x;
  1133. EOF
  1134. }
  1135.  
  1136. test_cflags(){
  1137. log test_cflags "$@"
  1138. set -- $($cflags_filter "$@")
  1139. check_cc "$@" <<EOF
  1140. int x;
  1141. EOF
  1142. }
  1143.  
  1144. check_cflags(){
  1145. log check_cflags "$@"
  1146. test_cflags "$@" && add_cflags "$@"
  1147. }
  1148.  
  1149. check_cxxflags(){
  1150. log check_cxxflags "$@"
  1151. check_cxx "$@" <<EOF && add_cxxflags "$@" || echolog "WARNING! An unknown C++ compiler flag in: \"$@\". Option(s) will be ignored."
  1152. class X {};
  1153. int x;
  1154. EOF
  1155. }
  1156.  
  1157. test_objcflags(){
  1158. log test_cflags "$@"
  1159. set -- $($cflags_filter "$@")
  1160. check_objcc "$@" <<EOF
  1161. int x;
  1162. EOF
  1163. }
  1164.  
  1165. check_objcflags(){
  1166. log check_cflags "$@"
  1167. test_objcflags "$@" && add_objcflags "$@"
  1168. }
  1169.  
  1170. test_ldflags(){
  1171. log test_ldflags "$@"
  1172. check_ld "cc" "$@" <<EOF
  1173. int main(void){ return 0; }
  1174. EOF
  1175. }
  1176.  
  1177. check_ldflags(){
  1178. log check_ldflags "$@"
  1179. test_ldflags "$@" && add_ldflags "$@"
  1180. }
  1181.  
  1182. test_stripflags(){
  1183. log test_stripflags "$@"
  1184. # call check_cc to get a fresh TMPO
  1185. check_cc <<EOF
  1186. int main(void) { return 0; }
  1187. EOF
  1188. check_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
  1189. }
  1190.  
  1191. check_stripflags(){
  1192. log check_stripflags "$@"
  1193. test_stripflags "$@" && add_stripflags "$@"
  1194. }
  1195.  
  1196. check_header(){
  1197. log check_header "$@"
  1198. header=$1
  1199. shift
  1200. disable_safe $header
  1201. check_cpp "$@" <<EOF && enable_safe $header
  1202. #include <$header>
  1203. int x;
  1204. EOF
  1205. }
  1206.  
  1207. check_header_objcc(){
  1208. log check_header_objcc "$@"
  1209. rm -f -- "$TMPO"
  1210. header=$1
  1211. shift
  1212. disable_safe $header
  1213. {
  1214. echo "#include <$header>"
  1215. echo "int main(void) { return 0; }"
  1216. } | check_objcc && check_stat "$TMPO" && enable_safe $headers
  1217. }
  1218.  
  1219. check_func(){
  1220. log check_func "$@"
  1221. func=$1
  1222. shift
  1223. disable $func
  1224. check_ld "cc" "$@" <<EOF && enable $func
  1225. extern int $func();
  1226. int main(void){ $func(); }
  1227. EOF
  1228. }
  1229.  
  1230. check_complexfunc(){
  1231. log check_complexfunc "$@"
  1232. func=$1
  1233. narg=$2
  1234. shift 2
  1235. test $narg = 2 && args="f, g" || args="f * I"
  1236. disable $func
  1237. check_ld "cc" "$@" <<EOF && enable $func
  1238. #include <complex.h>
  1239. #include <math.h>
  1240. float foo(complex float f, complex float g) { return $func($args); }
  1241. int main(void){ return (int) foo; }
  1242. EOF
  1243. }
  1244.  
  1245. check_mathfunc(){
  1246. log check_mathfunc "$@"
  1247. func=$1
  1248. narg=$2
  1249. shift 2
  1250. test $narg = 2 && args="f, g" || args="f"
  1251. disable $func
  1252. check_ld "cc" "$@" <<EOF && enable $func
  1253. #include <math.h>
  1254. float foo(float f, float g) { return $func($args); }
  1255. int main(void){ return (int) foo; }
  1256. EOF
  1257. }
  1258.  
  1259. check_func_headers(){
  1260. log check_func_headers "$@"
  1261. headers=$1
  1262. funcs=$2
  1263. shift 2
  1264. {
  1265. for hdr in $headers; do
  1266. print_include $hdr
  1267. done
  1268. for func in $funcs; do
  1269. echo "long check_$func(void) { return (long) $func; }"
  1270. done
  1271. echo "int main(void) { return 0; }"
  1272. } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers
  1273. }
  1274.  
  1275. check_class_headers_cpp(){
  1276. log check_class_headers_cpp "$@"
  1277. headers=$1
  1278. classes=$2
  1279. shift 2
  1280. {
  1281. for hdr in $headers; do
  1282. echo "#include <$hdr>"
  1283. done
  1284. echo "int main(void) { "
  1285. i=1
  1286. for class in $classes; do
  1287. echo "$class obj$i;"
  1288. i=$(expr $i + 1)
  1289. done
  1290. echo "return 0; }"
  1291. } | check_ld "cxx" "$@" && enable_safe $headers
  1292. }
  1293.  
  1294. check_cpp_condition(){
  1295. log check_cpp_condition "$@"
  1296. header=$1
  1297. condition=$2
  1298. shift 2
  1299. check_cpp "$@" <<EOF
  1300. #include <$header>
  1301. #if !($condition)
  1302. #error "unsatisfied condition: $condition"
  1303. #endif
  1304. EOF
  1305. }
  1306.  
  1307. check_lib(){
  1308. log check_lib "$@"
  1309. header="$1"
  1310. func="$2"
  1311. shift 2
  1312. check_header $header && check_func $func "$@" && add_extralibs "$@"
  1313. }
  1314.  
  1315. check_lib2(){
  1316. log check_lib2 "$@"
  1317. headers="$1"
  1318. funcs="$2"
  1319. shift 2
  1320. check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
  1321. }
  1322.  
  1323. check_lib_cpp(){
  1324. log check_lib_cpp "$@"
  1325. headers="$1"
  1326. classes="$2"
  1327. shift 2
  1328. check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@"
  1329. }
  1330.  
  1331. check_pkg_config(){
  1332. log check_pkg_config "$@"
  1333. pkgandversion="$1"
  1334. pkg="${1%% *}"
  1335. headers="$2"
  1336. funcs="$3"
  1337. shift 3
  1338. check_cmd $pkg_config --exists --print-errors $pkgandversion || return
  1339. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  1340. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  1341. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  1342. set_safe "${pkg}_cflags" $pkg_cflags &&
  1343. set_safe "${pkg}_libs" $pkg_libs
  1344. }
  1345.  
  1346. check_exec(){
  1347. check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  1348. }
  1349.  
  1350. check_exec_crash(){
  1351. code=$(cat)
  1352.  
  1353. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  1354. # are safe but may not be available everywhere. Thus we use
  1355. # raise(SIGTERM) instead. The check is run in a subshell so we
  1356. # can redirect the "Terminated" message from the shell. SIGBUS
  1357. # is not defined by standard C so it is used conditionally.
  1358.  
  1359. (check_exec "$@") >> $logfile 2>&1 <<EOF
  1360. #include <signal.h>
  1361. static void sighandler(int sig){
  1362. raise(SIGTERM);
  1363. }
  1364. int foo(void){
  1365. $code
  1366. }
  1367. int (*func_ptr)(void) = foo;
  1368. int main(void){
  1369. signal(SIGILL, sighandler);
  1370. signal(SIGFPE, sighandler);
  1371. signal(SIGSEGV, sighandler);
  1372. #ifdef SIGBUS
  1373. signal(SIGBUS, sighandler);
  1374. #endif
  1375. return func_ptr();
  1376. }
  1377. EOF
  1378. }
  1379.  
  1380. check_type(){
  1381. log check_type "$@"
  1382. headers=$1
  1383. type=$2
  1384. shift 2
  1385. disable_safe "$type"
  1386. check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
  1387. }
  1388.  
  1389. check_struct(){
  1390. log check_struct "$@"
  1391. headers=$1
  1392. struct=$2
  1393. member=$3
  1394. shift 3
  1395. disable_safe "${struct}_${member}"
  1396. check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  1397. enable_safe "${struct}_${member}"
  1398. }
  1399.  
  1400. check_builtin(){
  1401. log check_builtin "$@"
  1402. name=$1
  1403. headers=$2
  1404. builtin=$3
  1405. shift 3
  1406. disable "$name"
  1407. check_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
  1408. }
  1409.  
  1410. check_compile_assert(){
  1411. log check_compile_assert "$@"
  1412. name=$1
  1413. headers=$2
  1414. condition=$3
  1415. shift 3
  1416. disable "$name"
  1417. check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
  1418. }
  1419.  
  1420. require(){
  1421. name="$1"
  1422. header="$2"
  1423. func="$3"
  1424. shift 3
  1425. check_lib $header $func "$@" || die "ERROR: $name not found"
  1426. }
  1427.  
  1428. require2(){
  1429. name="$1"
  1430. headers="$2"
  1431. func="$3"
  1432. shift 3
  1433. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  1434. }
  1435.  
  1436. require_cpp(){
  1437. name="$1"
  1438. headers="$2"
  1439. classes="$3"
  1440. shift 3
  1441. check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
  1442. }
  1443.  
  1444. use_pkg_config(){
  1445. pkg="$1"
  1446. check_pkg_config "$@" || return 1
  1447. add_cflags $(get_safe "${pkg}_cflags")
  1448. add_extralibs $(get_safe "${pkg}_libs")
  1449. }
  1450.  
  1451. require_pkg_config(){
  1452. use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message"
  1453. }
  1454.  
  1455. require_libfreetype(){
  1456. log require_libfreetype "$@"
  1457. pkg="freetype2"
  1458. check_cmd $pkg_config --exists --print-errors $pkg \
  1459. || die "ERROR: $pkg not found"
  1460. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  1461. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  1462. {
  1463. echo "#include <ft2build.h>"
  1464. echo "#include FT_FREETYPE_H"
  1465. echo "long check_func(void) { return (long) FT_Init_FreeType; }"
  1466. echo "int main(void) { return 0; }"
  1467. } | check_ld "cc" $pkg_cflags $pkg_libs \
  1468. && set_safe "${pkg}_cflags" $pkg_cflags \
  1469. && set_safe "${pkg}_libs" $pkg_libs \
  1470. || die "ERROR: $pkg not found"
  1471. add_cflags $(get_safe "${pkg}_cflags")
  1472. add_extralibs $(get_safe "${pkg}_libs")
  1473. }
  1474.  
  1475. hostcc_e(){
  1476. eval printf '%s\\n' $HOSTCC_E
  1477. }
  1478.  
  1479. hostcc_o(){
  1480. eval printf '%s\\n' $HOSTCC_O
  1481. }
  1482.  
  1483. check_host_cc(){
  1484. log check_host_cc "$@"
  1485. cat > $TMPC
  1486. log_file $TMPC
  1487. check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
  1488. }
  1489.  
  1490. check_host_cpp(){
  1491. log check_host_cpp "$@"
  1492. cat > $TMPC
  1493. log_file $TMPC
  1494. check_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
  1495. }
  1496.  
  1497. check_host_cppflags(){
  1498. log check_host_cppflags "$@"
  1499. check_host_cc "$@" <<EOF && append host_cppflags "$@"
  1500. int x;
  1501. EOF
  1502. }
  1503.  
  1504. check_host_cflags(){
  1505. log check_host_cflags "$@"
  1506. set -- $($host_cflags_filter "$@")
  1507. check_host_cc "$@" <<EOF && append host_cflags "$@"
  1508. int x;
  1509. EOF
  1510. }
  1511.  
  1512. check_host_cpp_condition(){
  1513. log check_host_cpp_condition "$@"
  1514. header=$1
  1515. condition=$2
  1516. shift 2
  1517. check_host_cpp "$@" <<EOF
  1518. #include <$header>
  1519. #if !($condition)
  1520. #error "unsatisfied condition: $condition"
  1521. #endif
  1522. EOF
  1523. }
  1524.  
  1525. cp_if_changed(){
  1526. cmp -s "$1" "$2" && echo "$2 is unchanged" && return
  1527. mkdir -p "$(dirname $2)"
  1528. $cp_f "$1" "$2"
  1529. }
  1530.  
  1531. # MythTV Custom Tests
  1532. disable_bindings_python(){
  1533. echo "WARNING: disabling Python bindings; missing $1"
  1534. disable bindings_python
  1535. }
  1536.  
  1537. disable_bindings_perl(){
  1538. echo "WARNING: disabling Perl bindings; missing $1"
  1539. disable bindings_perl
  1540. }
  1541.  
  1542. disable_bindings_php(){
  1543. echo "WARNING: disabling PHP bindings; missing $1"
  1544. disable bindings_php
  1545. }
  1546.  
  1547. append_uniq(){
  1548. log append_uniq "$@"
  1549. var=$1
  1550. shift
  1551. for value; do
  1552. eval tmpvar='$'$var
  1553. echo "$tmpvar" | grep -q ".$value" || append $var $value
  1554. done
  1555. }
  1556.  
  1557. add_cxxppflags(){
  1558. append CXXPPFLAGS $($cxxppflags_filter "$@")
  1559. }
  1560.  
  1561. is_python3() {
  1562. log is_python3
  1563. check_cmd $python << EOF
  1564. import sys
  1565. if sys.version_info > (3,0):
  1566. sys.exit(0)
  1567. else:
  1568. sys.exit(1)
  1569. EOF
  1570. }
  1571.  
  1572. check_python(){
  1573. log check_python
  1574. check_cmd $python <<EOF
  1575. import sys
  1576. if sys.version_info < (2,6):
  1577. sys.exit(1)
  1578. EOF
  1579. }
  1580.  
  1581. check_py_lib(){
  1582. log check_py_lib "$@"
  1583. lib=${1}
  1584. check_cmd $python <<EOF
  1585. import sys
  1586. try:
  1587. import $lib
  1588. except:
  1589. sys.exit(1)
  1590. sys.exit(0)
  1591. EOF
  1592. }
  1593.  
  1594. check_pl_lib(){
  1595. log check_pl_lib "$@"
  1596. check_cmd perl -e "use ${1};"
  1597. }
  1598.  
  1599. check_ld_cxx(){
  1600. log check_ld_cxx "$@"
  1601. flags=''
  1602. libs=''
  1603. for f; do
  1604. test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
  1605. done
  1606. check_cxx $($cflags_filter $flags) || return
  1607. check_cmd $cxx $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
  1608. }
  1609.  
  1610. check_cxxppflags(){
  1611. log check_cxxppflags "$@"
  1612. set -- $($filter_cxxppflags "$@")
  1613. check_cxx "$@" <<EOF && append CXXPPFLAGS "$@"
  1614. int x;
  1615. EOF
  1616. }
  1617.  
  1618. check_libx(){
  1619. log check_libx "$@"
  1620. libvar="$1"
  1621. headers="$2"
  1622. func="$3"
  1623. shift 3
  1624. check_func_headers "$headers" $func "$@" && append_uniq $libvar "$@"
  1625. }
  1626.  
  1627. check_exec_cxx(){
  1628. check_ld_cxx "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  1629. }
  1630.  
  1631. check_foo_config(){
  1632. cfg=$1
  1633. pkg=$2
  1634. header=$3
  1635. func=$4
  1636. shift 4
  1637. disable $cfg
  1638. check_cmd ${pkg}-config --version
  1639. err=$?
  1640. if test "$err" = 0; then
  1641. backup_cflags=$CFLAGS
  1642. temp_extralibs=$(${pkg}-config --libs)
  1643. add_cflags $(${pkg}-config --cflags)
  1644. check_lib "$@" $header $func $temp_extralibs && enable $cfg
  1645. CFLAGS=$backup_cflags
  1646. fi
  1647. return $err
  1648. }
  1649.  
  1650. non_standard_header(){
  1651. test x"$1" != "x/usr/include"
  1652. }
  1653.  
  1654. x86_mmx_cpus="pentium-mmx,pentium2,pentium3,pentium3m,pentium-m"
  1655. x86_mmx_cpus="$x86_mmx_cpus,pentium4,pentium4m,prescott"
  1656. x86_mmx_cpus="$x86_mmx_cpus,athlon,athlon-xp,athlon-tbird,athlon-4,athlon-mp,"
  1657. x86_mmx_cpus="$x86_mmx_cpus,c3,c3-2,k6,k6-2,k6-3"
  1658.  
  1659. x86_cpus="i386,i486,i586,i686,pentium,pentiumpro,${x86_mmx_cpus}"
  1660.  
  1661. x86_64_cpus="x86-64,athlon64,k8,opteron,athlon64-sse3,k8-sse3,opteron-sse3"
  1662. x86_64_cpus="$x86_64_cpus,barcelona,athlon-fx,nocona,core2"
  1663.  
  1664. is_x86_cpu() {
  1665. expr ",${x86_cpus}," : ".*,$1," > /dev/null
  1666. }
  1667.  
  1668. is_x86_64_cpu() {
  1669. expr ",${x86_64_cpus}," : ".*,$1," > /dev/null
  1670. }
  1671.  
  1672. is_x86_mmx() {
  1673. expr ",${x86_mmx_cpus}," : ".*,$1," > /dev/null || is_x86_64_cpu "$1"
  1674. }
  1675.  
  1676.  
  1677. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  1678. # system-dependent things.
  1679.  
  1680. AVCODEC_COMPONENTS="
  1681. bsfs
  1682. decoders
  1683. encoders
  1684. hwaccels
  1685. parsers
  1686. "
  1687.  
  1688. AVDEVICE_COMPONENTS="
  1689. indevs
  1690. outdevs
  1691. "
  1692. AVFILTER_COMPONENTS="
  1693. filters
  1694. "
  1695. AVFORMAT_COMPONENTS="
  1696. demuxers
  1697. muxers
  1698. protocols
  1699. "
  1700.  
  1701. AVRESAMPLE_COMPONENTS=""
  1702. AVUTIL_COMPONENTS=""
  1703.  
  1704. COMPONENT_LIST="
  1705. $AVCODEC_COMPONENTS
  1706. $AVDEVICE_COMPONENTS
  1707. $AVFILTER_COMPONENTS
  1708. $AVFORMAT_COMPONENTS
  1709. $AVRESAMPLE_COMPONENTS
  1710. $AVUTIL_COMPONENTS
  1711. "
  1712.  
  1713. EXAMPLE_LIST="
  1714. avio_dir_cmd_example
  1715. avio_reading_example
  1716. decoding_encoding_example
  1717. demuxing_decoding_example
  1718. extract_mvs_example
  1719. filter_audio_example
  1720. filtering_audio_example
  1721. filtering_video_example
  1722. http_multiclient_example
  1723. metadata_example
  1724. muxing_example
  1725. qsvdec_example
  1726. remuxing_example
  1727. resampling_audio_example
  1728. scaling_video_example
  1729. transcode_aac_example
  1730. transcoding_example
  1731. "
  1732.  
  1733. EXTERNAL_LIBRARY_LIST="
  1734. avisynth
  1735. bzlib
  1736. chromaprint
  1737. crystalhd
  1738. decklink
  1739. frei0r
  1740. gcrypt
  1741. gmp
  1742. gnutls
  1743. iconv
  1744. jni
  1745. ladspa
  1746. libass
  1747. libbluray
  1748. libbs2b
  1749. libcaca
  1750. libcdio
  1751. libcelt
  1752. libdc1394
  1753. libebur128
  1754. libfdk_aac
  1755. libflite
  1756. libfontconfig
  1757. libfreetype
  1758. libfribidi
  1759. libgme
  1760. libgsm
  1761. libiec61883
  1762. libilbc
  1763. libkvazaar
  1764. libmodplug
  1765. libmp3lame
  1766. libnut
  1767. libopencore_amrnb
  1768. libopencore_amrwb
  1769. libopencv
  1770. libopenh264
  1771. libopenjpeg
  1772. libopenmpt
  1773. libopus
  1774. libpulse
  1775. librtmp
  1776. librubberband
  1777. libschroedinger
  1778. libshine
  1779. libsmbclient
  1780. libsnappy
  1781. libsoxr
  1782. libspeex
  1783. libssh
  1784. libtesseract
  1785. libtheora
  1786. libtwolame
  1787. libv4l2
  1788. libvidstab
  1789. libvo_amrwbenc
  1790. libvorbis
  1791. libvpx
  1792. libwavpack
  1793. libwebp
  1794. libx264
  1795. libx265
  1796. libxavs
  1797. libxcb
  1798. libxcb_shm
  1799. libxcb_shape
  1800. libxcb_xfixes
  1801. libxvid
  1802. libzimg
  1803. libzmq
  1804. libzvbi
  1805. lzma
  1806. mediacodec
  1807. netcdf
  1808. openal
  1809. opencl
  1810. opengl
  1811. openssl
  1812. schannel
  1813. sdl
  1814. sdl2
  1815. securetransport
  1816. videotoolbox
  1817. x11grab
  1818. xlib
  1819. zlib
  1820. "
  1821.  
  1822. HWACCEL_LIBRARY_LIST="
  1823. audiotoolbox
  1824. cuda
  1825. cuvid
  1826. d3d11va
  1827. dxva2
  1828. libmfx
  1829. libnpp
  1830. mmal
  1831. nvenc
  1832. omx
  1833. vaapi
  1834. vda
  1835. vdpau
  1836. videotoolbox_hwaccel
  1837. xvmc
  1838. "
  1839.  
  1840. DOCUMENT_LIST="
  1841. doc
  1842. htmlpages
  1843. manpages
  1844. podpages
  1845. txtpages
  1846. "
  1847.  
  1848. FEATURE_LIST="
  1849. ftrapv
  1850. gray
  1851. hardcoded_tables
  1852. omx_rpi
  1853. runtime_cpudetect
  1854. safe_bitstream_reader
  1855. shared
  1856. small
  1857. static
  1858. swscale_alpha
  1859. "
  1860.  
  1861. LIBRARY_LIST="
  1862. avcodec
  1863. avdevice
  1864. avfilter
  1865. avformat
  1866. avresample
  1867. avutil
  1868. postproc
  1869. swresample
  1870. swscale
  1871. "
  1872.  
  1873. LICENSE_LIST="
  1874. gpl
  1875. nonfree
  1876. version3
  1877. "
  1878.  
  1879. PROGRAM_LIST="
  1880. ffplay
  1881. ffprobe
  1882. ffserver
  1883. ffmpeg
  1884. "
  1885.  
  1886. SUBSYSTEM_LIST="
  1887. dct
  1888. dwt
  1889. error_resilience
  1890. faan
  1891. fast_unaligned
  1892. fft
  1893. lsp
  1894. lzo
  1895. mdct
  1896. pixelutils
  1897. network
  1898. rdft
  1899. "
  1900.  
  1901. CONFIG_LIST="
  1902. $COMPONENT_LIST
  1903. $DOCUMENT_LIST
  1904. $EXAMPLE_LIST
  1905. $EXTERNAL_LIBRARY_LIST
  1906. $HWACCEL_LIBRARY_LIST
  1907. $FEATURE_LIST
  1908. $LICENSE_LIST
  1909. $LIBRARY_LIST
  1910. $PROGRAM_LIST
  1911. $SUBSYSTEM_LIST
  1912. fontconfig
  1913. memalign_hack
  1914. memory_poisoning
  1915. neon_clobber_test
  1916. pic
  1917. pod2man
  1918. raise_major
  1919. thumb
  1920. valgrind_backtrace
  1921. xmm_clobber_test
  1922. "
  1923.  
  1924. THREADS_LIST="
  1925. pthreads
  1926. os2threads
  1927. w32threads
  1928. "
  1929.  
  1930. ATOMICS_LIST="
  1931. atomics_gcc
  1932. atomics_suncc
  1933. atomics_win32
  1934. "
  1935.  
  1936. ARCH_LIST="
  1937. aarch64
  1938. alpha
  1939. arm
  1940. avr32
  1941. avr32_ap
  1942. avr32_uc
  1943. bfin
  1944. ia64
  1945. m68k
  1946. mips
  1947. mips64
  1948. parisc
  1949. ppc
  1950. ppc64
  1951. s390
  1952. sh4
  1953. sparc
  1954. sparc64
  1955. tilegx
  1956. tilepro
  1957. tomi
  1958. x86
  1959. x86_32
  1960. x86_64
  1961. "
  1962.  
  1963. ARCH_EXT_LIST_ARM="
  1964. armv5te
  1965. armv6
  1966. armv6t2
  1967. armv8
  1968. neon
  1969. vfp
  1970. vfpv3
  1971. setend
  1972. "
  1973.  
  1974. ARCH_EXT_LIST_MIPS="
  1975. mipsfpu
  1976. mips32r2
  1977. mips32r5
  1978. mips64r2
  1979. mips32r6
  1980. mips64r6
  1981. mipsdsp
  1982. mipsdspr2
  1983. msa
  1984. "
  1985.  
  1986. ARCH_EXT_LIST_LOONGSON="
  1987. loongson2
  1988. loongson3
  1989. mmi
  1990. "
  1991.  
  1992. ARCH_EXT_LIST_X86_SIMD="
  1993. aesni
  1994. amd3dnow
  1995. amd3dnowext
  1996. avx
  1997. avx2
  1998. fma3
  1999. fma4
  2000. mmx
  2001. mmxext
  2002. sse
  2003. sse2
  2004. sse3
  2005. sse4
  2006. sse42
  2007. ssse3
  2008. xop
  2009. "
  2010.  
  2011. ARCH_EXT_LIST_PPC="
  2012. altivec
  2013. dcbzl
  2014. ldbrx
  2015. power8
  2016. ppc4xx
  2017. vsx
  2018. "
  2019.  
  2020. ARCH_EXT_LIST_X86="
  2021. $ARCH_EXT_LIST_X86_SIMD
  2022. cpunop
  2023. i686
  2024. "
  2025.  
  2026. ARCH_EXT_LIST="
  2027. $ARCH_EXT_LIST_ARM
  2028. $ARCH_EXT_LIST_PPC
  2029. $ARCH_EXT_LIST_X86
  2030. $ARCH_EXT_LIST_MIPS
  2031. $ARCH_EXT_LIST_LOONGSON
  2032. "
  2033.  
  2034. ARCH_FEATURES="
  2035. aligned_stack
  2036. fast_64bit
  2037. fast_clz
  2038. fast_cmov
  2039. local_aligned_8
  2040. local_aligned_16
  2041. local_aligned_32
  2042. simd_align_16
  2043. "
  2044.  
  2045. BUILTIN_LIST="
  2046. atomic_cas_ptr
  2047. atomic_compare_exchange
  2048. machine_rw_barrier
  2049. MemoryBarrier
  2050. mm_empty
  2051. rdtsc
  2052. sarestart
  2053. sem_timedwait
  2054. sync_val_compare_and_swap
  2055. "
  2056. HAVE_LIST_CMDLINE="
  2057. inline_asm
  2058. symver
  2059. yasm
  2060. "
  2061.  
  2062. HAVE_LIST_PUB="
  2063. bigendian
  2064. fast_unaligned
  2065. "
  2066.  
  2067. HEADERS_LIST="
  2068. alsa_asoundlib_h
  2069. altivec_h
  2070. arpa_inet_h
  2071. asm_types_h
  2072. cdio_paranoia_h
  2073. cdio_paranoia_paranoia_h
  2074. dispatch_dispatch_h
  2075. dev_bktr_ioctl_bt848_h
  2076. dev_bktr_ioctl_meteor_h
  2077. dev_ic_bt8xx_h
  2078. dev_video_bktr_ioctl_bt848_h
  2079. dev_video_meteor_ioctl_meteor_h
  2080. direct_h
  2081. dirent_h
  2082. dlfcn_h
  2083. d3d11_h
  2084. dxva_h
  2085. ES2_gl_h
  2086. EGL_egl_h
  2087. GLES2_gl2_h
  2088. fcntl_h
  2089. gsm_h
  2090. io_h
  2091. mach_mach_time_h
  2092. machine_ioctl_bt848_h
  2093. machine_ioctl_meteor_h
  2094. malloc_h
  2095. opencv2_core_core_c_h
  2096. openjpeg_2_1_openjpeg_h
  2097. openjpeg_2_0_openjpeg_h
  2098. openjpeg_1_5_openjpeg_h
  2099. OpenGL_gl3_h
  2100. poll_h
  2101. sndio_h
  2102. soundcard_h
  2103. sys_mman_h
  2104. sys_param_h
  2105. sys_resource_h
  2106. sys_select_h
  2107. sys_soundcard_h
  2108. sys_time_h
  2109. sys_un_h
  2110. sys_videoio_h
  2111. termios_h
  2112. udplite_h
  2113. unistd_h
  2114. valgrind_valgrind_h
  2115. windows_h
  2116. winsock2_h
  2117. "
  2118.  
  2119. INTRINSICS_LIST="
  2120. intrinsics_neon
  2121. "
  2122.  
  2123. COMPLEX_FUNCS="
  2124. cabs
  2125. cexp
  2126. "
  2127.  
  2128. MATH_FUNCS="
  2129. atanf
  2130. atan2f
  2131. cbrt
  2132. cbrtf
  2133. copysign
  2134. cosf
  2135. erf
  2136. exp2
  2137. exp2f
  2138. expf
  2139. hypot
  2140. isfinite
  2141. isinf
  2142. isnan
  2143. ldexpf
  2144. llrint
  2145. llrintf
  2146. log2
  2147. log2f
  2148. log10f
  2149. lrint
  2150. lrintf
  2151. powf
  2152. rint
  2153. round
  2154. roundf
  2155. sinf
  2156. trunc
  2157. truncf
  2158. "
  2159.  
  2160. SYSTEM_FUNCS="
  2161. access
  2162. aligned_malloc
  2163. arc4random
  2164. clock_gettime
  2165. closesocket
  2166. CommandLineToArgvW
  2167. CoTaskMemFree
  2168. CryptGenRandom
  2169. dlopen
  2170. fcntl
  2171. flt_lim
  2172. fork
  2173. getaddrinfo
  2174. gethrtime
  2175. getopt
  2176. GetProcessAffinityMask
  2177. GetProcessMemoryInfo
  2178. GetProcessTimes
  2179. getrusage
  2180. GetSystemTimeAsFileTime
  2181. gettimeofday
  2182. glob
  2183. glXGetProcAddress
  2184. gmtime_r
  2185. inet_aton
  2186. isatty
  2187. jack_port_get_latency_range
  2188. kbhit
  2189. LoadLibrary
  2190. localtime_r
  2191. lstat
  2192. lzo1x_999_compress
  2193. mach_absolute_time
  2194. MapViewOfFile
  2195. memalign
  2196. mkstemp
  2197. mmap
  2198. mprotect
  2199. nanosleep
  2200. PeekNamedPipe
  2201. posix_memalign
  2202. pthread_cancel
  2203. sched_getaffinity
  2204. SetConsoleTextAttribute
  2205. SetConsoleCtrlHandler
  2206. setmode
  2207. setrlimit
  2208. Sleep
  2209. strerror_r
  2210. sysconf
  2211. sysctl
  2212. usleep
  2213. UTGetOSTypeFromString
  2214. VirtualAlloc
  2215. wglGetProcAddress
  2216. eglGetProcAddress
  2217. "
  2218.  
  2219. TOOLCHAIN_FEATURES="
  2220. as_dn_directive
  2221. as_func
  2222. as_object_arch
  2223. asm_mod_q
  2224. attribute_may_alias
  2225. attribute_packed
  2226. ebp_available
  2227. ebx_available
  2228. gnu_as
  2229. gnu_windres
  2230. ibm_asm
  2231. inline_asm_direct_symbol_refs
  2232. inline_asm_labels
  2233. inline_asm_nonlocal_labels
  2234. pragma_deprecated
  2235. rsync_contimeout
  2236. symver_asm_label
  2237. symver_gnu_asm
  2238. vfp_args
  2239. xform_asm
  2240. xmm_clobbers
  2241. "
  2242.  
  2243. TYPES_LIST="
  2244. CONDITION_VARIABLE_Ptr
  2245. socklen_t
  2246. struct_addrinfo
  2247. struct_group_source_req
  2248. struct_ip_mreq_source
  2249. struct_ipv6_mreq
  2250. struct_msghdr_msg_flags
  2251. struct_pollfd
  2252. struct_rusage_ru_maxrss
  2253. struct_sctp_event_subscribe
  2254. struct_sockaddr_in6
  2255. struct_sockaddr_sa_len
  2256. struct_sockaddr_storage
  2257. struct_stat_st_mtim_tv_nsec
  2258. struct_v4l2_frmivalenum_discrete
  2259. "
  2260.  
  2261. HAVE_LIST="
  2262. $ARCH_EXT_LIST
  2263. $(add_suffix _external $ARCH_EXT_LIST)
  2264. $(add_suffix _inline $ARCH_EXT_LIST)
  2265. $ARCH_FEATURES
  2266. $ATOMICS_LIST
  2267. $BUILTIN_LIST
  2268. $COMPLEX_FUNCS
  2269. $HAVE_LIST_CMDLINE
  2270. $HAVE_LIST_PUB
  2271. $HEADERS_LIST
  2272. $INTRINSICS_LIST
  2273. $MATH_FUNCS
  2274. $SYSTEM_FUNCS
  2275. $THREADS_LIST
  2276. $TOOLCHAIN_FEATURES
  2277. $TYPES_LIST
  2278. atomics_native
  2279. dos_paths
  2280. dxva2_lib
  2281. dxva2api_cobj
  2282. libc_msvcrt
  2283. libdc1394_1
  2284. libdc1394_2
  2285. makeinfo
  2286. makeinfo_html
  2287. MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
  2288. perl
  2289. pod2man
  2290. sdl2
  2291. section_data_rel_ro
  2292. texi2html
  2293. threads
  2294. vaapi_drm
  2295. vaapi_x11
  2296. vdpau_x11
  2297. winrt
  2298. xlib
  2299. "
  2300.  
  2301. # options emitted with CONFIG_ prefix but not available on the command line
  2302. CONFIG_EXTRA="
  2303. aandcttables
  2304. ac3dsp
  2305. audio_frame_queue
  2306. audiodsp
  2307. blockdsp
  2308. bswapdsp
  2309. cabac
  2310. dirac_parse
  2311. dvprofile
  2312. exif
  2313. faandct
  2314. faanidct
  2315. fdctdsp
  2316. flacdsp
  2317. fmtconvert
  2318. frame_thread_encoder
  2319. g722dsp
  2320. golomb
  2321. gplv3
  2322. h263dsp
  2323. h264chroma
  2324. h264dsp
  2325. h264pred
  2326. h264qpel
  2327. hpeldsp
  2328. huffman
  2329. huffyuvdsp
  2330. huffyuvencdsp
  2331. idctdsp
  2332. iirfilter
  2333. imdct15
  2334. intrax8
  2335. iso_media
  2336. ividsp
  2337. jpegtables
  2338. lgplv3
  2339. libx262
  2340. llauddsp
  2341. llviddsp
  2342. lpc
  2343. lzf
  2344. me_cmp
  2345. mpeg_er
  2346. mpegaudio
  2347. mpegaudiodsp
  2348. mpegvideo
  2349. mpegvideoenc
  2350. mss34dsp
  2351. pixblockdsp
  2352. qpeldsp
  2353. qsv
  2354. qsvdec
  2355. qsvenc
  2356. rangecoder
  2357. riffdec
  2358. riffenc
  2359. rtpdec
  2360. rtpenc_chain
  2361. rv34dsp
  2362. sinewin
  2363. snappy
  2364. srtp
  2365. startcode
  2366. texturedsp
  2367. texturedspenc
  2368. tpeldsp
  2369. vaapi_encode
  2370. vc1dsp
  2371. videodsp
  2372. vp3dsp
  2373. vp56dsp
  2374. vp8dsp
  2375. vt_bt2020
  2376. wma_freqs
  2377. wmv2dsp
  2378. "
  2379.  
  2380. MYTHTV_CONFIG_LIST='
  2381. backend
  2382. bdjava
  2383. bindings_perl
  2384. bindings_python
  2385. bindings_php
  2386. crystalhd
  2387. cygwin
  2388. darwin
  2389. disable_mmx_for_debugging
  2390. dvb
  2391. firewire
  2392. frontend
  2393. hdhomerun
  2394. vbox
  2395. ceton
  2396. hdpvr
  2397. ivtv
  2398. asi
  2399. joystick_menu
  2400. libcec
  2401. libcrypto
  2402. libdns_sd
  2403. libfftw3
  2404. libmpeg2external
  2405. libxml2
  2406. lirc
  2407. mheg
  2408. opengl
  2409. opengl_video
  2410. opengl_themepainter
  2411. qtwebkit
  2412. qtscript
  2413. qtdbus
  2414. sdl2
  2415. taglib
  2416. v4l2
  2417. v4l1
  2418. valgrind
  2419. x11
  2420. xrandr
  2421. xv
  2422. profiletype
  2423. debugtype
  2424. mythlogserver
  2425. systemd_notify
  2426. systemd_journal
  2427. '
  2428.  
  2429. MYTHTV_HAVE_LIST='
  2430. byteswap_h
  2431. cpu_clips_negative
  2432. cpu_clips_positive
  2433. fe_can_2g_modulation
  2434. ftime
  2435. getifaddrs
  2436. gettimeofday
  2437. openmax_bellagio
  2438. openmax_broadcom
  2439. posix_fadvise
  2440. libudev
  2441. libuuid
  2442. stdint_h
  2443. sync_file_range
  2444. sys_endian_h
  2445. '
  2446.  
  2447. MYTHTV_LIST='
  2448. audio_pulse
  2449. audio_pulseoutput
  2450. audio_alsa
  2451. audio_jack
  2452. audio_oss
  2453. ffmpeg_pthreads
  2454. mac_bundle
  2455. proc_opt
  2456. silent_cc
  2457. symbol_visibility
  2458. '
  2459.  
  2460. USING_LIST='
  2461. appleremote
  2462. bdjava
  2463. bindings_perl
  2464. bindings_python
  2465. bindings_php
  2466. darwin_da
  2467. fontconfig
  2468. freetype2
  2469. mythtranscode
  2470. dxva2
  2471. opengl
  2472. opengles
  2473. vaapi
  2474. vdpau
  2475. openmax
  2476. '
  2477.  
  2478. CMDLINE_SELECT="
  2479. $ARCH_EXT_LIST
  2480. $CONFIG_LIST
  2481. $HAVE_LIST_CMDLINE
  2482. $THREADS_LIST
  2483. asm
  2484. cross_compile
  2485. debug
  2486. extra_warnings
  2487. logging
  2488. lto
  2489. optimizations
  2490. rpath
  2491. stripping
  2492. $MYTHTV_LIST
  2493. $MYTHTV_CONFIG_LIST
  2494. "
  2495.  
  2496. PATHS_LIST="
  2497. bindir
  2498. datadir
  2499. docdir
  2500. incdir
  2501. libdir
  2502. mandir
  2503. pkgconfigdir
  2504. prefix
  2505. shlibdir
  2506. install_name_dir
  2507. "
  2508.  
  2509. MYTHTV_PATHS_LIST='
  2510. dvb_path
  2511. libcec_path
  2512. runprefix
  2513. x11_path
  2514. libxml2_path
  2515. firewiresdk_path
  2516. '
  2517.  
  2518. MYTHTV_CMDLINE_SET='
  2519. logging
  2520. python
  2521. qmake
  2522. qmakespecs
  2523. samples
  2524. source_path
  2525. bdj_type
  2526. JDK_HOME
  2527. '
  2528.  
  2529. CMDLINE_SET="
  2530. $PATHS_LIST
  2531. ar
  2532. arch
  2533. as
  2534. assert_level
  2535. build_suffix
  2536. cc
  2537. objcc
  2538. cpu
  2539. cross_prefix
  2540. custom_allocator
  2541. cxx
  2542. dep_cc
  2543. doxygen
  2544. env
  2545. extra_version
  2546. gas
  2547. host_cc
  2548. host_cflags
  2549. host_ld
  2550. host_ldflags
  2551. host_libs
  2552. host_os
  2553. install
  2554. ld
  2555. ln_s
  2556. logfile
  2557. malloc_prefix
  2558. nm
  2559. optflags
  2560. pkg_config
  2561. pkg_config_flags
  2562. progs_suffix
  2563. random_seed
  2564. ranlib
  2565. samples
  2566. strip
  2567. sws_max_filter_size
  2568. sysinclude
  2569. sysroot
  2570. target_exec
  2571. target_os
  2572. target_path
  2573. target_samples
  2574. tempprefix
  2575. toolchain
  2576. valgrind
  2577. yasmexe
  2578. $MYTHTV_PATHS_LIST
  2579. $MYTHTV_CMDLINE_SET
  2580. "
  2581.  
  2582. CMDLINE_APPEND="
  2583. extra_cflags
  2584. extra_cxxflags
  2585. extra_objcflags
  2586. host_cppflags
  2587. "
  2588.  
  2589. # code dependency declarations
  2590.  
  2591. # architecture extensions
  2592.  
  2593. armv5te_deps="arm"
  2594. armv6_deps="arm"
  2595. armv6t2_deps="arm"
  2596. armv7_a_deps="arm"
  2597. armv8_deps="aarch64"
  2598. neon_deps_any="aarch64 arm"
  2599. intrinsics_neon_deps="neon"
  2600. vfp_deps_any="aarch64 arm"
  2601. vfpv3_deps="vfp"
  2602. setend_deps="arm"
  2603.  
  2604. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  2605.  
  2606. loongson2_deps="mips"
  2607. loongson3_deps="mips"
  2608. mipsfpu_deps="mips"
  2609. mipsdsp_deps="mips"
  2610. mipsdspr2_deps="mips"
  2611. mips32r2_deps="mips"
  2612. mips32r5_deps="mips"
  2613. mips32r6_deps="mips"
  2614. mips64r2_deps="mips"
  2615. mips64r6_deps="mips"
  2616. msa_deps="mipsfpu"
  2617. mmi_deps="mips"
  2618.  
  2619. altivec_deps="ppc"
  2620. dcbzl_deps="ppc"
  2621. ldbrx_deps="ppc"
  2622. ppc4xx_deps="ppc"
  2623. vsx_deps="altivec"
  2624. power8_deps="vsx"
  2625.  
  2626. cpunop_deps="i686"
  2627. x86_64_select="i686"
  2628. x86_64_suggest="fast_cmov"
  2629.  
  2630. amd3dnow_deps="mmx"
  2631. amd3dnowext_deps="amd3dnow"
  2632. i686_deps="x86"
  2633. mmx_deps="x86"
  2634. mmxext_deps="mmx"
  2635. sse_deps="mmxext"
  2636. sse2_deps="sse"
  2637. sse3_deps="sse2"
  2638. ssse3_deps="sse3"
  2639. sse4_deps="ssse3"
  2640. sse42_deps="sse4"
  2641. aesni_deps="sse42"
  2642. avx_deps="sse42"
  2643. xop_deps="avx"
  2644. fma3_deps="avx"
  2645. fma4_deps="avx"
  2646. avx2_deps="avx"
  2647.  
  2648. mmx_external_deps="yasm"
  2649. mmx_inline_deps="inline_asm"
  2650. mmx_suggest="mmx_external mmx_inline"
  2651.  
  2652. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  2653. eval dep=\$${ext}_deps
  2654. eval ${ext}_external_deps='"${dep}_external"'
  2655. eval ${ext}_inline_deps='"${dep}_inline"'
  2656. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  2657. done
  2658.  
  2659. aligned_stack_if_any="aarch64 ppc x86"
  2660. fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  2661. fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
  2662. fast_unaligned_if_any="aarch64 ppc x86"
  2663. simd_align_16_if_any="altivec neon sse"
  2664.  
  2665. # system capabilities
  2666. symver_if_any="symver_asm_label symver_gnu_asm"
  2667. valgrind_backtrace_deps="!optimizations valgrind_valgrind_h"
  2668.  
  2669. # threading support
  2670. atomics_gcc_if_any="sync_val_compare_and_swap atomic_compare_exchange"
  2671. atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
  2672. atomics_win32_if="MemoryBarrier"
  2673. atomics_native_if_any="$ATOMICS_LIST"
  2674. w32threads_deps="atomics_native"
  2675. threads_if_any="$THREADS_LIST"
  2676.  
  2677. # subsystems
  2678. dct_select="rdft"
  2679. dirac_parse_select="golomb"
  2680. error_resilience_select="me_cmp"
  2681. faandct_deps="faan fdctdsp"
  2682. faanidct_deps="faan idctdsp"
  2683. h264dsp_select="startcode"
  2684. frame_thread_encoder_deps="encoders threads"
  2685. intrax8_select="blockdsp idctdsp"
  2686. mdct_select="fft"
  2687. me_cmp_select="fdctdsp idctdsp pixblockdsp"
  2688. mpeg_er_select="error_resilience"
  2689. mpegaudio_select="mpegaudiodsp"
  2690. mpegaudiodsp_select="dct"
  2691. mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp mpeg_er videodsp"
  2692. mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
  2693. vc1dsp_select="h264chroma qpeldsp startcode"
  2694. rdft_select="fft"
  2695.  
  2696. # decoders / encoders
  2697. aac_decoder_select="imdct15 mdct sinewin"
  2698. aac_fixed_decoder_select="mdct sinewin"
  2699. aac_encoder_select="audio_frame_queue iirfilter lpc mdct sinewin"
  2700. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  2701. ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
  2702. ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
  2703. ac3_encoder_select="ac3dsp audiodsp mdct me_cmp"
  2704. ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp"
  2705. adpcm_g722_decoder_select="g722dsp"
  2706. adpcm_g722_encoder_select="g722dsp"
  2707. aic_decoder_select="golomb idctdsp"
  2708. alac_encoder_select="lpc"
  2709. als_decoder_select="bswapdsp"
  2710. amrnb_decoder_select="lsp"
  2711. amrwb_decoder_select="lsp"
  2712. amv_decoder_select="sp5x_decoder exif"
  2713. amv_encoder_select="aandcttables jpegtables mpegvideoenc"
  2714. ape_decoder_select="bswapdsp llauddsp"
  2715. apng_decoder_select="zlib"
  2716. apng_encoder_select="huffyuvencdsp zlib"
  2717. asv1_decoder_select="blockdsp bswapdsp idctdsp"
  2718. asv1_encoder_select="bswapdsp fdctdsp pixblockdsp"
  2719. asv2_decoder_select="blockdsp bswapdsp idctdsp"
  2720. asv2_encoder_select="bswapdsp fdctdsp pixblockdsp"
  2721. atrac1_decoder_select="mdct sinewin"
  2722. atrac3_decoder_select="mdct"
  2723. atrac3p_decoder_select="mdct sinewin"
  2724. avrn_decoder_select="exif jpegtables"
  2725. bink_decoder_select="blockdsp hpeldsp"
  2726. binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
  2727. binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
  2728. cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
  2729. cllc_decoder_select="bswapdsp"
  2730. comfortnoise_encoder_select="lpc"
  2731. cook_decoder_select="audiodsp mdct sinewin"
  2732. cscd_decoder_select="lzo"
  2733. cscd_decoder_suggest="zlib"
  2734. dca_decoder_select="mdct"
  2735. dds_decoder_select="texturedsp"
  2736. dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc"
  2737. dnxhd_decoder_select="blockdsp idctdsp"
  2738. dnxhd_encoder_select="aandcttables blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
  2739. dvvideo_decoder_select="dvprofile idctdsp"
  2740. dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
  2741. dxa_decoder_select="zlib"
  2742. dxv_decoder_select="lzf texturedsp"
  2743. eac3_decoder_select="ac3_decoder"
  2744. eac3_encoder_select="ac3_encoder"
  2745. eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
  2746. eatgq_decoder_select="aandcttables"
  2747. eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp"
  2748. exr_decoder_select="zlib"
  2749. ffv1_decoder_select="golomb rangecoder"
  2750. ffv1_encoder_select="rangecoder"
  2751. ffvhuff_decoder_select="huffyuv_decoder"
  2752. ffvhuff_encoder_select="huffyuv_encoder"
  2753. fic_decoder_select="golomb"
  2754. flac_decoder_select="flacdsp golomb"
  2755. flac_encoder_select="bswapdsp flacdsp golomb lpc"
  2756. flashsv2_decoder_select="zlib"
  2757. flashsv2_encoder_select="zlib"
  2758. flashsv_decoder_select="zlib"
  2759. flashsv_encoder_select="zlib"
  2760. flv_decoder_select="h263_decoder"
  2761. flv_encoder_select="h263_encoder"
  2762. fourxm_decoder_select="blockdsp bswapdsp"
  2763. fraps_decoder_select="bswapdsp huffman"
  2764. g2m_decoder_select="blockdsp idctdsp jpegtables zlib"
  2765. g729_decoder_select="audiodsp"
  2766. h261_decoder_select="mpegvideo"
  2767. h261_encoder_select="aandcttables mpegvideoenc"
  2768. h263_decoder_select="h263_parser h263dsp mpegvideo qpeldsp"
  2769. h263_encoder_select="aandcttables h263dsp mpegvideoenc"
  2770. h263i_decoder_select="h263_decoder"
  2771. h263p_decoder_select="h263_decoder"
  2772. h263p_encoder_select="h263_encoder"
  2773. h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel videodsp"
  2774. h264_decoder_suggest="error_resilience"
  2775. hap_decoder_select="snappy texturedsp"
  2776. hap_encoder_deps="libsnappy"
  2777. hap_encoder_select="texturedspenc"
  2778. hevc_decoder_select="bswapdsp cabac golomb videodsp"
  2779. huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
  2780. huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llviddsp"
  2781. iac_decoder_select="imc_decoder"
  2782. imc_decoder_select="bswapdsp fft mdct sinewin"
  2783. indeo3_decoder_select="hpeldsp"
  2784. indeo4_decoder_select="ividsp"
  2785. indeo5_decoder_select="ividsp"
  2786. interplay_video_decoder_select="hpeldsp"
  2787. jpegls_decoder_select="golomb mjpeg_decoder"
  2788. jpegls_encoder_select="golomb"
  2789. jv_decoder_select="blockdsp"
  2790. lagarith_decoder_select="huffyuvdsp"
  2791. ljpeg_encoder_select="aandcttables idctdsp jpegtables"
  2792. loco_decoder_select="golomb"
  2793. magicyuv_decoder_select="huffyuvdsp"
  2794. mdec_decoder_select="blockdsp idctdsp mpegvideo"
  2795. metasound_decoder_select="lsp mdct sinewin"
  2796. mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
  2797. mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
  2798. mjpeg_encoder_select="aandcttables jpegtables mpegvideoenc"
  2799. mjpegb_decoder_select="mjpeg_decoder"
  2800. mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
  2801. mjpeg_vaapi_encoder_select="vaapi_encode jpegtables"
  2802. mlp_decoder_select="mlp_parser"
  2803. motionpixels_decoder_select="bswapdsp"
  2804. mp1_decoder_select="mpegaudio"
  2805. mp1float_decoder_select="mpegaudio"
  2806. mp2_decoder_select="mpegaudio"
  2807. mp2float_decoder_select="mpegaudio"
  2808. mp3_decoder_select="mpegaudio"
  2809. mp3adu_decoder_select="mpegaudio"
  2810. mp3adufloat_decoder_select="mpegaudio"
  2811. mp3float_decoder_select="mpegaudio"
  2812. mp3on4_decoder_select="mpegaudio"
  2813. mp3on4float_decoder_select="mpegaudio"
  2814. mpc7_decoder_select="bswapdsp mpegaudiodsp"
  2815. mpc8_decoder_select="mpegaudiodsp"
  2816. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  2817. mpeg_xvmc_decoder_select="mpeg2video_decoder"
  2818. mpegvideo_decoder_select="mpegvideo"
  2819. mpeg1video_decoder_select="mpegvideo"
  2820. mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp"
  2821. mpeg2video_decoder_select="mpegvideo"
  2822. mpeg2video_encoder_select="aandcttables mpegvideoenc h263dsp"
  2823. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  2824. mpeg4_encoder_select="h263_encoder"
  2825. msa1_decoder_select="mss34dsp"
  2826. msmpeg4v1_decoder_select="h263_decoder"
  2827. msmpeg4v2_decoder_select="h263_decoder"
  2828. msmpeg4v2_encoder_select="h263_encoder"
  2829. msmpeg4v3_decoder_select="h263_decoder"
  2830. msmpeg4v3_encoder_select="h263_encoder"
  2831. mss2_decoder_select="vc1_decoder mpegvideo"
  2832. mts2_decoder_select="mss34dsp"
  2833. mxpeg_decoder_select="mjpeg_decoder"
  2834. nellymoser_decoder_select="mdct sinewin"
  2835. nellymoser_encoder_select="audio_frame_queue mdct sinewin"
  2836. nuv_decoder_select="idctdsp lzo"
  2837. on2avc_decoder_select="mdct"
  2838. opus_decoder_deps="swresample"
  2839. opus_decoder_select="imdct15"
  2840. png_decoder_select="zlib"
  2841. png_encoder_select="huffyuvencdsp zlib"
  2842. prores_decoder_select="blockdsp idctdsp"
  2843. prores_encoder_select="fdctdsp"
  2844. qcelp_decoder_select="lsp"
  2845. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  2846. ra_144_decoder_select="audiodsp"
  2847. ra_144_encoder_select="audio_frame_queue lpc audiodsp"
  2848. ralf_decoder_select="golomb"
  2849. rawvideo_decoder_select="bswapdsp"
  2850. rscc_decoder_select="zlib"
  2851. rtjpeg_decoder_select="me_cmp"
  2852. rv10_decoder_select="h263_decoder"
  2853. rv10_encoder_select="h263_encoder"
  2854. rv20_decoder_select="h263_decoder"
  2855. rv20_encoder_select="h263_encoder"
  2856. rv30_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp"
  2857. rv40_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp"
  2858. screenpresso_decoder_select="zlib"
  2859. shorten_decoder_select="golomb"
  2860. sipr_decoder_select="lsp"
  2861. snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp"
  2862. snow_encoder_select="aandcttables dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder"
  2863. sonic_decoder_select="golomb rangecoder"
  2864. sonic_encoder_select="golomb rangecoder"
  2865. sonic_ls_encoder_select="golomb rangecoder"
  2866. sp5x_decoder_select="mjpeg_decoder"
  2867. svq1_decoder_select="hpeldsp"
  2868. svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
  2869. svq3_decoder_select="golomb h264dsp h264pred hpeldsp tpeldsp videodsp"
  2870. svq3_decoder_suggest="zlib"
  2871. tak_decoder_select="audiodsp"
  2872. tdsc_decoder_select="zlib mjpeg_decoder"
  2873. theora_decoder_select="vp3_decoder"
  2874. thp_decoder_select="mjpeg_decoder"
  2875. tiff_decoder_suggest="zlib lzma"
  2876. tiff_encoder_suggest="zlib"
  2877. truehd_decoder_select="mlp_parser"
  2878. truemotion2_decoder_select="bswapdsp"
  2879. truespeech_decoder_select="bswapdsp"
  2880. tscc_decoder_select="zlib"
  2881. twinvq_decoder_select="mdct lsp sinewin"
  2882. txd_decoder_select="texturedsp"
  2883. utvideo_decoder_select="bswapdsp"
  2884. utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
  2885. vble_decoder_select="huffyuvdsp"
  2886. vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideo vc1dsp"
  2887. vc1_qsv_decoder_deps="libmfx"
  2888. vc1_qsv_decoder_select="qsvdec vc1_qsv_hwaccel"
  2889. vc1image_decoder_select="vc1_decoder"
  2890. vorbis_decoder_select="mdct"
  2891. vorbis_encoder_select="mdct"
  2892. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  2893. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
  2894. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
  2895. vp6a_decoder_select="vp6_decoder"
  2896. vp6f_decoder_select="vp6_decoder"
  2897. vp7_decoder_select="h264pred videodsp vp8dsp"
  2898. vp8_decoder_select="h264pred videodsp vp8dsp"
  2899. vp9_decoder_select="videodsp vp9_parser"
  2900. webp_decoder_select="vp8_decoder exif"
  2901. wmalossless_decoder_select="llauddsp"
  2902. wmapro_decoder_select="mdct sinewin wma_freqs"
  2903. wmav1_decoder_select="mdct sinewin wma_freqs"
  2904. wmav1_encoder_select="mdct sinewin wma_freqs"
  2905. wmav2_decoder_select="mdct sinewin wma_freqs"
  2906. wmav2_encoder_select="mdct sinewin wma_freqs"
  2907. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  2908. wmv1_decoder_select="h263_decoder"
  2909. wmv1_encoder_select="h263_encoder"
  2910. wmv2_decoder_select="blockdsp error_resilience h263_decoder idctdsp intrax8 videodsp wmv2dsp"
  2911. wmv2_encoder_select="h263_encoder wmv2dsp"
  2912. wmv3_decoder_select="vc1_decoder"
  2913. wmv3image_decoder_select="wmv3_decoder"
  2914. xma1_decoder_select="wmapro_decoder"
  2915. xma2_decoder_select="wmapro_decoder"
  2916. zerocodec_decoder_select="zlib"
  2917. zlib_decoder_select="zlib"
  2918. zlib_encoder_select="zlib"
  2919. zmbv_decoder_select="zlib"
  2920. zmbv_encoder_select="zlib"
  2921.  
  2922. # platform codecs
  2923. audiotoolbox_deps="AudioToolbox_AudioToolbox_h"
  2924. audiotoolbox_extralibs="-framework CoreFoundation -framework AudioToolbox -framework CoreMedia"
  2925.  
  2926. # hardware accelerators
  2927. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  2928. cuvid_deps="cuda"
  2929. d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
  2930. dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
  2931. vaapi_deps="va_va_h"
  2932. vda_framework_deps="VideoDecodeAcceleration_VDADecoder_h"
  2933. vda_framework_extralibs="-framework VideoDecodeAcceleration"
  2934. vda_deps="vda_framework pthreads"
  2935. vda_extralibs="-framework CoreFoundation -framework QuartzCore"
  2936. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  2937. videotoolbox_hwaccel_deps="videotoolbox pthreads"
  2938. videotoolbox_hwaccel_extralibs="-framework QuartzCore"
  2939. xvmc_deps="X11_extensions_XvMClib_h"
  2940.  
  2941. h263_cuvid_hwaccel_deps="cuda cuvid"
  2942. h263_vaapi_hwaccel_deps="vaapi"
  2943. h263_vaapi_hwaccel_select="h263_decoder"
  2944. h263_videotoolbox_hwaccel_deps="videotoolbox"
  2945. h263_videotoolbox_hwaccel_select="h263_decoder"
  2946. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  2947. h264_cuvid_hwaccel_deps="cuda cuvid"
  2948. h264_d3d11va_hwaccel_deps="d3d11va"
  2949. h264_d3d11va_hwaccel_select="h264_decoder"
  2950. h264_dxva2_hwaccel_deps="dxva2"
  2951. h264_dxva2_hwaccel_select="h264_decoder"
  2952. h264_mediacodec_decoder_deps="mediacodec"
  2953. h264_mediacodec_hwaccel_deps="mediacodec"
  2954. h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
  2955. h264_mmal_decoder_deps="mmal"
  2956. h264_mmal_decoder_select="mmal"
  2957. h264_mmal_hwaccel_deps="mmal"
  2958. h264_omx_encoder_deps="omx"
  2959. h264_qsv_hwaccel_deps="libmfx"
  2960. h264_vaapi_hwaccel_deps="vaapi"
  2961. h264_vaapi_hwaccel_select="h264_decoder"
  2962. h264_vda_decoder_deps="vda"
  2963. h264_vda_decoder_select="h264_decoder"
  2964. h264_vda_hwaccel_deps="vda"
  2965. h264_vda_hwaccel_select="h264_decoder"
  2966. h264_vda_old_hwaccel_deps="vda"
  2967. h264_vda_old_hwaccel_select="h264_decoder"
  2968. h264_vdpau_decoder_deps="vdpau"
  2969. h264_vdpau_decoder_select="h264_decoder"
  2970. h264_vdpau_hwaccel_deps="vdpau"
  2971. h264_vdpau_hwaccel_select="h264_decoder"
  2972. h264_videotoolbox_hwaccel_deps="videotoolbox"
  2973. h264_videotoolbox_hwaccel_select="h264_decoder"
  2974. hevc_cuvid_hwaccel_deps="cuda cuvid"
  2975. hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  2976. hevc_d3d11va_hwaccel_select="hevc_decoder"
  2977. hevc_mediacodec_decoder_deps="mediacodec"
  2978. hevc_mediacodec_hwaccel_deps="mediacodec"
  2979. hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
  2980. hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  2981. hevc_dxva2_hwaccel_select="hevc_decoder"
  2982. hevc_qsv_hwaccel_deps="libmfx"
  2983. hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
  2984. hevc_vaapi_hwaccel_select="hevc_decoder"
  2985. hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
  2986. hevc_vdpau_hwaccel_select="hevc_decoder"
  2987. mjpeg_cuvid_hwaccel_deps="cuda cuvid"
  2988. mpeg_vdpau_decoder_deps="vdpau"
  2989. mpeg_vdpau_decoder_select="mpeg2video_decoder"
  2990. mpeg_xvmc_hwaccel_deps="xvmc"
  2991. mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
  2992. mpeg1_cuvid_hwaccel_deps="cuda cuvid"
  2993. mpeg1_vdpau_decoder_deps="vdpau"
  2994. mpeg1_vdpau_decoder_select="mpeg1video_decoder"
  2995. mpeg1_vdpau_hwaccel_deps="vdpau"
  2996. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2997. mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
  2998. mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
  2999. mpeg1_xvmc_hwaccel_deps="xvmc"
  3000. mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
  3001. mpeg2_crystalhd_decoder_select="crystalhd"
  3002. mpeg2_cuvid_hwaccel_deps="cuda cuvid"
  3003. mpeg2_d3d11va_hwaccel_deps="d3d11va"
  3004. mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
  3005. mpeg2_dxva2_hwaccel_deps="dxva2"
  3006. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  3007. mpeg2_mmal_decoder_deps="mmal"
  3008. mpeg2_mmal_decoder_select="mmal"
  3009. mpeg2_mmal_hwaccel_deps="mmal"
  3010. mpeg2_qsv_hwaccel_deps="libmfx"
  3011. mpeg2_qsv_hwaccel_select="qsvdec_mpeg2"
  3012. mpeg2_vaapi_hwaccel_deps="vaapi"
  3013. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  3014. mpeg2_vdpau_hwaccel_deps="vdpau"
  3015. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  3016. mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
  3017. mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
  3018. mpeg2_xvmc_hwaccel_deps="xvmc"
  3019. mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
  3020. mpeg4_crystalhd_decoder_select="crystalhd"
  3021. mpeg4_cuvid_hwaccel_deps="cuda cuvid"
  3022. mpeg4_mediacodec_decoder_deps="mediacodec"
  3023. mpeg4_mediacodec_hwaccel_deps="mediacodec"
  3024. mpeg4_mmal_decoder_deps="mmal"
  3025. mpeg4_mmal_decoder_select="mmal"
  3026. mpeg4_mmal_hwaccel_deps="mmal"
  3027. mpeg4_omx_encoder_deps="omx"
  3028. mpeg4_vaapi_hwaccel_deps="vaapi"
  3029. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  3030. mpeg4_vdpau_decoder_deps="vdpau"
  3031. mpeg4_vdpau_decoder_select="mpeg4_decoder"
  3032. mpeg4_vdpau_hwaccel_deps="vdpau"
  3033. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  3034. mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
  3035. mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
  3036. msmpeg4_crystalhd_decoder_select="crystalhd"
  3037. vc1_crystalhd_decoder_select="crystalhd"
  3038. vc1_cuvid_hwaccel_deps="cuda cuvid"
  3039. vc1_d3d11va_hwaccel_deps="d3d11va"
  3040. vc1_d3d11va_hwaccel_select="vc1_decoder"
  3041. vc1_dxva2_hwaccel_deps="dxva2"
  3042. vc1_dxva2_hwaccel_select="vc1_decoder"
  3043. vc1_mmal_decoder_deps="mmal"
  3044. vc1_mmal_decoder_select="mmal"
  3045. vc1_mmal_hwaccel_deps="mmal"
  3046. vc1_qsv_hwaccel_deps="libmfx"
  3047. vc1_qsv_hwaccel_select="qsvdec_vc1"
  3048. vc1_vaapi_hwaccel_deps="vaapi"
  3049. vc1_vaapi_hwaccel_select="vc1_decoder"
  3050. vc1_vdpau_decoder_deps="vdpau"
  3051. vc1_vdpau_decoder_select="vc1_decoder"
  3052. vc1_vdpau_hwaccel_deps="vdpau"
  3053. vc1_vdpau_hwaccel_select="vc1_decoder"
  3054. vp8_cuvid_hwaccel_deps="cuda cuvid"
  3055. vp9_cuvid_hwaccel_deps="cuda cuvid"
  3056. vp8_mediacodec_decoder_deps="mediacodec"
  3057. vp8_mediacodec_hwaccel_deps="mediacodec"
  3058. vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
  3059. vp9_d3d11va_hwaccel_select="vp9_decoder"
  3060. vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
  3061. vp9_dxva2_hwaccel_select="vp9_decoder"
  3062. vp9_mediacodec_decoder_deps="mediacodec"
  3063. vp9_mediacodec_hwaccel_deps="mediacodec"
  3064. vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9"
  3065. vp9_vaapi_hwaccel_select="vp9_decoder"
  3066. wmv3_crystalhd_decoder_select="crystalhd"
  3067. wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  3068. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  3069. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  3070. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  3071. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  3072.  
  3073. # hardware-accelerated codecs
  3074. omx_deps="dlopen pthreads"
  3075. omx_extralibs='$ldl'
  3076. qsvdec_select="qsv"
  3077. qsvenc_select="qsv"
  3078. vaapi_encode_deps="vaapi"
  3079.  
  3080. hwupload_cuda_filter_deps="cuda"
  3081. scale_npp_filter_deps="cuda libnpp"
  3082.  
  3083. nvenc_deps_any="dlopen LoadLibrary"
  3084. nvenc_encoder_deps="nvenc"
  3085. h263_cuvid_decoder_deps="cuda cuvid"
  3086. h263_cuvid_decoder_select="h263_cuvid_hwaccel"
  3087. h264_cuvid_decoder_deps="cuda cuvid"
  3088. h264_cuvid_decoder_select="h264_mp4toannexb_bsf h264_cuvid_hwaccel"
  3089. h264_nvenc_encoder_deps="nvenc"
  3090. h264_qsv_decoder_deps="libmfx"
  3091. h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
  3092. h264_qsv_encoder_deps="libmfx"
  3093. h264_qsv_encoder_select="qsvenc"
  3094. h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
  3095. h264_vaapi_encoder_select="vaapi_encode golomb"
  3096.  
  3097. hevc_cuvid_decoder_deps="cuda cuvid"
  3098. hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf hevc_cuvid_hwaccel"
  3099. hevc_nvenc_encoder_deps="nvenc"
  3100. hevc_qsv_decoder_deps="libmfx"
  3101. hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec hevc_qsv_hwaccel"
  3102. hevc_qsv_encoder_deps="libmfx"
  3103. hevc_qsv_encoder_select="qsvenc"
  3104. hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
  3105. hevc_vaapi_encoder_select="vaapi_encode golomb"
  3106. mjpeg_cuvid_decoder_deps="cuda cuvid"
  3107. mjpeg_cuvid_decoder_select="mjpeg_cuvid_hwaccel"
  3108. mpeg1_cuvid_decoder_deps="cuda cuvid"
  3109. mpeg1_cuvid_decoder_select="mpeg1_cuvid_hwaccel"
  3110. mpeg2_cuvid_decoder_deps="cuda cuvid"
  3111. mpeg2_cuvid_decoder_select="mpeg2_cuvid_hwaccel"
  3112. mpeg2_qsv_decoder_deps="libmfx"
  3113. mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel"
  3114. mpeg2_qsv_encoder_deps="libmfx"
  3115. mpeg2_qsv_encoder_select="qsvenc"
  3116. mpeg4_cuvid_decoder_deps="cuda cuvid"
  3117. mpeg4_cuvid_decoder_select="mpeg4_cuvid_hwaccel"
  3118. nvenc_h264_encoder_deps="nvenc"
  3119. nvenc_hevc_encoder_deps="nvenc"
  3120.  
  3121. vc1_cuvid_decoder_deps="cuda cuvid"
  3122. vc1_cuvid_decoder_select="vc1_cuvid_hwaccel"
  3123. vp8_cuvid_decoder_deps="cuda cuvid"
  3124. vp8_cuvid_decoder_select="vp8_cuvid_hwaccel"
  3125. vp9_cuvid_decoder_deps="cuda cuvid"
  3126. vp9_cuvid_decoder_select="vp9_cuvid_hwaccel"
  3127.  
  3128. # parsers
  3129. h264_parser_select="golomb h264dsp"
  3130. hevc_parser_select="golomb"
  3131. mpegvideo_parser_select="mpegvideo"
  3132. mpeg4video_parser_select="h263dsp mpegvideo qpeldsp"
  3133. vc1_parser_select="vc1dsp"
  3134.  
  3135. # bitstream_filters
  3136. mjpeg2jpeg_bsf_select="jpegtables"
  3137.  
  3138. # external libraries
  3139. aac_at_decoder_deps="audiotoolbox"
  3140. ac3_at_decoder_deps="audiotoolbox"
  3141. ac3_at_decoder_select="ac3_parser"
  3142. adpcm_ima_qt_at_decoder_deps="audiotoolbox"
  3143. alac_at_decoder_deps="audiotoolbox"
  3144. amr_nb_at_decoder_deps="audiotoolbox"
  3145. eac3_at_decoder_deps="audiotoolbox"
  3146. eac3_at_decoder_select="ac3_parser"
  3147. gsm_ms_at_decoder_deps="audiotoolbox"
  3148. ilbc_at_decoder_deps="audiotoolbox"
  3149. mp1_at_decoder_deps="audiotoolbox"
  3150. mp2_at_decoder_deps="audiotoolbox"
  3151. mp3_at_decoder_deps="audiotoolbox"
  3152. pcm_alaw_at_decoder_deps="audiotoolbox"
  3153. pcm_mulaw_at_decoder_deps="audiotoolbox"
  3154. qdmc_at_decoder_deps="audiotoolbox"
  3155. qdm2_at_decoder_deps="audiotoolbox"
  3156. aac_at_encoder_deps="audiotoolbox"
  3157. aac_at_encoder_select="audio_frame_queue"
  3158. alac_at_encoder_deps="audiotoolbox"
  3159. alac_at_encoder_select="audio_frame_queue"
  3160. ilbc_at_encoder_deps="audiotoolbox"
  3161. ilbc_at_encoder_select="audio_frame_queue"
  3162. pcm_alaw_at_encoder_deps="audiotoolbox"
  3163. pcm_alaw_at_encoder_select="audio_frame_queue"
  3164. pcm_mulaw_at_encoder_deps="audiotoolbox"
  3165. pcm_mulaw_at_encoder_select="audio_frame_queue"
  3166. chromaprint_muxer_deps="chromaprint"
  3167. h264_videotoolbox_encoder_deps="videotoolbox_encoder pthreads"
  3168. libcelt_decoder_deps="libcelt"
  3169. libfdk_aac_decoder_deps="libfdk_aac"
  3170. libfdk_aac_encoder_deps="libfdk_aac"
  3171. libfdk_aac_encoder_select="audio_frame_queue"
  3172. libgme_demuxer_deps="libgme"
  3173. libgsm_decoder_deps="libgsm"
  3174. libgsm_encoder_deps="libgsm"
  3175. libgsm_ms_decoder_deps="libgsm"
  3176. libgsm_ms_encoder_deps="libgsm"
  3177. libilbc_decoder_deps="libilbc"
  3178. libilbc_encoder_deps="libilbc"
  3179. libkvazaar_encoder_deps="libkvazaar"
  3180. libmodplug_demuxer_deps="libmodplug"
  3181. libmp3lame_encoder_deps="libmp3lame"
  3182. libmp3lame_encoder_select="audio_frame_queue"
  3183. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  3184. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  3185. libopencore_amrnb_encoder_select="audio_frame_queue"
  3186. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  3187. libopenh264_decoder_deps="libopenh264"
  3188. libopenh264_decoder_select="h264_mp4toannexb_bsf"
  3189. libopenh264_encoder_deps="libopenh264"
  3190. libopenjpeg_decoder_deps="libopenjpeg"
  3191. libopenjpeg_encoder_deps="libopenjpeg"
  3192. libopenmpt_demuxer_deps="libopenmpt"
  3193. libopus_decoder_deps="libopus"
  3194. libopus_encoder_deps="libopus"
  3195. libopus_encoder_select="audio_frame_queue"
  3196. libschroedinger_decoder_deps="libschroedinger"
  3197. libschroedinger_encoder_deps="libschroedinger"
  3198. libshine_encoder_deps="libshine"
  3199. libshine_encoder_select="audio_frame_queue"
  3200. libspeex_decoder_deps="libspeex"
  3201. libspeex_encoder_deps="libspeex"
  3202. libspeex_encoder_select="audio_frame_queue"
  3203. libtheora_encoder_deps="libtheora"
  3204. libtwolame_encoder_deps="libtwolame"
  3205. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  3206. libvorbis_decoder_deps="libvorbis"
  3207. libvorbis_encoder_deps="libvorbis"
  3208. libvorbis_encoder_select="audio_frame_queue"
  3209. libvpx_vp8_decoder_deps="libvpx"
  3210. libvpx_vp8_encoder_deps="libvpx"
  3211. libvpx_vp9_decoder_deps="libvpx"
  3212. libvpx_vp9_encoder_deps="libvpx"
  3213. libwavpack_encoder_deps="libwavpack"
  3214. libwebp_encoder_deps="libwebp"
  3215. libwebp_anim_encoder_deps="libwebp"
  3216. libx262_encoder_deps="libx262"
  3217. libx264_encoder_deps="libx264"
  3218. libx264rgb_encoder_deps="libx264 x264_csp_bgr"
  3219. libx264rgb_encoder_select="libx264_encoder"
  3220. libx265_encoder_deps="libx265"
  3221. libxavs_encoder_deps="libxavs"
  3222. libxvid_encoder_deps="libxvid"
  3223. libzvbi_teletext_decoder_deps="libzvbi"
  3224. videotoolbox_deps="VideoToolbox_VideoToolbox_h"
  3225. videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox -framework CoreMedia -framework CoreVideo"
  3226. videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
  3227. videotoolbox_encoder_suggest="vda_framework vt_bt2020"
  3228. vt_bt2020_deps="kCVImageBufferColorPrimaries_ITU_R_2020"
  3229.  
  3230. # demuxers / muxers
  3231. ac3_demuxer_select="ac3_parser"
  3232. asf_demuxer_select="riffdec"
  3233. asf_o_demuxer_select="riffdec"
  3234. asf_muxer_select="riffenc"
  3235. asf_stream_muxer_select="asf_muxer"
  3236. avi_demuxer_select="iso_media riffdec exif"
  3237. avi_muxer_select="riffenc"
  3238. avisynth_demuxer_deps="avisynth"
  3239. avisynth_demuxer_select="riffdec"
  3240. caf_demuxer_select="iso_media riffdec"
  3241. dash_muxer_select="mp4_muxer"
  3242. dirac_demuxer_select="dirac_parser"
  3243. dts_demuxer_select="dca_parser"
  3244. dtshd_demuxer_select="dca_parser"
  3245. dv_demuxer_select="dvprofile"
  3246. dv_muxer_select="dvprofile"
  3247. dxa_demuxer_select="riffdec"
  3248. eac3_demuxer_select="ac3_parser"
  3249. f4v_muxer_select="mov_muxer"
  3250. fifo_muxer_deps="threads"
  3251. flac_demuxer_select="flac_parser"
  3252. hds_muxer_select="flv_muxer"
  3253. hls_muxer_select="mpegts_muxer"
  3254. image2_alias_pix_demuxer_select="image2_demuxer"
  3255. image2_brender_pix_demuxer_select="image2_demuxer"
  3256. ipod_muxer_select="mov_muxer"
  3257. ismv_muxer_select="mov_muxer"
  3258. libnut_demuxer_deps="libnut"
  3259. libnut_muxer_deps="libnut"
  3260. matroska_audio_muxer_select="matroska_muxer"
  3261. matroska_demuxer_select="iso_media riffdec"
  3262. matroska_demuxer_suggest="bzlib lzo zlib"
  3263. matroska_muxer_select="iso_media riffenc"
  3264. mmf_muxer_select="riffenc"
  3265. mov_demuxer_select="iso_media riffdec"
  3266. mov_demuxer_suggest="zlib"
  3267. mov_muxer_select="iso_media riffenc rtpenc_chain"
  3268. mp3_demuxer_select="mpegaudio_parser"
  3269. mp4_muxer_select="mov_muxer"
  3270. mpegts_demuxer_select="iso_media"
  3271. mpegts_muxer_select="adts_muxer latm_muxer"
  3272. mpegtsraw_demuxer_select="mpegts_demuxer"
  3273. mxf_d10_muxer_select="mxf_muxer"
  3274. mxf_opatom_muxer_select="mxf_muxer"
  3275. nut_muxer_select="riffenc"
  3276. nuv_demuxer_select="riffdec"
  3277. oga_muxer_select="ogg_muxer"
  3278. ogg_demuxer_select="dirac_parse"
  3279. ogv_muxer_select="ogg_muxer"
  3280. opus_muxer_select="ogg_muxer"
  3281. psp_muxer_select="mov_muxer"
  3282. rtp_demuxer_select="sdp_demuxer"
  3283. rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
  3284. rtsp_demuxer_select="http_protocol rtpdec"
  3285. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  3286. sap_demuxer_select="sdp_demuxer"
  3287. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  3288. sdp_demuxer_select="rtpdec"
  3289. smoothstreaming_muxer_select="ismv_muxer"
  3290. spdif_muxer_select="aac_parser"
  3291. spx_muxer_select="ogg_muxer"
  3292. swf_demuxer_suggest="zlib"
  3293. tak_demuxer_select="tak_parser"
  3294. tg2_muxer_select="mov_muxer"
  3295. tgp_muxer_select="mov_muxer"
  3296. vobsub_demuxer_select="mpegps_demuxer"
  3297. w64_demuxer_select="wav_demuxer"
  3298. w64_muxer_select="wav_muxer"
  3299. wav_demuxer_select="riffdec"
  3300. wav_muxer_select="riffenc"
  3301. webm_muxer_select="iso_media riffenc"
  3302. webm_dash_manifest_demuxer_select="matroska_demuxer"
  3303. wtv_demuxer_select="mpegts_demuxer riffdec"
  3304. wtv_muxer_select="mpegts_muxer riffenc"
  3305. xmv_demuxer_select="riffdec"
  3306. xwma_demuxer_select="riffdec"
  3307.  
  3308. # indevs / outdevs
  3309. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  3310. alsa_outdev_deps="alsa_asoundlib_h"
  3311. avfoundation_indev_extralibs="-framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia"
  3312. avfoundation_indev_select="avfoundation"
  3313. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  3314. caca_outdev_deps="libcaca"
  3315. decklink_indev_deps="decklink pthreads"
  3316. decklink_indev_extralibs="-lstdc++"
  3317. decklink_outdev_deps="decklink pthreads"
  3318. decklink_outdev_extralibs="-lstdc++"
  3319. dshow_indev_deps="IBaseFilter"
  3320. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
  3321. dv1394_indev_deps="dv1394"
  3322. dv1394_indev_select="dv_demuxer"
  3323. fbdev_indev_deps="linux_fb_h"
  3324. fbdev_outdev_deps="linux_fb_h"
  3325. gdigrab_indev_deps="CreateDIBSection"
  3326. gdigrab_indev_extralibs="-lgdi32"
  3327. gdigrab_indev_select="bmp_decoder"
  3328. iec61883_indev_deps="libiec61883"
  3329. jack_indev_deps="jack_jack_h"
  3330. jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
  3331. lavfi_indev_deps="avfilter"
  3332. libcdio_indev_deps="libcdio"
  3333. libdc1394_indev_deps="libdc1394"
  3334. libv4l2_indev_deps="libv4l2"
  3335. openal_indev_deps="openal"
  3336. opengl_outdev_deps="opengl"
  3337. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  3338. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  3339. pulse_indev_deps="libpulse"
  3340. pulse_outdev_deps="libpulse"
  3341. qtkit_indev_extralibs="-framework QTKit -framework Foundation -framework QuartzCore"
  3342. qtkit_indev_select="qtkit"
  3343. sdl2_outdev_deps="sdl2"
  3344. sndio_indev_deps="sndio_h"
  3345. sndio_outdev_deps="sndio_h"
  3346. v4l_indev_deps="linux_videodev_h"
  3347. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  3348. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  3349. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  3350. vfwcap_indev_extralibs="-lavicap32"
  3351. x11grab_indev_deps="x11grab"
  3352. x11grab_xcb_indev_deps="libxcb"
  3353. xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
  3354. xv_outdev_extralibs="-lXv -lX11 -lXext"
  3355.  
  3356. # protocols
  3357. async_protocol_deps="threads"
  3358. bluray_protocol_deps="libbluray"
  3359. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  3360. ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
  3361. ffrtmpcrypt_protocol_select="tcp_protocol"
  3362. ffrtmphttp_protocol_deps="!librtmp_protocol"
  3363. ffrtmphttp_protocol_select="http_protocol"
  3364. ftp_protocol_select="tcp_protocol"
  3365. gopher_protocol_select="network"
  3366. http_protocol_select="tcp_protocol"
  3367. httpproxy_protocol_select="tcp_protocol"
  3368. https_protocol_select="tls_protocol"
  3369. icecast_protocol_select="http_protocol"
  3370. librtmp_protocol_deps="librtmp"
  3371. librtmpe_protocol_deps="librtmp"
  3372. librtmps_protocol_deps="librtmp"
  3373. librtmpt_protocol_deps="librtmp"
  3374. librtmpte_protocol_deps="librtmp"
  3375. libsmbclient_protocol_deps="libsmbclient gplv3"
  3376. libssh_protocol_deps="libssh"
  3377. mmsh_protocol_select="http_protocol"
  3378. mmst_protocol_select="network"
  3379. rtmp_protocol_deps="!librtmp_protocol"
  3380. rtmp_protocol_select="tcp_protocol"
  3381. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  3382. rtmps_protocol_deps="!librtmp_protocol"
  3383. rtmps_protocol_select="tls_protocol"
  3384. rtmpt_protocol_select="ffrtmphttp_protocol"
  3385. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  3386. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  3387. rtp_protocol_select="udp_protocol"
  3388. sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
  3389. sctp_protocol_select="network"
  3390. srtp_protocol_select="rtp_protocol srtp"
  3391. tcp_protocol_select="network"
  3392. tls_gnutls_protocol_deps="gnutls !tls_schannel_protocol !tls_securetransport_protocol"
  3393. tls_gnutls_protocol_select="tcp_protocol"
  3394. tls_openssl_protocol_deps="openssl !tls_schannel_protocol !tls_securetransport_protocol !tls_gnutls_protocol"
  3395. tls_openssl_protocol_select="tcp_protocol"
  3396. tls_schannel_protocol_deps="schannel"
  3397. tls_schannel_protocol_select="tcp_protocol"
  3398. tls_securetransport_protocol_deps="securetransport"
  3399. tls_securetransport_protocol_select="tcp_protocol"
  3400. tls_protocol_deps_any="tls_schannel_protocol tls_securetransport_protocol tls_gnutls_protocol tls_openssl_protocol"
  3401. udp_protocol_select="network"
  3402. udplite_protocol_select="network"
  3403. unix_protocol_deps="sys_un_h"
  3404. unix_protocol_select="network"
  3405.  
  3406. # filters
  3407. afftfilt_filter_deps="avcodec"
  3408. afftfilt_filter_select="fft"
  3409. amovie_filter_deps="avcodec avformat"
  3410. aresample_filter_deps="swresample"
  3411. ass_filter_deps="libass"
  3412. asyncts_filter_deps="avresample"
  3413. atempo_filter_deps="avcodec"
  3414. atempo_filter_select="rdft"
  3415. azmq_filter_deps="libzmq"
  3416. blackframe_filter_deps="gpl"
  3417. boxblur_filter_deps="gpl"
  3418. bs2b_filter_deps="libbs2b"
  3419. colormatrix_filter_deps="gpl"
  3420. cover_rect_filter_deps="avcodec avformat gpl"
  3421. cropdetect_filter_deps="gpl"
  3422. delogo_filter_deps="gpl"
  3423. deshake_filter_select="pixelutils"
  3424. drawtext_filter_deps="libfreetype"
  3425. ebur128_filter_deps="gpl"
  3426. eq_filter_deps="gpl"
  3427. fftfilt_filter_deps="avcodec"
  3428. fftfilt_filter_select="rdft"
  3429. find_rect_filter_deps="avcodec avformat gpl"
  3430. firequalizer_filter_deps="avcodec"
  3431. firequalizer_filter_select="rdft"
  3432. flite_filter_deps="libflite"
  3433. framerate_filter_select="pixelutils"
  3434. frei0r_filter_deps="frei0r dlopen"
  3435. frei0r_src_filter_deps="frei0r dlopen"
  3436. fspp_filter_deps="gpl"
  3437. geq_filter_deps="gpl"
  3438. histeq_filter_deps="gpl"
  3439. hqdn3d_filter_deps="gpl"
  3440. interlace_filter_deps="gpl"
  3441. kerndeint_filter_deps="gpl"
  3442. ladspa_filter_deps="ladspa dlopen"
  3443. loudnorm_filter_deps="libebur128"
  3444. mcdeint_filter_deps="avcodec gpl"
  3445. movie_filter_deps="avcodec avformat"
  3446. mpdecimate_filter_deps="gpl"
  3447. mpdecimate_filter_select="pixelutils"
  3448. mptestsrc_filter_deps="gpl"
  3449. negate_filter_deps="lut_filter"
  3450. nnedi_filter_deps="gpl"
  3451. ocr_filter_deps="libtesseract"
  3452. ocv_filter_deps="libopencv"
  3453. owdenoise_filter_deps="gpl"
  3454. pan_filter_deps="swresample"
  3455. perspective_filter_deps="gpl"
  3456. phase_filter_deps="gpl"
  3457. pp7_filter_deps="gpl"
  3458. pp_filter_deps="gpl postproc"
  3459. pullup_filter_deps="gpl"
  3460. removelogo_filter_deps="avcodec avformat swscale"
  3461. repeatfields_filter_deps="gpl"
  3462. resample_filter_deps="avresample"
  3463. rubberband_filter_deps="librubberband"
  3464. sab_filter_deps="gpl swscale"
  3465. scale2ref_filter_deps="swscale"
  3466. scale_filter_deps="swscale"
  3467. select_filter_select="pixelutils"
  3468. showcqt_filter_deps="avcodec avformat swscale"
  3469. showcqt_filter_select="fft"
  3470. showfreqs_filter_deps="avcodec"
  3471. showfreqs_filter_select="fft"
  3472. showspectrum_filter_deps="avcodec"
  3473. showspectrum_filter_select="fft"
  3474. showspectrumpic_filter_deps="avcodec"
  3475. showspectrumpic_filter_select="fft"
  3476. smartblur_filter_deps="gpl swscale"
  3477. sofalizer_filter_deps="netcdf avcodec"
  3478. sofalizer_filter_select="fft"
  3479. spectrumsynth_filter_deps="avcodec"
  3480. spectrumsynth_filter_select="fft"
  3481. spp_filter_deps="gpl avcodec"
  3482. spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
  3483. stereo3d_filter_deps="gpl"
  3484. subtitles_filter_deps="avformat avcodec libass"
  3485. super2xsai_filter_deps="gpl"
  3486. pixfmts_super2xsai_test_deps="super2xsai_filter"
  3487. tinterlace_filter_deps="gpl"
  3488. tinterlace_merge_test_deps="tinterlace_filter"
  3489. tinterlace_pad_test_deps="tinterlace_filter"
  3490. uspp_filter_deps="gpl avcodec"
  3491. vaguedenoiser_filter_deps="gpl"
  3492. vidstabdetect_filter_deps="libvidstab"
  3493. vidstabtransform_filter_deps="libvidstab"
  3494. zmq_filter_deps="libzmq"
  3495. zoompan_filter_deps="swscale"
  3496. zscale_filter_deps="libzimg"
  3497. scale_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
  3498.  
  3499. # examples
  3500. avio_dir_cmd_deps="avformat avutil"
  3501. avio_reading_deps="avformat avcodec avutil"
  3502. decoding_encoding_example_deps="avcodec avformat avutil"
  3503. demuxing_decoding_example_deps="avcodec avformat avutil"
  3504. extract_mvs_example_deps="avcodec avformat avutil"
  3505. filter_audio_example_deps="avfilter avutil"
  3506. filtering_audio_example_deps="avfilter avcodec avformat avutil"
  3507. filtering_video_example_deps="avfilter avcodec avformat avutil"
  3508. http_multiclient_example_deps="avformat avutil"
  3509. metadata_example_deps="avformat avutil"
  3510. muxing_example_deps="avcodec avformat avutil swscale"
  3511. qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
  3512. remuxing_example_deps="avcodec avformat avutil"
  3513. resampling_audio_example_deps="avutil swresample"
  3514. scaling_video_example_deps="avutil swscale"
  3515. transcode_aac_example_deps="avcodec avformat swresample"
  3516. transcoding_example_deps="avfilter avcodec avformat avutil"
  3517.  
  3518. # libraries, in linking order
  3519. avcodec_deps="avutil"
  3520. avdevice_deps="avformat avcodec avutil"
  3521. avfilter_deps="avutil"
  3522. avformat_deps="avcodec avutil"
  3523. avresample_deps="avutil"
  3524. postproc_deps="avutil gpl"
  3525. swresample_deps="avutil"
  3526. swscale_deps="avutil"
  3527.  
  3528. # programs
  3529. ffmpeg_deps="avcodec avfilter avformat swresample"
  3530. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  3531. null_filter
  3532. setpts_filter trim_filter"
  3533. ffplay_deps="avcodec avformat swscale swresample sdl2"
  3534. ffplay_libs='$sdl2_libs'
  3535. ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
  3536. ffprobe_deps="avcodec avformat"
  3537. ffserver_deps="avformat fork sarestart"
  3538. ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
  3539.  
  3540. # mythtv dependencies
  3541. audio_oss_deps_any="soundcard_h sys_soundcard_h"
  3542. dvb_deps="backend"
  3543. firewire_deps="backend"
  3544. ivtv_deps="backend v4l2"
  3545. hdpvr_deps="backend v4l2"
  3546. hdhomerun_deps="backend"
  3547. vbox_deps="backend"
  3548. ceton_deps="backend"
  3549. mpegtsraw_demuxer_deps="merge_libavformat_mpegts_c"
  3550. mythtranscode_deps="backend frontend"
  3551. opengl_deps_any="agl_h GL_gl_h EGL_egl_h GLES2_gl2_h darwin windows x11"
  3552. opengles_deps="GLES2_gl2_h"
  3553. opengl_video_deps="opengl"
  3554. opengl_themepainter_deps="opengl"
  3555. v4l2_deps="backend linux_videodev2_h"
  3556. v4l1_deps="backend v4l2 linux_videodev_h"
  3557. xrandr_deps="x11"
  3558. xv_deps="x11"
  3559. asi_deps="backend"
  3560.  
  3561. <<EOF
  3562. # documentation
  3563. podpages_deps="perl"
  3564. manpages_deps="perl pod2man"
  3565. htmlpages_deps="perl"
  3566. htmlpages_deps_any="makeinfo_html texi2html"
  3567. txtpages_deps="perl makeinfo"
  3568. doc_deps_any="manpages htmlpages podpages txtpages"
  3569. EOF
  3570.  
  3571. # default parameters
  3572.  
  3573. pre_logfile="config.ep"
  3574. logfile="$pre_logfile"
  3575. compile_type="profile"
  3576.  
  3577. # installation paths
  3578. prefix_default="/usr/local"
  3579. bindir_default='${prefix}/bin'
  3580. datadir_default='${prefix}/share/mythtv'
  3581. docdir_default='${prefix}/share/doc/ffmpeg'
  3582. incdir_default='$(prefix)/include/mythtv'
  3583. libdir_default='${prefix}/lib'
  3584. mandir_default='${prefix}/share/man'
  3585.  
  3586. libdir_name='lib'
  3587.  
  3588. # toolchain
  3589. ar_default="ar"
  3590. cc_default="gcc"
  3591. cxx_default="g++"
  3592. host_cc_default="gcc"
  3593. cp_f="cp -f"
  3594. doxygen_default="doxygen"
  3595. install="install"
  3596. ln_s_default="ln -s -f"
  3597. nm_default="nm -g"
  3598. objformat="elf"
  3599. pkg_config_default=pkg-config
  3600. ranlib_default="ranlib"
  3601. strip_default="strip"
  3602. version_script='--version-script'
  3603. yasmexe_default="yasm"
  3604. windres_default="windres"
  3605.  
  3606. # MythTV toolchain
  3607. ccache="yes"
  3608. distcc="yes"
  3609. qmake_default="qmake"
  3610. qmakespecs_default=""
  3611. python_default="python"
  3612.  
  3613. #Bluray
  3614. bdj_type="j2se"
  3615.  
  3616. # machine
  3617. arch_default=$(uname -m)
  3618. cpu="generic"
  3619. processor=`uname -p 2>/dev/null`
  3620. processor_flags=""
  3621. tune="generic"
  3622.  
  3623. if test -f /proc/cpuinfo ; then
  3624. if test x"$processor" = x"" -o x"$processor" = x"$arch_default" -o \
  3625. x"$processor" = x"unknown" ; then
  3626. processor=`cat /proc/cpuinfo | grep "model name" | head -n 1`
  3627. fi
  3628. processor_flags=`cat /proc/cpuinfo | grep "flags" | head -n 1`
  3629. fi
  3630.  
  3631. # Mac OS X equivalent
  3632. if test -f /usr/bin/hostinfo ; then
  3633. arch=`arch`
  3634. if test x"$arch" = x"ppc" -o x"$arch" = x"ppc64" ; then
  3635. processor=`/usr/bin/hostinfo | grep "Processor type:"`
  3636. processor=${processor#Processor type: *}
  3637. processor=${processor% (*}
  3638. tune=$processor
  3639. else
  3640. # 10.4 only:
  3641. processor=`/usr/sbin/sysctl -n machdep.cpu.model_string 2>/dev/null`
  3642. if test x"$processor" = x"" ; then
  3643. # On 10.5, this contains the type of CPU also:
  3644. processor=`/usr/sbin/sysctl -n machdep.cpu.brand_string`
  3645. fi
  3646. processor_flags=`/usr/sbin/sysctl -n machdep.cpu.features`
  3647. processor_flags=`echo $processor_flags | tr "[A-Z]" "[a-z]"`
  3648. fi
  3649. fi
  3650.  
  3651. # OS
  3652. target_os_default=$(tolower $(uname -s))
  3653. host_os=$target_os_default
  3654.  
  3655. # machine
  3656. if test "$target_os_default" = aix; then
  3657. arch_default=$(uname -p)
  3658. strip_default="strip -X32_64"
  3659. else
  3660. arch_default=$(uname -m)
  3661. fi
  3662. cpu="generic"
  3663. intrinsics="none"
  3664.  
  3665. # configurable options
  3666. enable $PROGRAM_LIST
  3667. #enable $DOCUMENT_LIST
  3668. #enable $EXAMPLE_LIST
  3669. enable $(filter_out avresample $LIBRARY_LIST)
  3670. enable stripping
  3671.  
  3672. enable asm
  3673. enable debug
  3674. #enable doc
  3675. enable faan faandct faanidct
  3676. enable optimizations
  3677. enable runtime_cpudetect
  3678. enable safe_bitstream_reader
  3679. #enable static
  3680. enable swscale_alpha
  3681. enable valgrind_backtrace
  3682.  
  3683. sws_max_filter_size_default=256
  3684. set_default sws_max_filter_size
  3685.  
  3686. # Enable platform codecs by default.
  3687. enable audiotoolbox
  3688.  
  3689. # Enable hwaccels by default.
  3690. enable d3d11va dxva2 vaapi vda vdpau videotoolbox_hwaccel xvmc
  3691. enable xlib
  3692.  
  3693. enable nvenc vda_framework videotoolbox videotoolbox_encoder
  3694. # mythtv settings
  3695. enable shared
  3696. enable gpl
  3697.  
  3698. CONFIG_DEFINES=""
  3699. CONFIG_INCLUDEPATH=""
  3700. PROFILEFLAGS=""
  3701.  
  3702. audio_pulse="default"
  3703. audio_pulseoutput="default"
  3704. audio_alsa="default"
  3705. audio_jack="default"
  3706.  
  3707. enable audio_oss
  3708. enable bindings_perl
  3709. enable bindings_python
  3710. enable bindings_php
  3711. enable dvb
  3712. enable ffmpeg_pthreads
  3713. enable firewire
  3714. enable frontend
  3715. enable hdhomerun
  3716. enable vbox
  3717. enable ceton
  3718. enable hdpvr
  3719. enable ivtv
  3720. enable asi
  3721. enable lamemp3
  3722. enable libass
  3723. enable libcec
  3724. enable libcrypto
  3725. enable libdns_sd
  3726. enable libxml2
  3727. enable lirc
  3728. enable mheg
  3729. enable mythtranscode
  3730. enable opengl
  3731. enable opengles
  3732. enable opengl_video
  3733. enable opengl_themepainter
  3734. enable symbol_visibility
  3735. enable v4l1
  3736. enable v4l2
  3737. enable x11
  3738. enable xrandr
  3739. enable xv
  3740. disable indevs
  3741. disable sdl2
  3742. enable libfftw3
  3743. enable taglib
  3744. disable mythlogserver
  3745. enable exiv2
  3746. enable systemd_notify
  3747. enable systemd_journal
  3748.  
  3749. # mythtv paths
  3750. dvb_path_default="${sysinclude:-$sysroot/usr/include}"
  3751. x11_path_default="${sysinclude:-$sysroot/usr/include}/X11"
  3752. libcec_path_default="${sysinclude:-$sysroot/usr/include}"
  3753. libxml2_path_default="${sysinclude:-$sysroot/usr/include}/libxml2"
  3754. firewiresdk_path_default=""
  3755.  
  3756. # build settings
  3757. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  3758. LIBPREF="libmyth"
  3759. LIBSUF=".a"
  3760. FULLNAME='$(NAME)$(BUILDSUF)'
  3761. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  3762. SLIBPREF="libmyth"
  3763. SLIBSUF=".so"
  3764. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  3765. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  3766. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  3767. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  3768. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  3769. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  3770. VERSION_SCRIPT_POSTPROCESS_CMD="cat"
  3771.  
  3772. asflags_filter=echo
  3773. cflags_filter=echo
  3774. ldflags_filter=echo
  3775. cxxppflags_filter=echo
  3776.  
  3777. AS_C='-c'
  3778. AS_O='-o $@'
  3779. CC_C='-c'
  3780. CC_E='-E -o $@'
  3781. CC_O='-o $@'
  3782. CXX_C='-c'
  3783. CXX_O='-o $@'
  3784. OBJCC_C='-c'
  3785. OBJCC_E='-E -o $@'
  3786. OBJCC_O='-o $@'
  3787. LD_O='-o $@'
  3788. LD_LIB='-l%'
  3789. LD_MYTH_LIB='-lmyth%'
  3790. LD_PATH='-L'
  3791. HOSTCC_C='-c'
  3792. HOSTCC_O='-o $@'
  3793. HOSTLD_O='-o $@'
  3794.  
  3795. host_libs='-lm'
  3796. host_cflags_filter=echo
  3797. host_ldflags_filter=echo
  3798.  
  3799. target_path='$(CURDIR)'
  3800.  
  3801. # since the object filename is not given with the -MM flag, the compiler
  3802. # is only able to print the basename, and we must add the path ourselves
  3803. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
  3804. DEPFLAGS='-MM'
  3805.  
  3806. # find source path
  3807. source_path="$(dirname "$0")"
  3808. enable source_path_used
  3809. if test -f configure; then
  3810. source_path="$(pwd)"
  3811. disable source_path_used
  3812. else
  3813. source_path="$(cd "$source_path"; pwd)"
  3814. case "$source_path" in
  3815. *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
  3816. esac
  3817. test -e "$source_path/config.h" &&
  3818. die "Out of tree builds are impossible with config.h in source dir."
  3819. fi
  3820.  
  3821. for v in "$@"; do
  3822. r=${v#*=}
  3823. l=${v%"$r"}
  3824. r=$(sh_quote "$r")
  3825. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  3826. MYTHTV_CONFIGURATION="${MYTHTV_CONFIGURATION# } ${v}"
  3827. done
  3828.  
  3829. find_things(){
  3830. thing=$1
  3831. pattern=$2
  3832. file=$source_path/$3
  3833. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  3834. }
  3835.  
  3836. ENCODER_LIST=$(find_things encoder ENC external/FFmpeg/libavcodec/allcodecs.c)
  3837. DECODER_LIST=$(find_things decoder DEC external/FFmpeg/libavcodec/allcodecs.c)
  3838. HWACCEL_LIST=$(find_things hwaccel HWACCEL external/FFmpeg/libavcodec/allcodecs.c)
  3839. PARSER_LIST=$(find_things parser PARSER external/FFmpeg/libavcodec/allcodecs.c)
  3840. MUXER_LIST=$(find_things muxer _MUX external/FFmpeg/libavformat/allformats.c)
  3841. DEMUXER_LIST=$(find_things demuxer DEMUX external/FFmpeg/libavformat/allformats.c)
  3842. OUTDEV_LIST=$(find_things outdev OUTDEV external/FFmpeg/libavdevice/alldevices.c)
  3843. INDEV_LIST=$(find_things indev _IN external/FFmpeg/libavdevice/alldevices.c)
  3844. FILTER_LIST=$(find_things filter FILTER external/FFmpeg/libavfilter/allfilters.c)
  3845.  
  3846. find_things_extern(){
  3847. thing=$1
  3848. pattern=$2
  3849. file=$source_path/$3
  3850. sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$thing/p" "$file"
  3851. }
  3852.  
  3853. BSF_LIST=$(find_things_extern bsf AVBitStreamFilter external/FFmpeg/libavcodec/bitstream_filters.c)
  3854. PROTOCOL_LIST=$(find_things_extern protocol URLProtocol external/FFmpeg/libavformat/protocols.c)
  3855.  
  3856. ALL_COMPONENTS="
  3857. $BSF_LIST
  3858. $DECODER_LIST
  3859. $DEMUXER_LIST
  3860. $ENCODER_LIST
  3861. $FILTER_LIST
  3862. $HWACCEL_LIST
  3863. $INDEV_LIST
  3864. $MUXER_LIST
  3865. $OUTDEV_LIST
  3866. $PARSER_LIST
  3867. $PROTOCOL_LIST
  3868. "
  3869.  
  3870. for n in $COMPONENT_LIST; do
  3871. v=$(toupper ${n%s})_LIST
  3872. eval enable \$$v
  3873. eval ${n}_if_any="\$$v"
  3874. done
  3875.  
  3876. enable $ARCH_EXT_LIST
  3877.  
  3878. die_unknown(){
  3879. echo "Unknown option \"$1\"."
  3880. echo "See $0 --help for available options."
  3881. exit 1
  3882. }
  3883.  
  3884. print_in_columns() {
  3885. cols=$(expr $ncols / 24)
  3886. cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
  3887. }
  3888.  
  3889. show_list() {
  3890. suffix=_$1
  3891. shift
  3892. echo $* | sed s/$suffix//g | print_in_columns
  3893. exit 0
  3894. }
  3895.  
  3896. rand_list(){
  3897. IFS=', '
  3898. set -- $*
  3899. unset IFS
  3900. for thing; do
  3901. comp=${thing%:*}
  3902. prob=${thing#$comp}
  3903. prob=${prob#:}
  3904. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  3905. echo "prob ${prob:-0.5}"
  3906. printf '%s\n' $comp
  3907. done
  3908. }
  3909.  
  3910. do_random(){
  3911. action=$1
  3912. shift
  3913. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  3914. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  3915. }
  3916.  
  3917. if [ -e config.log ] ; then
  3918. PCONF=$(tail -n 1 config.log | grep configure | sed 's/.\/configure//g')
  3919. for opt in "$@" ; do
  3920. if test x"$opt" != x"--prev" -a x"$opt" != x"--previous" ; then
  3921. OTHOPT="${OTHOPT# }${opt}"
  3922. fi
  3923. if test x"$opt" = x"--prev" -o x"$opt" = x"--previous" ; then
  3924. if test x"$PCONF" != "--prev" ; then
  3925. PREV="yes";
  3926. fi
  3927. fi
  3928. done
  3929. if test x"$PREV" = x"yes"; then
  3930. echo "Options: $PCONF $OTHOPT"
  3931. ./configure $PCONF $OTHOPT
  3932. exit
  3933. fi
  3934. fi
  3935.  
  3936. for opt do
  3937. optval="${opt#*=}"
  3938. case "$opt" in
  3939. #Myth options
  3940. --compile-type=*) compile_type=$optval
  3941. ;;
  3942. --libdir-name=*) libdir_name=$optval
  3943. ;;
  3944. --extra-cxxflags=*) add_cxxflags $optval
  3945. ;;
  3946. --firewire-sdk=*) firewiresdk_path="${optval}"
  3947. ;;
  3948. --arch=*) arch=$optval && enable cpu_override
  3949. ;;
  3950. --cpu=*) cpu=$optval && enable cpu_override
  3951. ;;
  3952. --tune=*) tune=$optval
  3953. ;;
  3954. --disable-ccache) disable ccache
  3955. ;;
  3956. --disable-distcc) disable distcc
  3957. ;;
  3958. # disabled due to abuse in Gentoo ebuild
  3959. --disable-frontend)
  3960. ;;
  3961. # disabled due to abuse in Gentoo ebuild
  3962. --disable-backend)
  3963. ;;
  3964. --enable-mac-bundle) enable mac_bundle
  3965. ;;
  3966. --disable-mythlogserver) disable mythlogserver
  3967. ;;
  3968. --enable-mythlogserver) enable mythlogserver
  3969. ;;
  3970. --previous|--prev)
  3971. echo "No history of previous configure parameters."
  3972. ;;
  3973. --with-bindings=*)
  3974. tmp_bindings=`echo ${optval} | sed -e 's/,/ /g'`
  3975. for binding in ${tmp_bindings} ; do
  3976. if test x"${binding}" = x"perl"; then
  3977. bindings_perl="yes"
  3978. fi
  3979. if test x"${binding}" = x"python"; then
  3980. bindings_python="yes"
  3981. fi
  3982. if test x"${binding}" = x"php"; then
  3983. bindings_php="yes"
  3984. fi
  3985. done
  3986. ;;
  3987. --without-bindings=*)
  3988. tmp_bindings=`echo ${optval} | sed -e 's/,/ /g'`
  3989. for binding in ${tmp_bindings} ; do
  3990. if test x"${binding}" = x"perl"; then
  3991. bindings_perl="no"
  3992. fi
  3993. if test x"${binding}" = x"python"; then
  3994. bindings_python="no"
  3995. fi
  3996. if test x"${binding}" = x"php"; then
  3997. bindings_php="no"
  3998. fi
  3999. done
  4000. ;;
  4001. --perl-config-opts=*)
  4002. PERL_CONFIG_OPTS=`echo ${optval}`
  4003. ;;
  4004. #FFmpeg original
  4005. --extra-ldflags=*)
  4006. add_ldflags $optval
  4007. ;;
  4008. --extra-ldexeflags=*)
  4009. add_ldexeflags $optval
  4010. ;;
  4011. --extra-ldlibflags=*)
  4012. add_ldlibflags $optval
  4013. ;;
  4014. --extra-libs=*)
  4015. add_extralibs $optval
  4016. ;;
  4017. --disable-devices)
  4018. disable $INDEV_LIST $OUTDEV_LIST
  4019. ;;
  4020. --enable-debug=*)
  4021. debuglevel="$optval"
  4022. ;;
  4023. --disable-programs)
  4024. disable $PROGRAM_LIST
  4025. ;;
  4026. --disable-everything)
  4027. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  4028. ;;
  4029. --disable-all)
  4030. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  4031. disable $LIBRARY_LIST $PROGRAM_LIST doc
  4032. enable avutil
  4033. ;;
  4034. --enable-random|--disable-random)
  4035. action=${opt%%-random}
  4036. do_random ${action#--} $COMPONENT_LIST
  4037. ;;
  4038. --enable-random=*|--disable-random=*)
  4039. action=${opt%%-random=*}
  4040. do_random ${action#--} $optval
  4041. ;;
  4042. --enable-*=*|--disable-*=*)
  4043. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  4044. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  4045. eval list=\$$(toupper $thing)_LIST
  4046. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  4047. list=$(filter "$name" $list)
  4048. [ "$list" = "" ] && warn "Option $opt did not match anything"
  4049. $action $list
  4050. ;;
  4051. --enable-?*|--disable-?*)
  4052. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  4053. if is_in $option $COMPONENT_LIST; then
  4054. test $action = disable && action=unset
  4055. eval $action \$$(toupper ${option%s})_LIST
  4056. elif is_in $option $CMDLINE_SELECT; then
  4057. $action $option
  4058. else
  4059. die_unknown $opt
  4060. fi
  4061. ;;
  4062. --list-*)
  4063. NAME="${opt#--list-}"
  4064. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  4065. NAME=${NAME%s}
  4066. eval show_list $NAME \$$(toupper $NAME)_LIST
  4067. ;;
  4068. --help|-h) show_help
  4069. ;;
  4070. --fatal-warnings) enable fatal_warnings
  4071. ;;
  4072. *)
  4073. optname="${opt%%=*}"
  4074. optname="${optname#--}"
  4075. optname=$(echo "$optname" | sed 's/-/_/g')
  4076. if is_in $optname $CMDLINE_SET; then
  4077. eval $optname='$optval'
  4078. elif is_in $optname $CMDLINE_APPEND; then
  4079. append $optname "$optval"
  4080. else
  4081. die_unknown $opt
  4082. fi
  4083. ;;
  4084. esac
  4085. done
  4086.  
  4087.  
  4088. #setting default runtime prefix and libdir
  4089. if test -n "${prefix}"; then
  4090. runprefix_default=${prefix}
  4091. libdir_default="${prefix}/${libdir_name}"
  4092. shlibdir_default="${prefix}/${libdir_name}"
  4093. else
  4094. runprefix_default=${prefix_default}
  4095. libdir_default="${prefix_default}/${libdir_name}"
  4096. shlibdir_default="${prefix_default}/${libdir_name}"
  4097. fi
  4098.  
  4099. if enabled_any cpu_override cross_compile || test x"$tune" != x"generic" &&
  4100. enabled proc_opt; then
  4101. echo "Warning! --enable-proc-opt shouldn't be used with --arch, --cpu or --tune"
  4102. echo "Disabling it now."
  4103. disable proc_opt
  4104. fi
  4105.  
  4106. enabled proc_opt && disable runtime_cpudetect && cpu="host"
  4107.  
  4108. for e in $env; do
  4109. eval "export $e"
  4110. done
  4111.  
  4112. disabled logging && logfile=/dev/null
  4113.  
  4114. # Disable all the library-specific components if the library itself
  4115. # is disabled, see AVCODEC_LIST and following _LIST variables.
  4116.  
  4117. disable_components(){
  4118. disabled ${1} && disable $(
  4119. eval components="\$$(toupper ${1})_COMPONENTS"
  4120. map 'eval echo \${$(toupper ${v%s})_LIST}' $components
  4121. )
  4122. }
  4123.  
  4124. map 'disable_components $v' $LIBRARY_LIST
  4125.  
  4126. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  4127. set >> $logfile
  4128.  
  4129. test -n "$valgrind" && toolchain="valgrind-memcheck"
  4130.  
  4131. case "$toolchain" in
  4132. *-asan)
  4133. cc_default="${toolchain%-asan}"
  4134. add_cflags -fsanitize=address
  4135. add_ldflags -fsanitize=address
  4136. ;;
  4137. *-msan)
  4138. cc_default="${toolchain%-msan}"
  4139. add_cflags -fsanitize=memory -fsanitize-memory-track-origins
  4140. add_ldflags -fsanitize=memory
  4141. ;;
  4142. *-tsan)
  4143. cc_default="${toolchain%-tsan}"
  4144. add_cflags -fsanitize=thread -pie
  4145. add_ldflags -fsanitize=thread -pie
  4146. case "$toolchain" in
  4147. gcc-tsan)
  4148. add_cflags -fPIC
  4149. add_ldflags -fPIC
  4150. ;;
  4151. esac
  4152. ;;
  4153. *-usan)
  4154. cc_default="${toolchain%-usan}"
  4155. add_cflags -fsanitize=undefined
  4156. add_ldflags -fsanitize=undefined
  4157. ;;
  4158. valgrind-*)
  4159. target_exec_default="valgrind"
  4160. case "$toolchain" in
  4161. valgrind-massif)
  4162. target_exec_args="--tool=massif --alloc-fn=av_malloc --alloc-fn=av_mallocz --alloc-fn=av_calloc --alloc-fn=av_fast_padded_malloc --alloc-fn=av_fast_malloc --alloc-fn=av_realloc_f --alloc-fn=av_fast_realloc --alloc-fn=av_realloc"
  4163. ;;
  4164. valgrind-memcheck)
  4165. target_exec_args="--error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
  4166. ;;
  4167. esac
  4168. ;;
  4169. msvc)
  4170. # Check whether the current MSVC version needs the C99 converter.
  4171. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  4172. # support enough of C99 to build ffmpeg. Default to the new
  4173. # behaviour if the regexp was unable to match anything, since this
  4174. # successfully parses the version number of existing supported
  4175. # versions that require the converter (MSVC 2010 and 2012).
  4176. cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  4177. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  4178. cc_default="cl"
  4179. else
  4180. cc_default="c99wrap cl"
  4181. fi
  4182. ld_default="$source_path/compat/windows/mslink"
  4183. nm_default="dumpbin -symbols"
  4184. ar_default="lib"
  4185. case "$arch" in
  4186. arm*)
  4187. as_default="armasm"
  4188. ;;
  4189. esac
  4190. target_os_default="win32"
  4191. # Use a relative path for TMPDIR. This makes sure all the
  4192. # ffconf temp files are written with a relative path, avoiding
  4193. # issues with msys/win32 path conversion for MSVC parameters
  4194. # such as -Fo<file> or -out:<file>.
  4195. TMPDIR=.
  4196. ;;
  4197. icl)
  4198. cc_default="icl"
  4199. ld_default="xilink"
  4200. nm_default="dumpbin -symbols"
  4201. ar_default="xilib"
  4202. target_os_default="win32"
  4203. TMPDIR=.
  4204. ;;
  4205. gcov)
  4206. add_cflags -fprofile-arcs -ftest-coverage
  4207. add_ldflags -fprofile-arcs -ftest-coverage
  4208. ;;
  4209. llvm-cov)
  4210. add_cflags -fprofile-arcs -ftest-coverage
  4211. add_ldflags --coverage
  4212. ;;
  4213. hardened)
  4214. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  4215. add_cflags -fno-strict-overflow -fstack-protector-all
  4216. add_ldflags -Wl,-z,relro -Wl,-z,now
  4217. add_cflags -fPIE
  4218. add_ldexeflags -fPIE -pie
  4219. ;;
  4220. ?*)
  4221. die "Unknown toolchain $toolchain"
  4222. ;;
  4223. esac
  4224.  
  4225. test -n "$cross_prefix" && enable cross_compile
  4226.  
  4227. if enabled cross_compile; then
  4228. test -n "$arch" && test -n "$target_os" ||
  4229. die "Must specify target arch and OS when cross-compiling"
  4230. fi
  4231.  
  4232. ar_default="${cross_prefix}${ar_default}"
  4233. cc_default="${cross_prefix}${cc_default}"
  4234. cxx_default="${cross_prefix}${cxx_default}"
  4235. nm_default="${cross_prefix}${nm_default}"
  4236. pkg_config_default="${cross_prefix}${pkg_config_default}"
  4237. if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then
  4238. ranlib_default="${cross_prefix}${ranlib_default} -D"
  4239. else
  4240. ranlib_default="${cross_prefix}${ranlib_default}"
  4241. fi
  4242. strip_default="${cross_prefix}${strip_default}"
  4243. windres_default="${cross_prefix}${windres_default}"
  4244.  
  4245. sysinclude_default="${sysroot}/usr/include"
  4246.  
  4247. set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
  4248. target_exec target_os yasmexe
  4249. enabled cross_compile || host_cc_default=$cc
  4250. set_default host_cc
  4251.  
  4252. pkg_config_fail_message=""
  4253. if ! $pkg_config --version >/dev/null 2>&1; then
  4254. warn "$pkg_config not found, library detection may fail."
  4255. pkg_config=false
  4256. elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
  4257. pkg_config_fail_message="
  4258. Note: When building a static binary, add --pkg-config-flags=\"--static\"."
  4259. fi
  4260.  
  4261. set_default qmake qmakespecs python yasmexe
  4262.  
  4263. if test $doxygen != $doxygen_default && \
  4264. ! $doxygen --version >/dev/null 2>&1; then
  4265. warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
  4266. fi
  4267.  
  4268. exesuf() {
  4269. case $1 in
  4270. mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  4271. esac
  4272. }
  4273.  
  4274. EXESUF=$(exesuf $target_os)
  4275. HOSTEXESUF=$(exesuf $host_os)
  4276.  
  4277. # set temporary file name
  4278. : ${TMPDIR:=$TEMPDIR}
  4279. : ${TMPDIR:=$TMP}
  4280. : ${TMPDIR:=/tmp}
  4281.  
  4282. if [ -n "$tempprefix" ] ; then
  4283. mktemp(){
  4284. echo $tempprefix.${HOSTNAME}.${UID}
  4285. }
  4286. elif ! check_cmd mktemp -u XXXXXX; then
  4287. # simple replacement for missing mktemp
  4288. # NOT SAFE FOR GENERAL USE
  4289. mktemp(){
  4290. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  4291. }
  4292. fi
  4293.  
  4294. tmpfile(){
  4295. tmp=$(mktemp -u "${TMPDIR}/mythtv_conf.XXXXXXXX")$2 &&
  4296. (set -C; exec > $tmp) 2>/dev/null ||
  4297. die "Unable to create temporary file in $TMPDIR."
  4298. append TMPFILES $tmp
  4299. eval $1=$tmp
  4300. }
  4301.  
  4302. trap 'rm -f -- $TMPFILES' EXIT
  4303. trap exit HUP INT TERM
  4304.  
  4305. tmpfile TMPASM .asm
  4306. tmpfile TMPC .c
  4307. tmpfile TMPCPP .cpp
  4308. tmpfile TMPE $EXESUF
  4309. tmpfile TMPH .h
  4310. tmpfile TMPM .m
  4311. tmpfile TMPO .o
  4312. tmpfile TMPS .S
  4313. tmpfile TMPSH .sh
  4314. tmpfile TMPV .ver
  4315. tmpfile TMPMAK .mak
  4316. tmpfile TMPPRO .pro
  4317.  
  4318. unset -f mktemp
  4319.  
  4320. chmod +x $TMPE
  4321.  
  4322. # make sure we can execute files in $TMPDIR
  4323. cat > $TMPSH 2>> $logfile <<EOF
  4324. #! /bin/sh
  4325. EOF
  4326. chmod +x $TMPSH >> $logfile 2>&1
  4327. if ! $TMPSH >> $logfile 2>&1; then
  4328. cat <<EOF
  4329. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  4330. variable to another directory and make sure that it is not mounted noexec.
  4331. EOF
  4332. die "Sanity test failed."
  4333. fi
  4334.  
  4335. armasm_flags(){
  4336. for flag; do
  4337. case $flag in
  4338. # Filter out MSVC cl.exe options from cflags that shouldn't
  4339. # be passed to gas-preprocessor
  4340. -M[TD]*) ;;
  4341. *) echo $flag ;;
  4342. esac
  4343. done
  4344. }
  4345.  
  4346. ccc_flags(){
  4347. for flag; do
  4348. case $flag in
  4349. -std=c99) echo -c99 ;;
  4350. -mcpu=*) echo -arch ${flag#*=} ;;
  4351. -mieee) echo -ieee ;;
  4352. -O*|-fast) echo $flag ;;
  4353. -fno-math-errno) echo -assume nomath_errno ;;
  4354. -g) echo -g3 ;;
  4355. -Wall) echo -msg_enable level2 ;;
  4356. -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
  4357. -Wl,*) echo $flag ;;
  4358. -f*|-W*) ;;
  4359. *) echo $flag ;;
  4360. esac
  4361. done
  4362. }
  4363.  
  4364. cparser_flags(){
  4365. for flag; do
  4366. case $flag in
  4367. -Wno-switch) echo -Wno-switch-enum ;;
  4368. -Wno-format-zero-length) ;;
  4369. -Wdisabled-optimization) ;;
  4370. -Wno-pointer-sign) echo -Wno-other ;;
  4371. *) echo $flag ;;
  4372. esac
  4373. done
  4374. }
  4375.  
  4376. msvc_common_flags(){
  4377. for flag; do
  4378. case $flag in
  4379. # In addition to specifying certain flags under the compiler
  4380. # specific filters, they must be specified here as well or else the
  4381. # generic catch all at the bottom will print the original flag.
  4382. -Wall) ;;
  4383. -std=c99) ;;
  4384. # Common flags
  4385. -fomit-frame-pointer) ;;
  4386. -g) echo -Z7 ;;
  4387. -fno-math-errno) ;;
  4388. -fno-common) ;;
  4389. -fno-signed-zeros) ;;
  4390. -fPIC) ;;
  4391. -mthumb) ;;
  4392. -march=*) ;;
  4393. -lz) echo zlib.lib ;;
  4394. -lavifil32) echo vfw32.lib ;;
  4395. -lavicap32) echo vfw32.lib user32.lib ;;
  4396. -lx264) echo libx264.lib ;;
  4397. -l*) echo ${flag#-l}.lib ;;
  4398. -LARGEADDRESSAWARE) echo $flag ;;
  4399. -L*) echo -libpath:${flag#-L} ;;
  4400. *) echo $flag ;;
  4401. esac
  4402. done
  4403. }
  4404.  
  4405. msvc_flags(){
  4406. msvc_common_flags "$@"
  4407. for flag; do
  4408. case $flag in
  4409. -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  4410. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  4411. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  4412. -wd4307 \
  4413. -wd4273 -wd4554 -wd4701 ;;
  4414. esac
  4415. done
  4416. }
  4417.  
  4418. icl_flags(){
  4419. msvc_common_flags "$@"
  4420. for flag; do
  4421. case $flag in
  4422. # Despite what Intel's documentation says -Wall, which is supported
  4423. # on Windows, does enable remarks so disable them here.
  4424. -Wall) echo $flag -Qdiag-disable:remark ;;
  4425. -std=c99) echo -Qstd=c99 ;;
  4426. -flto) echo -ipo ;;
  4427. esac
  4428. done
  4429. }
  4430.  
  4431. icc_flags(){
  4432. for flag; do
  4433. case $flag in
  4434. -flto) echo -ipo ;;
  4435. *) echo $flag ;;
  4436. esac
  4437. done
  4438. }
  4439.  
  4440. pgi_flags(){
  4441. for flag; do
  4442. case $flag in
  4443. -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
  4444. -fomit-frame-pointer) echo -Mnoframe ;;
  4445. -g) echo -gopt ;;
  4446. *) echo $flag ;;
  4447. esac
  4448. done
  4449. }
  4450.  
  4451. suncc_flags(){
  4452. for flag; do
  4453. case $flag in
  4454. -march=*|-mcpu=*)
  4455. case "${flag#*=}" in
  4456. native) echo -xtarget=native ;;
  4457. v9|niagara) echo -xarch=sparc ;;
  4458. ultrasparc) echo -xarch=sparcvis ;;
  4459. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  4460. i586|pentium) echo -xchip=pentium ;;
  4461. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  4462. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  4463. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  4464. pentium4*) echo -xtarget=pentium4 ;;
  4465. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  4466. *-sse3) echo -xarch=sse3 ;;
  4467. core2) echo -xarch=ssse3 -xchip=core2 ;;
  4468. bonnell) echo -xarch=ssse3 ;;
  4469. corei7|nehalem) echo -xtarget=nehalem ;;
  4470. westmere) echo -xtarget=westmere ;;
  4471. silvermont) echo -xarch=sse4_2 ;;
  4472. corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
  4473. core-avx*|ivybridge|haswell|broadwell|skylake*|knl)
  4474. echo -xarch=avx ;;
  4475. amdfam10|barcelona) echo -xtarget=barcelona ;;
  4476. btver1) echo -xarch=amdsse4a ;;
  4477. btver2|bdver*|znver*) echo -xarch=avx ;;
  4478. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  4479. k8|opteron|athlon64|athlon-fx)
  4480. echo -xarch=sse2a ;;
  4481. athlon*) echo -xarch=pentium_proa ;;
  4482. esac
  4483. ;;
  4484. -std=c99) echo -xc99 ;;
  4485. -fomit-frame-pointer) echo -xregs=frameptr ;;
  4486. -fPIC) echo -KPIC -xcode=pic32 ;;
  4487. -W*,*) echo $flag ;;
  4488. -f*-*|-W*|-mimpure-text) ;;
  4489. -shared) echo -G ;;
  4490. *) echo $flag ;;
  4491. esac
  4492. done
  4493. }
  4494.  
  4495. tms470_flags(){
  4496. for flag; do
  4497. case $flag in
  4498. -march=*|-mcpu=*)
  4499. case "${flag#*=}" in
  4500. armv7-a|cortex-a*) echo -mv=7a8 ;;
  4501. armv7-r|cortex-r*) echo -mv=7r4 ;;
  4502. armv7-m|cortex-m*) echo -mv=7m3 ;;
  4503. armv6*|arm11*) echo -mv=6 ;;
  4504. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  4505. echo -mv=5e ;;
  4506. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  4507. esac
  4508. ;;
  4509. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  4510. -mfpu=vfp) echo --float_support=vfpv2 ;;
  4511. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  4512. -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
  4513. -msoft-float) echo --float_support=vfplib ;;
  4514. -O[0-3]|-mf=*) echo $flag ;;
  4515. -g) echo -g -mn ;;
  4516. -pds=*) echo $flag ;;
  4517. -D*|-I*) echo $flag ;;
  4518. --gcc|--abi=*) echo $flag ;;
  4519. -me) echo $flag ;;
  4520. esac
  4521. done
  4522. }
  4523.  
  4524. probe_cc(){
  4525. pfx=$1
  4526. _cc=$2
  4527. first=$3
  4528.  
  4529. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  4530. unset _ld_o _ldflags _ld_lib _ld_path
  4531. unset _depflags _DEPCMD _DEPFLAGS
  4532. _flags_filter=echo
  4533.  
  4534. if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
  4535. true # no-op to avoid reading stdin in following checks
  4536. elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  4537. _type=llvm_gcc
  4538. gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
  4539. _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
  4540. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4541. _cflags_speed='-O3'
  4542. _cflags_size='-Os'
  4543. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  4544. _type=gcc
  4545. gcc_version=$($_cc --version | head -n1)
  4546. gcc_basever=$($_cc -dumpversion)
  4547. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  4548. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  4549. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  4550. case $gcc_basever in
  4551. 2) ;;
  4552. 2.*) ;;
  4553. *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
  4554. esac
  4555. if [ "$first" = true ]; then
  4556. case $gcc_basever in
  4557. 4.2*)
  4558. warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
  4559. esac
  4560. fi
  4561. _cflags_speed='-O3'
  4562. _cflags_size='-Os'
  4563. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  4564. _type=icc
  4565. _ident=$($_cc --version | head -n1)
  4566. _depflags='-MMD'
  4567. _cflags_speed='-O3'
  4568. _cflags_size='-Os'
  4569. _cflags_noopt='-O1'
  4570. _flags_filter=icc_flags
  4571. elif $_cc -v 2>&1 | grep -q xlc; then
  4572. _type=xlc
  4573. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  4574. _cflags_speed='-O5'
  4575. _cflags_size='-O5 -qcompact'
  4576. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  4577. _type=ccc
  4578. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  4579. _DEPFLAGS='-M'
  4580. _cflags_speed='-fast'
  4581. _cflags_size='-O1'
  4582. _flags_filter=ccc_flags
  4583. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  4584. test -d "$sysroot" || die "No valid sysroot specified."
  4585. _type=armcc
  4586. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  4587. armcc_conf="$PWD/armcc.conf"
  4588. $_cc --arm_linux_configure \
  4589. --arm_linux_config_file="$armcc_conf" \
  4590. --configure_sysroot="$sysroot" \
  4591. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  4592. die "Error creating armcc configuration file."
  4593. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  4594. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  4595. as_default="${cross_prefix}gcc"
  4596. _depflags='-MMD'
  4597. _cflags_speed='-O3'
  4598. _cflags_size='-Os'
  4599. elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
  4600. _type=tms470
  4601. _ident=$($_cc -version | head -n1 | tr -s ' ')
  4602. _flags='--gcc --abi=eabi -me'
  4603. _cc_e='-ppl -fe=$@'
  4604. _cc_o='-fe=$@'
  4605. _depflags='-ppa -ppd=$(@:.o=.d)'
  4606. _cflags_speed='-O3 -mf=5'
  4607. _cflags_size='-O3 -mf=2'
  4608. _flags_filter=tms470_flags
  4609. elif $_cc -v 2>&1 | grep -q clang; then
  4610. _type=clang
  4611. _ident=$($_cc --version 2>/dev/null | head -n1)
  4612. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4613. _cflags_speed='-O3'
  4614. _cflags_size='-Os'
  4615. elif $_cc -V 2>&1 | grep -q Sun; then
  4616. _type=suncc
  4617. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  4618. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  4619. _DEPFLAGS='-xM1 -xc99'
  4620. _ldflags='-std=c99'
  4621. _cflags_speed='-O5'
  4622. _cflags_size='-O5 -xspace'
  4623. _flags_filter=suncc_flags
  4624. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  4625. _type=pathscale
  4626. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4627. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4628. _cflags_speed='-O2'
  4629. _cflags_size='-Os'
  4630. _flags_filter='filter_out -Wdisabled-optimization'
  4631. elif $_cc -v 2>&1 | grep -q Open64; then
  4632. _type=open64
  4633. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  4634. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  4635. _cflags_speed='-O2'
  4636. _cflags_size='-Os'
  4637. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  4638. elif $_cc -V 2>&1 | grep -q Portland; then
  4639. _type=pgi
  4640. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  4641. opt_common='-alias=ansi -Mdse -Mlre -Mpre'
  4642. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  4643. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  4644. _cflags_noopt="-O"
  4645. _flags_filter=pgi_flags
  4646. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  4647. _type=armasm
  4648. _ident=$($_cc | head -n1)
  4649. # 4509: "This form of conditional instruction is deprecated"
  4650. _flags="-nologo -ignore 4509"
  4651. _flags_filter=armasm_flags
  4652. elif $_cc 2>&1 | grep -q Intel; then
  4653. _type=icl
  4654. _ident=$($_cc 2>&1 | head -n1)
  4655. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  4656. # Not only is O3 broken on 13.x+ but it is slower on all previous
  4657. # versions (tested) as well.
  4658. _cflags_speed="-O2"
  4659. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  4660. if $_cc 2>&1 | grep -q Linker; then
  4661. _ld_o='-out:$@'
  4662. else
  4663. _ld_o='-Fe$@'
  4664. fi
  4665. _cc_o='-Fo$@'
  4666. _cc_e='-P'
  4667. _flags_filter=icl_flags
  4668. _ld_lib='lib%.a'
  4669. _ld_path='-libpath:'
  4670. # -Qdiag-error to make icl error when seeing certain unknown arguments
  4671. _flags='-nologo -Qdiag-error:4044,10157'
  4672. # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
  4673. # with MSVC which enables it by default.
  4674. _cflags='-D_USE_MATH_DEFINES -Qms0 -Qvec- -Qsimd- -GS -fp:precise'
  4675. disable stripping
  4676. elif $_cc -nologo- 2>&1 | grep -q Microsoft; then
  4677. _type=msvc
  4678. _ident=$($_cc 2>&1 | head -n1)
  4679. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  4680. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  4681. _cflags_speed="-O2"
  4682. _cflags_size="-O1"
  4683. if $_cc -nologo- 2>&1 | grep -q Linker; then
  4684. _ld_o='-out:$@'
  4685. else
  4686. _ld_o='-Fe$@'
  4687. fi
  4688. _cc_o='-Fo$@'
  4689. _cc_e='-P -Fi$@'
  4690. _flags_filter=msvc_flags
  4691. _ld_lib='lib%.a'
  4692. _ld_path='-libpath:'
  4693. _flags='-nologo'
  4694. _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS'
  4695. disable stripping
  4696. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  4697. _type=cparser
  4698. _ident=$($_cc --version | head -n1)
  4699. _depflags='-MMD'
  4700. _cflags_speed='-O4'
  4701. _cflags_size='-O2'
  4702. _flags_filter=cparser_flags
  4703. fi
  4704.  
  4705. eval ${pfx}_type=\$_type
  4706. eval ${pfx}_ident=\$_ident
  4707. }
  4708.  
  4709. set_ccvars(){
  4710. eval ${1}_C=\${_cc_c-\${${1}_C}}
  4711. eval ${1}_E=\${_cc_e-\${${1}_E}}
  4712. eval ${1}_O=\${_cc_o-\${${1}_O}}
  4713.  
  4714. if [ -n "$_depflags" ]; then
  4715. eval ${1}_DEPFLAGS=\$_depflags
  4716. else
  4717. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  4718. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  4719. eval DEP${1}FLAGS=\$_flags
  4720. fi
  4721. }
  4722.  
  4723. probe_cc cc "$cc" "true"
  4724. cflags_filter=$_flags_filter
  4725. cflags_speed=$_cflags_speed
  4726. cflags_size=$_cflags_size
  4727. cflags_noopt=$_cflags_noopt
  4728. add_cflags $_flags $_cflags
  4729. cc_ldflags=$_ldflags
  4730. set_ccvars CC
  4731.  
  4732. probe_cc hostcc "$host_cc"
  4733. host_cflags_filter=$_flags_filter
  4734. add_host_cflags $_flags $_cflags
  4735. set_ccvars HOSTCC
  4736.  
  4737. test -n "$cc_type" && enable $cc_type ||
  4738. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  4739.  
  4740.  
  4741. if $cxx -v 2>&1 | grep -qi ^gcc; then
  4742. cxx_type=gxx
  4743. gxx_version=$($cxx -dumpversion)
  4744. elif $cxx --version 2>/dev/null | grep -q Intel; then
  4745. cxx_type=icpc
  4746. gxx_version="AV_STRINGIFY(__INTEL_COMPILER)"
  4747. cxx_ident=$($cxx --version | head -n1)
  4748. icpc_version=$($cxx -dumpversion)
  4749. speed_cxxflags='-O3'
  4750. size_cxxflags='-Os'
  4751. noopt_cxxflags='-O1'
  4752. elif $cxx --version 2>/dev/null | grep -q clang; then
  4753. cxx_type=clangxx
  4754. gxx_version="AV_STRINGIFY(__CLANG_COMPILER)"
  4755. cxx_ident=$($cxx --version | head -n1)
  4756. clangxx_version=$($cxx -dumpversion)
  4757. speed_cxxflags='-O3'
  4758. size_cxxflags='-Os'
  4759. noopt_cxxflags='-O1'
  4760. fi
  4761.  
  4762. test -n "$cxx_type" && enable $cxx_type ||
  4763. warn "Unknown C++ compiler $cxx, unable to select optimal CXXFLAGS"
  4764.  
  4765. : ${as_default:=$cc}
  4766. : ${objcc_default:=$cc}
  4767. : ${dep_cc_default:=$cc}
  4768. : ${ld_default:=$cc}
  4769. : ${host_ld_default:=$host_cc}
  4770. set_default ar as objcc dep_cc ld ln_s host_ld windres
  4771.  
  4772. probe_cc as "$as"
  4773. asflags_filter=$_flags_filter
  4774. add_asflags $_flags $_cflags
  4775. set_ccvars AS
  4776.  
  4777. probe_cc objcc "$objcc"
  4778. objcflags_filter=$_flags_filter
  4779. add_objcflags $_flags $_cflags
  4780. set_ccvars OBJC
  4781.  
  4782. probe_cc ld "$ld"
  4783. ldflags_filter=$_flags_filter
  4784. add_ldflags $_flags $_ldflags
  4785. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  4786. LD_O=${_ld_o-$LD_O}
  4787. LD_LIB=${_ld_lib-$LD_LIB}
  4788. LD_PATH=${_ld_path-$LD_PATH}
  4789.  
  4790. probe_cc hostld "$host_ld"
  4791. host_ldflags_filter=$_flags_filter
  4792. add_host_ldflags $_flags $_ldflags
  4793. HOSTLD_O=${_ld_o-$HOSTLD_O}
  4794.  
  4795. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  4796. probe_cc depcc "$dep_cc"
  4797. CCDEP=${_DEPCMD:-$DEPCMD}
  4798. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  4799. DEPCCFLAGS=$_flags
  4800. fi
  4801.  
  4802. if $ar 2>&1 | grep -q Microsoft; then
  4803. arflags="-nologo"
  4804. ar_o='-out:$@'
  4805. elif $ar 2>&1 | grep -q 'Texas Instruments'; then
  4806. arflags="rq"
  4807. ar_o='$@'
  4808. elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
  4809. arflags='-Xany -r -c'
  4810. ar_o='$@'
  4811. elif $ar 2>&1 | grep -q "\[D\] "; then
  4812. arflags="rcD"
  4813. ar_o='$@'
  4814. else
  4815. arflags="rc"
  4816. ar_o='$@'
  4817. fi
  4818.  
  4819. add_cflags $extra_cflags
  4820. add_cxxflags $extra_cxxflags
  4821. add_objcflags $extra_objcflags
  4822. add_asflags $extra_cflags
  4823.  
  4824. if test -n "$sysroot"; then
  4825. case "$cc_type" in
  4826. gcc|llvm_gcc|clang)
  4827. add_cppflags --sysroot="$sysroot"
  4828. add_ldflags --sysroot="$sysroot"
  4829. # On Darwin --sysroot may be ignored, -isysroot always affects headers and linking
  4830. add_cppflags -isysroot "$sysroot"
  4831. add_ldflags -isysroot "$sysroot"
  4832. add_cxxppflags --sysroot="$sysroot"
  4833. ;;
  4834. tms470)
  4835. add_cppflags -I"$sysinclude"
  4836. add_ldflags --sysroot="$sysroot"
  4837. add_cxxppflags -I"$sysinclude"
  4838. ;;
  4839. esac
  4840. fi
  4841.  
  4842. if test "$cpu" = host; then
  4843. enabled cross_compile &&
  4844. die "--cpu=host makes no sense when cross-compiling."
  4845.  
  4846. case "$cc_type" in
  4847. gcc|llvm_gcc)
  4848. check_native(){
  4849. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4850. sed -n "/cc1.*$1=/{
  4851. s/.*$1=\\([^ ]*\\).*/\\1/
  4852. p
  4853. q
  4854. }" $TMPE
  4855. }
  4856. cpu=$(check_native -march || check_native -mcpu)
  4857. ;;
  4858. clang)
  4859. check_native(){
  4860. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  4861. sed -n "/cc1.*-target-cpu /{
  4862. s/.*-target-cpu \\([^ ]*\\).*/\\1/
  4863. p
  4864. q
  4865. }" $TMPE
  4866. }
  4867. cpu=$(check_native -march)
  4868. ;;
  4869. esac
  4870.  
  4871. if test "${cpu:-host}" = host ; then
  4872. enable proc_opt_old
  4873. cpu="$arch"
  4874. fi
  4875.  
  4876. test "${cpu:-host}" = host &&
  4877. die "--cpu=host not supported with compiler $cc"
  4878. fi
  4879.  
  4880. # Deal with common $arch aliases
  4881. case "$arch" in
  4882. aarch64|arm64)
  4883. arch="aarch64"
  4884. ;;
  4885. arm*|iPad*|iPhone*)
  4886. arch="arm"
  4887. ;;
  4888. mips*|IP*)
  4889. case "$arch" in
  4890. *el)
  4891. add_cppflags -EL
  4892. add_ldflags -EL
  4893. ;;
  4894. *eb)
  4895. add_cppflags -EB
  4896. add_ldflags -EB
  4897. ;;
  4898. esac
  4899. arch="mips"
  4900. ;;
  4901. parisc*|hppa*)
  4902. arch="parisc"
  4903. ;;
  4904. "Power Macintosh"|ppc*|powerpc*)
  4905. arch="ppc"
  4906. ;;
  4907. s390|s390x)
  4908. arch="s390"
  4909. ;;
  4910. sh4|sh)
  4911. arch="sh4"
  4912. ;;
  4913. sun4*|sparc*)
  4914. arch="sparc"
  4915. ;;
  4916. tilegx|tile-gx)
  4917. arch="tilegx"
  4918. ;;
  4919. i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  4920. arch="x86"
  4921. ;;
  4922. esac
  4923.  
  4924. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  4925. enable $arch
  4926.  
  4927. # if no tune setting and we know cpu class look at $processor
  4928. if enabled proc_opt_old; then
  4929. # first try to tune based on processor info
  4930. # Intel i3, i5, i7 processors (EMT64T capable)
  4931. if expr "$processor" : ".*Intel(R).*Core(TM) i[357] CPU.*" > /dev/null ; then
  4932. cpu="core2"
  4933. # EM64T era Intel Xeon
  4934. elif expr "$processor" : ".*Intel(R) Xeon(R) CPU.*51[1-6][08]" > /dev/null ; then
  4935. cpu="core2"
  4936. elif expr "$processor" : ".*Intel(R) Xeon(R) CPU.*54[0-9][025]" > /dev/null ; then
  4937. cpu="core2"
  4938. elif expr "$processor" : ".*Intel(R) Xeon(R) CPU.*33[2567]0" > /dev/null ; then
  4939. cpu="core2"
  4940. elif expr "$processor" : ".*Intel(R) Xeon(R) CPU.*X32[123]0" > /dev/null ; then
  4941. cpu="core2"
  4942. # Various Intel Duo processors (EMT64T capable)
  4943. elif expr "$processor" : ".*Intel(R).*Core(TM)2.*CPU" > /dev/null ; then
  4944. cpu="core2"
  4945. elif expr "$processor" : "*.Pentium(R) 5 CPU" > /dev/null ; then
  4946. cpu="nocona"
  4947. # EM64T compatible Intel Celeron
  4948. elif expr "$processor" : ".*Celeron(R) D CPU" > /dev/null ; then
  4949. cpu="nocona"
  4950. enable small
  4951. # Intel Core2 Duo
  4952. elif expr "$processor" : ".*Genuine.*Intel.*CPU.*2160" > /dev/null ; then
  4953. cpu="core2"
  4954. # Intel Atom
  4955. elif expr "$processor" : ".*Intel(R) Atom(TM)" > /dev/null ; then
  4956. cpu="nocona"
  4957. enable small
  4958. # Reportedly Intel Duo, but we assume 32 bit P3 due to generic name
  4959. elif expr "$processor" : ".*Genuine.*Intel.*CPU" > /dev/null ; then
  4960. cpu="pentium3"
  4961. # Pentium-M derivative in AppleTV, assume 32 bit P3 due to generic name
  4962. elif expr "$processor" : ".*Genuine.*Intel.*processor" > /dev/null ; then
  4963. cpu="pentium3"
  4964. # P4
  4965. elif expr "$processor" : ".*Xeon(TM) CPU" > /dev/null ; then
  4966. cpu="pentium4"
  4967. elif expr "$processor" : ".*XEON(TM) CPU" > /dev/null ; then
  4968. cpu="pentium4"
  4969. elif expr "$processor" : ".*XEON(TM) MP CPU" > /dev/null ; then
  4970. cpu="pentium4"
  4971. elif expr "$processor" : "pentium4" > /dev/null ; then
  4972. cpu="pentium4"
  4973. elif expr "$processor" : ".*Pentium(R) [4D]" > /dev/null ; then
  4974. cpu="pentium4"
  4975. elif expr "$processor" : ".*Celeron(R) CPU" > /dev/null ; then
  4976. cpu="pentium4"
  4977. enable small
  4978. # P6, which includes Intel Core
  4979. elif expr "$processor" : ".*Intel P6 Family" > /dev/null ; then
  4980. cpu="pentium4"
  4981. # P3
  4982. elif expr "$processor" : "pentium3" > /dev/null ; then
  4983. cpu="pentium3"
  4984. elif expr "$processor" : ".*Pentium.* III" > /dev/null ; then
  4985. cpu="pentium3"
  4986. elif expr "$processor" : ".*Coppermine" > /dev/null ; then
  4987. cpu="pentium3"
  4988. enable small
  4989. elif expr "$processor" : ".*Celeron(TM) CPU" > /dev/null ; then
  4990. cpu="pentium3"
  4991. enable small
  4992. elif expr "$processor" : ".*Pentium(R) M" > /dev/null ; then
  4993. cpu="pentium3"
  4994. elif expr "$processor" : ".*Celeron(R) M processor" > /dev/null ; then
  4995. cpu="pentium3"
  4996. enable small
  4997. # P2
  4998. elif expr "$processor" : "pentium2" > /dev/null ; then
  4999. cpu="pentium2"
  5000. elif expr "$processor" : ".*Mendocino" > /dev/null ; then
  5001. cpu="pentium2"
  5002. enable small
  5003. elif expr "$processor" : ".*Klamath" > /dev/null ; then
  5004. cpu="pentium2"
  5005. enable small
  5006. elif expr "$processor" : ".*Deschutes" > /dev/null ; then
  5007. cpu="pentium2"
  5008. enable small
  5009. elif expr "$processor" : ".*Pentium II" > /dev/null ; then
  5010. cpu="pentium2"
  5011. enable small
  5012. # AMD Turion
  5013. elif expr "$processor" : ".*AMD Turion(tm) 64" > /dev/null ; then
  5014. cpu="k8"
  5015. # AMD Geode NX
  5016. elif expr "$processor" : ".*AMD Geode(tm) NX" > /dev/null ; then
  5017. cpu="athlon"
  5018. enable small
  5019. # Athlon 64
  5020. elif expr "$processor" : ".*AMD Athlon(tm) II" > /dev/null ; then
  5021. cpu="k8"
  5022. elif expr "$processor" : ".*AMD Athlon(tm) 64" > /dev/null ; then
  5023. cpu="k8"
  5024. elif expr "$processor" : ".*AMD Athlon(tm) Dual Core" > /dev/null ; then
  5025. cpu="k8"
  5026. elif expr "$processor" : ".*Athlon LE-16" > /dev/null ; then
  5027. cpu="k8"
  5028. # AMD Phenom
  5029. elif expr "$processor" : ".*AMD Phenom(tm)" > /dev/null ; then
  5030. cpu="barcelona"
  5031. # AMD Opteron
  5032. elif expr "$processor" : ".*AMD Opteron(tm)" >/dev/null ; then
  5033. cpu="k8"
  5034. # Athlon MP
  5035. elif expr "$processor" : ".*AMD Athlon(tm) MP.*" > /dev/null ; then
  5036. cpu="athlon-mp"
  5037. # Athlon XP
  5038. elif expr "$processor" : "athlon-xp" > /dev/null ; then
  5039. cpu="athlon-xp"
  5040. elif expr "$processor" : ".*AMD Athlon(tm) XP" > /dev/null ; then
  5041. cpu="athlon-xp"
  5042. elif expr "$processor" : ".*AMD Sempron(tm)" > /dev/null ; then
  5043. cpu="athlon-xp"
  5044. # Athlon
  5045. elif expr "$processor" : "athlon" > /dev/null ; then
  5046. cpu="athlon"
  5047. elif expr "$processor" : ".*AMD Athlon(..)" > /dev/null ; then
  5048. cpu="athlon"
  5049. elif expr "$processor" : ".*AMD Duron(..)" > /dev/null ; then
  5050. cpu="athlon"
  5051. enable small
  5052. # K6
  5053. elif expr "$processor" : ".*AMD-K6(tm) 3D" > /dev/null ; then
  5054. cpu="k6"
  5055. enable small
  5056. # Transmeta Crusoe
  5057. elif expr "$processor" : ".*Crusoe(m) Processor TM5600" > /dev/null ; then
  5058. cpu="pentium2"
  5059. # c3-2
  5060. elif expr "$processor" : ".*VIA Esther" > /dev/null ; then
  5061. cpu="c3-2"
  5062. enable small
  5063. elif expr "$processor" : ".*VIA Nehemiah" > /dev/null ; then
  5064. cpu="c3-2"
  5065. enable small
  5066. # c3
  5067. elif expr "$processor" : ".*VIA.*Ezra" > /dev/null ; then
  5068. cpu="c3"
  5069. enable small
  5070. elif expr "$processor" : ".*VIA Samuel" > /dev/null ; then
  5071. cpu="c3"
  5072. enable small
  5073. # if no known processor info, tune base on uname -m info
  5074. else
  5075. enable proc_error_msg
  5076. fi
  5077. fi
  5078.  
  5079. if enabled proc_error_msg; then
  5080. UNAME_M_INFO=` uname -m 2> /dev/null`
  5081. UNAME_P_INFO=` uname -p 2> /dev/null`
  5082. PROC_INFO=`cat /proc/cpuinfo | grep "model name" | head -n 1 | sed s/"\t"//g 2>/dev/null`
  5083. PROC_FLAG=`cat /proc/cpuinfo | grep "flags" | head -n 1 | sed s/"\t"//g 2>/dev/null`
  5084. echo ""
  5085. echo " *** WARNING *** "
  5086. echo " Your CPU was not detected properly:"
  5087. echo " uname -m: $UNAME_M_INFO"
  5088. echo " uname -p: $UNAME_P_INFO"
  5089. echo " $PROC_INFO"
  5090. echo " $PROC_FLAG"
  5091. echo ""
  5092. echo " If you are using a recent checkout from "
  5093. echo " https://github.com/MythTV/mythtv "
  5094. echo " please e-mail the above to mythtv-dev@mythtv.org"
  5095. echo " With the subject \"configure did not detect my cpu\""
  5096. echo ""
  5097. fi
  5098.  
  5099. if test $target_os = "darwin"; then
  5100. # Apple GCC doesn't support march=core2 yet:
  5101. if test $cpu = "core2"; then
  5102. cpu="nocona"
  5103. fi
  5104. # Core Duo might be identified as march=pentium3, which errors:
  5105. # ...MachineExceptions.h:... error: '__m128i' does not name a type
  5106. # ...MachineExceptions.h:... error: '__m128i' does not name a type
  5107. if test $cpu = "pentium3"; then
  5108. cpu=prescott
  5109. fi
  5110. fi
  5111.  
  5112. # Add processor-specific flags
  5113. if enabled aarch64; then
  5114.  
  5115. case $cpu in
  5116. armv*)
  5117. cpuflags="-march=$cpu"
  5118. ;;
  5119. *)
  5120. cpuflags="-mcpu=$cpu"
  5121. ;;
  5122. esac
  5123.  
  5124. elif enabled alpha; then
  5125.  
  5126. cpuflags="-mcpu=$cpu"
  5127.  
  5128. elif enabled arm; then
  5129.  
  5130. check_arm_arch() {
  5131. check_cpp_condition stddef.h \
  5132. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  5133. $cpuflags
  5134. }
  5135.  
  5136. probe_arm_arch() {
  5137. if check_arm_arch 4; then echo armv4
  5138. elif check_arm_arch 4T; then echo armv4t
  5139. elif check_arm_arch 5; then echo armv5
  5140. elif check_arm_arch 5E; then echo armv5e
  5141. elif check_arm_arch 5T; then echo armv5t
  5142. elif check_arm_arch 5TE; then echo armv5te
  5143. elif check_arm_arch 5TEJ; then echo armv5te
  5144. elif check_arm_arch 6; then echo armv6
  5145. elif check_arm_arch 6J; then echo armv6j
  5146. elif check_arm_arch 6K; then echo armv6k
  5147. elif check_arm_arch 6Z; then echo armv6z
  5148. elif check_arm_arch 6ZK; then echo armv6zk
  5149. elif check_arm_arch 6T2; then echo armv6t2
  5150. elif check_arm_arch 7; then echo armv7
  5151. elif check_arm_arch 7A 7_A; then echo armv7-a
  5152. elif check_arm_arch 7S; then echo armv7-a
  5153. elif check_arm_arch 7R 7_R; then echo armv7-r
  5154. elif check_arm_arch 7M 7_M; then echo armv7-m
  5155. elif check_arm_arch 7EM 7E_M; then echo armv7-m
  5156. elif check_arm_arch 8A 8_A; then echo armv8-a
  5157. fi
  5158. }
  5159.  
  5160. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  5161.  
  5162. case $cpu in
  5163. armv*)
  5164. cpuflags="-march=$cpu"
  5165. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  5166. ;;
  5167. *)
  5168. cpuflags="-mcpu=$cpu"
  5169. case $cpu in
  5170. cortex-a*) subarch=armv7a ;;
  5171. cortex-r*) subarch=armv7r ;;
  5172. cortex-m*) enable thumb; subarch=armv7m ;;
  5173. arm11*) subarch=armv6 ;;
  5174. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  5175. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  5176. *) subarch=$(probe_arm_arch) ;;
  5177. esac
  5178. ;;
  5179. esac
  5180.  
  5181. case "$subarch" in
  5182. armv5t*) enable fast_clz ;;
  5183. armv[6-8]*)
  5184. enable fast_clz
  5185. disabled fast_unaligned || enable fast_unaligned
  5186. ;;
  5187. esac
  5188.  
  5189. elif enabled avr32; then
  5190.  
  5191. case $cpu in
  5192. ap7[02]0[0-2])
  5193. subarch="avr32_ap"
  5194. cpuflags="-mpart=$cpu"
  5195. ;;
  5196. ap)
  5197. subarch="avr32_ap"
  5198. cpuflags="-march=$cpu"
  5199. ;;
  5200. uc3[ab]*)
  5201. subarch="avr32_uc"
  5202. cpuflags="-mcpu=$cpu"
  5203. ;;
  5204. uc)
  5205. subarch="avr32_uc"
  5206. cpuflags="-march=$cpu"
  5207. ;;
  5208. esac
  5209.  
  5210. elif enabled bfin; then
  5211.  
  5212. cpuflags="-mcpu=$cpu"
  5213.  
  5214. elif enabled mips; then
  5215.  
  5216. cpuflags="-march=$cpu"
  5217.  
  5218. if [ "$cpu" != "generic" ]; then
  5219. disable mips32r2
  5220. disable mips32r5
  5221. disable mips64r2
  5222. disable mips32r6
  5223. disable mips64r6
  5224. disable loongson2
  5225. disable loongson3
  5226.  
  5227. case $cpu in
  5228. 24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf)
  5229. enable mips32r2
  5230. disable msa
  5231. ;;
  5232. p5600|i6400|p6600)
  5233. disable mipsdsp
  5234. disable mipsdspr2
  5235. ;;
  5236. loongson*)
  5237. enable loongson2
  5238. enable loongson3
  5239. enable local_aligned_8 local_aligned_16 local_aligned_32
  5240. enable simd_align_16
  5241. enable fast_64bit
  5242. enable fast_clz
  5243. enable fast_cmov
  5244. enable fast_unaligned
  5245. disable aligned_stack
  5246. disable mipsfpu
  5247. disable mipsdsp
  5248. disable mipsdspr2
  5249. case $cpu in
  5250. loongson3*)
  5251. cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
  5252. ;;
  5253. loongson2e)
  5254. cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
  5255. ;;
  5256. loongson2f)
  5257. cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
  5258. ;;
  5259. esac
  5260. ;;
  5261. *)
  5262. # Unknown CPU. Disable everything.
  5263. warn "unknown CPU. Disabling all MIPS optimizations."
  5264. disable mipsfpu
  5265. disable mipsdsp
  5266. disable mipsdspr2
  5267. disable msa
  5268. disable mmi
  5269. ;;
  5270. esac
  5271.  
  5272. case $cpu in
  5273. 24kc)
  5274. disable mipsfpu
  5275. disable mipsdsp
  5276. disable mipsdspr2
  5277. ;;
  5278. 24kf*)
  5279. disable mipsdsp
  5280. disable mipsdspr2
  5281. ;;
  5282. 24kec|34kc|1004kc)
  5283. disable mipsfpu
  5284. disable mipsdspr2
  5285. ;;
  5286. 24kef*|34kf*|1004kf*)
  5287. disable mipsdspr2
  5288. ;;
  5289. 74kc)
  5290. disable mipsfpu
  5291. ;;
  5292. p5600)
  5293. enable mips32r5
  5294. check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
  5295. ;;
  5296. i6400)
  5297. enable mips64r6
  5298. check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  5299. ;;
  5300. p6600)
  5301. enable mips64r6
  5302. check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
  5303. ;;
  5304. esac
  5305. else
  5306. # We do not disable anything. Is up to the user to disable the unwanted features.
  5307. warn 'generic cpu selected'
  5308. fi
  5309.  
  5310. elif enabled ppc; then
  5311.  
  5312. disable ldbrx
  5313.  
  5314. case $(tolower $cpu) in
  5315. 601|ppc601|powerpc601)
  5316. cpuflags="-mcpu=601"
  5317. disable altivec
  5318. ;;
  5319. 603*|ppc603*|powerpc603*)
  5320. cpuflags="-mcpu=603"
  5321. disable altivec
  5322. ;;
  5323. 604*|ppc604*|powerpc604*)
  5324. cpuflags="-mcpu=604"
  5325. disable altivec
  5326. ;;
  5327. g3|75*|ppc75*|powerpc75*)
  5328. cpuflags="-mcpu=750"
  5329. disable altivec
  5330. ;;
  5331. g4|745*|ppc745*|powerpc745*)
  5332. cpuflags="-mcpu=7450"
  5333. disable vsx
  5334. ;;
  5335. 74*|ppc74*|powerpc74*)
  5336. cpuflags="-mcpu=7400"
  5337. disable vsx
  5338. ;;
  5339. g5|970|ppc970|powerpc970)
  5340. cpuflags="-mcpu=970"
  5341. disable vsx
  5342. ;;
  5343. power[3-6]*)
  5344. cpuflags="-mcpu=$cpu"
  5345. disable vsx
  5346. ;;
  5347. power[7-8]*)
  5348. cpuflags="-mcpu=$cpu"
  5349. ;;
  5350. cell)
  5351. cpuflags="-mcpu=cell"
  5352. enable ldbrx
  5353. disable vsx
  5354. ;;
  5355. e500mc)
  5356. cpuflags="-mcpu=e500mc"
  5357. disable altivec
  5358. ;;
  5359. e500v2)
  5360. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  5361. disable altivec
  5362. disable dcbzl
  5363. ;;
  5364. e500)
  5365. cpuflags="-mcpu=8540 -mhard-float"
  5366. disable altivec
  5367. disable dcbzl
  5368. ;;
  5369. esac
  5370.  
  5371. elif enabled sparc; then
  5372.  
  5373. case $cpu in
  5374. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  5375. cpuflags="-mcpu=$cpu"
  5376. ;;
  5377. ultrasparc*|niagara[234])
  5378. cpuflags="-mcpu=$cpu"
  5379. ;;
  5380. esac
  5381.  
  5382. elif enabled x86; then
  5383.  
  5384. case $cpu in
  5385. i[345]86|pentium)
  5386. cpuflags="-march=$cpu"
  5387. disable i686
  5388. disable mmx
  5389. ;;
  5390. # targets that do NOT support nopl and conditional mov (cmov)
  5391. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  5392. cpuflags="-march=$cpu"
  5393. disable i686
  5394. ;;
  5395. # targets that do support nopl and conditional mov (cmov)
  5396. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
  5397. |core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|skylake*|knl\
  5398. |amdfam10|barcelona|b[dt]ver*|znver*)
  5399. cpuflags="-march=$cpu"
  5400. enable i686
  5401. enable fast_cmov
  5402. ;;
  5403. # targets that do support conditional mov but on which it's slow
  5404. pentium4|pentium4m|prescott|nocona)
  5405. cpuflags="-march=$cpu"
  5406. enable i686
  5407. disable fast_cmov
  5408. ;;
  5409. esac
  5410.  
  5411. fi
  5412.  
  5413.  
  5414. # if architecture specific flags don't work blank them
  5415. if test -n "$cpuflags"; then
  5416. tmp_cpuflags="$cpuflags"
  5417. check_cc $cpuflags <<EOF || cpuflags=""
  5418. int main( void ) { return 0; }
  5419. EOF
  5420. if test -z "$cpuflags"; then
  5421. if enabled cpu_override || enabled proc_opt || test x"$tune" != x"generic"; then
  5422. echo "ERROR: CPU specific ./configure options failed compile test"
  5423. echo " Removing CPU specific compilation options. ($tmp_cpuflags)"
  5424. echo ""
  5425. fi
  5426. fi
  5427. fi
  5428.  
  5429. if [ "$cpu" != generic ]; then
  5430. add_cflags $cpuflags
  5431. add_asflags $cpuflags
  5432. add_cxxflags $cpuflags
  5433. test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
  5434. fi
  5435.  
  5436. # compiler sanity check
  5437. check_exec <<EOF
  5438. int main(void){ return 0; }
  5439. EOF
  5440. if test "$?" != 0; then
  5441. echo "$cc is unable to create an executable file."
  5442. echo "Check your ECFLAGS: [$ECFLAGS]"
  5443. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  5444. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  5445. echo "Only do this if you know what cross compiling means."
  5446. fi
  5447. die "C compiler test failed."
  5448. fi
  5449.  
  5450. add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
  5451. #add_cxxflags -D__STDC_CONSTANT_MACROS
  5452.  
  5453. # C++ compiler sanity check
  5454. check_exec_cxx <<EOF
  5455. int main(void){ return 0; }
  5456. EOF
  5457. if test "$?" != 0; then
  5458. echo "$cxx is unable to create an executable file."
  5459. echo "Check your ECXXFLAGS: [$ECXXFLAGS]"
  5460. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  5461. echo "If $cxx is a cross-compiler, use the --enable-cross-compile option."
  5462. echo "Only do this if you know what cross compiling means."
  5463. fi
  5464. die "C++ compiler test failed."
  5465. fi
  5466.  
  5467. check_cflags -std=c99
  5468. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  5469. #include <stdlib.h>
  5470. EOF
  5471. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  5472. #include <stdlib.h>
  5473. EOF
  5474. check_cxx -D_FILE_OFFSET_BITS=64 <<EOF && add_cxxppflags -D_FILE_OFFSET_BITS=64
  5475. #include <stdlib.h>
  5476. EOF
  5477. check_cxx -D_LARGEFILE_SOURCE <<EOF && add_cxxppflags -D_LARGEFILE_SOURCE
  5478. #include <stdlib.h>
  5479. EOF
  5480.  
  5481. add_host_cppflags -D_ISOC99_SOURCE
  5482. check_host_cflags -std=c99
  5483. check_host_cflags -Wall
  5484. check_host_cflags -O3
  5485.  
  5486. check_64bit(){
  5487. arch32=$1
  5488. arch64=$2
  5489. expr=$3
  5490. check_code cc "" "int test[2*($expr) - 1]" &&
  5491. subarch=$arch64 || subarch=$arch32
  5492. }
  5493.  
  5494. case "$arch" in
  5495. aarch64|alpha|ia64)
  5496. spic=$shared
  5497. ;;
  5498. mips)
  5499. check_64bit mips mips64 '_MIPS_SIM > 1'
  5500. spic=$shared
  5501. ;;
  5502. parisc)
  5503. check_64bit parisc parisc64 'sizeof(void *) > 4'
  5504. spic=$shared
  5505. ;;
  5506. ppc)
  5507. check_64bit ppc ppc64 'sizeof(void *) > 4'
  5508. spic=$shared
  5509. ;;
  5510. s390)
  5511. check_64bit s390 s390x 'sizeof(void *) > 4'
  5512. spic=$shared
  5513. ;;
  5514. sparc)
  5515. check_64bit sparc sparc64 'sizeof(void *) > 4'
  5516. spic=$shared
  5517. ;;
  5518. x86)
  5519. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  5520. # Treat x32 as x64 for now. Note it also needs spic=$shared
  5521. test "$subarch" = "x86_32" && check_cpp_condition stddef.h 'defined(__x86_64__)' &&
  5522. subarch=x86_64
  5523. if test "$subarch" = "x86_64"; then
  5524. spic=$shared
  5525. fi
  5526. ;;
  5527. ppc)
  5528. check_cc <<EOF && subarch="ppc64"
  5529. int test[(int)sizeof(char*) - 7];
  5530. EOF
  5531. ;;
  5532. esac
  5533.  
  5534. enable $subarch
  5535. enabled spic && enable_weak pic
  5536.  
  5537. # OS specific
  5538. case $target_os in
  5539. aix)
  5540. SHFLAGS=-shared
  5541. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  5542. enabled shared && add_ldflags -Wl,-brtl
  5543. ;;
  5544. android)
  5545. disable symver
  5546. enable section_data_rel_ro
  5547. disable qtdbus
  5548. SLIB_INSTALL_NAME='$(SLIBNAME)'
  5549. SLIB_INSTALL_LINKS=
  5550. # soname not set on purpose
  5551. SHFLAGS=-shared
  5552. enable pic
  5553. ;;
  5554. haiku)
  5555. prefix_default="/boot/common"
  5556. network_extralibs="-lnetwork"
  5557. host_libs=
  5558. ;;
  5559. sunos)
  5560. SHFLAGS='-shared -Wl,-h,$$(@F)'
  5561. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  5562. network_extralibs="-lsocket -lnsl"
  5563. add_cppflags -D__EXTENSIONS__
  5564. # When using suncc to build, the Solaris linker will mark
  5565. # an executable with each instruction set encountered by
  5566. # the Solaris assembler. As our libraries contain their own
  5567. # guards for processor-specific code, instead suppress
  5568. # generation of the HWCAPS ELF section on Solaris x86 only.
  5569. enabled_all suncc x86 &&
  5570. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  5571. add_ldflags -Wl,-M,mapfile
  5572. add_cxxppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  5573. nm_default='nm -P -g'
  5574. version_script='-M'
  5575. VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
  5576. ;;
  5577. netbsd)
  5578. disable symver
  5579. oss_indev_extralibs="-lossaudio"
  5580. oss_outdev_extralibs="-lossaudio"
  5581. enabled gcc || check_ldflags -Wl,-zmuldefs
  5582. add_cppflags -D_XOPEN_SOURCE=600
  5583. add_cxxppflags -D_XOPEN_SOURCE=600
  5584. ;;
  5585. openbsd|bitrig)
  5586. disable symver
  5587. SHFLAGS='-shared'
  5588. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  5589. SLIB_INSTALL_LINKS=
  5590. oss_indev_extralibs="-lossaudio"
  5591. oss_outdev_extralibs="-lossaudio"
  5592. ;;
  5593. dragonfly)
  5594. disable symver
  5595. ;;
  5596. freebsd)
  5597. append CCONFIG "freebsd"
  5598. # Workaround compile errors from missing u_int/uint def
  5599. CPPFLAGS=`echo $CPPFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`
  5600. disable ivtv
  5601. disable v4l2
  5602. enable backend
  5603. ;;
  5604. bsd/os)
  5605. add_extralibs -lpoll -lgnugetopt
  5606. strip="strip -d"
  5607. ;;
  5608. darwin)
  5609. enable appleremote
  5610. enable backend
  5611. enable darwin
  5612. disable dvb
  5613. disable v4l1
  5614. disable v4l2
  5615. disable x11
  5616. # Workaround compile errors from missing u_int/uint def
  5617. CFLAGS=`echo $CFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`
  5618. CPPFLAGS=`echo $CPPFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`
  5619. # Workaround compile errors from missing ru_maxrss
  5620. add_cppflags -D_DARWIN_C_SOURCE
  5621.  
  5622. ###### Standard ffmpeg configure stuff follows:
  5623. enabled ppc && add_asflags -force_cpusubtype_ALL
  5624. install_name_dir_default='$(SHLIBDIR)'
  5625.  
  5626. #Need to add @rpath in front of install name so test unit can use non-installed lib
  5627. SHFLAGS='-headerpad_max_install_names -dynamiclib -Wl,-single_module -Wl,-install_name,@rpath/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  5628. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  5629. strip="${strip} -x"
  5630. add_ldflags -Wl,-dynamic,-search_paths_first
  5631. SLIBSUF=".dylib"
  5632. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  5633. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  5634. objformat="macho"
  5635. enabled x86_64 && objformat="macho64"
  5636. enabled_any pic shared x86_64 ||
  5637. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  5638. check_header dispatch/dispatch.h &&
  5639. add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
  5640. version_script='-exported_symbols_list'
  5641. VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
  5642. ;;
  5643. msys*)
  5644. die "Native MSYS builds are discouraged, please use the MINGW environment."
  5645. ;;
  5646. mingw32*|mingw64*)
  5647. enable backend
  5648. disable bindings_perl
  5649. disable bindings_python
  5650. disable bindings_php
  5651. disable dv1394
  5652. disable dvb
  5653. disable ceton
  5654. enable memalign_hack
  5655. disable mythtranscode
  5656. disable network
  5657. enable opengl
  5658. if enabled wince; then
  5659. disable protocols
  5660. fi
  5661. disable symver
  5662. disable v4l1
  5663. disable v4l2
  5664. enable windows
  5665. disable x11
  5666. disable qtdbus
  5667. disable libuuid
  5668. disable ffserver
  5669. ###### Standard ffmpeg configure stuff follows:
  5670. if test $target_os = "mingw32ce"; then
  5671. disable network
  5672. else
  5673. target_os=mingw32
  5674. fi
  5675. decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
  5676. decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
  5677. LIBTARGET=i386
  5678. if enabled x86_64; then
  5679. LIBTARGET="i386:x86-64"
  5680. elif enabled arm; then
  5681. LIBTARGET=arm-wince
  5682. fi
  5683. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  5684. enabled x86_32 && check_ldflags -Wl,--large-address-aware
  5685. shlibdir_default="$bindir_default"
  5686. SLIBPREF="libmyth"
  5687. SLIBSUF=".dll"
  5688. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  5689. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  5690. dlltool="${cross_prefix}dlltool"
  5691. if check_cmd lib.exe -list ; then
  5692. SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
  5693. else
  5694. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  5695. fi
  5696. SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
  5697. install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
  5698. install -d "$(LIBDIR)"; \
  5699. install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
  5700. SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
  5701. SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
  5702. objformat="win32"
  5703. ranlib=:
  5704. enable dos_paths
  5705. check_ldflags -Wl,--nxcompat,--dynamicbase
  5706. # Lets work around some stupidity in binutils.
  5707. # ld will strip relocations from executables even though we need them
  5708. # for dynamicbase (ASLR). Using -pie does retain the reloc section
  5709. # however ld then forgets what the entry point should be (oops) so we
  5710. # have to manually (re)set it.
  5711. if enabled x86_32; then
  5712. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
  5713. elif enabled x86_64; then
  5714. disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
  5715. check_ldflags -Wl,--high-entropy-va # binutils 2.25
  5716. # Set image base >4GB for extra entropy with HEASLR
  5717. add_ldexeflags -Wl,--image-base,0x140000000
  5718. append SHFLAGS -Wl,--image-base,0x180000000
  5719. fi
  5720. add_extralibs -lws2_32
  5721. # Workaround compile errors due -std=c++98 incompatible system headers
  5722. ECXXFLAGS=`echo $ECXXFLAGS | sed 's/-std=c++98//'`
  5723. ;;
  5724. win32|win64)
  5725. disable symver
  5726. if enabled shared; then
  5727. # Link to the import library instead of the normal static library
  5728. # for shared libs.
  5729. LD_LIB='%.lib'
  5730. # Cannot build both shared and static libs with MSVC or icl.
  5731. disable static
  5732. fi
  5733. enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
  5734. shlibdir_default="$bindir_default"
  5735. SLIBPREF="libmyth"
  5736. SLIBSUF=".dll"
  5737. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5738. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  5739. SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  5740. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5741. SLIB_INSTALL_LINKS=
  5742. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  5743. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  5744. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  5745. objformat="win32"
  5746. ranlib=:
  5747. enable dos_paths
  5748. ;;
  5749. cygwin*)
  5750. enable cygwin
  5751. enable windows
  5752. target_os=cygwin
  5753. shlibdir_default="$bindir_default"
  5754. SLIBPREF="cygmyth"
  5755. SLIBSUF=".dll"
  5756. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5757. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  5758. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5759. SLIB_INSTALL_LINKS=
  5760. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  5761. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  5762. objformat="win32"
  5763. enable dos_paths
  5764. enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
  5765. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5766. ;;
  5767. *-dos|freedos|opendos)
  5768. disable ffplay ffserver
  5769. disable $INDEV_LIST $OUTDEV_LIST
  5770. network_extralibs="-lsocket"
  5771. objformat="coff"
  5772. enable dos_paths
  5773. add_cppflags -U__STRICT_ANSI__
  5774. ;;
  5775. linux)
  5776. enable dv1394
  5777. enable section_data_rel_ro
  5778. append CCONFIG "linux"
  5779. enable backend
  5780. ! disabled joystick_menu && enable joystick_menu
  5781. enable libudev
  5782. enable libuuid
  5783. enable pic
  5784. ;;
  5785. irix*)
  5786. target_os=irix
  5787. ranlib="echo ignoring ranlib"
  5788. ;;
  5789. os/2*)
  5790. strip="lxlite -CS"
  5791. objformat="aout"
  5792. add_cppflags -D_GNU_SOURCE
  5793. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  5794. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  5795. LIBSUF="_s.a"
  5796. SLIBPREF="myth"
  5797. SLIBSUF=".dll"
  5798. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  5799. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  5800. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \
  5801. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \
  5802. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \
  5803. echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \
  5804. emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def'
  5805. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \
  5806. emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;'
  5807. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  5808. SLIB_INSTALL_LINKS=
  5809. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib'
  5810. enable dos_paths
  5811. enable_weak os2threads
  5812. ;;
  5813. gnu/kfreebsd)
  5814. add_cppflags -D_BSD_SOURCE
  5815. ;;
  5816. gnu)
  5817. ;;
  5818. qnx)
  5819. add_cppflags -D_QNX_SOURCE
  5820. network_extralibs="-lsocket"
  5821. ;;
  5822. symbian)
  5823. SLIBSUF=".dll"
  5824. enable dos_paths
  5825. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  5826. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  5827. add_ldflags -Wl,--target1-abs,--no-undefined \
  5828. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  5829. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  5830. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  5831. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  5832. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  5833. ;;
  5834. osf1)
  5835. add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
  5836. ;;
  5837. minix)
  5838. ;;
  5839. plan9)
  5840. add_cppflags -D_C99_SNPRINTF_EXTENSION \
  5841. -D_REENTRANT_SOURCE \
  5842. -D_RESEARCH_SOURCE \
  5843. -DFD_SETSIZE=96 \
  5844. -DHAVE_SOCK_OPTS
  5845. add_compat strtod.o strtod=avpriv_strtod
  5846. network_extralibs='-lbsd'
  5847. exeobjs=compat/plan9/main.o
  5848. disable ffserver
  5849. cp_f='cp'
  5850. ;;
  5851. none)
  5852. ;;
  5853. *)
  5854. die "Unknown OS '$target_os'."
  5855. ;;
  5856. esac
  5857.  
  5858. # test if creating links works
  5859. link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
  5860. link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
  5861. mkdir "$link_dest"
  5862. $ln_s "$link_dest" "$link_name"
  5863. touch "$link_dest/test_file"
  5864. if [ "$source_path" != "." ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
  5865. # create link to source path
  5866. [ -e src ] && rm src
  5867. $ln_s "$source_path" src
  5868. source_link=src
  5869. else
  5870. # creating directory links doesn't work
  5871. # fall back to using the full source path
  5872. source_link="$source_path"
  5873. fi
  5874. # cleanup
  5875. rm -r "$link_dest"
  5876. rm -r "$link_name"
  5877.  
  5878. # determine libc flavour
  5879.  
  5880. probe_libc(){
  5881. pfx=$1
  5882. pfx_no_=${pfx%_}
  5883. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  5884. if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  5885. eval ${pfx}libc_type=uclibc
  5886. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5887. elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  5888. eval ${pfx}libc_type=glibc
  5889. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5890. # MinGW headers can be installed on Cygwin, so check for newlib first.
  5891. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  5892. eval ${pfx}libc_type=newlib
  5893. add_${pfx}cppflags -U__STRICT_ANSI__
  5894. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  5895. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  5896. eval ${pfx}libc_type=mingw64
  5897. if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
  5898. add_compat msvcrt/snprintf.o
  5899. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  5900. fi
  5901. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5902. eval test \$${pfx_no_}cc_type = "gcc" &&
  5903. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5904. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  5905. check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  5906. eval ${pfx}libc_type=mingw32
  5907. check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  5908. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  5909. die "ERROR: MinGW32 runtime version must be >= 3.15."
  5910. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  5911. check_${pfx}cpp_condition _mingw.h "defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0502" ||
  5912. add_${pfx}cppflags -D_WIN32_WINNT=0x0502
  5913. eval test \$${pfx_no_}cc_type = "gcc" &&
  5914. add_${pfx}cppflags -D__printf__=__gnu_printf__
  5915. elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  5916. eval ${pfx}libc_type=msvcrt
  5917. if check_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
  5918. if [ "$pfx" = host_ ]; then
  5919. add_host_cppflags -Dsnprintf=_snprintf
  5920. else
  5921. add_compat strtod.o strtod=avpriv_strtod
  5922. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  5923. _snprintf=avpriv_snprintf \
  5924. vsnprintf=avpriv_vsnprintf
  5925. fi
  5926. fi
  5927. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  5928. # 0x601 by default unless something else is set by the user.
  5929. # This can easily lead to us detecting functions only present
  5930. # in such new versions and producing binaries requiring windows 7.0.
  5931. # Therefore explicitly set the default to XP unless the user has
  5932. # set something else on the command line.
  5933. # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
  5934. # family. For these cases, configure is free to use any functions
  5935. # found in the SDK headers by default. (Alternatively, we could force
  5936. # _WIN32_WINNT to 0x0602 in that case.)
  5937. check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  5938. { check_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0502; }
  5939. #ifdef WINAPI_FAMILY
  5940. #include <winapifamily.h>
  5941. #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  5942. #error not desktop
  5943. #endif
  5944. #endif
  5945. EOF
  5946. elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  5947. eval ${pfx}libc_type=klibc
  5948. elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  5949. eval ${pfx}libc_type=bionic
  5950. elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  5951. eval ${pfx}libc_type=solaris
  5952. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  5953. fi
  5954. check_${pfx}cc <<EOF
  5955. #include <time.h>
  5956. void *v = localtime_r;
  5957. EOF
  5958. test "$?" != 0 && check_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  5959. #include <time.h>
  5960. void *v = localtime_r;
  5961. EOF
  5962.  
  5963. }
  5964.  
  5965. probe_libc
  5966. test -n "$libc_type" && enable libc_$libc_type
  5967. probe_libc host_
  5968. test -n "$host_libc_type" && enable host_libc_$host_libc_type
  5969.  
  5970. case $libc_type in
  5971. bionic)
  5972. if test $target_os != android ; then
  5973. add_compat strtod.o strtod=avpriv_strtod
  5974. fi
  5975. ;;
  5976. esac
  5977.  
  5978. # hacks for compiler/libc/os combinations
  5979.  
  5980. if enabled_all tms470 libc_glibc; then
  5981. CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
  5982. add_cppflags -D__USER_LABEL_PREFIX__=
  5983. add_cppflags -D__builtin_memset=memset
  5984. add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
  5985. add_cflags -pds=48 # incompatible redefinition of macro
  5986. fi
  5987.  
  5988. if enabled_all ccc libc_glibc; then
  5989. add_ldflags -Wl,-z,now # calls to libots crash without this
  5990. fi
  5991.  
  5992. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  5993. add_cppflags '-I\$(SRC_PATH)/compat/float'
  5994.  
  5995. esc(){
  5996. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  5997. }
  5998.  
  5999. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  6000.  
  6001. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  6002.  
  6003. set_default libdir
  6004. : ${shlibdir_default:="$libdir"}
  6005. : ${pkgconfigdir_default:="$libdir/pkgconfig"}
  6006.  
  6007. set_default $PATHS_LIST
  6008. set_default nm
  6009.  
  6010. set_default $MYTHTV_PATHS_LIST
  6011. if test $target_os = android ; then
  6012. append CONFIG_INCLUDEPATH $sysinclude "${sysroot}${prefix}"
  6013. fi
  6014.  
  6015. append CCONFIG "$compile_type"
  6016. if test x$compile_type = x"profile" ; then
  6017. add_cflags -DNDEBUG
  6018. add_cxxflags -DNDEBUG
  6019. enable debug
  6020. disable stripping
  6021. enable profiletype
  6022. elif test x$compile_type = x"debug"; then
  6023. enable debug
  6024. disable optimizations stripping
  6025. enable debugtype
  6026. fi
  6027.  
  6028. enabled silent_cc && append CCONFIG "silent"
  6029.  
  6030. # we need to build at least one lib type
  6031. if ! enabled_any static shared; then
  6032. cat <<EOF
  6033. At least one library type must be built.
  6034. Specify --enable-static to build the static libraries or --enable-shared to
  6035. build the shared libraries as well. To only build the shared libraries specify
  6036. --disable-static in addition to --enable-shared.
  6037. EOF
  6038. exit 1
  6039. fi
  6040.  
  6041. # backward compatibility layer for incompatible_libav/fork_abi
  6042. enabled incompatible_fork_abi && enable incompatible_libav_abi
  6043. enabled incompatible_libav_abi && enable incompatible_fork_abi
  6044.  
  6045. disabled static && LIBNAME=""
  6046.  
  6047. die_license_disabled() {
  6048. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  6049. }
  6050.  
  6051. die_license_disabled_gpl() {
  6052. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  6053. }
  6054.  
  6055. die_license_disabled gpl frei0r
  6056. #die_license_disabled gpl libcdio
  6057. #die_license_disabled gpl libutvideo
  6058. die_license_disabled gpl librubberband
  6059. die_license_disabled gpl libsmbclient
  6060. die_license_disabled gpl libvidstab
  6061. die_license_disabled gpl libx264
  6062. die_license_disabled gpl libx265
  6063. die_license_disabled gpl libxavs
  6064. die_license_disabled gpl libxvid
  6065. die_license_disabled gpl x11grab
  6066.  
  6067. die_license_disabled nonfree cuda
  6068. die_license_disabled nonfree cuvid
  6069. die_license_disabled nonfree libnpp
  6070. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  6071. enabled gpl && die_license_disabled_gpl nonfree openssl
  6072.  
  6073. die_license_disabled version3 gmp
  6074. die_license_disabled version3 libopencore_amrnb
  6075. die_license_disabled version3 libopencore_amrwb
  6076. die_license_disabled version3 libsmbclient
  6077. die_license_disabled version3 libvo_amrwbenc
  6078.  
  6079. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  6080.  
  6081. disabled optimizations || check_cflags -fomit-frame-pointer
  6082. disabled optimizations || check_cxxflags -fomit-frame-pointer
  6083.  
  6084. enable_weak_pic() {
  6085. disabled pic && return
  6086. enable pic
  6087. add_cppflags -DPIC
  6088. add_cxxppflags -DPIC
  6089. case "$target_os" in
  6090. mingw*|cygwin*)
  6091. ;;
  6092. *)
  6093. add_cflags -fPIC
  6094. add_cxxflags -fPIC
  6095. ;;
  6096. esac
  6097. add_asflags -fPIC
  6098. }
  6099.  
  6100. enabled pic && enable_weak_pic
  6101.  
  6102. is_qmake5(){
  6103. $1 --version 2>&1 | egrep -q -e "Qt version 5\.[2-9]\.[0-9]"
  6104. }
  6105.  
  6106. # qmake-qt5 /usr/lib64/qt5/bin/qmake /usr/lib/x86_64-linux-gnu/qt5/bin/qmake
  6107. if [ x"$qmake" = "xqmake" ]; then
  6108. CHECK_QMAKE=`which qmake-qt5 2>&1`" /usr/lib64/qt5/bin/qmake /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /usr/lib/i386-linux-gnu/qt5/bin/qmake /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake /usr/local/lib/qt5/bin/qmake `which $qmake 2>&1`"
  6109. else
  6110. CHECK_QMAKE=`which $qmake 2>&1`" "`which qmake-qt5 2>&1`" /usr/lib64/qt5/bin/qmake /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /usr/lib/i386-linux-gnu/qt5/bin/qmake /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake /usr/local/lib/qt5/bin/qmake"
  6111. fi
  6112. # try to find a qt5 qmake to use
  6113. found_qmake=''
  6114. for i in $CHECK_QMAKE; do
  6115. if test -e $i ; then
  6116. if is_qmake5 $i; then
  6117. found_qmake=$i
  6118. check_cxxflags -DQT_DISABLE_DEPRECATED_BEFORE=0x050000
  6119. break;
  6120. else
  6121. echo "found qmake at $i but version failed"
  6122. echo "got version: " `$i --version`
  6123. fi
  6124. fi
  6125. done
  6126. if [ x"$found_qmake" = "x" ]; then
  6127. die "qmake for Qt5.2 or newer not found.\nPlease specify the correct qmake with --qmake="
  6128. else
  6129. qmake=$found_qmake
  6130. fi
  6131.  
  6132. if test x"$qmakespecs" != x; then
  6133. qmakeconf="$qmake -spec $qmakespecs"
  6134. else
  6135. qmakeconf="$qmake"
  6136. fi
  6137.  
  6138. check_cc <<EOF || die "Symbol mangling check failed."
  6139. int ff_extern;
  6140. EOF
  6141. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  6142. extern_prefix=${sym%%ff_extern*}
  6143.  
  6144. check_cc <<EOF && enable_weak inline_asm
  6145. void foo(void) { __asm__ volatile ("" ::); }
  6146. EOF
  6147.  
  6148. _restrict=
  6149. for restrict_keyword in restrict __restrict__ __restrict; do
  6150. check_cxx <<EOF && _restrict=$restrict_keyword && break
  6151. void foo(char * $restrict_keyword p);
  6152. EOF
  6153. done
  6154.  
  6155. check_cc <<EOF && enable pragma_deprecated
  6156. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  6157. EOF
  6158.  
  6159. check_cc <<EOF && enable attribute_packed
  6160. struct { int x; } __attribute__((packed)) x;
  6161. EOF
  6162.  
  6163. check_cc <<EOF && enable attribute_may_alias
  6164. union { int x; } __attribute__((may_alias)) x;
  6165. EOF
  6166.  
  6167. check_cc <<EOF || die "endian test failed"
  6168. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  6169. EOF
  6170. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  6171.  
  6172. if ! enabled ppc64 || enabled bigendian; then
  6173. disable vsx
  6174. fi
  6175.  
  6176. check_gas() {
  6177. log "check_gas using '$as' as AS"
  6178. # :vararg is used on aarch64, arm and ppc altivec
  6179. check_as <<EOF || return 1
  6180. .macro m n, y:vararg=0
  6181. \n: .int \y
  6182. .endm
  6183. m x
  6184. EOF
  6185. # .altmacro is only used in arm asm
  6186. ! enabled arm || check_as <<EOF || return 1
  6187. .altmacro
  6188. EOF
  6189. enable gnu_as
  6190. return 0
  6191. }
  6192.  
  6193. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  6194. nogas=:
  6195. enabled_any arm aarch64 && nogas=die
  6196. enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
  6197. as_noop=-v
  6198.  
  6199. case $as_type in
  6200. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  6201. gcc) gaspp_as_type=gas ;;
  6202. *) gaspp_as_type=$as_type ;;
  6203. esac
  6204.  
  6205. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  6206.  
  6207. test "${as#*gas-preprocessor.pl}" != "$as" ||
  6208. check_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
  6209. gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
  6210.  
  6211. if ! check_gas ; then
  6212. as=${gas:=$as}
  6213. check_gas || \
  6214. $nogas "GNU assembler not found, install/update gas-preprocessor"
  6215. fi
  6216.  
  6217. check_as <<EOF && enable as_func
  6218. .func test
  6219. .endfunc
  6220. EOF
  6221. fi
  6222.  
  6223. check_inline_asm inline_asm_labels '"1:\n"'
  6224.  
  6225. check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
  6226.  
  6227. if enabled aarch64; then
  6228. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  6229. # internal assembler in clang 3.3 does not support this instruction
  6230. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  6231. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  6232.  
  6233. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  6234.  
  6235. elif enabled alpha; then
  6236.  
  6237. check_cflags -mieee
  6238.  
  6239. elif enabled arm; then
  6240.  
  6241. enabled msvc && check_cpp_condition stddef.h "defined _M_ARMT" && enable thumb
  6242.  
  6243. check_cpp_condition stddef.h "defined __thumb__" && check_cc <<EOF && enable_weak thumb
  6244. float func(float a, float b){ return a+b; }
  6245. EOF
  6246.  
  6247. enabled thumb && check_cflags -mthumb || check_cflags -marm
  6248.  
  6249. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  6250. enable vfp_args
  6251. elif check_cpp_condition stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
  6252. enable vfp_args
  6253. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
  6254. case "${cross_prefix:-$cc}" in
  6255. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  6256. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  6257. __asm__ (".eabi_attribute 28, 1");
  6258. int main(void) { return 0; }
  6259. EOF
  6260. esac
  6261. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  6262. fi
  6263.  
  6264. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  6265. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  6266. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  6267. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  6268. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  6269. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  6270. enabled setend && check_insn setend 'setend be'
  6271.  
  6272. [ $target_os = linux ] || [ $target_os = android ] ||
  6273. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  6274. $ARCH_EXT_LIST_ARM
  6275.  
  6276. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  6277.  
  6278. check_as <<EOF && enable as_dn_directive
  6279. ra .dn d0.i16
  6280. .unreq ra
  6281. EOF
  6282.  
  6283. # llvm's integrated assembler supports .object_arch from llvm 3.5
  6284. [ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
  6285. .object_arch armv4
  6286. EOF
  6287.  
  6288. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  6289.  
  6290. elif enabled mips; then
  6291.  
  6292. enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"'
  6293. enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
  6294. enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
  6295.  
  6296. # Enable minimum ISA based on selected options
  6297. if enabled mips64; then
  6298. enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
  6299. enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
  6300. disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
  6301. else
  6302. enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
  6303. enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
  6304. enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
  6305. disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
  6306. fi
  6307.  
  6308. enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float'
  6309. enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
  6310. enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_header msa.h || disable msa
  6311. enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
  6312. enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
  6313.  
  6314. elif enabled parisc; then
  6315.  
  6316. if enabled gcc; then
  6317. case $($cc -dumpversion) in
  6318. 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
  6319. esac
  6320. fi
  6321.  
  6322. elif enabled ppc; then
  6323.  
  6324. enable local_aligned_8 local_aligned_16 local_aligned_32
  6325.  
  6326. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  6327. check_inline_asm ibm_asm '"add 0, 0, 0"'
  6328. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  6329. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  6330.  
  6331. # AltiVec flags: The FSF version of GCC differs from the Apple version
  6332. if enabled altivec; then
  6333. check_cflags -maltivec -mabi=altivec &&
  6334. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  6335. check_cflags -faltivec
  6336. check_cxxflags -maltivec -mabi=altivec &&
  6337. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  6338. check_cxxflags -faltivec
  6339.  
  6340. # check if our compiler supports Motorola AltiVec C API
  6341. check_cc <<EOF || disable altivec
  6342. $inc_altivec_h
  6343. int main(void) {
  6344. vector signed int v1 = (vector signed int) { 0 };
  6345. vector signed int v2 = (vector signed int) { 1 };
  6346. v1 = vec_add(v1, v2);
  6347. return 0;
  6348. }
  6349. EOF
  6350.  
  6351. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  6352. fi
  6353.  
  6354. if enabled vsx; then
  6355. check_cflags -mvsx &&
  6356. check_builtin vec_vsx_ld "altivec.h" "__builtin_vec_vsx_ld" || disable vsx
  6357. fi
  6358.  
  6359. if enabled power8; then
  6360. check_cpp_condition "altivec.h" "defined(_ARCH_PWR8)" || disable power8
  6361. fi
  6362.  
  6363. elif enabled x86; then
  6364.  
  6365. check_builtin rdtsc intrin.h "__rdtsc()"
  6366. check_builtin mm_empty mmintrin.h "_mm_empty()"
  6367.  
  6368. enable local_aligned_8 local_aligned_16 local_aligned_32
  6369.  
  6370. # check whether EBP is available on x86
  6371. # As 'i' is stored on the stack, this program will crash
  6372. # if the base pointer is used to access it because the
  6373. # base pointer is cleared in the inline assembly code.
  6374. check_exec_crash <<EOF && enable ebp_available
  6375. volatile int i=0;
  6376. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  6377. return i;
  6378. EOF
  6379.  
  6380. # check whether EBX is available on x86
  6381. check_inline_asm ebx_available '""::"b"(0)' &&
  6382. check_inline_asm ebx_available '"":::"%ebx"'
  6383.  
  6384. # check whether xmm clobbers are supported
  6385. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  6386.  
  6387. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
  6388. check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
  6389.  
  6390. # check whether binutils is new enough to compile SSSE3/MMXEXT
  6391. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  6392. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  6393.  
  6394. if ! disabled_any asm mmx yasm; then
  6395. if check_cmd $yasmexe --version; then
  6396. enabled x86_64 && yasm_extra="-m amd64"
  6397. yasm_debug="-g dwarf2"
  6398. elif check_cmd nasm -v; then
  6399. yasmexe=nasm
  6400. yasm_debug="-g -F dwarf"
  6401. if enabled x86_64; then
  6402. case "$objformat" in
  6403. elf) objformat=elf64 ;;
  6404. win32) objformat=win64 ;;
  6405. esac
  6406. fi
  6407. fi
  6408.  
  6409. YASMFLAGS="-f $objformat $yasm_extra"
  6410. enabled pic && append YASMFLAGS "-DPIC"
  6411. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  6412. case "$objformat" in
  6413. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  6414. esac
  6415.  
  6416. check_yasm "movbe ecx, [5]" && enable yasm ||
  6417. die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
  6418. check_yasm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
  6419. check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
  6420. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  6421. check_yasm "CPU amdnop" || disable cpunop
  6422. fi
  6423.  
  6424. case "$cpu" in
  6425. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  6426. disable fast_clz
  6427. ;;
  6428. esac
  6429.  
  6430. fi
  6431.  
  6432. check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
  6433.  
  6434. check_ldflags -Wl,--as-needed
  6435. check_ldflags -Wl,-z,noexecstack
  6436.  
  6437. if check_func dlopen && check_func dlsym; then
  6438. ldl=
  6439. elif check_func dlopen -ldl && check_func dlsym -ldl; then
  6440. ldl=-ldl
  6441. fi
  6442.  
  6443. decklink_outdev_extralibs="$decklink_outdev_extralibs $ldl"
  6444. decklink_indev_extralibs="$decklink_indev_extralibs $ldl"
  6445. frei0r_filter_extralibs='$ldl'
  6446. frei0r_src_filter_extralibs='$ldl'
  6447. ladspa_filter_extralibs='$ldl'
  6448. nvenc_extralibs='$ldl'
  6449. coreimage_filter_extralibs="-framework QuartzCore -framework AppKit -framework OpenGL"
  6450. coreimagesrc_filter_extralibs="-framework QuartzCore -framework AppKit -framework OpenGL"
  6451.  
  6452. if ! disabled network; then
  6453. check_func getaddrinfo $network_extralibs
  6454. check_func inet_aton $network_extralibs
  6455.  
  6456. check_type netdb.h "struct addrinfo"
  6457. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  6458. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  6459. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  6460. check_type poll.h "struct pollfd"
  6461. check_type netinet/sctp.h "struct sctp_event_subscribe"
  6462. check_struct "sys/socket.h" "struct msghdr" msg_flags
  6463. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  6464. check_type netinet/in.h "struct sockaddr_in6"
  6465. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  6466. check_type "sys/types.h sys/socket.h" socklen_t
  6467.  
  6468. # Prefer arpa/inet.h over winsock2
  6469. if check_header arpa/inet.h ; then
  6470. check_func closesocket
  6471. elif check_header winsock2.h ; then
  6472. check_func_headers winsock2.h closesocket -lws2 &&
  6473. network_extralibs="-lws2" ||
  6474. { check_func_headers winsock2.h closesocket -lws2_32 &&
  6475. network_extralibs="-lws2_32"; } || disable winsock2_h network
  6476. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  6477.  
  6478. check_type ws2tcpip.h socklen_t
  6479. check_type ws2tcpip.h "struct addrinfo"
  6480. check_type ws2tcpip.h "struct group_source_req"
  6481. check_type ws2tcpip.h "struct ip_mreq_source"
  6482. check_type ws2tcpip.h "struct ipv6_mreq"
  6483. check_type winsock2.h "struct pollfd"
  6484. check_struct winsock2.h "struct sockaddr" sa_len
  6485. check_type ws2tcpip.h "struct sockaddr_in6"
  6486. check_type ws2tcpip.h "struct sockaddr_storage"
  6487. else
  6488. disable network
  6489. fi
  6490. fi
  6491.  
  6492. # "CPU_CLIP" test for SRC / libsamplerate
  6493. # test positive wrap
  6494. check_exec -lm << EOF && enable cpu_clips_positive
  6495. #define _ISOC9X_SOURCE 1
  6496. #define _ISOC99_SOURCE 1
  6497. #define __USE_ISOC99 1
  6498. #define __USE_ISOC9X 1
  6499. #include <math.h>
  6500. int main (void)
  6501. { double fval ;
  6502. int k, ival ;
  6503.  
  6504. fval = 1.0 * 0x7FFFFFFF ;
  6505. for (k = 0 ; k < 100 ; k++)
  6506. {
  6507. ival = (lrint (fval)) >> 24 ;
  6508. if (ival != 127)
  6509. return 1 ;
  6510.  
  6511. fval *= 1.2499999 ;
  6512. } ;
  6513.  
  6514. return 0 ;
  6515. }
  6516. EOF
  6517.  
  6518. # test negative wrap
  6519. check_exec -lm << EOF && enable cpu_clips_negative
  6520. #define _ISOC9X_SOURCE 1
  6521. #define _ISOC99_SOURCE 1
  6522. #define __USE_ISOC99 1
  6523. #define __USE_ISOC9X 1
  6524. #include <math.h>
  6525. int main (void)
  6526. {
  6527. double fval ;
  6528. int k, ival ;
  6529.  
  6530. fval = -8.0 * 0x10000000 ;
  6531. for (k = 0 ; k < 100 ; k++)
  6532. {
  6533. ival = (lrint (fval)) >> 24 ;
  6534. if (ival != -128)
  6535. return 1 ;
  6536.  
  6537. fval *= 1.2499999 ;
  6538. } ;
  6539.  
  6540. return 0 ;
  6541. }
  6542. EOF
  6543.  
  6544. # required to compile inline sse with some compilers
  6545. enabled x86 && enabled sse2 && add_cxxflags "-msse"
  6546.  
  6547. # test for distcc
  6548. enabled distcc && check_cmd distcc --version || disable distcc
  6549. if enabled distcc; then
  6550. XYZ=`which $cc`
  6551. if test x"$XYZ" != x"" -a x"`ls -l $XYZ | grep distcc`" != x""; then
  6552. distcc="symlink"
  6553. distcc_txt=" $cc"
  6554. fi
  6555. fi
  6556.  
  6557. # test for ccache
  6558. enabled ccache && check_cmd ccache -V || disable ccache
  6559. if enabled ccache; then
  6560. XYZ=`which $cc`
  6561. if test x"$XYZ" != x"" -a x"`ls -l $XYZ | grep ccache`" != x""; then
  6562. ccache="symlink"
  6563. ccache_txt=" $cc"
  6564. fi
  6565. fi
  6566.  
  6567. # ccache should be used before distcc for better cache coherency
  6568. if enabled distcc; then
  6569. if disabled ccache; then
  6570. cc="distcc $cc"
  6571. cxx="distcc $cxx"
  6572. elif enabled ccache; then
  6573. cc="ccache distcc $cc"
  6574. cxx="ccache distcc $cxx"
  6575. else
  6576. disable distcc
  6577. distcc_txt="t using distcc explicitly, since ccache symlink is present"
  6578. fi
  6579. else
  6580. if enabled ccache; then
  6581. cc="ccache $cc"
  6582. cxx="ccache $cxx"
  6583. fi
  6584. fi
  6585.  
  6586. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  6587. check_builtin atomic_compare_exchange "" "int *ptr, *oldval; int newval; __atomic_compare_exchange_n(ptr, oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)"
  6588. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  6589. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  6590. check_builtin sarestart signal.h "SA_RESTART"
  6591. check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" -lpthread
  6592. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  6593. check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
  6594. check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
  6595. check_builtin x264_csp_bgr "stdint.h x264.h" "X264_CSP_BGR"
  6596.  
  6597. case "$custom_allocator" in
  6598. jemalloc)
  6599. # jemalloc by default does not use a prefix
  6600. require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
  6601. ;;
  6602. tcmalloc)
  6603. require_pkg_config libtcmalloc gperftools/tcmalloc.h tc_malloc
  6604. malloc_prefix=tc_
  6605. ;;
  6606. esac
  6607.  
  6608. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  6609. check_func ${malloc_prefix}memalign && enable memalign
  6610. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  6611.  
  6612. check_func access
  6613. check_func_headers stdlib.h arc4random
  6614. check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  6615. check_func fcntl
  6616. check_func fork
  6617. check_func gethrtime
  6618. check_func getopt
  6619. check_func getrusage
  6620. check_func gettimeofday
  6621. check_func isatty
  6622. check_func mach_absolute_time
  6623. check_func mkstemp
  6624. check_func mmap
  6625. check_func mprotect
  6626. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  6627. check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt && LIBRT="-lrt"; }
  6628. check_func sched_getaffinity
  6629. check_func setrlimit
  6630. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  6631. check_func strerror_r
  6632. check_func sysconf
  6633. check_func sysctl
  6634. check_func usleep
  6635.  
  6636. check_func_headers conio.h kbhit
  6637. check_func_headers io.h setmode
  6638. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  6639. check_func_headers stdlib.h getenv
  6640. check_func_headers sys/stat.h lstat
  6641.  
  6642. check_func_headers windows.h CoTaskMemFree -lole32
  6643. check_func_headers windows.h GetProcessAffinityMask
  6644. check_func_headers windows.h GetProcessTimes
  6645. check_func_headers windows.h GetSystemTimeAsFileTime
  6646. check_func_headers windows.h LoadLibrary
  6647. check_func_headers windows.h MapViewOfFile
  6648. check_func_headers windows.h PeekNamedPipe
  6649. check_func_headers windows.h SetConsoleTextAttribute
  6650. check_func_headers windows.h SetConsoleCtrlHandler
  6651. check_func_headers windows.h Sleep
  6652. check_func_headers windows.h VirtualAlloc
  6653. check_struct windows.h "CONDITION_VARIABLE" Ptr
  6654. check_func_headers glob.h glob
  6655. enabled xlib &&
  6656. check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  6657.  
  6658. check_header AudioToolbox/AudioToolbox.h
  6659. check_header direct.h
  6660. check_header dirent.h
  6661. check_header dlfcn.h
  6662. check_header d3d11.h
  6663. check_header dxva.h
  6664. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  6665. check_header fcntl.h
  6666. check_header io.h
  6667. check_header libcrystalhd/libcrystalhd_if.h
  6668. check_header mach/mach_time.h
  6669. check_header malloc.h
  6670. check_header net/udplite.h
  6671. check_header poll.h
  6672. check_header sys/mman.h
  6673. check_header sys/param.h
  6674. check_header sys/resource.h
  6675. check_header sys/select.h
  6676. check_header sys/time.h
  6677. check_header sys/un.h
  6678. check_header termios.h
  6679. check_header unistd.h
  6680. check_header valgrind/valgrind.h
  6681. check_header vdpau/vdpau.h
  6682. check_header vdpau/vdpau_x11.h
  6683. check_header VideoDecodeAcceleration/VDADecoder.h
  6684. check_header VideoToolbox/VideoToolbox.h
  6685. check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
  6686. enabled videotoolbox && check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 -framework CoreVideo
  6687. check_header windows.h
  6688. #check_header X11/extensions/XvMClib.h
  6689. check_header asm/types.h
  6690.  
  6691. #Myth check for MYTHTV_HAVE_LIST
  6692. check_header byteswap.h
  6693. check_header sys/endian.h
  6694. check_header va/va.h
  6695. check_header va/va_x11.h
  6696. check_header va/va_glx.h
  6697. check_struct dxva2api.h DXVA_PictureParameters wDecodedPictureIndex
  6698. check_func posix_fadvise
  6699. check_func_headers sys/timeb.h ftime
  6700. check_func_headers "sys/types.h sys/socket.h ifaddrs.h" getifaddrs
  6701. check_func_headers sys/time.h gettimeofday
  6702. #End MythTV check
  6703.  
  6704. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  6705. check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  6706. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  6707. check_lib "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework CoreServices"
  6708.  
  6709. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  6710.  
  6711. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  6712. check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  6713. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  6714. check_type "windows.h d3d11.h" "ID3D11VideoContext"
  6715. check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
  6716.  
  6717. check_type "va/va.h" "VAPictureParameterBufferHEVC"
  6718. check_type "va/va.h" "VADecPictureParameterBufferVP9"
  6719. check_type "va/va.h va/va_vpp.h" "VAProcPipelineParameterBuffer"
  6720. check_type "va/va.h va/va_enc_h264.h" "VAEncPictureParameterBufferH264"
  6721. check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
  6722. check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
  6723.  
  6724. check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
  6725.  
  6726. check_cpp_condition windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" && enable winrt || disable winrt
  6727.  
  6728. # check for OpenMAX header & lib
  6729. if enabled openmax ; then
  6730. openmax_was_enabled=Y
  6731. fi
  6732. if ! disabled openmax; then
  6733. test -f /opt/vc/include/IL/OMX_Core.h && enable openmax
  6734. fi
  6735. if ! disabled openmax; then
  6736. if test -f /opt/vc/include/IL/OMX_Broadcom.h \
  6737. && test -f /opt/vc/lib/libopenmaxil.so ; then
  6738. enable openmax_broadcom
  6739. elif test -f /usr/include/bellagio/omxcore.h \
  6740. && test -f /usr/lib/libomxil-bellagio.so; then
  6741. enable openmax_bellagio
  6742. else
  6743. disable openmax
  6744. fi
  6745. fi
  6746.  
  6747. if test "$openmax_was_enabled" = "Y" && disabled openmax ; then
  6748. die "ERROR - Unable to enable openmax"
  6749. fi
  6750.  
  6751. if ! disabled w32threads && ! enabled pthreads; then
  6752. check_func_headers "windows.h process.h" _beginthreadex &&
  6753. enable w32threads || disable w32threads
  6754. if ! enabled w32threads && enabled winrt; then
  6755. check_func_headers "windows.h" CreateThread &&
  6756. enable w32threads || disable w32threads
  6757. fi
  6758. fi
  6759.  
  6760. # check for some common methods of building with pthread support
  6761. # do this before the optional library checks as some of them require pthreads
  6762. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  6763. enable pthreads
  6764. if check_func pthread_join -pthread && check_func pthread_create -pthread; then
  6765. add_cflags -pthread
  6766. add_cxxflags -pthread
  6767. add_extralibs -pthread
  6768. elif check_func pthread_join -pthreads && check_func pthread_create -pthreads; then
  6769. add_cflags -pthreads
  6770. add_cxxflags -pthread
  6771. add_extralibs -pthreads
  6772. elif check_func pthread_join -ldl -pthread && check_func pthread_create -ldl -pthread; then
  6773. add_cflags -ldl -pthread
  6774. add_extralibs -ldl -pthread
  6775. elif check_func pthread_join -lpthreadGC2 && check_func pthread_create -lpthreadGC2; then
  6776. add_extralibs -lpthreadGC2
  6777. elif check_lib pthread.h pthread_join -lpthread && check_lib pthread.h pthread_create -lpthread; then
  6778. :
  6779. elif ! check_func pthread_join && ! check_func pthread_create; then
  6780. disable pthreads
  6781. fi
  6782. check_code cc "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER" || disable pthreads
  6783. fi
  6784.  
  6785.  
  6786. if enabled pthreads; then
  6787. check_func pthread_cancel
  6788. fi
  6789.  
  6790. enabled ffmpeg_pthreads && enable pthreads
  6791.  
  6792. # Check for libuuid for zeromq
  6793. enabled mythlogserver || disable libuuid
  6794. if enabled libuuid ; then
  6795. check_lib uuid/uuid.h uuid_generate -luuid || disable libuuid
  6796. if disabled libuuid ; then
  6797. die "ERROR: can not find libuuid. (debian uuid-dev; RedHat libuuid-devel)"
  6798. fi
  6799. fi
  6800.  
  6801. # Check for taglib for libmythmetadata
  6802. if enabled taglib; then
  6803. taglib_minor="0"
  6804. if test x`which taglib-config` != x"" ; then
  6805. taglib_minor=`taglib-config --version | cut -d. -f2`
  6806. if test x"$taglib_minor" = x"" ; then
  6807. echo "Can't find taglib-config. Assuming 1.7 or later."
  6808. taglib_minor="7"
  6809. fi
  6810. if test $target_os = android ; then
  6811. tagprefix=`taglib-config --prefix`
  6812. else
  6813. tagprefix=${sysroot}`taglib-config --prefix`
  6814. fi
  6815. tagincludes="-I${tagprefix}/include"
  6816. taglibs=`taglib-config --libs`
  6817. fi
  6818.  
  6819. if test $taglib_minor -lt 7 || ! check_class_headers_cpp "taglib/fileref.h stdlib.h" TagLib::FileRef $tagincludes $taglibs -lstdc++; then
  6820. die "ERROR: cannot find taglib 1.7 or later."
  6821. fi
  6822. fi
  6823.  
  6824. # Attempt to use libudev for mediamonitor
  6825. enabled libudev && check_lib2 libudev.h udev_new -ludev || disable libudev
  6826.  
  6827. # libmythbluray
  6828. antbin=""
  6829. if enabled bdjava; then
  6830. enabled x86_64 && java_arch=amd64
  6831. enabled x86_32 && java_arch=i386
  6832. enabled arm && java_arch=arm
  6833.  
  6834. antbin=`which ant`
  6835. if test x"$antbin" = x"" ; then
  6836. die "ERROR: BD-J requires ANT, but ant was not found. Please install it."
  6837. fi
  6838.  
  6839. if test "$bdj_type" = "j2me"; then
  6840. enable bdj_j2me
  6841. fi
  6842.  
  6843. # Probably makes little sense to try to process Bluray menus without fontconfig
  6844. enable fontconfig
  6845. fi
  6846.  
  6847. enabled pthreads &&
  6848. check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)"
  6849.  
  6850. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  6851. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  6852. disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma
  6853.  
  6854. check_lib math.h sin -lm && LIBM="-lm"
  6855. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  6856.  
  6857. atan2f_args=2
  6858. copysign_args=2
  6859. hypot_args=2
  6860. ldexpf_args=2
  6861. powf_args=2
  6862.  
  6863. for func in $MATH_FUNCS; do
  6864. eval check_mathfunc $func \${${func}_args:-1}
  6865. done
  6866.  
  6867. for func in $COMPLEX_FUNCS; do
  6868. eval check_complexfunc $func \${${func}_args:-1}
  6869. done
  6870.  
  6871. # Enable CUVID by default if CUDA is enabled
  6872. if enabled cuda && ! disabled cuvid; then
  6873. enable cuvid
  6874. fi
  6875.  
  6876. # these are off by default, so fail if requested and not available
  6877. enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
  6878. enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
  6879. check_lib2 ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework ApplicationServices; }
  6880. enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
  6881. { check_lib2 "dlfcn.h" dlopen -ldl; } ||
  6882. die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
  6883. enabled cuda && { check_lib cuda.h cuInit -lcuda ||
  6884. die "ERROR: CUDA not found"; }
  6885. enabled cuvid && { add_cflags -I$source_path;
  6886. check_lib "compat/cuda/cuviddec.h" cuvidCreateDecoder -lnvcuvid ||
  6887. die "ERROR: CUVID not found"; } &&
  6888. { enabled cuda ||
  6889. die "ERROR: CUVID requires CUDA"; }
  6890. enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
  6891. enabled coreimage_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimage_filter; }
  6892. enabled coreimagesrc_filter && { check_header_objcc QuartzCore/CoreImage.h || disable coreimagesrc_filter; }
  6893. enabled decklink && { { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; } &&
  6894. { check_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a060100" || die "ERROR: Decklink API version must be >= 10.6.1."; } }
  6895. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  6896. enabled gmp && require2 gmp gmp.h mpz_export -lgmp
  6897. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  6898. enabled jni && { [ $target_os = "android" ] && check_header jni.h && enabled pthreads &&
  6899. check_lib2 "dlfcn.h" dlopen -ldl; }
  6900. enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
  6901. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  6902. #enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  6903. enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
  6904. enabled libbs2b && require_pkg_config libbs2b bs2b.h bs2b_open
  6905. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  6906. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  6907. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  6908. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  6909. enabled libebur128 && require ebur128 ebur128.h ebur128_relative_threshold -lebur128
  6910. enabled libfdk_aac && { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
  6911. { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
  6912. warn "using libfdk without pkg-config"; } }
  6913. flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
  6914. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  6915. enabled fontconfig && enable libfontconfig
  6916. enabled libfontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  6917. enabled libfreetype && require_libfreetype
  6918. enabled libfribidi && require_pkg_config fribidi fribidi.h fribidi_version_info
  6919. enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
  6920. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  6921. check_lib "${gsm_hdr}" gsm_create -lgsm && break;
  6922. done || die "ERROR: libgsm not found"; }
  6923. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  6924. enabled libkvazaar && require_pkg_config "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
  6925. enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
  6926. enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
  6927. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  6928. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  6929. enabled libnpp && require libnpp npp.h nppGetLibVersion -lnppi -lnppc
  6930. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  6931. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  6932. enabled libopencv && { check_header opencv2/core/core_c.h &&
  6933. { use_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
  6934. require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
  6935. require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
  6936. enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
  6937. enabled libopenjpeg && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
  6938. check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
  6939. { check_lib2 openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
  6940. { check_lib2 openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
  6941. { check_lib2 openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
  6942. die "ERROR: libopenjpeg not found"; }
  6943. enabled libopenmpt && require_pkg_config "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
  6944. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  6945. enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
  6946. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  6947. enabled librubberband && require_pkg_config "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new
  6948. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  6949. enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
  6950. enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
  6951. require smbclient libsmbclient.h smbc_init -lsmbclient; }
  6952. enabled libsnappy && require snappy snappy-c.h snappy_compress -lsnappy
  6953. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr && LIBSOXR="-lsoxr"
  6954. enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
  6955. enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
  6956. enabled libtesseract && require_pkg_config tesseract tesseract/capi.h TessBaseAPICreate
  6957. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  6958. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  6959. { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  6960. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  6961. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  6962. enabled libvidstab && require_pkg_config "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
  6963. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  6964. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  6965.  
  6966. enabled libvpx && {
  6967. enabled libvpx_vp8_decoder && {
  6968. use_pkg_config "vpx >= 0.9.1" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
  6969. check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  6970. die "ERROR: libvpx decoder version must be >=0.9.1";
  6971. }
  6972. enabled libvpx_vp8_encoder && {
  6973. use_pkg_config "vpx >= 0.9.7" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
  6974. check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
  6975. die "ERROR: libvpx encoder version must be >=0.9.7";
  6976. }
  6977. enabled libvpx_vp9_decoder && {
  6978. use_pkg_config "vpx >= 1.3.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
  6979. check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx ||
  6980. disable libvpx_vp9_decoder;
  6981. }
  6982. enabled libvpx_vp9_encoder && {
  6983. use_pkg_config "vpx >= 1.3.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
  6984. check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx ||
  6985. disable libvpx_vp9_encoder;
  6986. }
  6987. if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
  6988. die "libvpx enabled but no supported decoders found"
  6989. fi
  6990. }
  6991.  
  6992. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  6993. enabled libwebp && {
  6994. enabled libwebp_encoder && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
  6995. enabled libwebp_anim_encoder && { use_pkg_config "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit || disable libwebp_anim_encoder; } }
  6996. enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
  6997. { require libx264 x264.h x264_encoder_encode -lx264 &&
  6998. warn "using libx264 without pkg-config"; } } &&
  6999. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  7000. die "ERROR: libx264 must be installed and version must be >= 0.118."; } &&
  7001. { check_cpp_condition x264.h "X264_MPEG2" &&
  7002. enable libx262; }
  7003. enabled libx265 && require_pkg_config x265 x265.h x265_api_get &&
  7004. { check_cpp_condition x265.h "X265_BUILD >= 68" ||
  7005. die "ERROR: libx265 version must be >= 68."; }
  7006. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  7007. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  7008. enabled libzimg && require_pkg_config zimg zimg.h zimg_get_api_version
  7009. enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
  7010. enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi &&
  7011. { check_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
  7012. enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
  7013. enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
  7014. enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  7015. { ! enabled cross_compile && {
  7016. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline ;
  7017. add_extralibs -L/opt/vc/lib/ -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ;
  7018. check_lib interface/mmal/mmal.h mmal_port_connect ; }
  7019. check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
  7020. die "ERROR: mmal not found"; }
  7021. enabled mmal && check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"
  7022.  
  7023. enabled netcdf && require_pkg_config netcdf netcdf.h nc_inq_libvers
  7024. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  7025. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  7026. die "ERROR: openal not found"; } &&
  7027. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  7028. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  7029. enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  7030. check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  7031. die "ERROR: opencl not found"; } &&
  7032. { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  7033. check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  7034. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  7035. enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
  7036. check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
  7037. check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
  7038. check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
  7039. check_lib2 GLES/gl.h glGetError "-Wl,-framework,OpenGLES" ||
  7040. { check_lib2 GLES2/gl2.h glGetError "-lGLESv2" &&
  7041. check_lib2 EGL/egl.h eglGetProcAddress "-lEGL"
  7042. } ||
  7043. die "ERROR: opengl not found."
  7044. }
  7045. enabled omx_rpi && enable omx
  7046. enabled omx && { check_header OMX_Core.h ||
  7047. { ! enabled cross_compile && enabled omx_rpi && {
  7048. add_cflags -isystem/opt/vc/include/IL ; }
  7049. check_header OMX_Core.h ; } ||
  7050. die "ERROR: OpenMAX IL headers not found"; }
  7051. enabled openssl && { use_pkg_config openssl openssl/ssl.h OPENSSL_init_ssl ||
  7052. use_pkg_config openssl openssl/ssl.h SSL_library_init ||
  7053. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  7054. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  7055. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  7056. die "ERROR: openssl not found"; }
  7057. enabled qtkit_indev && { check_header_objcc QTKit/QTKit.h || disable qtkit_indev; }
  7058.  
  7059. if enabled libmpeg2external; then
  7060. check_lib mpeg2dec/mpeg2.h mpeg2_init -lmpeg2 || disable libmpeg2external
  7061. if disabled libmpeg2external; then
  7062. die "Warning! No suitable external libmpeg2 found, use internal copy."
  7063. fi
  7064. disable mythtranscode
  7065. fi
  7066.  
  7067. # libdc1394 check
  7068. if enabled libdc1394; then
  7069. { require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new &&
  7070. enable libdc1394_2; } ||
  7071. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  7072. enable libdc1394_1; } ||
  7073. die "ERROR: No version of libdc1394 found "
  7074. fi
  7075.  
  7076. if enabled gcrypt; then
  7077. GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
  7078. if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
  7079. gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
  7080. gcrypt_libs=$("${GCRYPT_CONFIG}" --libs)
  7081. check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_libs ||
  7082. die "ERROR: gcrypt not found"
  7083. add_cflags $gcrypt_cflags && add_extralibs $gcrypt_libs
  7084. else
  7085. require2 gcrypt gcrypt.h gcry_mpi_new -lgcrypt
  7086. fi
  7087. fi
  7088.  
  7089. check_header stdint.h
  7090.  
  7091. # test for lrint in math.h
  7092. check_exec <<EOF && lrint=yes || lrint=no
  7093. #define _ISOC9X_SOURCE 1
  7094. #include <math.h>
  7095. int main( void ) { return (lrint(3.999f) > 0)?0:1; }
  7096. EOF
  7097.  
  7098. #test for round()
  7099. check_exec <<EOF && round=yes || round=no
  7100. #define _ISOC9X_SOURCE 1
  7101. #include <math.h>
  7102. int main( void ) { return (round(3.999f) > 0)?0:1; }
  7103. EOF
  7104.  
  7105. # test for sync_file_range (linux only system call since 2.6.17)
  7106. check_ld "cc" <<EOF #&& enable sync_file_range
  7107. #define _GNU_SOURCE
  7108. #include <fcntl.h>
  7109.  
  7110. int main(int argc, char **argv){
  7111. sync_file_range(0,0,0,0);
  7112. return 0;
  7113. }
  7114. EOF
  7115.  
  7116. # test for sizeof(int)
  7117. for sizeof in 1 2 4 8 16; do
  7118. check_cc <<EOF && _sizeof_int=$sizeof && break
  7119. void foo(){switch (0) case 0: case (sizeof(int) == $sizeof):;}
  7120. EOF
  7121. done
  7122.  
  7123. # test for sizeof(long)
  7124. for sizeof in 1 2 4 8 16; do
  7125. check_cc <<EOF && _sizeof_long=$sizeof && break
  7126. void foo(){switch (0) case 0: case (sizeof(long) == $sizeof):;}
  7127. EOF
  7128. done
  7129.  
  7130. check_foo_config freetype2 freetype ft2build.h FT_Init_FreeType
  7131.  
  7132. enabled freetype2 ||
  7133. die "ERROR! You must have FreeType installed to compile MythTV."
  7134.  
  7135.  
  7136. ##########################################
  7137. disabled sdl && disable sdl2
  7138. if ! disabled sdl2; then
  7139. SDL2_CONFIG="${cross_prefix}sdl2-config"
  7140. if check_pkg_config sdl2 SDL_events.h SDL_PollEvent; then
  7141. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
  7142. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
  7143. check_func SDL_Init $sdl2_libs $sdl2_cflags && enable sdl2
  7144. else
  7145. if "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
  7146. sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
  7147. sdl2_libs=$("${SDL2_CONFIG}" --libs)
  7148. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
  7149. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
  7150. check_func SDL_Init $sdl2_libs $sdl2_cflags && enable sdl2
  7151. fi
  7152. fi
  7153. if test $target_os = "mingw32"; then
  7154. sdl2_libs="$sdl2_libs -mconsole"
  7155. fi
  7156. fi
  7157. enabled sdl2 && add_cflags $sdl2_cflags && add_extralibs $sdl2_libs
  7158.  
  7159. disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  7160. check_lib2 "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
  7161. enable securetransport; }
  7162.  
  7163. disabled schannel || { check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
  7164. check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lsecur32; }
  7165.  
  7166. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  7167. enabled makeinfo \
  7168. && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
  7169. && enable makeinfo_html || disable makeinfo_html
  7170. disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  7171. perl -v > /dev/null 2>&1 && enable perl || disable perl
  7172. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  7173. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  7174.  
  7175. check_header linux/fb.h
  7176. check_header linux/videodev.h
  7177. check_header linux/videodev2.h
  7178. check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  7179.  
  7180. check_header sys/videoio.h
  7181. check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  7182.  
  7183. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  7184. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  7185. # w32api 3.12 had it defined wrong
  7186. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  7187.  
  7188. check_type "dshow.h" IBaseFilter
  7189.  
  7190. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  7191. { check_header dev/bktr/ioctl_meteor.h &&
  7192. check_header dev/bktr/ioctl_bt848.h; } ||
  7193. { check_header machine/ioctl_meteor.h &&
  7194. check_header machine/ioctl_bt848.h; } ||
  7195. { check_header dev/video/meteor/ioctl_meteor.h &&
  7196. check_header dev/video/bktr/ioctl_bt848.h; } ||
  7197. check_header dev/ic/bt8xx.h
  7198.  
  7199. check_header sndio.h
  7200. if check_struct sys/soundcard.h audio_buf_info bytes; then
  7201. enable_safe sys/soundcard.h
  7202. else
  7203. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  7204. #include <sys/soundcard.h>
  7205. audio_buf_info abc;
  7206. EOF
  7207. fi
  7208. check_header soundcard.h
  7209.  
  7210. enabled_any alsa_indev alsa_outdev &&
  7211. check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  7212.  
  7213. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack &&
  7214. check_func jack_port_get_latency_range -ljack
  7215.  
  7216. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  7217.  
  7218. # PulseAudio probe
  7219. ! disabled audio_pulse &&
  7220. check_lib pulse/version.h pa_get_library_version -lpulse &&
  7221. $(pkg-config --atleast-version=0.9.7 libpulse) &&
  7222. enable audio_pulse ||
  7223. disable audio_pulse
  7224.  
  7225. # Enable Pulse Audio output iff not disabled and pulse audio is available
  7226. if ! enabled audio_pulse ; then
  7227. disable audio_pulseoutput
  7228. elif ! disabled audio_pulseoutput ; then
  7229. enable audio_pulseoutput
  7230. fi
  7231.  
  7232. # ALSA probe
  7233. ! disabled audio_alsa &&
  7234. check_lib alsa/asoundlib.h snd_asoundlib_version -lasound &&
  7235. check_cpp_condition alsa/asoundlib.h "(defined(SND_PCM_NO_AUTO_RESAMPLE))" &&
  7236. enable audio_alsa ||
  7237. { { ! enabled audio_alsa || die "ERROR: Alsa >= 1.0.16 required"; } &&
  7238. disable audio_alsa; }
  7239.  
  7240. if enabled libcdio; then
  7241. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  7242. check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  7243. die "ERROR: No usable libcdio/cdparanoia found"
  7244. fi
  7245.  
  7246. enabled xlib &&
  7247. check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
  7248.  
  7249. if ! disabled libxcb; then
  7250. check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
  7251. enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
  7252. } && disable x11grab && enable libxcb
  7253.  
  7254. if enabled libxcb; then
  7255. disabled libxcb_shm || {
  7256. check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
  7257. enabled libxcb_shm && die "ERROR: libxcb_shm not found";
  7258. } && check_header sys/shm.h && enable libxcb_shm; }
  7259.  
  7260. disabled libxcb_xfixes || {
  7261. check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
  7262. enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
  7263. } && enable libxcb_xfixes; }
  7264.  
  7265. disabled libxcb_shape || {
  7266. check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
  7267. enabled libxcb_shape && die "ERROR: libxcb_shape not found";
  7268. } && enable libxcb_shape; }
  7269.  
  7270. add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
  7271. add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_libs
  7272. fi
  7273. fi
  7274.  
  7275. if enabled x11grab; then
  7276. enabled xlib || die "ERROR: Xlib not found"
  7277. require Xext X11/extensions/XShm.h XShmCreateImage -lXext
  7278. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  7279. fi
  7280.  
  7281. check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
  7282.  
  7283. enabled dxva2api_h &&
  7284. check_cc <<EOF && enable dxva2api_cobj
  7285. #define _WIN32_WINNT 0x0600
  7286. #define COBJMACROS
  7287. #include <windows.h>
  7288. #include <d3d9.h>
  7289. #include <dxva2api.h>
  7290. int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
  7291. EOF
  7292.  
  7293. enabled vaapi && enabled opengl &&
  7294. check_header GL/glx.h &&
  7295. check_lib va/va.h vaInitialize -lva ||
  7296. disable vaapi
  7297.  
  7298. enabled vaapi &&
  7299. check_code cc "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" ||
  7300. disable vaapi
  7301.  
  7302. if enabled vaapi ; then
  7303. enabled xlib &&
  7304. check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
  7305. enable vaapi_x11
  7306.  
  7307. check_lib2 "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm &&
  7308. enable vaapi_drm
  7309. fi
  7310.  
  7311. enabled vdpau &&
  7312. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  7313. disable vdpau
  7314.  
  7315. enabled vdpau && enabled xlib &&
  7316. check_lib2 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
  7317. enable vdpau_x11
  7318.  
  7319. if enabled x86; then
  7320. case $target_os in
  7321. mingw32*|mingw64*|win32|win64|linux|cygwin*)
  7322. ;;
  7323. *)
  7324. disable nvenc
  7325. ;;
  7326. esac
  7327. else
  7328. disable nvenc
  7329. fi
  7330.  
  7331. enabled nvenc &&
  7332. check_cc -I$source_path <<EOF || disable nvenc
  7333. #include "compat/nvenc/nvEncodeAPI.h"
  7334. NV_ENCODE_API_FUNCTION_LIST flist;
  7335. void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_PRESET_HQ_GUID } }; }
  7336. int main(void) { return 0; }
  7337. EOF
  7338.  
  7339. # Funny iconv installations are not unusual, so check it after all flags have been set
  7340. disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
  7341.  
  7342. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  7343. enabled debug && add_cxxflags -g"$debuglevel"
  7344.  
  7345. # add some useful compiler flags if supported
  7346. #check_cflags -Wdeclaration-after-statement
  7347. check_cflags -Wall
  7348. ! disabled optimizations && check_cflags -Wdisabled-optimization
  7349. check_cflags -Wpointer-arith
  7350. disabled icc && check_cflags -Wredundant-decls
  7351. check_cflags -Wwrite-strings
  7352. check_cflags -Wtype-limits
  7353. check_cflags -Wundef
  7354. #-Wmissing-prototypes breaks zeromq compilation in universal mode
  7355. if [ "$target_os" != "darwin" ]; then
  7356. check_cflags -Wmissing-prototypes
  7357. fi
  7358. check_cflags -Wno-pointer-to-int-cast
  7359. check_cflags -Wstrict-prototypes
  7360. check_cflags -Wempty-body
  7361. enabled extra_warnings && check_cflags -Winline
  7362. enabled extra_warnings && check_cflags -Wcast-qual
  7363.  
  7364. check_disable_warning(){
  7365. warning_flag=-W${1#-Wno-}
  7366. test_cflags $warning_flag && add_cflags $1
  7367. }
  7368.  
  7369. check_disable_warning -Wno-parentheses
  7370. disabled icc && check_disable_warning -Wno-switch
  7371. check_disable_warning -Wno-format-zero-length
  7372. check_disable_warning -Wno-pointer-sign
  7373. check_disable_warning -Wno-unused-const-variable
  7374.  
  7375. # C++ Flags
  7376. check_cxxflags -Wall
  7377. check_cxxflags -Wpointer-arith
  7378. #needed for INT64_C in libs/libavformat under g++
  7379. check_cxxflags -D__STDC_CONSTANT_MACROS
  7380. check_cxxflags -D__STDC_LIMIT_MACROS
  7381.  
  7382. # add some linker flags
  7383. check_ldflags -Wl,--warn-common
  7384. check_ldflags '-Wl,-rpath-link,\${SRC_PATH_BARE}/external/FFmpeg/libpostproc:\${SRC_PATH_BARE}/external/FFmpeg/libswresample:\${SRC_PATH_BARE}/external/FFmpeg/libswscale:\${SRC_PATH_BARE}/external/FFmpeg/libavfilter:\${SRC_PATH_BARE}/external/FFmpeg/libavdevice:\${SRC_PATH_BARE}/external/FFmpeg/libavformat:\${SRC_PATH_BARE}/external/FFmpeg/libavcodec:\${SRC_PATH_BARE}/external/FFmpeg/libavutil:\${SRC_PATH_BARE}/external/FFmpeg/libavresample'
  7385. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
  7386. enabled rpath && add_ldlibflags -Wl,-rpath,$libdir
  7387. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  7388.  
  7389. # add some strip flags
  7390. # -wN '..@*' is more selective than -x, but not available everywhere.
  7391. check_stripflags -wN \'..@*\' || check_stripflags -x
  7392.  
  7393. enabled neon_clobber_test &&
  7394. check_ldflags -Wl,--wrap,avcodec_open2 \
  7395. -Wl,--wrap,avcodec_decode_audio4 \
  7396. -Wl,--wrap,avcodec_decode_video2 \
  7397. -Wl,--wrap,avcodec_decode_subtitle2 \
  7398. -Wl,--wrap,avcodec_encode_audio2 \
  7399. -Wl,--wrap,avcodec_encode_video2 \
  7400. -Wl,--wrap,avcodec_send_packet \
  7401. -Wl,--wrap,avcodec_receive_frame \
  7402. -Wl,--wrap,avcodec_send_frame \
  7403. -Wl,--wrap,avcodec_receive_packet \
  7404. -Wl,--wrap,avcodec_encode_subtitle \
  7405. -Wl,--wrap,swr_convert \
  7406. -Wl,--wrap,avresample_convert ||
  7407. disable neon_clobber_test
  7408.  
  7409. enabled xmm_clobber_test &&
  7410. check_ldflags -Wl,--wrap,avcodec_open2 \
  7411. -Wl,--wrap,avcodec_decode_audio4 \
  7412. -Wl,--wrap,avcodec_decode_video2 \
  7413. -Wl,--wrap,avcodec_decode_subtitle2 \
  7414. -Wl,--wrap,avcodec_encode_audio2 \
  7415. -Wl,--wrap,avcodec_encode_video2 \
  7416. -Wl,--wrap,avcodec_encode_subtitle \
  7417. -Wl,--wrap,avcodec_send_packet \
  7418. -Wl,--wrap,avcodec_receive_frame \
  7419. -Wl,--wrap,avcodec_send_frame \
  7420. -Wl,--wrap,avcodec_receive_packet \
  7421. -Wl,--wrap,swr_convert \
  7422. -Wl,--wrap,avresample_convert \
  7423. -Wl,--wrap,sws_scale ||
  7424. disable xmm_clobber_test
  7425.  
  7426. check_ld "cc" <<EOF && enable proper_dce
  7427. extern const int array[512];
  7428. static inline int func(void) { return array[0]; }
  7429. int main(void) { return 0; }
  7430. EOF
  7431.  
  7432. if enabled proper_dce; then
  7433. echo "X { local: *; };" > $TMPV
  7434. if test_ldflags -Wl,${version_script},$TMPV; then
  7435. append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
  7436. check_cc <<EOF && enable symver_asm_label
  7437. void ff_foo(void) __asm__ ("av_foo@VERSION");
  7438. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  7439. EOF
  7440. check_cc <<EOF && enable symver_gnu_asm
  7441. __asm__(".symver ff_foo,av_foo@VERSION");
  7442. void ff_foo(void) {}
  7443. EOF
  7444. fi
  7445. fi
  7446.  
  7447. if [ -z "$optflags" ]; then
  7448. if enabled small; then
  7449. optflags=$cflags_size
  7450. elif enabled optimizations; then
  7451. optflags=$cflags_speed
  7452. else
  7453. optflags=$cflags_noopt
  7454. fi
  7455. fi
  7456.  
  7457. check_optflags(){
  7458. check_cflags "$@"
  7459. enabled lto && check_ldflags "$@"
  7460. }
  7461.  
  7462.  
  7463. if enabled lto; then
  7464. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  7465. check_cflags -flto
  7466. check_ldflags -flto $cpuflags
  7467. disable inline_asm_direct_symbol_refs
  7468. fi
  7469.  
  7470. check_optflags $optflags
  7471. check_optflags -fno-math-errno
  7472. check_optflags -fno-signed-zeros
  7473.  
  7474. enabled ftrapv && check_cflags -ftrapv
  7475.  
  7476. if enabled dvb; then
  7477. [ -d "$dvb_path" ] || dvb_path="${sysroot}/usr/include"
  7478. if test -f "$dvb_path"/linux/dvb/frontend.h ; then
  7479. if test -f "$dvb_path"/../MAINTAINERS ; then
  7480. echo "Warning: DVB location in kernel. May not compile."
  7481. fi
  7482. else
  7483. KERNEL_RELEASE=`uname -r 2>/dev/null`
  7484. if test x"$KERNEL_RELEASE" != x"" ; then
  7485. dvb_path="${sysroot}/usr/src/linux-$KERNEL_RELEASE/include"
  7486. [ -d "$dvb_path" ] ||\
  7487. dvb_path="${sysroot}/usr/src/linux-headers-$KERNEL_RELEASE/include/uapi"
  7488. else
  7489. dvb_path="${sysroot}/usr/src/linux/include"
  7490. fi
  7491.  
  7492. if test -f "$dvb_path"/linux/dvb/frontend.h ; then
  7493. if test -f "$dvb_path"/../MAINTAINERS ; then
  7494. echo "Warning: DVB location in kernel. May not compile."
  7495. fi
  7496. else
  7497. echo "DVB location needs to have linux/dvb/frontend.h [$dvb_path]"
  7498. disable dvb
  7499. fi
  7500. fi
  7501. fi
  7502.  
  7503.  
  7504. enabled dvb && check_cc -I"$dvb_path" <<EOF && enable fe_can_2g_modulation
  7505. #include <linux/dvb/frontend.h>
  7506. int main(void) {
  7507. if (FE_CAN_2G_MODULATION)
  7508. return 1;
  7509. return 0;
  7510. }
  7511. EOF
  7512.  
  7513. enabled asi && check_cc <<EOF || disable asi
  7514. #include <dveo/asi.h>
  7515. #include <dveo/master.h>
  7516. int main(void) { return 1; }
  7517. EOF
  7518.  
  7519. if enabled systemd_notify ; then
  7520. if check_pkg_config libsystemd-daemon systemd/sd-daemon.h sd_notify ; then
  7521. require_pkg_config libsystemd-daemon systemd/sd-daemon.h sd_notify
  7522. elif check_pkg_config libsystemd systemd/sd-daemon.h sd_notify ; then
  7523. require_pkg_config libsystemd systemd/sd-daemon.h sd_notify
  7524. else
  7525. disable systemd_notify
  7526. fi
  7527. fi
  7528.  
  7529. if enabled systemd_journal ; then
  7530. if check_pkg_config libsystemd systemd/sd-journal.h sd_journal_send ; then
  7531. require_pkg_config libsystemd systemd/sd-journal.h sd_journal_send
  7532. else
  7533. disable systemd_journal
  7534. fi
  7535. fi
  7536.  
  7537. # Check that all MythTV build "requirements" are met:
  7538. enabled exiv2 && $(pkg-config --exists exiv2) ||
  7539. die "ERROR! You must have the Exiv2 image tag reader library installed to compile MythTV."
  7540.  
  7541. # Qt dependency checks
  7542. if test $target_os = mingw32 ; then
  7543. qt_inc="-I`cd $(${qmake} -query QT_INSTALL_HEADERS); pwd`"
  7544. qt_libs="-L`cd $(${qmake} -query QT_INSTALL_LIBS) ; pwd`"
  7545. elif test $target_os = darwin ; then
  7546. qt_inc="-I`cd $(${qmake} -query QT_INSTALL_HEADERS); pwd` -F`cd $(${qmake} -query QT_INSTALL_LIBS); pwd`"
  7547. qt_libs="-L`cd $(${qmake} -query QT_INSTALL_LIBS) ; pwd`"
  7548. elif test $target_os = android ; then
  7549. qt_inc="-I$(${qmake} -query QT_INSTALL_HEADERS)"
  7550. qt_libs="-L$(${qmake} -query QT_INSTALL_LIBS)"
  7551. else
  7552. qt_inc="-I${sysroot}/$(${qmake} -query QT_INSTALL_HEADERS)"
  7553. qt_libs="-L${sysroot}/$(${qmake} -query QT_INSTALL_LIBS)"
  7554. fi
  7555.  
  7556. if $(pkg-config --exists Qt5WebKit) || $(pkg-config --exists QtWebKit) ; then
  7557. enable qtwebkit
  7558. else
  7559. check_ecxx ${qt_inc} ${qt_inc}/QtCore <<EOF && enable qtwebkit
  7560. #include <QtWebKit/QtWebKit>
  7561. int main(void){ return 0; }
  7562. EOF
  7563. fi
  7564.  
  7565. enabled qtwebkit || die "Error! QtWebkit headers not found"
  7566.  
  7567. if $(pkg-config --exists Qt5Script) || $(pkg-config --exists QtScript) ; then
  7568. enable qtscript
  7569. else
  7570. check_ecxx ${qt_inc} <<EOF && enable qtscript
  7571. #include <QtScript/QtScript>
  7572. int main(void){ return 0; }
  7573. EOF
  7574. fi
  7575.  
  7576. enabled qtscript || die "Error! QtScript headers not found"
  7577.  
  7578. # Check if Qt was built with DBus support:
  7579. if ! disabled qtdbus; then
  7580. if $(pkg-config --exists QtDBus) ; then
  7581. enable qtdbus
  7582. else
  7583. check_ecxx ${qt_inc} <<EOF && enable qtdbus
  7584. #include <QtDBus/QtDBus>
  7585. #include <QtDBus/QDBusInterface>
  7586. int main(void)
  7587. {
  7588. QDBusInterface test("org.kde.test", "/test", "org.kde.blah");
  7589. return 0;
  7590. }
  7591. EOF
  7592. fi
  7593. fi
  7594.  
  7595. # Disable OpenGL ES support if Qt does not support it
  7596. QTCONF=$(pkg-config --variable=qt_config Qt5Core || pkg-config --variable=qt_config QtCore)
  7597. if echo "$QTCONF" | grep -qv opengles2 ; then
  7598. if test $target_os != android ; then
  7599. disable opengles
  7600. fi
  7601. fi
  7602.  
  7603. if enabled firewire; then
  7604. fwlibs=""
  7605. check_libx fwlibs libavc1394/avc1394.h avc1394_transaction_block2 -lavc1394 && check_libx fwlibs libiec61883/iec61883.h iec61883_cmp_reconnect -liec61883 || disable firewire
  7606.  
  7607. if test $target_os = darwin; then
  7608. if [ -n "$firewiresdk_path" ] ; then
  7609. mac_avc="$firewiresdk_path"
  7610. else
  7611. # This should pick the newest. e.g. FireWireSDK21 instead of 20
  7612. # Unfortunately, the location keeps changing:
  7613. #/Developer/FireWireSDK20/Examples/AVCVideoServices/Framework
  7614. #/Developer/FireWireSDK21/Examples/Framework
  7615. mac_avc=`find /Developer/FireWireSDK* -name Framework 2> /dev/null \
  7616. | tail -n 1`
  7617. fi
  7618. if test -d "$mac_avc" ; then
  7619. firewire="yes"
  7620. else
  7621. echo Firewire being disabled. FireWire SDK missing
  7622. fi
  7623. fi
  7624. fi
  7625.  
  7626. enabled libfftw3 && check_lib2 fftw3.h fftw_init_threads -lfftw3_threads -lfftw3f -lfftw3 ||
  7627. disable libfftw3
  7628.  
  7629. # ass_flush_events was added in 0.9.10
  7630. enabled libass && check_lib2 ass/ass.h ass_flush_events -lass || disable libass
  7631.  
  7632. if enabled libcec ; then
  7633. if pkg-config --exists libcec; then
  7634. libcec_path=`pkg-config --variable includedir libcec`
  7635. else
  7636. check_cxx -I"$libcec_path" <<EOF || { disable libcec; }
  7637. #include <libcec/cec.h>
  7638. #include <iostream>
  7639. using namespace std;
  7640. using namespace CEC;
  7641. #include <libcec/cecloader.h>
  7642. int main(void) {
  7643. #if (CEC_LIB_VERSION_MAJOR < 1 || (CEC_LIB_VERSION_MAJOR == 1 && \
  7644. CEC_LIB_VERSION_MINOR < 7))
  7645. #error libcec version to old
  7646. #endif
  7647. return 1;
  7648. }
  7649. EOF
  7650. fi
  7651. fi
  7652.  
  7653. enabled libcrypto && check_lib openssl/rsa.h RSA_new -lcrypto || disable libcrypto
  7654.  
  7655. if test $target_os != darwin ; then
  7656. enabled libdns_sd && check_lib dns_sd.h DNSServiceRegister -ldns_sd || disable libdns_sd
  7657. fi
  7658.  
  7659. if enabled libxml2 ; then
  7660. if pkg-config --exists libxml-2.0 ; then
  7661. libxml2_path=`pkg-config --cflags-only-I libxml-2.0|sed -n "s/-I\([^ ]*\) *$/\1/p"`
  7662. else
  7663. disable libxml2
  7664. fi
  7665. fi
  7666. enabled libxml2 && check_cc -I"$libxml2_path" <<EOF && add_extralibs "-lxml2" || disable libxml2
  7667. #include <libxml/xmlversion.h>
  7668. int main(void) {
  7669. #if (LIBXML_VERSION < 20600)
  7670. #error libxml2 version to old
  7671. #endif
  7672. return 0;
  7673. }
  7674. EOF
  7675.  
  7676. if enabled taglib; then
  7677. taglib_include=`taglib-config --prefix`/include/taglib
  7678. taglib_libs=`taglib-config --libs`
  7679. fi
  7680.  
  7681. enabled x11 && check_lib X11/Xlib.h XQueryExtension -lX11 || disable x11
  7682. enabled xrandr && check_lib X11/extensions/Xrandr.h XRRSelectInput -lXrandr || disable xrandr
  7683. enabled xv && check_lib X11/extensions/Xv.h XvPutStill -lXv || disable xv
  7684.  
  7685. if enabled x11; then
  7686. require libXxf86vm X11/extensions/xf86vmode.h XF86VidModeSetClientVersion -lXxf86vm
  7687. require libXinerama X11/extensions/Xinerama.h XineramaQueryExtension -lXinerama
  7688. require libXext X11/extensions/Xext.h XMissingExtension -lXext
  7689. fi
  7690.  
  7691. if enabled x11; then
  7692. if disabled opengles; then
  7693. # Qt was compiled without OpenGL ES support, so GLES2 isn't usable
  7694. check_libx gl_lib GL/gl.h glBegin -lGL || check_libx gl_lib GL/gl.h glBegin -lopengl32 || disable opengl
  7695. else
  7696. # Qt was compiled with OpenGL ES support, so OpenGL support requires ES
  7697. check_libx gl_lib GLES2/gl2.h glClear -lGLESv2 || disable opengl
  7698. fi
  7699. fi
  7700.  
  7701. # CoreVideo in only available on Mac OS 10.4, or on 10.3 with QuickTime 7.
  7702. # This checks for it, and some other calls that the module needs
  7703. if test $target_os = darwin; then
  7704. cat > $TMPC << EOF
  7705. #include <AGL/agl.h>
  7706. int main( void ) { return aglGetCGLContext(0,0L); }
  7707. EOF
  7708. if $cc -o $TMPE $TMPC -framework AGL > /dev/null 2>&1; then
  7709. mac_corevideo="yes"
  7710. fi
  7711. fi
  7712.  
  7713. # Ubuntu Dapper installs NVIDIA GL headers to a weird location in order
  7714. # not to overwrite the headers installed from Mesa, etc. We need to
  7715. # add that path to include paths if that's the case.
  7716. if test -d ${sysroot}/usr/share/doc/nvidia-glx-dev/include; then
  7717. append CONFIG_INCLUDEPATH "${sysroot}/usr/share/doc/nvidia-glx-dev/include"
  7718. fi
  7719.  
  7720. # Same for Debian Sid.
  7721. if test -d ${sysroot}/usr/share/nvidia/include/GL; then
  7722. append CONFIG_INCLUDEPATH "${sysroot}/usr/share/nvidia/include"
  7723. fi
  7724.  
  7725. if test $target_os = darwin; then
  7726. # So far, only OS X 10.4 has this as a non-private framework
  7727. if test -d /System/Library/Frameworks/DiskArbitration.framework/Headers ; then
  7728. darwin_da="yes"
  7729. fi
  7730. fi
  7731.  
  7732. if [ -n "$optflags" ]; then
  7733. add_cflags $optflags
  7734. elif enabled small; then
  7735. add_cflags $cflags_size
  7736. elif enabled optimizations; then
  7737. add_cflags $cflags_speed
  7738. else
  7739. add_cflags $cflags_noopt
  7740. fi
  7741. check_cflags -fno-math-errno
  7742. check_cflags -fno-signed-zeros
  7743. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  7744. int x;
  7745. EOF
  7746.  
  7747.  
  7748. if enabled icc; then
  7749. # Just warnings, no remarks
  7750. check_cflags -w1
  7751. # -wd: Disable following warnings
  7752. # 144, 167, 556: -Wno-pointer-sign
  7753. # 188: enumerated type mixed with another type
  7754. # 1292: attribute "foo" ignored
  7755. # 1419: external declaration in primary source file
  7756. # 10006: ignoring unknown option -fno-signed-zeros
  7757. # 10148: ignoring unknown option -Wno-parentheses
  7758. # 10156: ignoring option '-W'; no argument required
  7759. # 13200: No EMMS instruction before call to function
  7760. # 13203: No EMMS instruction before return from function
  7761. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
  7762. # 11030: Warning unknown option --as-needed
  7763. # 10156: ignoring option '-export'; no argument required
  7764. check_ldflags -wd10156,11030
  7765. # -wd: Disable the following warnings for MythTV
  7766. # 177: function declared but never referenced (triggers on Q_OBJECT)
  7767. # 592: variable is used before its value is set (triggers on (void)x;)
  7768. # 913: ignoring invalid multibyte character sequence,
  7769. # icpc and g++ do the right thing for char 0x80-0xFF
  7770. # 13200: ignore EMMS instruction required, filters do the right thing
  7771. check_cflags -wd177,592,913,13200
  7772. # -wd: Disable the following warnings for MythTV
  7773. # 10159: ignore invalid argument for option '-m'
  7774. check_ldflags -wd10159
  7775. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  7776. enable ebp_available
  7777. # The test above does not test linking
  7778. enabled lto && disable symver_asm_label
  7779. if enabled x86_32; then
  7780. icc_version=$($cc -dumpversion)
  7781. test ${icc_version%%.*} -ge 11 &&
  7782. check_cflags -falign-stack=maintain-16-byte ||
  7783. disable aligned_stack
  7784. fi
  7785. elif enabled ccc; then
  7786. # disable some annoying warnings
  7787. add_cflags -msg_disable bitnotint
  7788. add_cflags -msg_disable mixfuncvoid
  7789. add_cflags -msg_disable nonstandcast
  7790. add_cflags -msg_disable unsupieee
  7791. elif enabled gcc; then
  7792. check_optflags -fno-tree-vectorize
  7793. check_cflags -Werror=format-security
  7794. check_cflags -Werror=implicit-function-declaration
  7795. # check_cflags -Werror=missing-prototypes
  7796. check_cflags -Werror=return-type
  7797. check_cflags -Werror=vla
  7798. check_cflags -Wformat
  7799. check_cflags -fdiagnostics-color=auto
  7800. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  7801. check_cflags -Werror=format-security
  7802. elif enabled llvm_gcc; then
  7803. check_cflags -mllvm -stack-alignment=16
  7804. elif enabled clang; then
  7805. check_cflags -mllvm -stack-alignment=16
  7806. check_cflags -mstack-alignment=16
  7807. check_cflags -Qunused-arguments
  7808. check_cflags -Werror=implicit-function-declaration
  7809. # check_cflags -Werror=missing-prototypes
  7810. check_cflags -Werror=return-type
  7811. elif enabled cparser; then
  7812. add_cflags -Wno-missing-variable-declarations
  7813. add_cflags -Wno-empty-statement
  7814. elif enabled armcc; then
  7815. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  7816. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  7817. # 2523: use of inline assembly is deprecated
  7818. add_cflags -W${armcc_opt},--diag_suppress=2523
  7819. add_cflags -W${armcc_opt},--diag_suppress=1207
  7820. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  7821. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  7822. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  7823. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  7824. elif enabled tms470; then
  7825. add_cflags -pds=824 -pds=837
  7826. disable inline_asm
  7827. elif enabled pathscale; then
  7828. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  7829. elif enabled_any msvc icl; then
  7830. enabled x86_32 && disable aligned_stack
  7831. enabled_all x86_32 debug && add_cflags -Oy-
  7832. enabled debug && add_ldflags -debug
  7833. enable pragma_deprecated
  7834. if enabled icl; then
  7835. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  7836. # (correctly) on icl 13.x.
  7837. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  7838. add_cflags -Qansi-alias
  7839. # Some inline asm is not compilable in debug
  7840. if enabled debug; then
  7841. disable ebp_available
  7842. disable ebx_available
  7843. fi
  7844. fi
  7845. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  7846. check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
  7847. # The CRT headers contain __declspec(restrict) in a few places, but if redefining
  7848. # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
  7849. # (as it ends up if the restrict redefine is done before including stdlib.h), while
  7850. # MSVC 2013 and newer can handle it fine.
  7851. # If this declspec fails, force including stdlib.h before the restrict redefinition
  7852. # happens in config.h.
  7853. if [ $_restrict != restrict ]; then
  7854. check_cc <<EOF || add_cflags -FIstdlib.h
  7855. __declspec($_restrict) void* foo(int);
  7856. EOF
  7857. fi
  7858. check_func strtoll || add_cflags -Dstrtoll=_strtoi64
  7859. # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
  7860. # this flag should be re-checked on newer compiler releases and put under a
  7861. # version check once its fixed
  7862. check_cflags -d2SSAOptimizer-
  7863. fi
  7864.  
  7865. for pfx in "" host_; do
  7866. varname=${pfx%_}cc_type
  7867. eval "type=\$$varname"
  7868. if [ $type = "msvc" ]; then
  7869. check_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
  7870. static inline int foo(int a) { return a; }
  7871. EOF
  7872. fi
  7873. done
  7874.  
  7875. case $as_type in
  7876. clang)
  7877. add_asflags -Qunused-arguments
  7878. ;;
  7879. esac
  7880.  
  7881. case $ld_type in
  7882. clang)
  7883. check_ldflags -Qunused-arguments
  7884. ;;
  7885. esac
  7886.  
  7887. if enabled gxx; then
  7888. if enabled symbol_visibility; then
  7889. check_cxxflags -fvisibility-inlines-hidden
  7890. append CCONFIG "use_hidesyms"
  7891. fi
  7892. check_cxxflags -Wmissing-declarations
  7893. check_cxxflags -Wno-switch
  7894. check_cxxflags -Woverloaded-virtual
  7895. check_cxxflags -funit-at-a-time
  7896. elif enabled icpc; then
  7897. # 177: function declared but never referenced (triggers on Q_OBJECT)
  7898. # 192: icpc confused by Qt %0-%99 in strings
  7899. # 592: variable is used before its value is set (triggers on (void)x;)
  7900. # 913: ignoring invalid multibyte character sequence,
  7901. # icpc and g++ do the right thing for char 0x80-0xFF
  7902. # 10181: ignore warning about -fomit-frame-pointer being ignored
  7903. # 13200: ignore EMMS instruction required, RTjpegN.cpp does the right thing
  7904. check_cxxflags -wd177,192,592,913,10181,13200
  7905. check_cxxflags -std=c++11
  7906. elif enabled clangxx; then
  7907. # The self assign warning triggers on headers that use x=x;
  7908. # to suppress warnings about unused parameters.
  7909. check_cxxflags -Wno-self-assign
  7910. # The constant-logical-operand only gives use false positives
  7911. # for constant logical operands meant to be optimized away.
  7912. check_cxxflags -Wno-constant-logical-operand
  7913. # Unfortunately clang's unused-value warning is smart enough to notice
  7914. # that ZMQ_ASSERT expressions don't use the values unless it is a debug
  7915. # build. So lets rely on other compilers to report on unused values.
  7916. check_cxxflags -Wno-unused-value
  7917. # clang complains about every unused -I unless you pass it this.
  7918. check_cxxflags -Qunused-arguments
  7919. fi
  7920.  
  7921. # Check for python dependencies
  7922. if enabled bindings_python; then
  7923. is_python3 && python=python2
  7924. check_python || disable_bindings_python "Python 2.6"
  7925. check_py_lib MySQLdb || disable_bindings_python "MySQLdb"
  7926. check_py_lib lxml || disable_bindings_python "lxml"
  7927. check_py_lib urlgrabber || disable_bindings_python "urlgrabber"
  7928. fi
  7929.  
  7930. # Check for perl dependencies
  7931. # Modules distributed in Perl core
  7932. if enabled bindings_perl; then
  7933. check_pl_lib "ExtUtils::MakeMaker" ||
  7934. disable_bindings_perl "ExtUtils::MakeMaker"
  7935. check_pl_lib Config || disable_bindings_perl Config
  7936. check_pl_lib Exporter || disable_bindings_perl Exporter
  7937. check_pl_lib Fcntl || disable_bindings_perl Fcntl
  7938. check_pl_lib "File::Copy" || disable_bindings_perl "File::Copy"
  7939. check_pl_lib "Sys::Hostname" || disable_bindings_perl "Sys::Hostname"
  7940. # Modules not distributed in Perl core
  7941. check_pl_lib DBI || disable_bindings_perl DBI
  7942. check_pl_lib "DBD::mysql" || disable_bindings_perl "DBD::mysql"
  7943. check_pl_lib "HTTP::Request" || disable_bindings_perl "HTTP::Request"
  7944. check_pl_lib "LWP::UserAgent" || disable_bindings_perl "LWP::UserAgent"
  7945. check_pl_lib "Net::UPnP::QueryResponse" ||
  7946. disable_bindings_perl "Net::UPnP::QueryResponse"
  7947. check_pl_lib "Net::UPnP::ControlPoint" ||
  7948. disable_bindings_perl "Net::UPnP::ControlPoint"
  7949. check_pl_lib "IO::Socket::INET6" ||
  7950. disable_bindings_perl "IO::Socket::INET6"
  7951. fi
  7952.  
  7953. # Check for php dependencies
  7954. # are none at this time
  7955.  
  7956. case $target_os in
  7957. osf1)
  7958. enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
  7959. ;;
  7960. plan9)
  7961. add_cppflags -Dmain=plan9_main
  7962. ;;
  7963. esac
  7964.  
  7965. enable frame_thread_encoder
  7966.  
  7967. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  7968.  
  7969. check_deps $CONFIG_LIST \
  7970. $CONFIG_EXTRA \
  7971. $HAVE_LIST \
  7972. $ALL_COMPONENTS \
  7973. $MYTHTV_LIST \
  7974. $MYTHTV_CONFIG_LIST \
  7975. $MYTHTV_HAVE_LIST \
  7976. $USING_LIST \
  7977.  
  7978. enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86"
  7979.  
  7980.  
  7981. if test $target_os = "haiku"; then
  7982. disable memalign
  7983. disable posix_memalign
  7984. fi
  7985.  
  7986. enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
  7987. prepend ffmpeg_libs $($ldflags_filter "-lole32" "-luser32") &&
  7988. enable dxva2_lib
  7989.  
  7990. ! enabled_any memalign posix_memalign aligned_malloc &&
  7991. enabled simd_align_16 && enable memalign_hack
  7992.  
  7993. # add_dep lib dep
  7994. # -> enable ${lib}_deps_${dep}
  7995. # -> add $dep to ${lib}_deps only once
  7996. add_dep() {
  7997. lib=$1
  7998. dep=$2
  7999. enabled "${lib}_deps_${dep}" && return 0
  8000. enable "${lib}_deps_${dep}"
  8001. prepend "${lib}_deps" $dep
  8002. }
  8003.  
  8004. # merge deps lib components
  8005. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  8006. merge_deps() {
  8007. lib=$1
  8008. shift
  8009. for comp in $*; do
  8010. enabled $comp || continue
  8011. eval "dep=\"\$${comp}_deps\""
  8012. for d in $dep; do
  8013. add_dep $lib $d
  8014. done
  8015. done
  8016. }
  8017.  
  8018. merge_deps libavfilter $FILTER_LIST
  8019.  
  8020. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  8021.  
  8022. for thread in $THREADS_LIST; do
  8023. if enabled $thread; then
  8024. test -n "$thread_type" &&
  8025. die "ERROR: Only one thread type must be selected." ||
  8026. thread_type="$thread"
  8027. fi
  8028. done
  8029.  
  8030. enabled zlib && add_cppflags -DZLIB_CONST
  8031.  
  8032. # conditional library dependencies, in linking order
  8033. enabled afftfilt_filter && prepend avfilter_deps "avcodec"
  8034. enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
  8035. enabled aresample_filter && prepend avfilter_deps "swresample"
  8036. enabled asyncts_filter && prepend avfilter_deps "avresample"
  8037. enabled atempo_filter && prepend avfilter_deps "avcodec"
  8038. enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
  8039. enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
  8040. enabled elbg_filter && prepend avfilter_deps "avcodec"
  8041. enabled fftfilt_filter && prepend avfilter_deps "avcodec"
  8042. enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
  8043. enabled mcdeint_filter && prepend avfilter_deps "avcodec"
  8044. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  8045. enabled pan_filter && prepend avfilter_deps "swresample"
  8046. enabled pp_filter && prepend avfilter_deps "postproc"
  8047. enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
  8048. enabled resample_filter && prepend avfilter_deps "avresample"
  8049. enabled sab_filter && prepend avfilter_deps "swscale"
  8050. enabled scale_filter && prepend avfilter_deps "swscale"
  8051. enabled scale2ref_filter && prepend avfilter_deps "swscale"
  8052. enabled sofalizer_filter && prepend avfilter_deps "avcodec"
  8053. enabled showcqt_filter && prepend avfilter_deps "avformat avcodec swscale"
  8054. enabled showfreqs_filter && prepend avfilter_deps "avcodec"
  8055. enabled showspectrum_filter && prepend avfilter_deps "avcodec"
  8056. enabled smartblur_filter && prepend avfilter_deps "swscale"
  8057. enabled spectrumsynth_filter && prepend avfilter_deps "avcodec"
  8058. enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
  8059. enabled uspp_filter && prepend avfilter_deps "avcodec"
  8060.  
  8061. enabled lavfi_indev && prepend avdevice_deps "avfilter"
  8062.  
  8063. enabled opus_decoder && prepend avcodec_deps "swresample"
  8064.  
  8065. expand_deps(){
  8066. lib_deps=${1}_deps
  8067. eval "deps=\$$lib_deps"
  8068. append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
  8069. unique $lib_deps
  8070. }
  8071.  
  8072. #we have to remove gpl from the deps here as some code assumes all lib deps are libs
  8073. postproc_deps="$(filter_out 'gpl' $postproc_deps)"
  8074.  
  8075. map 'expand_deps $v' $LIBRARY_LIST
  8076.  
  8077. if enabled x86 && (disabled mmx && ! enabled disable_mmx_for_debugging); then
  8078. die "ERROR: MMX disabled on x86, MythTV will be very slow.\n\tDisable this check with --enable-disable-mmx-for-debugging"
  8079. fi
  8080.  
  8081. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  8082.  
  8083. echo "# Basic Settings"
  8084. echo "Compile type $compile_type"
  8085. echo "Compiler cache $ccache$ccache_txt"
  8086. echo "DistCC $distcc$distcc_txt"
  8087. echo "qmake $(which $qmake)"
  8088. echo "install prefix $prefix"
  8089. echo "runtime prefix $runprefix"
  8090. <<BLOCK_QUOTE
  8091. echo "source path $source_path"
  8092. echo "C compiler $cc"
  8093. echo "C library $libc_type"
  8094. if test "$host_cc" != "$cc"; then
  8095. echo "host C compiler $host_cc"
  8096. echo "host C library $host_libc_type"
  8097. fi
  8098. echo "ARCH $arch ($cpu)"
  8099. BLOCK_QUOTE
  8100. if enabled cpu_override && test x"$cpu" != x"generic"; then
  8101. echo "CPU $arch $subarch ($cpu)"
  8102. elif test x"$processor" != x"" ; then
  8103. echo "CPU $arch $subarch ($processor)"
  8104. else
  8105. echo "CPU $arch $subarch"
  8106. fi
  8107. <<BLOCK_QUOTE
  8108. if test "$build_suffix" != ""; then
  8109. echo "build suffix $build_suffix"
  8110. fi
  8111. if test "$progs_suffix" != ""; then
  8112. echo "progs suffix $progs_suffix"
  8113. fi
  8114. if test "$extra_version" != ""; then
  8115. echo "version string suffix $extra_version"
  8116. fi
  8117. echo "big-endian ${bigendian-no}"
  8118. echo "runtime cpu detection ${runtime_cpudetect-no}"
  8119. BLOCK_QUOTE
  8120. if enabled x86; then
  8121. echo "${yasmexe} ${yasm-no}"
  8122. echo "MMX enabled ${mmx-no}"
  8123. echo "MMXEXT enabled ${mmxext-no}"
  8124. echo "3DNow! enabled ${amd3dnow-no}"
  8125. echo "3DNow! extended enabled ${amd3dnowext-no}"
  8126. echo "SSE enabled ${sse-no}"
  8127. echo "SSSE3 enabled ${ssse3-no}"
  8128. echo "AESNI enabled ${aesni-no}"
  8129. echo "AVX enabled ${avx-no}"
  8130. echo "XOP enabled ${xop-no}"
  8131. echo "FMA3 enabled ${fma3-no}"
  8132. echo "FMA4 enabled ${fma4-no}"
  8133. echo "i686 features enabled ${i686-no}"
  8134. <<BLOCK_QUOTE
  8135. echo "CMOV is fast ${fast_cmov-no}"
  8136. echo "EBX available ${ebx_available-no}"
  8137. echo "EBP available ${ebp_available-no}"
  8138. echo "10 operands supported ${ten_operands-no}"
  8139. BLOCK_QUOTE
  8140. fi
  8141. if enabled aarch64; then
  8142. echo "NEON enabled ${neon-no}"
  8143. echo "VFP enabled ${vfp-no}"
  8144. fi
  8145. if enabled arm; then
  8146. echo "ARMv5TE enabled ${armv5te-no}"
  8147. echo "ARMv6 enabled ${armv6-no}"
  8148. echo "ARMv6T2 enabled ${armv6t2-no}"
  8149. echo "VFP enabled ${vfp-no}"
  8150. echo "NEON enabled ${neon-no}"
  8151. echo "THUMB enabled ${thumb-no}"
  8152. fi
  8153. if enabled mips; then
  8154. echo "MIPS FPU enabled ${mipsfpu-no}"
  8155. echo "MIPS DSP R1 enabled ${mipsdsp-no}"
  8156. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  8157. echo "MIPS MSA enabled ${msa-no}"
  8158. echo "LOONGSON MMI enabled ${mmi-no}"
  8159. fi
  8160. if enabled ppc; then
  8161. echo "AltiVec enabled ${altivec-no}"
  8162. echo "VSX enabled ${vsx-no}"
  8163. echo "POWER8 enabled ${power8-no}"
  8164. echo "PPC 4xx optimizations ${ppc4xx-no}"
  8165. echo "dcbzl available ${dcbzl-no}"
  8166. fi
  8167. <<BLOCK_QUOTE
  8168. echo "debug symbols ${debug-no}"
  8169. echo "strip symbols ${stripping-no}"
  8170. echo "optimize for size ${small-no}"
  8171. echo "optimizations ${optimizations-no}"
  8172. echo "static ${static-no}"
  8173. echo "shared ${shared-no}"
  8174. echo "postprocessing support ${postproc-no}"
  8175. echo "new filter support ${avfilter-no}"
  8176. echo "network support ${network-no}"
  8177. echo "threading support ${thread_type-no}"
  8178. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  8179. echo "SDL2 support ${sdl2-no}"
  8180. echo "opencl enabled ${opencl-no}"
  8181. echo "JNI support ${jni-no}"
  8182. echo "texi2html enabled ${texi2html-no}"
  8183. echo "perl enabled ${perl-no}"
  8184. echo "pod2man enabled ${pod2man-no}"
  8185. echo "makeinfo enabled ${makeinfo-no}"
  8186. echo "makeinfo supports HTML ${makeinfo_html-no}"
  8187. test -n "$random_seed" &&
  8188. echo "random seed ${random_seed}"
  8189. echo
  8190.  
  8191. echo "Enabled programs:"
  8192. print_enabled '' $PROGRAM_LIST | print_in_columns
  8193. echo
  8194.  
  8195. echo "External libraries:"
  8196. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_in_columns
  8197. echo
  8198.  
  8199. echo "External libraries providing hardware acceleration:"
  8200. print_enabled '' $HWACCEL_LIBRARY_LIST | print_in_columns
  8201. echo
  8202.  
  8203. echo "Libraries:"
  8204. print_enabled '' $LIBRARY_LIST | print_in_columns
  8205. echo
  8206.  
  8207. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  8208. echo "Enabled ${type}s:"
  8209. eval list=\$$(toupper $type)_LIST
  8210. print_enabled '_*' $list | print_in_columns
  8211. echo
  8212. done
  8213.  
  8214. license="LGPL version 2.1 or later"
  8215. if enabled nonfree; then
  8216. license="nonfree and unredistributable"
  8217. elif enabled gplv3; then
  8218. license="GPL version 3 or later"
  8219. elif enabled lgplv3; then
  8220. license="LGPL version 3 or later"
  8221. elif enabled gpl; then
  8222. license="GPL version 2 or later"
  8223. fi
  8224.  
  8225. echo "License: $license"
  8226. BLOCK_QUOTE
  8227.  
  8228. echo
  8229. if enabled frontend; then
  8230. echo "# Input Support"
  8231. echo "Joystick menu ${joystick_menu-no}"
  8232. echo "lirc support ${lirc-no}"
  8233. echo "libCEC device support ${libcec-no} [$libcec_path]"
  8234. if test x"$target_os" = x"darwin" ; then
  8235. echo "Apple Remote ${appleremote-no}"
  8236. fi
  8237. fi
  8238.  
  8239. #ignore
  8240. # build tree in object directory if source path is different from current one
  8241. if enabled source_path_used; then
  8242. DIRS="
  8243. doc
  8244. libavcodec
  8245. libavcodec/$arch
  8246. libavdevice
  8247. libavfilter
  8248. libavformat
  8249. libavutil
  8250. libavutil/$arch
  8251. libpostproc
  8252. libswscale
  8253. libswscale/$arch
  8254. tests
  8255. tools
  8256. "
  8257. FILES="
  8258. Makefile
  8259. common.mak
  8260. subdir.mak
  8261. doc/texi2pod.pl
  8262. libavcodec/Makefile
  8263. libavcodec/${arch}/Makefile
  8264. libavdevice/Makefile
  8265. libavfilter/Makefile
  8266. libavformat/Makefile
  8267. libavutil/Makefile
  8268. libpostproc/Makefile
  8269. libswscale/Makefile
  8270. "
  8271. map 'mkdir -p $v' $DIRS;
  8272. map 'test -f "$source_path/$v" && $ln_s "$source_path/$v" $v' $FILES
  8273. fi
  8274.  
  8275. enabled stripping || strip="echo skipping strip"
  8276.  
  8277. config_files="$TMPH $TMPMAK"
  8278.  
  8279. if enabled backend; then
  8280. echo "Video4Linux support ${v4l2-no}"
  8281. echo "ivtv support ${ivtv-no}"
  8282. echo "HD-PVR support ${hdpvr-no}"
  8283. echo "FireWire support ${firewire-no}"
  8284. echo "DVB support ${dvb-no} [$dvb_path]"
  8285. echo "DVB-S2 support ${fe_can_2g_modulation-no}"
  8286. echo "HDHomeRun support ${hdhomerun-no}"
  8287. echo "V@Box TV Gateway support ${vbox-no}"
  8288. echo "Ceton support ${ceton-no}"
  8289. echo "ASI support ${asi-no}"
  8290. fi
  8291.  
  8292. if enabled frontend; then
  8293. echo
  8294. echo "# Sound Output Support"
  8295. echo "PulseAudio support ${audio_pulseoutput-no}"
  8296. echo "OSS support ${audio_oss-no}"
  8297. echo "ALSA support ${audio_alsa-no}"
  8298. echo "JACK support ${audio_jack-no}"
  8299. if test x"$target_os" = x"mingw32" ; then
  8300. echo "Windows (Windows audio) yes"
  8301. echo "Windows (DirectX) yes"
  8302. fi
  8303. echo "libfftw3 support ${libfftw3-no}"
  8304. echo
  8305. echo "# Video Output Support"
  8306. echo "x11 support ${x11-no}"
  8307. if enabled x11 ; then
  8308. echo "xrandr support ${xrandr-no}"
  8309. echo "xv support ${xv-no}"
  8310. echo "VDPAU support ${vdpau-no}"
  8311. echo "VAAPI support ${vaapi-no}"
  8312. echo "CrystalHD support ${crystalhd-no}"
  8313. echo "OpenMAX support ${openmax-no}"
  8314. if enabled openmax ; then
  8315. echo "OpenMAX Broadcom ${openmax_broadcom-no}"
  8316. echo "OpenMAX Bellagio ${openmax_bellagio-no}"
  8317. fi
  8318. fi
  8319. echo "OpenGL video ${opengl_video-no}"
  8320. echo "OpenGL ThemePainter ${opengl_themepainter-no}"
  8321. if test x"$target_os" = x"darwin" ; then
  8322. echo "VDA support ${vda-no}"
  8323. echo "VideoToolBox support ${videotoolbox-no}"
  8324. fi
  8325. if test x"$target_os" = x"mingw32" ; then
  8326. echo "Windows (Direct3D) yes"
  8327. echo "DXVA2 support ${dxva2-no}"
  8328. fi
  8329. echo "MHEG support ${mheg}"
  8330. echo "libass subtitle support ${libass-no}"
  8331. echo
  8332. fi
  8333.  
  8334. echo "# Misc Features"
  8335. echo "Frontend ${frontend-no}"
  8336. echo "Backend ${backend-no}"
  8337. echo "mythlogserver ${mythlogserver-no}"
  8338. echo "multi threaded libavcodec ${threads-no}"
  8339. if enabled frontend; then
  8340. echo "libxml2 support ${libxml2-no} [$libxml2_path]"
  8341. fi
  8342. echo "libdns_sd (Bonjour) ${libdns_sd-no}"
  8343. echo "libcrypto ${libcrypto-no}"
  8344. if test x"$target_os" = x"darwin" ; then
  8345. echo "TLS -"
  8346. echo "OpenSSL ${tls_openssl_protocol-no}"
  8347. echo "gnutls ${tls_gnutls_protocol-no}"
  8348. echo "Secure Transport ${tls_securetransport_protocol-no}"
  8349. fi
  8350. echo "OpenGL ES 2.0 ${opengles-no}"
  8351. echo "BD-J (Bluray java) ${bdjava-no}"
  8352. echo "BD-J type ${bdj_type}"
  8353. echo "systemd_notify ${systemd_notify-no}"
  8354. echo "systemd_journal ${systemd_journal-no}"
  8355. echo
  8356.  
  8357. echo "# Bindings"
  8358. echo "bindings_perl ${bindings_perl-no}"
  8359. if test x"$PERL_CONFIG_OPTS" != x""; then
  8360. echo "Perl config options $PERL_CONFIG_OPTS"
  8361. fi
  8362. echo "bindings_python ${bindings_python-no}"
  8363. echo "bindings_php ${bindings_php-no}"
  8364. echo ""
  8365.  
  8366. echo "# External Codec Options"
  8367. echo "mp3lame ${libmp3lame-no}"
  8368. echo "xvid ${libxvid-no}"
  8369. echo "x264 ${libx264-no}"
  8370. echo "x265 (HEVC) ${libx265-no}"
  8371. echo "vpx ${libvpx-no}"
  8372. echo "SDL2 ${sdl2-no}"
  8373. echo ""
  8374.  
  8375. MYTH_CONFIG_H=libs/libmythbase/mythconfig.h
  8376. MYTH_CONFIG_MAK=libs/libmythbase/mythconfig.mak
  8377. echo "Creating $MYTH_CONFIG_H and $MYTH_CONFIG_MAK"
  8378.  
  8379. date >> config.log
  8380. echo " $0 $MYTHTV_CONFIGURATION" >> config.log
  8381.  
  8382. cat > $TMPMAK <<EOF
  8383. # Automatically generated by configure - do not modify!
  8384. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  8385. MYTHTV_CONFIG_MAK=1
  8386. PREFIX=$prefix
  8387. prefix=$prefix
  8388. LIBDIRNAME=$libdir_name
  8389. LIBDIR=$libdir
  8390. SHLIBDIR=$shlibdir
  8391. INCDIR=$incdir
  8392. BINDIR=$bindir
  8393. DATADIR=$datadir
  8394. MANDIR=$mandir
  8395. PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
  8396. SRC_PATH="$source_path"
  8397. SRC_LINK=$source_link
  8398. #ifndef MAIN_MAKEFILE
  8399. #SRC_PATH:=\$(SRC_PATH:.%=..%)
  8400. #endif
  8401. SRC_PATH_BARE=$source_path
  8402. BUILD_ROOT="$PWD"
  8403. CC_IDENT=$cc_ident
  8404. ARCH=$arch
  8405. INTRINSICS=$intrinsics
  8406. CC=$cc
  8407. CXX=$cxx
  8408. AS=$as
  8409. OBJCC=$objcc
  8410. QMAKE=$qmakeconf
  8411. QMAKE_CC=$cc
  8412. QMAKE_CXX=$cxx
  8413. QMAKE_LINK=$cxx
  8414. PYTHON=$python
  8415. LD=$ld
  8416. DEPCC=$dep_cc
  8417. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  8418. DEPAS=$as
  8419. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  8420. YASM=$yasmexe
  8421. DEPYASM=$yasmexe
  8422. AR=$ar
  8423. ARFLAGS=$arflags
  8424. AR_O=$ar_o
  8425. RANLIB=$ranlib
  8426. STRIP=$strip
  8427. CP=cp -p
  8428. LN_S=$ln_s
  8429. CPPFLAGS=$CPPFLAGS
  8430. CFLAGS=$CFLAGS
  8431. CXXFLAGS=$CXXFLAGS
  8432. OBJCFLAGS=$OBJCFLAGS
  8433. ASFLAGS=$ASFLAGS
  8434. AS_C=$AS_C
  8435. AS_O=$AS_O
  8436. OBJCC_C=$OBJCC_C
  8437. OBJCC_E=$OBJCC_E
  8438. OBJCC_O=$OBJCC_O
  8439. CC_C=$CC_C
  8440. CC_E=$CC_E
  8441. CC_O=$CC_O
  8442. CXX_C=$CXX_C
  8443. CXX_O=$CXX_O
  8444. LD_O=$LD_O
  8445. LD_LIB=$LD_LIB
  8446. LD_MYTH_LIB=$LD_MYTH_LIB
  8447. LD_PATH=$LD_PATH
  8448. DLLTOOL=$dlltool
  8449. WINDRES=$windres
  8450. DEPWINDRES=$dep_cc
  8451. CXXPPFLAGS=$CXXPPFLAGS
  8452. ECXXFLAGS=$ECXXFLAGS
  8453. DOXYGEN=$doxygen
  8454. LDFLAGS=$LDFLAGS
  8455. LDFLAGS-ffserver=$FFSERVERLDFLAGS
  8456. LDEXEFLAGS=$LDEXEFLAGS
  8457. LDLIBFLAGS=$LDLIBFLAGS
  8458. #SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  8459. ASMSTRIPFLAGS=$ASMSTRIPFLAGS
  8460. YASMFLAGS=$YASMFLAGS
  8461. BUILDSUF=$build_suffix
  8462. PROGSSUF=$progs_suffix
  8463. FULLNAME=$FULLNAME
  8464. LIBPREF=$LIBPREF
  8465. LIBSUF=$LIBSUF
  8466. LIBNAME=$LIBNAME
  8467. SLIBPREF=$SLIBPREF
  8468. SLIBSUF=$SLIBSUF
  8469. EXESUF=$EXESUF
  8470. EXTRA_VERSION=$extra_version
  8471. CCDEP=$CCDEP
  8472. CXXDEP=$CXXDEP
  8473. CCDEP_FLAGS=$CCDEP_FLAGS
  8474. ASDEP=$ASDEP
  8475. ASDEP_FLAGS=$ASDEP_FLAGS
  8476. CC_DEPFLAGS=$CC_DEPFLAGS
  8477. AS_DEPFLAGS=$AS_DEPFLAGS
  8478. HOSTCC=$host_cc
  8479. HOSTLD=$host_ld
  8480. HOSTCFLAGS=$host_cflags
  8481. HOSTCPPFLAGS=$host_cppflags
  8482. HOSTEXESUF=$HOSTEXESUF
  8483. HOSTLDFLAGS=$host_ldflags
  8484. HOSTLIBS=$host_libs
  8485. DEPHOSTCC=$host_cc
  8486. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  8487. HOSTCCDEP=$HOSTCCDEP
  8488. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  8489. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  8490. HOSTCC_C=$HOSTCC_C
  8491. HOSTCC_O=$HOSTCC_O
  8492. HOSTLD_O=$HOSTLD_O
  8493. TARGET_EXEC=$target_exec $target_exec_args
  8494. TARGET_PATH=$target_path
  8495. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  8496. CFLAGS-ffplay=${sdl2_cflags}
  8497. ZLIB=$($ldflags_filter -lz)
  8498. #LIB_INSTALL_EXTRA_CMD=$_LIB_INSTALL_EXTRA_CMD
  8499. EXTRALIBS=$extralibs $ldl
  8500. COMPAT_OBJS=$compat_objs
  8501. EXEOBJS=$exeobjs
  8502. INSTALL=$install
  8503. LIBTARGET=${LIBTARGET}
  8504. SLIBNAME=${SLIBNAME}
  8505. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  8506. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  8507. SLIBNAME_QT=$(echo ${SLIBNAME} | sed 's/\$(\(\(FULL\)*NAME\))/\1/;s/\$(\([A-Z]*\))/$${\1}/g')
  8508. SLIBNAME_WITH_MAJOR_QT=$(echo ${SLIBNAME_WITH_MAJOR} | sed 's/\$(\(\(FULL\)*NAME\))/\1/;s/\$(\(LIBMAJOR\))/\1/;s/\$(\(SLIBNAME\))/$${\1_QT}/;s/\$(\([A-Z]*\))/$${\1}/g')
  8509. #SLIB_CREATE_DEF_CMD=$_{SLIB_CREATE_DEF_CMD}
  8510. #SLIB_EXTRA_CMD=$_{SLIB_EXTRA_CMD}
  8511. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  8512. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  8513. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  8514. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  8515. VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
  8516. SAMPLES=$samples
  8517. NOREDZONE_FLAGS=$noredzone_flags
  8518. ANTBIN=$antbin
  8519. BDJ_TYPE=$bdj_type
  8520. JDK_HOME=$JDK_HOME
  8521. JAVA_ARCH=$java_arch
  8522. EOF
  8523.  
  8524. get_version(){
  8525. lcname=lib${1}
  8526. name=$(toupper $lcname)
  8527. file=$source_path/external/FFmpeg/$lcname/version.h
  8528. eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
  8529. enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
  8530. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  8531. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> $TMPMAK
  8532. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> $TMPMAK
  8533. eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> $TMPMAK
  8534. }
  8535.  
  8536. map 'get_version $v' $LIBRARY_LIST
  8537.  
  8538. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> $TMPMAK' $LIBRARY_LIST
  8539.  
  8540. print_program_libs(){
  8541. eval "program_libs=\$${1}_libs"
  8542. eval echo "LIBS-${1}=${program_libs}" >> $TMPMAK
  8543. }
  8544.  
  8545. map 'print_program_libs $v' $PROGRAM_LIST
  8546.  
  8547. echo "RUNPREFIX=$runprefix" >> $TMPMAK
  8548. echo "SYSROOT=$sysroot" >> $TMPMAK
  8549.  
  8550. enabled audio_alsa && append CCONFIG "using_alsa"
  8551. enabled audio_jack && append CCONFIG "using_jack"
  8552. enabled audio_oss && append CCONFIG "using_oss"
  8553. enabled audio_pulse && append CCONFIG "using_pulse"
  8554. enabled audio_pulseoutput && append CCONFIG "using_pulseoutput"
  8555.  
  8556. if enabled darwin_da; then
  8557. append CCONFIG "darwin_da"
  8558. echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> $TMPMAK
  8559. fi
  8560.  
  8561. if enabled freetype2; then
  8562. echo "FREETYPE_CFLAGS=`freetype-config --cflags`" >> $TMPMAK
  8563. echo "FREETYPE_LIBS=`freetype-config --libs`" >> $TMPMAK
  8564. fi
  8565.  
  8566. if test $target_os = darwin; then
  8567. # Qt, by default builds .app bundles everywhere. Prevent this.
  8568. enabled mac_bundle || echo "CONFIG-=app_bundle" >> $TMPMAK
  8569. fi
  8570.  
  8571. cat > $TMPH <<EOF
  8572. /* Automatically generated by configure - do not modify! */
  8573. #ifndef MYTHTV_CONFIG_H
  8574. #define MYTHTV_CONFIG_H
  8575. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  8576. #define FFMPEG_LICENSE "$(c_escape $license)"
  8577. #define CONFIG_THIS_YEAR 2016
  8578. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  8579. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  8580. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  8581. #define av_restrict $_restrict
  8582. #define EXTERN_PREFIX "${extern_prefix}"
  8583. #define EXTERN_ASM ${extern_prefix}
  8584. #define BUILDSUF "$build_suffix"
  8585. #define SLIBSUF "$SLIBSUF"
  8586. #define HAVE_MMX2 HAVE_MMXEXT
  8587. #define SWS_MAX_FILTER_SIZE $sws_max_filter_size
  8588. #define ASMALIGN(ZEROBITS) ".p2align " #ZEROBITS "\\n\\t"
  8589. #define SIZEOF_INT $_sizeof_int
  8590. #define SIZEOF_LONG $_sizeof_long
  8591. #define JDK_HOME "$JDK_HOME"
  8592. #define JAVA_ARCH "$java_arch"
  8593. EOF
  8594.  
  8595. # Code only checks whether HAVE_BDJ_J2ME is defined, not what value
  8596. # it has been defined as so we mustn't define it if we don't have it.
  8597. enabled bdj_j2me && echo "#define HAVE_BDJ_J2ME 1" >>$TMPH
  8598.  
  8599. test -n "$assert_level" &&
  8600. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  8601.  
  8602. test -n "$malloc_prefix" &&
  8603. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  8604.  
  8605. if enabled mac_corevideo; then
  8606. append CCONFIG "using_corevideo"
  8607. fi
  8608.  
  8609. if enabled cygwin ; then
  8610. echo "#ifndef llrint" >> $TMPH
  8611. echo "#define llrint llrint // make sure not to define twice" >> $TMPH
  8612. echo "static inline long long int llrint (double x)" >> $TMPH
  8613. echo "{" >> $TMPH
  8614. echo " long long int llrintres;" >> $TMPH
  8615. echo " asm" >> $TMPH
  8616. echo " (\"fistpll %0\"" >> $TMPH
  8617. echo " : \"=m\" (llrintres) : \"t\" (x) : \"st\");" >> $TMPH
  8618. echo " return llrintres;" >> $TMPH
  8619. echo "}" >> $TMPH
  8620. echo "#endif" >> $TMPH
  8621. fi
  8622.  
  8623. if enabled yasm; then
  8624. append config_files $TMPASM
  8625. printf '' >$TMPASM
  8626. fi
  8627.  
  8628. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  8629.  
  8630.  
  8631. mkdir -p doc
  8632. mkdir -p tests
  8633. mkdir -p tests/api
  8634. echo "@c auto-generated by configure - do not modify! " > doc/config.texi
  8635.  
  8636. print_config ARCH_ "$config_files" $ARCH_LIST
  8637. print_config HAVE_ "$config_files" $HAVE_LIST
  8638. print_config HAVE_ "$config_files" $MYTHTV_HAVE_LIST
  8639. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  8640. $CONFIG_EXTRA \
  8641. $ALL_COMPONENTS \
  8642. $MYTHTV_LIST \
  8643. $MYTHTV_CONFIG_LIST \
  8644.  
  8645.  
  8646. for opt in $MYTHTV_CONFIG_LIST $USING_LIST; do
  8647. enabled $opt && append CCONFIG "using_$opt"
  8648. done
  8649.  
  8650. enabled threads && append CCONFIG "using_ffmpeg_threads"
  8651.  
  8652. if disabled frontend; then
  8653. echo
  8654. echo "WARNING: --disable-frontend is only intended to aid porting."
  8655. echo "WARNING: THIS WILL BREAK THINGS. You are on your own now."
  8656. fi
  8657.  
  8658. if disabled backend; then
  8659. echo
  8660. echo "WARNING: --disable-backend is only intended to aid porting."
  8661. echo "WARNING: You are on your own now."
  8662. fi
  8663.  
  8664. if enabled proc_opt; then
  8665. echo
  8666. echo "WARNING: When using --enable-proc-opt you must include the "
  8667. echo " output of ./configure along with any bug report."
  8668. fi
  8669.  
  8670. if enabled cpu_override; then
  8671. echo
  8672. echo "WARNING: When using --arch=X or --cpu=X you must include the "
  8673. echo " output of ./configure along with any bug report."
  8674. fi
  8675.  
  8676. echo # add a newline after any warnings.
  8677.  
  8678. if enabled mmx; then
  8679. CONFIG_DEFINES="$CONFIG_DEFINES MMX"
  8680. if enabled x86_32 ; then
  8681. CONFIG_DEFINES="$CONFIG_DEFINES i386"
  8682. fi
  8683. fi
  8684.  
  8685. if enabled firewire; then
  8686. if test $target_os = darwin; then
  8687. echo "CONFIG_MAC_AVC=$mac_avc" >> $TMPMAK
  8688. else
  8689. echo "CONFIG_FIREWIRE_LIBS=-lraw1394 -liec61883 -lavc1394 -lrom1394" >> $TMPMAK
  8690. fi
  8691. fi
  8692.  
  8693. if enabled mheg; then
  8694. append CCONFIG "using_mheg"
  8695. fi
  8696.  
  8697. if enabled libass; then
  8698. append CCONFIG "using_libass"
  8699. fi
  8700.  
  8701. if enabled appleremote; then
  8702. append CONFIG_DEFINES "USING_APPLEREMOTE"
  8703. fi
  8704.  
  8705. if enabled dvb && non_standard_header $dvb_path; then
  8706. append CONFIG_INCLUDEPATH "$dvb_path"
  8707. fi
  8708.  
  8709. #if enabled vbox; then
  8710. # append CCONFIG "using_vbox"
  8711. #fi
  8712.  
  8713. if enabled libcec; then
  8714. append CONFIG_DEFINES "using_libcec"
  8715. if non_standard_header $libcec_path; then
  8716. append CONFIG_INCLUDEPATH "$libcec_path"
  8717. fi
  8718. fi
  8719.  
  8720. if enabled libxml2; then
  8721. if [ -d $libxml2_path ] ; then
  8722. if non_standard_header $libxml2_path; then
  8723. append CONFIG_INCLUDEPATH "$libxml2_path"
  8724. fi
  8725. append CCONFIG "using_libxml2"
  8726. fi
  8727. fi
  8728.  
  8729. if enabled libmp3lame; then
  8730. append CCONFIG "using_libmp3lame"
  8731. fi
  8732.  
  8733. if enabled taglib; then
  8734. echo "CONFIG_TAGLIB_INCLUDES=$taglib_include" >> $TMPMAK
  8735. echo "CONFIG_TAGLIB_LIBS=$taglib_libs" >> $TMPMAK
  8736. fi
  8737.  
  8738. if enabled x11; then
  8739. if [ -d $x11_path ] ; then
  8740. append CONFIG_INCLUDEPATH "$x11_path"
  8741. fi
  8742. fi
  8743.  
  8744. if ! enabled darwin && enabled opengl; then
  8745. echo "CONFIG_OPENGL_LIBS=$gl_lib $glu_lib" >> $TMPMAK
  8746. fi
  8747.  
  8748. if test x"$PERL_CONFIG_OPTS" != x"" ; then
  8749. echo "PERL_CONFIG_OPTS=$PERL_CONFIG_OPTS" >> $TMPMAK
  8750. fi
  8751.  
  8752. if test x"$CCONFIG" != x"" ; then
  8753. echo "CCONFIG=$CCONFIG" >> $TMPMAK
  8754. echo "#define MYTH_BUILD_CONFIG \"$CCONFIG\"" >>$TMPH
  8755. fi
  8756.  
  8757. if test x"$CONFIG_DEFINES" != x"" ; then
  8758. echo "CONFIG_DEFINES=$CONFIG_DEFINES" >> $TMPMAK
  8759. fi
  8760.  
  8761. if test x"$CONFIG_INCLUDEPATH" != x"" ; then
  8762. echo "CONFIG_INCLUDEPATH=$CONFIG_INCLUDEPATH" >> $TMPMAK
  8763. fi
  8764.  
  8765. echo "#endif /* MYTHTV_CONFIG_H */" >> $TMPH
  8766.  
  8767. cat <<EOF >> $TMPMAK
  8768. # HACK: If Qt 4 and MythTV's installed library dirs are the same, remove the
  8769. # -L from early in the link line, to ignore any old installed libmyth*
  8770. # Note: Qt uses QMAKE_INCDIR_QT to build an absolute path for include
  8771. # directories, it cannot be modified.
  8772. QMAKE_LIBDIR_QT-=${sysroot}${libdir}
  8773. QMAKE_LIBDIR-=${sysroot}${libdir}
  8774. LATE_LIBS+=-L${sysroot}${libdir}
  8775. EOF
  8776.  
  8777. #echo "endif # FFMPEG_CONFIG_MAK" >> $TMPMAK
  8778.  
  8779. # Should be done on all platforms, but for the time being limit it to mac only
  8780. if enabled darwin; then
  8781. echo "QMAKE_LFLAGS+=\"$LDFLAGS\"" >> $TMPMAK
  8782. fi
  8783.  
  8784. cp_if_changed $TMPH $MYTH_CONFIG_H
  8785.  
  8786. if ! test -L config.h ; then
  8787. ${ln_s} $MYTH_CONFIG_H config.h
  8788. fi
  8789.  
  8790. if [ ! -e config.h ] ; then
  8791. ${ln_s} $MYTH_CONFIG_H config.h
  8792. fi
  8793.  
  8794. cat $TMPMAK | sed -e 's/^!/#/' > $TMPPRO
  8795.  
  8796. cp_if_changed $TMPPRO $MYTH_CONFIG_MAK
  8797.  
  8798. if ! test -L config.mak ; then
  8799. ${ln_s} $MYTH_CONFIG_MAK config.mak
  8800. fi
  8801.  
  8802. if [ ! -e config.mak ] ; then
  8803. ${ln_s} $MYTH_CONFIG_MAK config.mak
  8804. fi
  8805.  
  8806.  
  8807. # create config.mak for external/FFmpeg
  8808. cat > external/FFmpeg/config.mak <<EOF
  8809. # Automatically generated by configure - do not modify!
  8810. ifndef FFMPEG_CONFIG_MAK
  8811. FFMPEG_CONFIG_MAK=1
  8812. SHFLAGS=$SHFLAGS
  8813. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  8814. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  8815. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  8816. SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}
  8817. SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}
  8818. EOF
  8819. # Strip out the old dirs that we are about to put back in.
  8820. sed -e '/^S?H?LIBDIR=.*$/d' -e '/^INCDIR=.*$/d' -e '/^BINDIR=.*$/d' -e '/^DATADIR=.*$/d' -e '/^MANDIR=.*$/d' $TMPMAK >> external/FFmpeg/config.mak
  8821. cat >> external/FFmpeg/config.mak <<EOF
  8822. LIBDIR=\$(INSTALL_ROOT)$libdir
  8823. SHLIBDIR=\$(INSTALL_ROOT)$shlibdir
  8824. INCDIR=\$(INSTALL_ROOT)$incdir
  8825. BINDIR=\$(INSTALL_ROOT)$bindir
  8826. DATADIR=\$(INSTALL_ROOT)$datadir
  8827. MANDIR=\$(INSTALL_ROOT)$mandir
  8828. CFLAGS=${CFLAGS} -DFF_API_OLD_DECODE_AUDIO=1 -w
  8829. endif # FFMPEG_CONFIG_MAK
  8830. EOF
  8831.  
  8832. # link config.h into external/FFmpeg
  8833. rm -f external/FFmpeg/config.h
  8834. (cd external/FFmpeg/ && ${ln_s} ../../$MYTH_CONFIG_H config.h)
  8835. touch external/FFmpeg/.config
  8836.  
  8837. enabled yasm && cp_if_changed $TMPASM external/FFmpeg/config.asm
  8838.  
  8839. # delete old myth config files in old location
  8840. if [ -e libs/libmyth/mythconfig.mak ] ; then
  8841. rm -f libs/libmyth/mythconfig.mak
  8842. fi
  8843. if [ -e libs/libmyth/mythconfig.h ] ; then
  8844. rm -f libs/libmyth/mythconfig.h
  8845. fi
  8846.  
  8847.  
  8848. cat > $TMPH <<EOF
  8849. /* Generated by ffconf */
  8850. #ifndef AVUTIL_AVCONFIG_H
  8851. #define AVUTIL_AVCONFIG_H
  8852. EOF
  8853. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  8854.  
  8855. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  8856.  
  8857. cp_if_changed $TMPH external/FFmpeg/libavutil/avconfig.h
  8858.  
  8859. <<BLOCKQUOTE
  8860. echo "config:$arch:$subarch:$cpu:$target_os:$cc_ident:$FFMPEG_CONFIGURATION" >config.fate
  8861. BLOCKQUOTE
  8862.  
  8863. if enabled mythlogserver; then
  8864. # configure zeromq
  8865. echo "Configuring zeromq..."
  8866. if [ ! `which libtool` ]
  8867. then
  8868. echo libtool not found. please install it.
  8869. exit 1
  8870. fi
  8871. if [ ! `which autoreconf` ]
  8872. then
  8873. echo autoreconf not found. please install it.
  8874. exit 1
  8875. fi
  8876. (cd external/zeromq ; ./autogen.sh 2> /dev/null > /dev/null)
  8877. if [ $? -ne 0 ]; then
  8878. echo external/zeromq/autogen.sh failed.
  8879. exit 1
  8880. fi
  8881. (cd external/zeromq ; \
  8882. ./configure --quiet --without-documentation --prefix=${prefix} \
  8883. --includedir=${prefix}/include/mythtv/zeromq \
  8884. --libdir=${libdir-name})
  8885. echo "Configuring nzmqt..."
  8886. (cd external/nzmqt/src ; \
  8887. ${qmakeconf} -o Makefile)
  8888. fi
  8889. if ! disabled hdhomerun ; then
  8890. echo "Configuring libhdhomerun..."
  8891. (cd external/libhdhomerun; \
  8892. ${qmakeconf} -o Makefile.lib CONFIG+=Makefile.lib; \
  8893. ${qmakeconf} -o Makefile.app CONFIG+=Makefile.app)
  8894. fi
  8895. echo "Configuring libmythbluray..."
  8896. (cd external/libmythbluray ; \
  8897. ${qmakeconf} -o Makefile)
  8898. echo "Configuring libmythdvdnav..."
  8899. (cd external/libmythdvdnav ; \
  8900. ${qmakeconf} -o Makefile)
  8901. echo "Configuring libsamplerate..."
  8902. (cd external/libsamplerate ; \
  8903. ${qmakeconf} -o Makefile)
  8904. echo "Configuring libudfread..."
  8905. (cd external/libudfread ; \
  8906. ${qmakeconf} -o Makefile)
  8907. echo "Configuring minilzo..."
  8908. (cd external/minilzo ; \
  8909. ${qmakeconf} -o Makefile)
  8910. echo "Configuring libmythsoundtouch..."
  8911. (cd external/libmythsoundtouch ; \
  8912. ${qmakeconf} -o Makefile)
  8913. if ! disabled x11 ; then
  8914. echo "Configuring libXNVCtrl..."
  8915. (cd external/libXNVCtrl; \
  8916. ${qmakeconf} -o Makefile.lib)
  8917. fi
  8918.  
  8919. # generate the lists of enabled components
  8920. print_enabled_components(){
  8921. file=$1
  8922. struct_name=$2
  8923. name=$3
  8924. shift 3
  8925. echo "static const $struct_name *$name[] = {" > $TMPH
  8926. for c in $*; do
  8927. enabled $c && printf " &ff_%s,\n" $c >> $TMPH
  8928. done
  8929. echo " NULL };" >> $TMPH
  8930. cp_if_changed $TMPH $file
  8931. }
  8932.  
  8933. print_enabled_components external/FFmpeg/libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
  8934. print_enabled_components external/FFmpeg/libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
  8935.  
  8936. test -n "$WARNINGS" && printf "\n$WARNINGS" || exit 0
  8937.  
  8938. <<MYTHEOF
  8939. # build pkg-config files
  8940.  
  8941. lib_version(){
  8942. eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
  8943. }
  8944.  
  8945. pkgconfig_generate(){
  8946. name=$1
  8947. shortname=${name#lib}${build_suffix}
  8948. comment=$2
  8949. version=$3
  8950. libs=$4
  8951. requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
  8952. requires=${requires%, }
  8953. enabled ${name#lib} || return 0
  8954. mkdir -p $name
  8955. cat <<EOF > $name/$name${build_suffix}.pc
  8956. prefix=$prefix
  8957. exec_prefix=\${prefix}
  8958. libdir=$libdir
  8959. includedir=$incdir
  8960.  
  8961. Name: $name
  8962. Description: $comment
  8963. Version: $version
  8964. Requires: $(enabled shared || echo $requires)
  8965. Requires.private: $(enabled shared && echo $requires)
  8966. Conflicts:
  8967. Libs: -L\${libdir} $(enabled rpath && echo "-Wl,-rpath,\${libdir}") -l${shortname} $(enabled shared || echo $libs)
  8968. Libs.private: $(enabled shared && echo $libs)
  8969. Cflags: -I\${includedir}
  8970. EOF
  8971.  
  8972. mkdir -p doc/examples/pc-uninstalled
  8973. includedir=${source_path}
  8974. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  8975. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  8976. prefix=
  8977. exec_prefix=
  8978. libdir=\${pcfiledir}/../../../$name
  8979. includedir=${includedir}
  8980.  
  8981. Name: $name
  8982. Description: $comment
  8983. Version: $version
  8984. Requires: $requires
  8985. Conflicts:
  8986. Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs)
  8987. Cflags: -I\${includedir}
  8988. EOF
  8989. }
  8990.  
  8991. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM"
  8992. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
  8993. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
  8994. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
  8995. pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
  8996. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
  8997. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
  8998. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
  8999. pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM $LIBSOXR"
  9000. MYTHEOF
Add Comment
Please, Sign In to add comment