configure 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359
  1. #!/bin/sh
  2. #
  3. # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
  4. #
  5. # make sure we are running under a compatible shell
  6. unset foo
  7. (: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null
  8. if test "$?" != 0; then
  9. if test "x$FFMPEG_CONFIGURE_EXEC" = x; then
  10. FFMPEG_CONFIGURE_EXEC=1
  11. export FFMPEG_CONFIGURE_EXEC
  12. exec bash "$0" "$@"
  13. exec ksh "$0" "$@"
  14. exec /usr/xpg4/bin/sh "$0" "$@"
  15. fi
  16. echo "No compatible shell script interpreter found."
  17. exit 1
  18. fi
  19. show_help(){
  20. echo "Usage: configure [options]"
  21. echo "Options: [defaults in brackets after descriptions]"
  22. echo
  23. echo "Standard options:"
  24. echo " --help print this message"
  25. echo " --log[=FILE|yes|no] log tests and output to FILE [config.err]"
  26. echo " --prefix=PREFIX install in PREFIX [$PREFIX]"
  27. echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
  28. echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]"
  29. echo " --incdir=DIR install includes in DIR [PREFIX/include/ffmpeg]"
  30. echo " --mandir=DIR install man page in DIR [PREFIX/man]"
  31. echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]"
  32. echo " --enable-libogg enable Ogg support via libogg [default=no]"
  33. echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]"
  34. echo " --enable-faad enable FAAD support via libfaad [default=no]"
  35. echo " --enable-faadbin build FAAD support with runtime linking [default=no]"
  36. echo " --enable-faac enable FAAC support via libfaac [default=no]"
  37. echo " --enable-libgsm enable GSM support via libgsm [default=no]"
  38. echo " --enable-xvid enable XviD support via xvidcore [default=no]"
  39. echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
  40. echo " --enable-mingw32 enable MinGW native/cross Windows compile"
  41. echo " --enable-mingwce enable MinGW native/cross WinCE compile"
  42. echo " --enable-a52 enable GPLed A52 support [default=no]"
  43. echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
  44. echo " --enable-dts enable GPLed DTS support [default=no]"
  45. echo " --enable-pp enable GPLed postprocessing support [default=no]"
  46. echo " --enable-static build static libraries [default=yes]"
  47. echo " --disable-static do not build static libraries [default=no]"
  48. echo " --enable-shared build shared libraries [default=no]"
  49. echo " --disable-shared do not build shared libraries [default=yes]"
  50. echo " --enable-amr_nb enable amr_nb float audio codec"
  51. echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
  52. echo " --enable-amr_wb enable amr_wb float audio codec"
  53. echo " --enable-amr_if2 enable amr_wb IF2 audio codec"
  54. echo " --enable-sunmlib use Sun medialib [default=no]"
  55. echo " --enable-pthreads use pthreads [default=no]"
  56. echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
  57. echo " and libraw1394 [default=no]"
  58. echo " --enable-swscaler software scaler support [default=no]"
  59. echo " --enable-avisynth allow reading AVISynth script files [default=no]"
  60. echo " --enable-gpl allow use of GPL code, the resulting libav*"
  61. echo " and ffmpeg will be under GPL [default=no]"
  62. echo ""
  63. echo "Advanced options (experts only):"
  64. echo " --source-path=PATH path to source code [$source_path]"
  65. echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
  66. echo " --cross-compile assume a cross-compiler is used"
  67. echo " --cc=CC use C compiler CC [$cc]"
  68. echo " --make=MAKE use specified make [$make]"
  69. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  70. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  71. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  72. echo " --build-suffix=SUFFIX suffix for application specific build []"
  73. echo " --arch=ARCH select architecture [$arch]"
  74. echo " --tune=CPU tune code for a particular CPU"
  75. echo " (may fail or perform badly on other CPUs)"
  76. echo " --powerpc-perf-enable enable performance report on PPC"
  77. echo " (requires enabling PMC)"
  78. echo " --disable-mmx disable MMX usage"
  79. echo " --disable-armv5te disable armv5te usage"
  80. echo " --disable-iwmmxt disable iwmmxt usage"
  81. echo " --disable-altivec disable AltiVec usage"
  82. echo " --disable-audio-oss disable OSS audio support [default=no]"
  83. echo " --disable-audio-beos disable BeOS audio support [default=no]"
  84. echo " --disable-v4l disable video4linux grabbing [default=no]"
  85. echo " --disable-v4l2 disable video4linux2 grabbing [default=no]"
  86. echo " --disable-bktr disable bktr video grabbing [default=no]"
  87. echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
  88. echo " --disable-network disable network support [default=no]"
  89. echo " --disable-ipv6 disable ipv6 support [default=no]"
  90. echo " --disable-zlib disable zlib [default=no]"
  91. echo " --disable-simple_idct disable simple IDCT routines [default=no]"
  92. echo " --disable-vhook disable video hooking support"
  93. echo " --enable-gprof enable profiling with gprof [$gprof]"
  94. echo " --disable-debug disable debugging symbols"
  95. echo " --disable-opts disable compiler optimizations"
  96. echo " --disable-mpegaudio-hp faster (but less accurate)"
  97. echo " MPEG audio decoding [default=no]"
  98. echo " --disable-protocols disable I/O protocols support [default=no]"
  99. echo " --disable-ffserver disable ffserver build"
  100. echo " --disable-ffplay disable ffplay build"
  101. echo " --enable-small optimize for size instead of speed"
  102. echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
  103. echo " --disable-strip disable stripping of executables and shared libraries"
  104. echo " --disable-encoder=NAME disables encoder NAME"
  105. echo " --enable-encoder=NAME enables encoder NAME"
  106. echo " --disable-decoder=NAME disables decoder NAME"
  107. echo " --enable-decoder=NAME enables decoder NAME"
  108. echo " --disable-encoders disables all encoders"
  109. echo " --disable-decoders disables all decoders"
  110. echo " --disable-muxer=NAME disables muxer NAME"
  111. echo " --enable-muxer=NAME enables muxer NAME"
  112. echo " --disable-muxers disables all muxers"
  113. echo " --disable-demuxer=NAME disables demuxer NAME"
  114. echo " --enable-demuxer=NAME enables demuxer NAME"
  115. echo " --disable-demuxers disables all demuxers"
  116. echo " --enable-parser=NAME enables parser NAME"
  117. echo " --disable-parser=NAME disables parser NAME"
  118. echo " --disable-parsers disables all parsers"
  119. echo ""
  120. echo "NOTE: Object files are built at the place where configure is launched."
  121. exit 1
  122. }
  123. log(){
  124. echo "$@" >>$logfile
  125. }
  126. log_file(){
  127. log BEGIN $1
  128. cat -n $1 >>$logfile
  129. log END $1
  130. }
  131. echolog(){
  132. log "$@"
  133. echo "$@"
  134. }
  135. die(){
  136. echolog "$@"
  137. cat <<EOF
  138. If you think configure made a mistake, make sure you are using the latest
  139. version from SVN. If the latest version fails, report the problem to the
  140. ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
  141. EOF
  142. if enabled logging; then
  143. cat <<EOF
  144. Include the log file "$logfile" produced by configure as this will help
  145. solving the problem.
  146. EOF
  147. else
  148. cat <<EOF
  149. Rerun configure with logging enabled (do not use --log=no), and include the
  150. log this produces with your report.
  151. EOF
  152. fi
  153. rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
  154. exit 1
  155. }
  156. enabled(){
  157. eval test "\$$1" = "yes"
  158. }
  159. flags_saved(){
  160. (: ${SAVE_CFLAGS?}) 2>/dev/null
  161. }
  162. save_flags(){
  163. flags_saved && return
  164. SAVE_CFLAGS="$CFLAGS"
  165. SAVE_LDFLAGS="$LDFLAGS"
  166. SAVE_extralibs="$extralibs"
  167. }
  168. restore_flags(){
  169. CFLAGS="$SAVE_CFLAGS"
  170. LDFLAGS="$SAVE_LDFLAGS"
  171. extralibs="$SAVE_extralibs"
  172. unset SAVE_CFLAGS
  173. unset SAVE_LDFLAGS
  174. unset SAVE_extralibs
  175. }
  176. temp_cflags(){
  177. save_flags
  178. CFLAGS="$CFLAGS $*"
  179. }
  180. temp_ldflags(){
  181. save_flags
  182. LDFLAGS="$LDFLAGS $*"
  183. }
  184. temp_extralibs(){
  185. save_flags
  186. extralibs="$extralibs $*"
  187. }
  188. append(){
  189. var=$1
  190. shift
  191. flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
  192. eval "$var=\"\$$var $*\""
  193. }
  194. add_cflags(){
  195. append CFLAGS "$@"
  196. }
  197. add_ldflags(){
  198. append LDFLAGS "$@"
  199. }
  200. add_extralibs(){
  201. append extralibs "$@"
  202. }
  203. check_cmd(){
  204. log "$@"
  205. "$@" >>$logfile 2>&1
  206. }
  207. check_cc(){
  208. log check_cc "$@"
  209. cat >$TMPC
  210. log_file $TMPC
  211. check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
  212. }
  213. check_cpp(){
  214. log check_cpp "$@"
  215. cat >$TMPC
  216. log_file $TMPC
  217. check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
  218. }
  219. check_ld(){
  220. log check_ld "$@"
  221. check_cc || return
  222. check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs
  223. }
  224. check_cflags(){
  225. log check_cflags "$@"
  226. check_cc "$@" <<EOF && add_cflags "$@"
  227. int x;
  228. EOF
  229. }
  230. check_ldflags(){
  231. log check_ldflags "$@"
  232. check_ld "$@" <<EOF && add_ldflags "$@"
  233. int main(){
  234. return 0;
  235. }
  236. EOF
  237. }
  238. check_header(){
  239. log check_header "$@"
  240. header=$1
  241. shift
  242. check_cpp "$@" <<EOF
  243. #include <$header>
  244. int x;
  245. EOF
  246. }
  247. check_func(){
  248. log check_func "$@"
  249. func=$1
  250. shift
  251. check_ld "$@" <<EOF
  252. extern int $func();
  253. int main(){
  254. $func();
  255. }
  256. EOF
  257. }
  258. check_lib(){
  259. log check_lib "$@"
  260. header="$1"
  261. func="$2"
  262. shift 2
  263. temp_extralibs "$@"
  264. check_header $header && check_func $func && add_extralibs "$@"
  265. err=$?
  266. restore_flags
  267. return $err
  268. }
  269. check_exec(){
  270. check_ld "$@" && { test "$cross_compile" = yes || $TMPE >>$logfile 2>&1; }
  271. }
  272. require(){
  273. name="$1"
  274. header="$2"
  275. func="$3"
  276. shift 3
  277. check_lib $header $func "$@" || die "ERROR: $name not found"
  278. }
  279. filter_out(){
  280. pattern="$1"
  281. shift
  282. echo "$@" | sed "s%\\<$pattern\\>%%g"
  283. }
  284. # set temporary file name
  285. if test ! -z "$TMPDIR" ; then
  286. TMPDIR1="${TMPDIR}"
  287. elif test ! -z "$TEMPDIR" ; then
  288. TMPDIR1="${TEMPDIR}"
  289. else
  290. TMPDIR1="/tmp"
  291. fi
  292. TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
  293. TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
  294. TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
  295. TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
  296. TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
  297. # default parameters
  298. logging="yes"
  299. logfile="config.err"
  300. PREFIX="/usr/local"
  301. libdir='${PREFIX}/lib'
  302. shlibdir="$libdir"
  303. incdir='${PREFIX}/include/ffmpeg'
  304. mandir='${PREFIX}/man'
  305. bindir='${PREFIX}/bin'
  306. cross_prefix=""
  307. cross_compile="no"
  308. cc="gcc"
  309. ar="ar"
  310. ranlib="ranlib"
  311. make="make"
  312. strip="strip"
  313. arch=`uname -m`
  314. tune="generic"
  315. powerpc_perf="no"
  316. mmx="default"
  317. armv5te="default"
  318. iwmmxt="default"
  319. altivec="default"
  320. dcbzl="no"
  321. mmi="default"
  322. case "$arch" in
  323. i386|i486|i586|i686|i86pc|BePC)
  324. arch="x86"
  325. ;;
  326. x86_64|amd64)
  327. arch="x86"
  328. canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
  329. if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
  330. if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
  331. arch="x86_64"
  332. fi
  333. fi
  334. ;;
  335. # armv4l is a subset of armv5tel
  336. arm|armv4l|armv5tel)
  337. arch="armv4l"
  338. ;;
  339. alpha)
  340. arch="alpha"
  341. ;;
  342. "Power Macintosh"|ppc|ppc64|powerpc)
  343. arch="powerpc"
  344. ;;
  345. mips|mipsel|IP*)
  346. arch="mips"
  347. ;;
  348. sun4u|sparc64)
  349. arch="sparc64"
  350. ;;
  351. sparc)
  352. arch="sparc"
  353. ;;
  354. sh4)
  355. arch="sh4"
  356. ;;
  357. parisc|parisc64)
  358. arch="parisc"
  359. ;;
  360. s390|s390x)
  361. arch="s390"
  362. ;;
  363. m68k)
  364. arch="m68k"
  365. ;;
  366. ia64)
  367. arch="ia64"
  368. ;;
  369. bfin)
  370. arch="bfin"
  371. ;;
  372. *)
  373. arch="unknown"
  374. ;;
  375. esac
  376. gprof="no"
  377. v4l="yes"
  378. v4l2="yes"
  379. bktr="no"
  380. audio_oss="yes"
  381. audio_beos="no"
  382. dv1394="yes"
  383. dc1394="no"
  384. network="yes"
  385. ipv6="yes"
  386. zlib="yes"
  387. libgsm="no"
  388. mp3lame="no"
  389. libogg="no"
  390. vorbis="no"
  391. faad="no"
  392. faadbin="no"
  393. faac="no"
  394. xvid="no"
  395. x264="no"
  396. a52="no"
  397. a52bin="no"
  398. dts="no"
  399. pp="no"
  400. mingw32="no"
  401. mingwce="no"
  402. os2="no"
  403. lstatic="yes"
  404. lshared="no"
  405. optimize="yes"
  406. debug="yes"
  407. dostrip="yes"
  408. installstrip="-s"
  409. extralibs="-lm"
  410. simpleidct="yes"
  411. bigendian="no"
  412. inttypes="yes"
  413. emu_fast_int="no"
  414. vhook="default"
  415. avisynth="no"
  416. dlfcn="no"
  417. dlopen="no"
  418. mpegaudio_hp="yes"
  419. SHFLAGS='-shared -Wl,-soname,$@'
  420. VHOOKSHFLAGS='$(SHFLAGS)'
  421. netserver="no"
  422. need_inet_aton="no"
  423. protocols="yes"
  424. ffserver="yes"
  425. ffplay="yes"
  426. LIBOBJFLAGS=""
  427. FFLDFLAGS=-Wl,--warn-common
  428. FFSERVERLDFLAGS=-Wl,-E
  429. LDCONFIG="ldconfig"
  430. LIBPREF="lib"
  431. LIBSUF=".a"
  432. LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
  433. SLIBPREF="lib"
  434. SLIBSUF=".so"
  435. SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
  436. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  437. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  438. EXESUF=""
  439. BUILDSUF=""
  440. amr_nb="no"
  441. amr_wb="no"
  442. amr_nb_fixed="no"
  443. amr_if2="no"
  444. sunmlib="no"
  445. pthreads="no"
  446. swscaler="no"
  447. gpl="no"
  448. memalignhack="no"
  449. asmalign_pot="unknown"
  450. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
  451. # OS specific
  452. targetos=`uname -s`
  453. case $targetos in
  454. BeOS)
  455. PREFIX="/boot/home/config"
  456. # helps building libavcodec
  457. add_cflags "-DPIC -fomit-frame-pointer"
  458. # 3 gcc releases known for BeOS, each with ugly bugs
  459. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  460. case "$gcc_version" in
  461. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  462. mmx="no"
  463. ;;
  464. *20010315*) echo "BeBits gcc"
  465. add_cflags "-fno-expensive-optimizations"
  466. ;;
  467. esac
  468. SHFLAGS=-nostart
  469. # disable Linux things
  470. audio_oss="no"
  471. v4l="no"
  472. v4l2="no"
  473. dv1394="no"
  474. # enable BeOS things
  475. audio_beos="yes"
  476. # no need for libm, but the inet stuff
  477. # Check for BONE
  478. if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
  479. extralibs="-lbind -lsocket"
  480. else
  481. netserver="yes"
  482. need_inet_aton="yes"
  483. extralibs="-lnet"
  484. fi ;;
  485. SunOS)
  486. v4l="no"
  487. v4l2="no"
  488. audio_oss="no"
  489. dv1394="no"
  490. make="gmake"
  491. FFLDFLAGS=""
  492. FFSERVERLDFLAGS=""
  493. SHFLAGS="-shared -Wl,-h,\$@"
  494. need_inet_aton="yes"
  495. add_extralibs "-lsocket -lnsl"
  496. ;;
  497. NetBSD)
  498. v4l="no"
  499. v4l2="no"
  500. bktr="yes"
  501. audio_oss="yes"
  502. dv1394="no"
  503. make="gmake"
  504. add_extralibs "-lossaudio"
  505. ;;
  506. OpenBSD)
  507. v4l="no"
  508. v4l2="no"
  509. bktr="yes"
  510. audio_oss="yes"
  511. dv1394="no"
  512. make="gmake"
  513. LIBOBJFLAGS="\$(PIC)"
  514. LDCONFIG="ldconfig -m \$(shlibdir)"
  515. add_extralibs "-lossaudio"
  516. ;;
  517. FreeBSD)
  518. v4l="no"
  519. v4l2="no"
  520. bktr="yes"
  521. audio_oss="yes"
  522. dv1394="no"
  523. make="gmake"
  524. add_cflags "-pthread"
  525. ;;
  526. GNU/kFreeBSD)
  527. v4l="no"
  528. v4l2="no"
  529. bktr="yes"
  530. audio_oss="yes"
  531. dv1394="no"
  532. add_cflags "-pthread"
  533. ;;
  534. BSD/OS)
  535. v4l="no"
  536. v4l2="no"
  537. bktr="yes"
  538. audio_oss="yes"
  539. dv1394="no"
  540. extralibs="-lpoll -lgnugetopt -lm"
  541. make="gmake"
  542. strip="strip -d"
  543. installstrip=""
  544. ;;
  545. Darwin)
  546. cc="cc"
  547. v4l="no"
  548. v4l2="no"
  549. audio_oss="no"
  550. dv1394="no"
  551. SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
  552. VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@'
  553. extralibs=""
  554. strip="strip -x"
  555. installstrip=""
  556. FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
  557. SLIBSUF=".dylib"
  558. SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
  559. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
  560. FFSERVERLDFLAGS=-Wl,-bind_at_load
  561. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
  562. ;;
  563. MINGW32*)
  564. # Note: the rest of the mingw32 config is done afterwards as mingw32
  565. # can be forced on the command line for Linux cross compilation.
  566. mingw32="yes"
  567. ;;
  568. CYGWIN*)
  569. targetos=CYGWIN
  570. shlibdir='${PREFIX}/bin'
  571. v4l="no"
  572. v4l2="no"
  573. audio_oss="yes"
  574. dv1394="no"
  575. VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
  576. VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
  577. extralibs=""
  578. EXESUF=".exe"
  579. SLIBPREF="cyg"
  580. SLIBSUF=".dll"
  581. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  582. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  583. SHFLAGS='-shared -Wl,--out-implib=lib$(NAME).dll.a'
  584. ;;
  585. Linux)
  586. ;;
  587. IRIX*)
  588. targetos=IRIX
  589. ranlib="echo ignoring ranlib"
  590. v4l="no"
  591. v4l2="no"
  592. audio_oss="no"
  593. make="gmake"
  594. ;;
  595. OS/2)
  596. TMPE=$TMPE".exe"
  597. ar="emxomfar -p128"
  598. ranlib="echo ignoring ranlib"
  599. strip="echo ignoring strip"
  600. add_cflags "-Zomf"
  601. FFLDFLAGS="-Zomf -Zstack 16384 -s"
  602. SHFLAGS="-Zdll -Zomf"
  603. FFSERVERLDFLAGS=""
  604. LIBPREF=""
  605. LIBSUF=".lib"
  606. SLIBPREF=""
  607. SLIBSUF=".dll"
  608. EXESUF=".exe"
  609. extralibs=""
  610. pkg_requires=""
  611. v4l="no"
  612. v4l2="no"
  613. audio_oss="no"
  614. dv1394="no"
  615. ffserver="no"
  616. vhook="no"
  617. os2="yes"
  618. ;;
  619. *)
  620. targetos="${targetos}-UNKNOWN"
  621. ;;
  622. esac
  623. # find source path
  624. source_path="`dirname $0`"
  625. source_path_used="yes"
  626. if test -z "$source_path" -o "$source_path" = "." ; then
  627. source_path=`pwd`
  628. source_path_used="no"
  629. else
  630. source_path="`cd \"$source_path\"; pwd`"
  631. fi
  632. if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
  633. show_help
  634. fi
  635. FFMPEG_CONFIGURATION=" "
  636. for opt do
  637. FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
  638. done
  639. ENCODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_encoder)' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
  640. DECODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_decoder)' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
  641. PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
  642. MUXER_LIST=`grep 'av_register_output_format(&[a-z]' $source_path/libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
  643. DEMUXER_LIST=`grep 'av_register_input_format(&[a-z]' $source_path/libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
  644. for opt do
  645. optval="${opt#*=}"
  646. case "$opt" in
  647. --log)
  648. ;;
  649. --log=*) logging="$optval"
  650. ;;
  651. --prefix=*) PREFIX="$optval"; force_prefix=yes
  652. ;;
  653. --libdir=*) libdir="$optval"; force_libdir=yes
  654. ;;
  655. --shlibdir=*) shlibdir="$optval"
  656. ;;
  657. --incdir=*) incdir="$optval"
  658. ;;
  659. --mandir=*) mandir="$optval"
  660. ;;
  661. --source-path=*) source_path="$optval"
  662. ;;
  663. --cross-prefix=*) cross_prefix="$optval"
  664. ;;
  665. --cross-compile) cross_compile=yes
  666. ;;
  667. --cc=*) cc="$optval"
  668. ;;
  669. --make=*) make="$optval"
  670. ;;
  671. --extra-cflags=*) add_cflags "$optval"
  672. ;;
  673. --extra-ldflags=*) EXTRALDFLAGS="$optval"
  674. ;;
  675. --extra-libs=*) extralibs="$optval"
  676. ;;
  677. --build-suffix=*) BUILDSUF="$optval"
  678. ;;
  679. --arch=*) arch="$optval"
  680. ;;
  681. --tune=*) tune="$optval"
  682. ;;
  683. --powerpc-perf-enable) powerpc_perf="yes"
  684. ;;
  685. --disable-mmx) mmx="no"
  686. ;;
  687. --disable-armv5te) armv5te="no"
  688. ;;
  689. --disable-iwmmxt) iwmmxt="no"
  690. ;;
  691. --disable-altivec) altivec="no"
  692. ;;
  693. --enable-gprof) gprof="yes"
  694. ;;
  695. --disable-v4l) v4l="no"
  696. ;;
  697. --disable-v4l2) v4l2="no"
  698. ;;
  699. --disable-bktr) bktr="no"
  700. ;;
  701. --disable-audio-oss) audio_oss="no"
  702. ;;
  703. --disable-audio-beos) audio_beos="no"
  704. ;;
  705. --disable-dv1394) dv1394="no"
  706. ;;
  707. --disable-network) network="no"; ffserver="no"
  708. ;;
  709. --disable-ipv6) ipv6="no";
  710. ;;
  711. --disable-zlib) zlib="no"
  712. ;;
  713. --enable-a52) a52="yes"
  714. ;;
  715. --enable-a52bin) a52bin="yes"
  716. ;;
  717. --enable-dts) dts="yes"
  718. ;;
  719. --enable-pp) pp="yes"
  720. ;;
  721. --enable-libgsm) libgsm="yes"
  722. ;;
  723. --enable-mp3lame) mp3lame="yes"
  724. ;;
  725. --enable-libogg) libogg="yes"
  726. pkg_requires="$pkg_requires ogg >= 1.1"
  727. ;;
  728. --enable-vorbis) vorbis="yes"
  729. pkg_requires="$pkg_requires vorbis vorbisenc"
  730. ;;
  731. --enable-faad) faad="yes"
  732. ;;
  733. --enable-faadbin) faadbin="yes"
  734. ;;
  735. --enable-faac) faac="yes"
  736. ;;
  737. --enable-xvid) xvid="yes"
  738. ;;
  739. --enable-x264) x264="yes"
  740. ;;
  741. --enable-avisynth) avisynth="yes";
  742. ;;
  743. --enable-dc1394) dc1394="yes"
  744. pkg_requires="$pkg_requires libraw1394"
  745. ;;
  746. --disable-vhook) vhook="no"
  747. ;;
  748. --disable-simple_idct) simpleidct="no"
  749. ;;
  750. --enable-mingw32) mingw32="yes"
  751. ;;
  752. --enable-mingwce) mingwce="yes"
  753. ;;
  754. --enable-static) lstatic="yes"
  755. ;;
  756. --disable-static) lstatic="no"
  757. ;;
  758. --enable-shared) lshared="yes"
  759. ;;
  760. --disable-shared) lshared="no"
  761. ;;
  762. --disable-debug) debug="no"
  763. ;;
  764. --disable-opts) optimize="no"
  765. ;;
  766. --disable-mpegaudio-hp) mpegaudio_hp="no"
  767. ;;
  768. --disable-protocols) protocols="no"; network="no"; ffserver="no"
  769. ;;
  770. --disable-ffserver) ffserver="no"
  771. ;;
  772. --disable-ffplay) ffplay="no"
  773. ;;
  774. --enable-small) optimize="small"
  775. ;;
  776. --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
  777. ;;
  778. --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
  779. ;;
  780. --enable-amr_wb) amr="yes"; amr_wb="yes"
  781. ;;
  782. --enable-amr_if2) amr="yes"; amr_if2="yes"
  783. ;;
  784. --enable-sunmlib) sunmlib="yes"
  785. ;;
  786. --enable-pthreads) pthreads="yes"
  787. ;;
  788. --enable-swscaler) swscaler="yes"
  789. ;;
  790. --enable-gpl) gpl="yes"
  791. ;;
  792. --enable-memalign-hack) memalignhack="yes"
  793. ;;
  794. --disable-strip) dostrip="no"
  795. ;;
  796. --enable-encoder=*) ENCODER_LIST="$ENCODER_LIST ${optval}_encoder"
  797. ;;
  798. --enable-decoder=*) DECODER_LIST="$DECODER_LIST ${optval}_decoder"
  799. ;;
  800. --disable-encoder=*) ENCODER_LIST="`filter_out ${optval}_encoder $ENCODER_LIST`"
  801. ;;
  802. --disable-decoder=*) DECODER_LIST="`filter_out ${optval}_decoder $DECODER_LIST`"
  803. ;;
  804. --disable-encoders) ENCODER_LIST=""
  805. ;;
  806. --disable-decoders) DECODER_LIST=""
  807. ;;
  808. --enable-muxer=*) MUXER_LIST="$MUXER_LIST ${optval}_muxer"
  809. ;;
  810. --disable-muxer=*) MUXER_LIST="`filter_out ${optval}_muxer $MUXER_LIST`"
  811. ;;
  812. --disable-muxers) MUXER_LIST=""; ffserver="no"
  813. ;;
  814. --enable-demuxer=*) DEMUXER_LIST="$DEMUXER_LIST ${optval}_demuxer"
  815. ;;
  816. --disable-demuxer=*) DEMUXER_LIST="`filter_out ${optval}_demuxer $DEMUXER_LIST`"
  817. ;;
  818. --disable-demuxers) DEMUXER_LIST=""
  819. ;;
  820. --enable-parser=*) PARSER_LIST="$PARSER_LIST ${optval}_parser"
  821. ;;
  822. --disable-parser=*) PARSER_LIST="`filter_out ${optval}_parser $PARSER_LIST`"
  823. ;;
  824. --disable-parsers) PARSER_LIST=""
  825. ;;
  826. --help) show_help
  827. ;;
  828. *)
  829. echo "Unknown option \"$opt\"."
  830. echo "See $0 --help for available options."
  831. exit 1
  832. ;;
  833. esac
  834. done
  835. if test "$logging" != no; then
  836. test "$logging" = yes || logfile="$logging"
  837. echo "# $0 $@" >$logfile
  838. set >>$logfile
  839. else
  840. logfile=/dev/null
  841. fi
  842. if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
  843. if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
  844. cat <<EOF
  845. You can only build one library type at once on MinGW.
  846. Specify --disable-static --enable-shared to only build
  847. the shared libraries. To build only the static libraries
  848. you do not need to pass additional options.
  849. EOF
  850. exit 1
  851. fi
  852. v4l="no"
  853. v4l2="no"
  854. bktr="no"
  855. audio_oss="no"
  856. dv1394="no"
  857. dc1394="no"
  858. ffserver="no"
  859. network="no"
  860. if test "$mingwce" = "yes"; then
  861. protocols="no"
  862. fi
  863. SLIBPREF=""
  864. SLIBSUF=".dll"
  865. EXESUF=".exe"
  866. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  867. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  868. SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)"
  869. SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a)"
  870. if test "$force_prefix" != yes; then PREFIX="$PROGRAMFILES/FFmpeg"; fi
  871. if test "$force_libdir" != yes; then bindir='${PREFIX}'; fi
  872. shlibdir='${PREFIX}'
  873. fi
  874. # Combine FFLDFLAGS, EXTRALDFLAGS and the LDFLAGS environment variable.
  875. LDFLAGS="$FFLDFLAGS $EXTRALDFLAGS $LDFLAGS"
  876. test -n "$cross_prefix" && cross_compile=yes
  877. cc="${cross_prefix}${cc}"
  878. ar="${cross_prefix}${ar}"
  879. ranlib="${cross_prefix}${ranlib}"
  880. strip="${cross_prefix}${strip}"
  881. # we need to build at least one lib type
  882. if test "$lstatic" = "no" && test "$lshared" = "no" ; then
  883. cat <<EOF
  884. At least one library type must be built.
  885. Specify --enable-static to build the static libraries or --enable-shared to
  886. build the shared libraries as well. To only build the shared libraries specify
  887. --disable-static in addition to --enable-shared.
  888. EOF
  889. exit 1;
  890. fi
  891. if test "$vorbis" = "yes" ; then
  892. if test "$libogg" = "no"; then
  893. echo "libogg must be enabled to enable Vorbis."
  894. fail="yes"
  895. fi
  896. fi
  897. if test "$gpl" != "yes"; then
  898. if test "$pp" != "no"; then
  899. echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
  900. fail="yes"
  901. fi
  902. if test "$a52" != "no" -o "$a52bin" != "no"; then
  903. echo "liba52 is under GPL and --enable-gpl is not specified."
  904. fail="yes"
  905. fi
  906. if test "$xvid" != "no"; then
  907. echo "libxvidcore is under GPL and --enable-gpl is not specified."
  908. fail="yes"
  909. fi
  910. if test "$x264" != "no"; then
  911. echo "x264 is under GPL and --enable-gpl is not specified."
  912. fail="yes"
  913. fi
  914. if test "$dts" != "no"; then
  915. echo "libdts is under GPL and --enable-gpl is not specified."
  916. fail="yes"
  917. fi
  918. if test "$faad" != "no" -o "$faadbin" != "no"; then
  919. if check_header faad.h; then
  920. check_cc << EOF
  921. #include <faad.h>
  922. #ifndef FAAD2_VERSION
  923. ok faad1
  924. #endif
  925. int main( void ) { return 0; }
  926. EOF
  927. if test $? = 0 ; then
  928. echo "FAAD2 is under GPL and --enable-gpl is not specified."
  929. fail="yes"
  930. fi
  931. else
  932. faad="no"
  933. faadbin="no"
  934. echo "FAAD test failed."
  935. fi
  936. fi
  937. if test "$swscaler" != "no"; then
  938. echo "The software scaler is under GPL and --enable-gpl is not specified."
  939. fail="yes"
  940. fi
  941. fi
  942. if test "$fail" = "yes"; then
  943. exit 1
  944. fi
  945. # compute MMX state
  946. if test $mmx = "default"; then
  947. if test $arch = "x86" -o $arch = "x86_64"; then
  948. mmx="yes"
  949. else
  950. mmx="no"
  951. fi
  952. fi
  953. #Darwin CC versions
  954. needmdynamicnopic="no"
  955. if test $targetos = Darwin; then
  956. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  957. add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
  958. else
  959. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  960. case "$gcc_version" in
  961. *2.95*)
  962. add_cflags "-no-cpp-precomp -pipe"
  963. ;;
  964. *[34].*)
  965. add_cflags "-no-cpp-precomp -pipe -force_cpusubtype_ALL -Wno-sign-compare"
  966. if test "$lshared" = no; then
  967. needmdynamicnopic="yes"
  968. fi
  969. ;;
  970. *)
  971. add_cflags "-no-cpp-precomp -pipe"
  972. if test "$lshared" = no; then
  973. needmdynamicnopic="yes"
  974. fi
  975. ;;
  976. esac
  977. fi
  978. fi
  979. if test $optimize != "no"; then
  980. add_cflags "-fomit-frame-pointer"
  981. fi
  982. # Can only do AltiVec on PowerPC
  983. if test $altivec = "default"; then
  984. if test $arch = "powerpc"; then
  985. altivec="yes"
  986. else
  987. altivec="no"
  988. fi
  989. fi
  990. # Add processor-specific flags
  991. TUNECPU="generic"
  992. POWERPCMODE="32bits"
  993. if test $tune != "generic"; then
  994. case $tune in
  995. 601|ppc601|PowerPC601)
  996. add_cflags "-mcpu=601"
  997. if test $altivec = "yes"; then
  998. echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
  999. fi
  1000. TUNECPU=ppc601
  1001. ;;
  1002. 603*|ppc603*|PowerPC603*)
  1003. add_cflags "-mcpu=603"
  1004. if test $altivec = "yes"; then
  1005. echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
  1006. fi
  1007. TUNECPU=ppc603
  1008. ;;
  1009. 604*|ppc604*|PowerPC604*)
  1010. add_cflags "-mcpu=604"
  1011. if test $altivec = "yes"; then
  1012. echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
  1013. fi
  1014. TUNECPU=ppc604
  1015. ;;
  1016. G3|g3|75*|ppc75*|PowerPC75*)
  1017. add_cflags "-mcpu=750 -mtune=750 -mpowerpc-gfxopt"
  1018. if test $altivec = "yes"; then
  1019. echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
  1020. fi
  1021. TUNECPU=ppc750
  1022. ;;
  1023. G4|g4|745*|ppc745*|PowerPC745*)
  1024. add_cflags "-mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
  1025. if test $altivec = "no"; then
  1026. echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
  1027. fi
  1028. TUNECPU=ppc7450
  1029. ;;
  1030. 74*|ppc74*|PowerPC74*)
  1031. add_cflags "-mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
  1032. if test $altivec = "no"; then
  1033. echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
  1034. fi
  1035. TUNECPU=ppc7400
  1036. ;;
  1037. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  1038. add_cflags "-mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
  1039. if test $altivec = "no"; then
  1040. echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
  1041. fi
  1042. TUNECPU=ppc970
  1043. POWERPCMODE="64bits"
  1044. ;;
  1045. i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|pentium-m|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx)
  1046. add_cflags "-march=$tune"
  1047. ;;
  1048. sparc64)
  1049. add_cflags "-mcpu=v9 -mtune=v9"
  1050. ;;
  1051. *)
  1052. echo "WARNING: Unknown CPU \"$tune\", ignored."
  1053. ;;
  1054. esac
  1055. fi
  1056. # make sure we can execute files in $TMPDIR
  1057. cat >$TMPE 2>>$logfile <<EOF
  1058. #! /bin/sh
  1059. EOF
  1060. chmod +x $TMPE >>$logfile 2>&1
  1061. if ! $TMPE >>$logfile 2>&1; then
  1062. cat <<EOF
  1063. Unable to create and execute files in $TMPDIR1. Set the TMPDIR environment
  1064. variable to another directory.
  1065. EOF
  1066. die "Sanity test failed."
  1067. fi
  1068. rm $TMPE
  1069. # compiler sanity check
  1070. check_exec <<EOF
  1071. int main(){
  1072. return 0;
  1073. }
  1074. EOF
  1075. if test "$?" != 0; then
  1076. echo "$cc is unable to create an executable file."
  1077. if test -z "$cross_prefix" -a "$cross_compile" = no; then
  1078. echo "If $cc is a cross-compiler, use the --cross-compile option."
  1079. echo "Only do this if you know what cross compiling means."
  1080. fi
  1081. die "C compiler test failed."
  1082. fi
  1083. # check for assembler specific support
  1084. if test $arch = "powerpc"; then
  1085. check_cc <<EOF && dcbzl=yes
  1086. int main(void) {
  1087. register long zero = 0;
  1088. char data[1024];
  1089. asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));
  1090. return 0;
  1091. }
  1092. EOF
  1093. fi
  1094. # check for SIMD availability
  1095. # AltiVec flags: The FSF version of GCC differs from the Apple version
  1096. if test $arch = "powerpc"; then
  1097. if test $altivec = "yes"; then
  1098. if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
  1099. add_cflags "-faltivec"
  1100. else
  1101. add_cflags "-maltivec -mabi=altivec"
  1102. fi
  1103. fi
  1104. fi
  1105. check_header altivec.h && _altivec_h=yes || _altivec_h=no
  1106. # check if our compiler supports Motorola AltiVec C API
  1107. if test $altivec = "yes"; then
  1108. if test $_altivec_h = "yes"; then
  1109. inc_altivec_h="#include <altivec.h>"
  1110. else
  1111. inc_altivec_h=
  1112. fi
  1113. check_cc <<EOF || altivec=no
  1114. $inc_altivec_h
  1115. int main(void) {
  1116. vector signed int v1, v2, v3;
  1117. v1 = vec_add(v2,v3);
  1118. return 0;
  1119. }
  1120. EOF
  1121. fi
  1122. # check armv5te instructions support
  1123. if test $armv5te = "default" -a $arch = "armv4l"; then
  1124. armv5te=no
  1125. check_cc <<EOF && armv5te=yes
  1126. int main(void) {
  1127. __asm__ __volatile__ ("qadd r0, r0, r0");
  1128. }
  1129. EOF
  1130. fi
  1131. # check iwmmxt support
  1132. if test $iwmmxt = "default" -a $arch = "armv4l"; then
  1133. iwmmxt=no
  1134. check_cc <<EOF && iwmmxt=yes
  1135. int main(void) {
  1136. __asm__ __volatile__ ("wunpckelub wr6, wr4");
  1137. }
  1138. EOF
  1139. fi
  1140. # mmi only available on mips
  1141. if test $mmi = "default"; then
  1142. if test $arch = "mips"; then
  1143. mmi="yes"
  1144. else
  1145. mmi="no"
  1146. fi
  1147. fi
  1148. # check if our compiler supports mmi
  1149. enabled mmi && check_cc <<EOF || mmi="no"
  1150. int main(void) {
  1151. __asm__ ("lq \$2, 0(\$2)");
  1152. return 0;
  1153. }
  1154. EOF
  1155. # ---
  1156. # big/little-endian test
  1157. if test "$cross_compile" = "no"; then
  1158. check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
  1159. #include <inttypes.h>
  1160. int main(int argc, char ** argv){
  1161. volatile uint32_t i=0x01234567;
  1162. return (*((uint8_t*)(&i))) == 0x67;
  1163. }
  1164. EOF
  1165. else
  1166. # programs cannot be launched if cross compiling, so make a static guess
  1167. if test "$arch" = "powerpc" -o "$arch" = "mips" ; then
  1168. bigendian="yes"
  1169. fi
  1170. fi
  1171. # ---
  1172. # *inttypes.h* test
  1173. check_header inttypes.h || inttypes=no
  1174. # ---
  1175. # *int_fast* test
  1176. check_cc <<EOF || emu_fast_int=yes
  1177. #include <inttypes.h>
  1178. int main(int argc, char ** argv){
  1179. volatile uint_fast64_t i=0x01234567;
  1180. return 0;
  1181. }
  1182. EOF
  1183. # ---
  1184. # check availability of some header files
  1185. _memalign=no
  1186. _malloc_h=no
  1187. if check_header malloc.h; then
  1188. _malloc_h=yes
  1189. _memalign=yes
  1190. check_func memalign || _memalign="no"
  1191. fi
  1192. if test "$_memalign" = "no" -a "$mmx" = "yes" -a \
  1193. "$memalignhack" != "yes" -a "$targetos" != "Darwin" -a \
  1194. "$targetos" != "FreeBSD" ; then
  1195. die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
  1196. fi
  1197. check_func localtime_r && localtime_r=yes || localtime_r=no
  1198. enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
  1199. # check for some common methods of building with pthread support
  1200. # do this before the optional library checks as some of them require pthreads
  1201. if enabled pthreads; then
  1202. { check_cflags -pthread && check_ldflags -pthread; } ||
  1203. { check_cflags -pthreads && check_ldflags -pthreads; } ||
  1204. check_lib pthread.h pthread_create -lpthread ||
  1205. check_func pthread_create ||
  1206. die "ERROR: can't find pthreads library"
  1207. fi
  1208. # these are off by default, so fail if requested and not available
  1209. enabled dts && require libdts dts.h dts_init -ldts
  1210. enabled libgsm && require libgsm gsm.h gsm_create -lgsm
  1211. enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame
  1212. enabled vorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc -logg
  1213. enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg
  1214. enabled xvid && require XviD xvid.h xvid_global -lxvidcore
  1215. enabled x264 && require x264 x264.h x264_encoder_open -lx264
  1216. enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
  1217. enabled sunmlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
  1218. # Ugh, faac uses stdcall calling convention on win32 so we can't use
  1219. # the generic test functions
  1220. if enabled faac; then
  1221. save_flags
  1222. temp_extralibs -lfaac
  1223. check_ld <<EOF && add_extralibs -lfaac || die "ERROR: libfaac not found"
  1224. #include <stdint.h>
  1225. #include <faac.h>
  1226. int main(){
  1227. char *id, *cpr;
  1228. faacEncGetVersion(&id, &cpr);
  1229. return 0;
  1230. }
  1231. EOF
  1232. restore_flags
  1233. fi
  1234. # Ugh, recent faad2 versions have renamed all functions and #define the
  1235. # old names in faad.h. Generic tests won't work.
  1236. if enabled faad; then
  1237. save_flags
  1238. temp_extralibs -lfaad
  1239. check_ld <<EOF && add_extralibs -lfaad || die "ERROR: libfaad not found"
  1240. #include <faad.h>
  1241. int main(){
  1242. faacDecOpen();
  1243. return 0;
  1244. }
  1245. EOF
  1246. restore_flags
  1247. fi
  1248. # Ugh, avisynth uses WINAPI calls. Generic tests won't work.
  1249. if enabled avisynth; then
  1250. save_flags
  1251. temp_extralibs -lvfw32
  1252. check_ld <<EOF && add_extralibs -lvfw32 || die "ERROR: vfw32 not found"
  1253. #include <windows.h>
  1254. #include <vfw.h>
  1255. int main(){
  1256. AVIFileInit();
  1257. return 0;
  1258. }
  1259. EOF
  1260. restore_flags
  1261. fi
  1262. # test for lrintf in math.h
  1263. check_exec <<EOF && have_lrintf=yes || have_lrintf=no
  1264. #define _ISOC9X_SOURCE 1
  1265. #include <math.h>
  1266. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  1267. EOF
  1268. _restrict=
  1269. for restrict_keyword in restrict __restrict__ __restrict; do
  1270. check_cc <<EOF && _restrict=$restrict_keyword && break
  1271. void foo(char * $restrict_keyword p);
  1272. EOF
  1273. done
  1274. # dlopen/dlfcn.h probing
  1275. check_header dlfcn.h && dlfcn=yes
  1276. temp_extralibs -ldl
  1277. if check_func dlopen; then
  1278. dlopen=yes
  1279. ldl=-ldl
  1280. fi
  1281. restore_flags
  1282. if check_func dlopen; then
  1283. dlopen=yes
  1284. ldl=
  1285. fi
  1286. if test "$vhook" = "default"; then
  1287. vhook="$dlopen"
  1288. fi
  1289. if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
  1290. add_extralibs $ldl
  1291. fi
  1292. if test "$targetos" = "CYGWIN" -a "$lstatic" = "yes" ; then
  1293. vhook="no"
  1294. echo
  1295. echo "At the moment vhooks don't work on Cygwin static builds."
  1296. echo "Patches welcome."
  1297. echo
  1298. fi
  1299. if enabled vhook; then
  1300. check_ldflags -rdynamic
  1301. check_ldflags -export-dynamic
  1302. fi
  1303. ##########################################
  1304. # imlib check
  1305. temp_extralibs -lImlib2
  1306. check_ld <<EOF && imlib2=yes || imlib2=no
  1307. #include <X11/Xlib.h>
  1308. #include <Imlib2.h>
  1309. int main( void ) { return (int) imlib_load_font("foo"); }
  1310. EOF
  1311. restore_flags
  1312. ##########################################
  1313. # FreeType check
  1314. freetype2=no
  1315. if test "x$targetos" != "xBeOS"; then
  1316. if (freetype-config --version) >/dev/null 2>&1 ; then
  1317. temp_cflags `freetype-config --cflags`
  1318. temp_extralibs `freetype-config --libs`
  1319. check_ld <<EOF && freetype2=yes
  1320. #include <ft2build.h>
  1321. int main( void ) { return (int) FT_Init_FreeType(0); }
  1322. EOF
  1323. restore_flags
  1324. fi
  1325. fi
  1326. ##########################################
  1327. # SDL check
  1328. sdl_too_old=no
  1329. sdl=no
  1330. SDL_CONFIG="${cross_prefix}sdl-config"
  1331. if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
  1332. temp_cflags `"${SDL_CONFIG}" --cflags`
  1333. temp_extralibs `"${SDL_CONFIG}" --libs`
  1334. check_ld <<EOF
  1335. #include <SDL.h>
  1336. #undef main /* We don't want SDL to override our main() */
  1337. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  1338. EOF
  1339. if test $? = 0; then
  1340. _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
  1341. if test "$_sdlversion" -lt 121 ; then
  1342. sdl_too_old=yes
  1343. else
  1344. sdl=yes
  1345. check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no
  1346. #include <SDL.h>
  1347. int main(void){
  1348. const SDL_VideoInfo *vi = SDL_GetVideoInfo();
  1349. int w = vi->current_w;
  1350. return 0;
  1351. }
  1352. EOF
  1353. fi
  1354. fi
  1355. restore_flags
  1356. fi
  1357. enabled sdl || ffplay=no
  1358. ##########################################
  1359. # texi2html check
  1360. texi2html=no
  1361. if (texi2html -version) >/dev/null 2>&1; then
  1362. texi2html=yes
  1363. fi
  1364. ##########################################
  1365. # IPv6 check
  1366. enabled network && enabled ipv6 && check_ld <<EOF && ipv6=yes || ipv6=no
  1367. #include <sys/types.h>
  1368. #include <sys/socket.h>
  1369. #include <netinet/in.h>
  1370. #include <netdb.h>
  1371. int main( void ) {
  1372. struct sockaddr_storage saddr;
  1373. struct ipv6_mreq mreq6;
  1374. getaddrinfo(0,0,0,0);
  1375. getnameinfo(0,0,0,0,0,0,0);
  1376. IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
  1377. }
  1378. EOF
  1379. # check for video4linux2 --- V4L2_PIX_FMT_YUV420
  1380. enabled v4l2 && check_cc <<EOF || v4l2="no"
  1381. #include <sys/time.h>
  1382. #include <asm/types.h>
  1383. #include <linux/videodev2.h>
  1384. int dummy = V4L2_PIX_FMT_YUV420;
  1385. struct v4l2_buffer dummy1;
  1386. EOF
  1387. enabled debug && add_cflags -g
  1388. # add some useful compiler flags if supported
  1389. check_cflags -Wdeclaration-after-statement
  1390. check_cflags -Wall
  1391. check_cflags -Wno-switch
  1392. check_cflags -Wdisabled-optimization
  1393. check_cflags -Wpointer-arith
  1394. check_cflags -Wredundant-decls
  1395. check_cflags -Winline
  1396. # add some linker flags
  1397. check_ldflags '-Wl,--as-needed' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavformat' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
  1398. # not all compilers support -Os
  1399. test "$optimize" = "small" && check_cflags -Os
  1400. if enabled optimize; then
  1401. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  1402. add_cflags "-O5"
  1403. add_ldflags "-O5"
  1404. else
  1405. add_cflags "-O3"
  1406. fi
  1407. fi
  1408. # PIC flags for shared library objects where they are needed
  1409. if test "$lshared" = "yes" ; then
  1410. # LIBOBJFLAGS may have already been set in the OS configuration
  1411. if test -z "$LIBOBJFLAGS" ; then
  1412. case "$arch" in
  1413. x86_64|ia64|alpha|sparc*) LIBOBJFLAGS="\$(PIC)" ;;
  1414. esac
  1415. fi
  1416. fi
  1417. if test "$gprof" = "yes" ; then
  1418. add_cflags "-p"
  1419. add_ldflags "-p"
  1420. fi
  1421. # find if .align arg is power-of-two or not
  1422. if test $asmalign_pot = "unknown"; then
  1423. asmalign_pot="no"
  1424. echo 'asm (".align 3");' | check_cc && asmalign_pot="yes"
  1425. fi
  1426. echo "install prefix $PREFIX"
  1427. echo "source path $source_path"
  1428. echo "C compiler $cc"
  1429. echo "make $make"
  1430. echo "ARCH $arch ($tune)"
  1431. if test "$BUILDSUF" != ""; then
  1432. echo "build suffix $BUILDSUF"
  1433. fi
  1434. echo "big-endian $bigendian"
  1435. echo "inttypes.h $inttypes"
  1436. echo "broken inttypes.h $emu_fast_int"
  1437. if test $arch = "x86" -o $arch = "x86_64"; then
  1438. echo "MMX enabled $mmx"
  1439. fi
  1440. if test $arch = "armv4l"; then
  1441. echo "ARMv5TE enabled $armv5te"
  1442. echo "IWMMXT enabled $iwmmxt"
  1443. fi
  1444. if test $arch = "mips"; then
  1445. echo "MMI enabled $mmi"
  1446. fi
  1447. if test $arch = "powerpc"; then
  1448. echo "AltiVec enabled $altivec"
  1449. echo "dcbzl available $dcbzl"
  1450. fi
  1451. echo "gprof enabled $gprof"
  1452. echo "zlib enabled $zlib"
  1453. echo "libgsm enabled $libgsm"
  1454. echo "mp3lame enabled $mp3lame"
  1455. echo "libogg enabled $libogg"
  1456. echo "Vorbis enabled $vorbis"
  1457. echo "FAAD enabled $faad"
  1458. echo "faadbin enabled $faadbin"
  1459. echo "FAAC enabled $faac"
  1460. echo "XviD enabled $xvid"
  1461. echo "x264 enabled $x264"
  1462. echo "a52 support $a52"
  1463. echo "a52 dlopened $a52bin"
  1464. echo "DTS support $dts"
  1465. echo "pp support $pp"
  1466. echo "Software Scaler enabled $swscaler"
  1467. echo "AVISynth enabled $avisynth"
  1468. echo "debug symbols $debug"
  1469. echo "strip symbols $dostrip"
  1470. echo "optimize $optimize"
  1471. echo "static $lstatic"
  1472. echo "shared $lshared"
  1473. echo "video hooking $vhook"
  1474. echo "SDL support $sdl"
  1475. if test $sdl_too_old = "yes"; then
  1476. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  1477. fi
  1478. if test "$vhook" = "yes"; then
  1479. echo "Imlib2 support $imlib2"
  1480. echo "FreeType support $freetype2"
  1481. fi
  1482. echo "Sun medialib support" $sunmlib
  1483. echo "pthreads support" $pthreads
  1484. echo "AMR-NB float support" $amr_nb
  1485. echo "AMR-NB fixed support" $amr_nb_fixed
  1486. echo "AMR-WB float support" $amr_wb
  1487. echo "AMR-WB IF2 support" $amr_if2
  1488. echo "network support $network"
  1489. if test "$network" = "yes" ; then
  1490. echo "IPv6 support $ipv6"
  1491. fi
  1492. echo ".align is power-of-two" $asmalign_pot
  1493. if test "$gpl" = "no" ; then
  1494. echo "License: LGPL"
  1495. else
  1496. echo "License: GPL"
  1497. fi
  1498. echo "Creating config.mak and config.h..."
  1499. date >> config.log
  1500. echo " $0 $FFMPEG_CONFIGURATION" >> config.log
  1501. echo "# Automatically generated by configure - do not modify!" > config.mak
  1502. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  1503. echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
  1504. echo "PREFIX=$PREFIX" >> config.mak
  1505. echo "prefix=\$(DESTDIR)\${PREFIX}" >> config.mak
  1506. echo "libdir=\$(DESTDIR)$libdir" >> config.mak
  1507. echo "shlibdir=\$(DESTDIR)$shlibdir" >> config.mak
  1508. echo "incdir=\$(DESTDIR)$incdir" >> config.mak
  1509. echo "bindir=\$(DESTDIR)$bindir" >> config.mak
  1510. echo "mandir=\$(DESTDIR)$mandir" >> config.mak
  1511. echo "MAKE=$make" >> config.mak
  1512. echo "CC=$cc" >> config.mak
  1513. echo "AR=$ar" >> config.mak
  1514. echo "RANLIB=$ranlib" >> config.mak
  1515. if test "$dostrip" = "yes" ; then
  1516. echo "STRIP=$strip" >> config.mak
  1517. echo "INSTALLSTRIP=$installstrip" >> config.mak
  1518. else
  1519. echo "STRIP=echo ignoring strip" >> config.mak
  1520. echo "INSTALLSTRIP=" >> config.mak
  1521. fi
  1522. VHOOKCFLAGS="-fPIC $CFLAGS"
  1523. test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic
  1524. echo "OPTFLAGS=$CFLAGS" >> config.mak
  1525. echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak
  1526. echo "LDFLAGS=$LDFLAGS" >> config.mak
  1527. echo "LDCONFIG=$LDCONFIG" >> config.mak
  1528. echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
  1529. echo "SHFLAGS=$SHFLAGS" >> config.mak
  1530. echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
  1531. echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
  1532. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  1533. echo "BUILD_STATIC=$lstatic" >> config.mak
  1534. echo "BUILDSUF=$BUILDSUF" >> config.mak
  1535. echo "LIBPREF=$LIBPREF" >> config.mak
  1536. echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
  1537. if test "$lstatic" = "yes" ; then
  1538. echo "LIB=$LIB" >> config.mak
  1539. else # Some Make complain if this variable does not exist.
  1540. echo "LIB=" >> config.mak
  1541. fi
  1542. echo "SLIBPREF=$SLIBPREF" >> config.mak
  1543. echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
  1544. echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
  1545. echo "TARGET_OS=$targetos" >> config.mak
  1546. if test "$arch" = "x86" ; then
  1547. echo "TARGET_ARCH_X86=yes" >> config.mak
  1548. echo "#define ARCH_X86 1" >> $TMPH
  1549. elif test "$arch" = "x86_64" ; then
  1550. echo "TARGET_ARCH_X86_64=yes" >> config.mak
  1551. echo "#define ARCH_X86_64 1" >> $TMPH
  1552. elif test "$arch" = "armv4l" ; then
  1553. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  1554. echo "#define ARCH_ARMV4L 1" >> $TMPH
  1555. elif test "$arch" = "alpha" ; then
  1556. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  1557. echo "#define ARCH_ALPHA 1" >> $TMPH
  1558. elif test "$arch" = "sparc64" ; then
  1559. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  1560. echo "#define ARCH_SPARC64 1" >> $TMPH
  1561. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1562. echo "#define ARCH_SPARC 1" >> $TMPH
  1563. elif test "$arch" = "sparc" ; then
  1564. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1565. echo "#define ARCH_SPARC 1" >> $TMPH
  1566. elif test "$arch" = "powerpc" ; then
  1567. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  1568. echo "#define ARCH_POWERPC 1" >> $TMPH
  1569. if test $POWERPCMODE = "32bits"; then
  1570. echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
  1571. else
  1572. echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
  1573. fi
  1574. if test "$powerpc_perf" = "yes"; then
  1575. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  1576. fi
  1577. elif test "$arch" = "mips" ; then
  1578. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  1579. echo "#define ARCH_MIPS 1" >> $TMPH
  1580. elif test "$arch" = "sh4" ; then
  1581. echo "TARGET_ARCH_SH4=yes" >> config.mak
  1582. echo "#define ARCH_SH4 1" >> $TMPH
  1583. elif test "$arch" = "parisc" ; then
  1584. echo "TARGET_ARCH_PARISC=yes" >> config.mak
  1585. echo "#define ARCH_PARISC 1" >> $TMPH
  1586. elif test "$arch" = "s390" ; then
  1587. echo "TARGET_ARCH_S390=yes" >> config.mak
  1588. echo "#define ARCH_S390 1" >> $TMPH
  1589. elif test "$arch" = "m68k" ; then
  1590. echo "TARGET_ARCH_M68K=yes" >> config.mak
  1591. echo "#define ARCH_M68K 1" >> $TMPH
  1592. elif test "$arch" = "ia64" ; then
  1593. echo "TARGET_ARCH_IA64=yes" >> config.mak
  1594. echo "#define ARCH_IA64 1" >> $TMPH
  1595. elif test "$arch" = "bfin" ; then
  1596. echo "TARGET_ARCH_BFIN=yes" >> config.mak
  1597. echo "#define ARCH_BFIN 1" >> $TMPH
  1598. fi
  1599. echo "#define TUNECPU $TUNECPU" >> $TMPH
  1600. if test "$bigendian" = "yes" ; then
  1601. echo "WORDS_BIGENDIAN=yes" >> config.mak
  1602. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  1603. fi
  1604. if test "$inttypes" != "yes" ; then
  1605. echo "#define EMULATE_INTTYPES 1" >> $TMPH
  1606. fi
  1607. if test "$emu_fast_int" = "yes" ; then
  1608. echo "#define EMULATE_FAST_INT 1" >> $TMPH
  1609. fi
  1610. if test "$mmx" = "yes" ; then
  1611. echo "TARGET_MMX=yes" >> config.mak
  1612. echo "#define HAVE_MMX 1" >> $TMPH
  1613. echo "#define __CPU__ 586" >> $TMPH
  1614. fi
  1615. if test "$armv5te" = "yes" ; then
  1616. echo "TARGET_ARMV5TE=yes" >> config.mak
  1617. echo "#define HAVE_ARMV5TE 1" >> $TMPH
  1618. fi
  1619. if test "$iwmmxt" = "yes" ; then
  1620. echo "TARGET_IWMMXT=yes" >> config.mak
  1621. echo "#define HAVE_IWMMXT 1" >> $TMPH
  1622. fi
  1623. if test "$mmi" = "yes" ; then
  1624. echo "TARGET_MMI=yes" >> config.mak
  1625. echo "#define HAVE_MMI 1" >> $TMPH
  1626. fi
  1627. if test "$dcbzl" = "yes" ; then
  1628. echo "#define HAVE_DCBZL 1" >> $TMPH
  1629. else
  1630. echo "#undef HAVE_DCBZL" >> $TMPH
  1631. fi
  1632. if test "$altivec" = "yes" ; then
  1633. echo "TARGET_ALTIVEC=yes" >> config.mak
  1634. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  1635. if test "$_altivec_h" = "yes" ; then
  1636. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  1637. else
  1638. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  1639. fi
  1640. fi
  1641. if test "$gprof" = "yes" ; then
  1642. echo "#define HAVE_GPROF 1" >> $TMPH
  1643. fi
  1644. if test "$localtime_r" = "yes" ; then
  1645. echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
  1646. fi
  1647. if test "$imlib2" = "yes" ; then
  1648. echo "HAVE_IMLIB2=yes" >> config.mak
  1649. fi
  1650. if test "$freetype2" = "yes" ; then
  1651. echo "HAVE_FREETYPE2=yes" >> config.mak
  1652. fi
  1653. if test "$sunmlib" = "yes" ; then
  1654. echo "HAVE_MLIB=yes" >> config.mak
  1655. echo "#define HAVE_MLIB 1" >> $TMPH
  1656. fi
  1657. if test "$pthreads" = "yes" ; then
  1658. echo "HAVE_PTHREADS=yes" >> config.mak
  1659. echo "#define HAVE_PTHREADS 1" >> $TMPH
  1660. echo "#define HAVE_THREADS 1" >> $TMPH
  1661. fi
  1662. if test "$sdl" = "yes" ; then
  1663. echo "CONFIG_SDL=yes" >> config.mak
  1664. echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
  1665. echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
  1666. if test "$sdl_video_size" = "yes"; then
  1667. echo "#define HAVE_SDL_VIDEO_SIZE 1" >> $TMPH
  1668. fi
  1669. fi
  1670. if test "$texi2html" = "yes"; then
  1671. echo "BUILD_DOC=yes" >> config.mak
  1672. fi
  1673. if test "$have_lrintf" = "yes" ; then
  1674. echo "#define HAVE_LRINTF 1" >> $TMPH
  1675. fi
  1676. if test "$vhook" = "yes" ; then
  1677. echo "BUILD_VHOOK=yes" >> config.mak
  1678. echo "#define HAVE_VHOOK 1" >> $TMPH
  1679. fi
  1680. sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'`
  1681. pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
  1682. lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
  1683. lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
  1684. lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
  1685. if test "$lshared" = "yes" ; then
  1686. echo "#define BUILD_SHARED_AV 1" >> $TMPH
  1687. echo "BUILD_SHARED=yes" >> config.mak
  1688. echo "PIC=-fPIC -DPIC" >> config.mak
  1689. echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
  1690. echo "SPPVERSION=$lavc_version" >> config.mak
  1691. echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
  1692. echo "LAVCVERSION=$lavc_version" >> config.mak
  1693. echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
  1694. echo "LAVFVERSION=$lavf_version" >> config.mak
  1695. echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
  1696. echo "LAVUVERSION=$lavu_version" >> config.mak
  1697. echo "SWSMAJOR=${sws_version%%.*}" >> config.mak
  1698. echo "SWSVERSION=$sws_version" >> config.mak
  1699. echo "SLIBNAME=${SLIBNAME}" >> config.mak
  1700. echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
  1701. echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
  1702. echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
  1703. fi
  1704. echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
  1705. echo "EXTRALIBS=$extralibs" >> config.mak
  1706. # If you do not want to use encoders, disable them.
  1707. if echo "$ENCODER_LIST" | grep -q encoder; then
  1708. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  1709. echo "CONFIG_ENCODERS=yes" >> config.mak
  1710. fi
  1711. # If you do not want to use decoders, disable them.
  1712. if echo "$DECODER_LIST" | grep -q decoder; then
  1713. echo "#define CONFIG_DECODERS 1" >> $TMPH
  1714. echo "CONFIG_DECODERS=yes" >> config.mak
  1715. fi
  1716. # muxers
  1717. if echo "$MUXER_LIST" | grep -q muxer; then
  1718. echo "#define CONFIG_MUXERS 1" >> $TMPH
  1719. echo "CONFIG_MUXERS=yes" >> config.mak
  1720. fi
  1721. # demuxers
  1722. if echo "$DEMUXER_LIST" | grep -q demuxer; then
  1723. echo "#define CONFIG_DEMUXERS 1" >> $TMPH
  1724. echo "CONFIG_DEMUXERS=yes" >> config.mak
  1725. fi
  1726. # AC3
  1727. if test "$a52" = "yes" ; then
  1728. echo "#define CONFIG_AC3 1" >> $TMPH
  1729. echo "CONFIG_AC3=yes" >> config.mak
  1730. if test "$a52bin" = "yes" ; then
  1731. echo "#define CONFIG_A52BIN 1" >> $TMPH
  1732. echo "CONFIG_A52BIN=yes" >> config.mak
  1733. fi
  1734. fi
  1735. # DTS
  1736. if test "$dts" = "yes" ; then
  1737. echo "#define CONFIG_DTS 1" >> $TMPH
  1738. echo "CONFIG_DTS=yes" >> config.mak
  1739. fi
  1740. # PP
  1741. if test "$pp" = "yes" ; then
  1742. echo "#define CONFIG_PP 1" >> $TMPH
  1743. echo "CONFIG_PP=yes" >> config.mak
  1744. fi
  1745. if test "$swscaler" = "yes" ; then
  1746. echo "#define CONFIG_SWSCALER 1" >> $TMPH
  1747. echo "CONFIG_SWSCALER=yes" >> config.mak
  1748. fi
  1749. # MPEG audio high precision mode
  1750. if test "$mpegaudio_hp" = "yes" ; then
  1751. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  1752. fi
  1753. if test "$v4l" = "yes" ; then
  1754. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  1755. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  1756. fi
  1757. if test "$v4l2" = "yes" ; then
  1758. echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
  1759. echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
  1760. fi
  1761. if test "$bktr" = "yes" ; then
  1762. echo "#define CONFIG_BKTR 1" >> $TMPH
  1763. echo "CONFIG_BKTR=yes" >> config.mak
  1764. fi
  1765. if test "$dv1394" = "yes" ; then
  1766. echo "#define CONFIG_DV1394 1" >> $TMPH
  1767. echo "CONFIG_DV1394=yes" >> config.mak
  1768. fi
  1769. if test "$dc1394" = "yes" ; then
  1770. echo "#define CONFIG_DC1394 1" >> $TMPH
  1771. echo "CONFIG_DC1394=yes" >> config.mak
  1772. fi
  1773. if test "$dlopen" = "yes" ; then
  1774. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  1775. fi
  1776. if test "$dlfcn" = "yes" ; then
  1777. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  1778. fi
  1779. if test "$audio_oss" = "yes" ; then
  1780. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  1781. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  1782. fi
  1783. if test "$audio_beos" = "yes" ; then
  1784. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  1785. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  1786. fi
  1787. if test "$network" = "yes" ; then
  1788. echo "#define CONFIG_NETWORK 1" >> $TMPH
  1789. echo "CONFIG_NETWORK=yes" >> config.mak
  1790. fi
  1791. if test "$ipv6" = "yes" ; then
  1792. echo "#define CONFIG_IPV6 1" >> $TMPH
  1793. fi
  1794. if test "$zlib" = "yes" ; then
  1795. echo "#define CONFIG_ZLIB 1" >> $TMPH
  1796. echo "CONFIG_ZLIB=yes" >> config.mak
  1797. fi
  1798. if test "$libgsm" = "yes" ; then
  1799. echo "#define CONFIG_LIBGSM 1" >> $TMPH
  1800. echo "CONFIG_LIBGSM=yes" >> config.mak
  1801. fi
  1802. if test "$mp3lame" = "yes" ; then
  1803. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  1804. echo "CONFIG_MP3LAME=yes" >> config.mak
  1805. fi
  1806. if test "$libogg" = "yes" ; then
  1807. echo "#define CONFIG_LIBOGG 1" >> $TMPH
  1808. echo "CONFIG_LIBOGG=yes" >> config.mak
  1809. fi
  1810. if test "$vorbis" = "yes" ; then
  1811. echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
  1812. echo "CONFIG_LIBVORBIS=yes" >> config.mak
  1813. fi
  1814. if test "$faad" = "yes" ; then
  1815. echo "#define CONFIG_FAAD 1" >> $TMPH
  1816. echo "CONFIG_FAAD=yes" >> config.mak
  1817. fi
  1818. if test "$faadbin" = "yes" ; then
  1819. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  1820. echo "CONFIG_FAADBIN=yes" >> config.mak
  1821. fi
  1822. if test "$faac" = "yes" ; then
  1823. echo "#define CONFIG_FAAC 1" >> $TMPH
  1824. echo "CONFIG_FAAC=yes" >> config.mak
  1825. fi
  1826. if test "$xvid" = "yes" ; then
  1827. echo "#define CONFIG_XVID 1" >> $TMPH
  1828. echo "CONFIG_XVID=yes" >> config.mak
  1829. fi
  1830. if test "$x264" = "yes" ; then
  1831. echo "#define CONFIG_X264 1" >> $TMPH
  1832. echo "CONFIG_X264=yes" >> config.mak
  1833. fi
  1834. if test "$avisynth" = "yes" ; then
  1835. echo "#define CONFIG_AVISYNTH 1" >> $TMPH
  1836. echo "CONFIG_AVISYNTH=yes" >> config.mak
  1837. fi
  1838. if test "$mingw32" = "yes" ; then
  1839. echo "CONFIG_MINGW=yes" >> config.mak
  1840. echo "HAVE_W32THREADS=yes" >> config.mak
  1841. echo "#define HAVE_W32THREADS 1" >> $TMPH
  1842. echo "#define HAVE_THREADS 1" >> $TMPH
  1843. echo "#ifndef __MINGW32__" >> $TMPH
  1844. echo "#define __MINGW32__ 1" >> $TMPH
  1845. echo "#endif" >> $TMPH
  1846. fi
  1847. if test "$mingwce" = "yes" ; then
  1848. echo "CONFIG_MINGW=yes" >> config.mak
  1849. echo "#define CONFIG_WINCE 1" >> $TMPH
  1850. echo "CONFIG_WINCE=yes" >> config.mak
  1851. echo "#ifndef __MINGW32__" >> $TMPH
  1852. echo "#define __MINGW32__ 1" >> $TMPH
  1853. echo "#endif" >> $TMPH
  1854. fi
  1855. if test "$os2" = "yes" ; then
  1856. echo "#define CONFIG_OS2 1" >> $TMPH
  1857. echo "CONFIG_OS2=yes" >> config.mak
  1858. echo "HAVE_OS2THREADS=yes" >> config.mak
  1859. echo "#define HAVE_OS2THREADS 1" >> $TMPH
  1860. echo "#define HAVE_THREADS 1" >> $TMPH
  1861. fi
  1862. if test "$targetos" = "SunOS" ; then
  1863. echo "#define CONFIG_SUNOS 1" >> $TMPH
  1864. fi
  1865. if test "$targetos" = "BeOS" ; then
  1866. echo "HAVE_BEOSTHREADS=yes" >> config.mak
  1867. echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
  1868. echo "#define HAVE_THREADS 1" >> $TMPH
  1869. fi
  1870. if test "$targetos" = "Darwin"; then
  1871. echo "#define CONFIG_DARWIN 1" >> $TMPH
  1872. echo "CONFIG_DARWIN=yes" >> config.mak
  1873. fi
  1874. if test "$_malloc_h" = "yes" ; then
  1875. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  1876. else
  1877. echo "#undef HAVE_MALLOC_H" >> $TMPH
  1878. fi
  1879. if test "$_memalign" = "yes" ; then
  1880. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  1881. else
  1882. echo "#undef HAVE_MEMALIGN" >> $TMPH
  1883. fi
  1884. if test "$memalignhack" = "yes" ; then
  1885. echo "#define MEMALIGN_HACK 1" >> $TMPH
  1886. fi
  1887. if test "$netserver" = "yes" ; then
  1888. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  1889. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  1890. fi
  1891. if test "$need_inet_aton" = "yes" ; then
  1892. echo "NEED_INET_ATON=yes" >> config.mak
  1893. fi
  1894. if test "$simpleidct" = "yes" ; then
  1895. echo "#define SIMPLE_IDCT 1" >> $TMPH
  1896. fi
  1897. if test "$protocols" = "yes" ; then
  1898. echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
  1899. echo "CONFIG_PROTOCOLS=yes" >> config.mak
  1900. fi
  1901. if test "$ffserver" = "yes" ; then
  1902. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  1903. echo "CONFIG_FFSERVER=yes" >> config.mak
  1904. fi
  1905. if test "$ffplay" = "yes" ; then
  1906. echo "CONFIG_FFPLAY=yes" >> config.mak
  1907. fi
  1908. if test "$gpl" = "yes" ; then
  1909. echo "#define CONFIG_GPL 1" >> $TMPH
  1910. echo "CONFIG_GPL=yes" >> config.mak
  1911. fi
  1912. echo "#define restrict $_restrict" >> $TMPH
  1913. if test "$optimize" = "small"; then
  1914. echo "#define always_inline" >> $TMPH
  1915. echo "#define CONFIG_SMALL 1" >> $TMPH
  1916. fi
  1917. # build tree in object directory if source path is different from current one
  1918. if test "$source_path_used" = "yes" ; then
  1919. DIRS="\
  1920. doc \
  1921. libavformat \
  1922. libavcodec \
  1923. libavcodec/alpha \
  1924. libavcodec/armv4l \
  1925. libavcodec/bfin \
  1926. libavcodec/i386 \
  1927. libavcodec/sparc \
  1928. libavcodec/mlib \
  1929. libavcodec/ppc \
  1930. libavcodec/liba52 \
  1931. libpostproc \
  1932. libavutil \
  1933. libswscale \
  1934. tests \
  1935. vhook \
  1936. "
  1937. FILES="\
  1938. Makefile \
  1939. libavformat/Makefile \
  1940. libavcodec/Makefile \
  1941. libpostproc/Makefile \
  1942. libavutil/Makefile \
  1943. libswscale/Makefile \
  1944. tests/Makefile \
  1945. vhook/Makefile \
  1946. doc/Makefile \
  1947. doc/texi2pod.pl \
  1948. "
  1949. for dir in $DIRS ; do
  1950. mkdir -p $dir
  1951. done
  1952. for f in $FILES ; do
  1953. ln -sf "$source_path/$f" $f
  1954. done
  1955. fi
  1956. echo "SRC_PATH=$source_path" >> config.mak
  1957. echo "BUILD_ROOT=$PWD" >> config.mak
  1958. if test "$amr" = "yes" ; then
  1959. echo "#define CONFIG_AMR 1" >> $TMPH
  1960. echo "CONFIG_AMR=yes" >> config.mak
  1961. fi
  1962. if test "$amr_wb" = "yes" ; then
  1963. echo "#define CONFIG_AMR_WB 1" >> $TMPH
  1964. echo "CONFIG_AMR_WB=yes" >> config.mak
  1965. echo
  1966. echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
  1967. echo "V5.1.0 from "
  1968. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
  1969. echo "and extracted the source to libavcodec/amrwb_float"
  1970. fi
  1971. if test "$amr_nb" = "yes" ; then
  1972. echo "#define CONFIG_AMR_NB 1" >> $TMPH
  1973. echo "CONFIG_AMR_NB=yes" >> config.mak
  1974. echo
  1975. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  1976. echo "REL-5 V5.1.0 from "
  1977. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip"
  1978. echo "and extracted the source to libavcodec/amr_float"
  1979. echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
  1980. fi
  1981. if test "$amr_nb_fixed" = "yes" ; then
  1982. echo "#define CONFIG_AMR_NB_FIXED 1" >> $TMPH
  1983. echo "CONFIG_AMR_NB_FIXED=yes" >> config.mak
  1984. echo
  1985. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  1986. echo "REL-5 version 5.1.0 from "
  1987. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip"
  1988. echo "and extracted src to libavcodec/amr"
  1989. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  1990. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  1991. fi
  1992. if test "$amr_if2" = "yes" ; then
  1993. echo "AMR_CFLAGS=-DIF2=1" >> config.mak
  1994. fi
  1995. # Apparently it's not possible to portably echo a backslash.
  1996. if test "$asmalign_pot" = "yes" ; then
  1997. printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH
  1998. else
  1999. printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
  2000. fi
  2001. # "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking "tr a-z A-Z"
  2002. for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do
  2003. echo "#define CONFIG_`echo $codec | tr '[a-z]' '[A-Z]'` 1" >> $TMPH
  2004. echo "CONFIG_`echo $codec | tr '[a-z]' '[A-Z]'`=yes" >> config.mak
  2005. done
  2006. # Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
  2007. diff $TMPH config.h >/dev/null 2>&1
  2008. if test "$?" != "0" ; then
  2009. mv -f $TMPH config.h
  2010. else
  2011. echo "config.h is unchanged"
  2012. fi
  2013. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
  2014. # build pkg-config files libav*.pc and libpostproc.pc
  2015. # libavutil.pc
  2016. cat <<EOF >libavutil.pc
  2017. prefix=$PREFIX
  2018. exec_prefix=\${prefix}
  2019. libdir=\${exec_prefix}/lib
  2020. includedir=\${prefix}/include
  2021. Name: libavutil
  2022. Description: FFmpeg utility library
  2023. Version: $lavu_version
  2024. Requires:
  2025. Conflicts:
  2026. Libs: -L\${libdir} -lavutil
  2027. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  2028. EOF
  2029. cat <<EOF >libavutil-uninstalled.pc
  2030. prefix=
  2031. exec_prefix=
  2032. libdir=\${pcfiledir}/libavutil
  2033. includedir=\${pcfiledir}/libavutil
  2034. Name: libavutil
  2035. Description: FFmpeg utility library
  2036. Version: $lavu_version
  2037. Requires:
  2038. Conflicts:
  2039. Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
  2040. Cflags: -I\${includedir}
  2041. EOF
  2042. # libavcodec.pc
  2043. cat <<EOF >libavcodec.pc
  2044. prefix=$PREFIX
  2045. exec_prefix=\${prefix}
  2046. libdir=\${exec_prefix}/lib
  2047. includedir=\${prefix}/include
  2048. Name: libavcodec
  2049. Description: FFmpeg codec library
  2050. Version: $lavc_version
  2051. Requires: $pkg_requires libavutil = $lavu_version
  2052. Conflicts:
  2053. Libs: -L\${libdir} -lavcodec $extralibs
  2054. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  2055. EOF
  2056. cat <<EOF >libavcodec-uninstalled.pc
  2057. prefix=
  2058. exec_prefix=
  2059. libdir=\${pcfiledir}/libavcodec
  2060. includedir=\${pcfiledir}/libavcodec
  2061. Name: libavcodec
  2062. Description: FFmpeg codec library
  2063. Version: $lavc_version
  2064. Requires: $pkg_requires libavutil = $lavu_version
  2065. Conflicts:
  2066. Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
  2067. Cflags: -I\${includedir}
  2068. EOF
  2069. # libavformat.pc
  2070. cat <<EOF >libavformat.pc
  2071. prefix=$PREFIX
  2072. exec_prefix=\${prefix}
  2073. libdir=\${exec_prefix}/lib
  2074. includedir=\${prefix}/include
  2075. Name: libavformat
  2076. Description: FFmpeg container format library
  2077. Version: $lavf_version
  2078. Requires: $pkg_requires libavcodec = $lavc_version
  2079. Conflicts:
  2080. Libs: -L\${libdir} -lavformat $extralibs
  2081. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  2082. EOF
  2083. cat <<EOF >libavformat-uninstalled.pc
  2084. prefix=
  2085. exec_prefix=
  2086. libdir=\${pcfiledir}/libavformat
  2087. includedir=\${pcfiledir}/libavformat
  2088. Name: libavformat
  2089. Description: FFmpeg container format library
  2090. Version: $lavf_version
  2091. Requires: $pkg_requires libavcodec = $lavc_version
  2092. Conflicts:
  2093. Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
  2094. Cflags: -I\${includedir}
  2095. EOF
  2096. # libpostproc.pc
  2097. cat <<EOF >libpostproc.pc
  2098. prefix=$PREFIX
  2099. exec_prefix=\${prefix}
  2100. libdir=\${exec_prefix}/lib
  2101. includedir=\${prefix}/include
  2102. Name: libpostproc
  2103. Description: FFmpeg post processing library
  2104. Version: $lavc_version
  2105. Requires:
  2106. Conflicts:
  2107. Libs: -L\${libdir} -lpostproc
  2108. Cflags: -I\${includedir} -I\${includedir}/postproc
  2109. EOF
  2110. cat <<EOF >libpostproc-uninstalled.pc
  2111. prefix=
  2112. exec_prefix=
  2113. libdir=\${pcfiledir}/libpostproc
  2114. includedir=\${pcfiledir}/libpostproc
  2115. Name: libpostproc
  2116. Description: FFmpeg post processing library
  2117. Version: $lavc_version
  2118. Requires:
  2119. Conflicts:
  2120. Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
  2121. Cflags: -I\${includedir}
  2122. EOF
  2123. # libswscale.pc
  2124. cat <<EOF >libswscale.pc
  2125. prefix=$PREFIX
  2126. exec_prefix=\${prefix}
  2127. libdir=\${exec_prefix}/lib
  2128. includedir=\${prefix}/include
  2129. Name: libswscale
  2130. Description: FFmpeg image rescaling library
  2131. Version: $sws_version
  2132. Requires: $pkg_requires libavutil = $lavu_version
  2133. Conflicts:
  2134. Libs: -L\${libdir} -lswscale
  2135. Cflags: -I\${includedir} -I\${includedir}/swscale
  2136. EOF
  2137. cat <<EOF >libswscale-uninstalled.pc
  2138. prefix=
  2139. exec_prefix=
  2140. libdir=\${pcfiledir}/libswscale
  2141. includedir=\${pcfiledir}/libswscale
  2142. Name: libswscale
  2143. Description: FFmpeg image rescaling library
  2144. Version: $sws_version
  2145. Requires: $pkg_requires libavutil = $lavu_version
  2146. Conflicts:
  2147. Libs: \${libdir}/${LIBPREF}swscale${LIBSUF}
  2148. Cflags: -I\${includedir}
  2149. EOF