You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1136 lines
27KB

  1. #!/bin/sh
  2. #
  3. # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
  4. #
  5. # set temporary file name
  6. if test ! -z "$TMPDIR" ; then
  7. TMPDIR1="${TMPDIR}"
  8. elif test ! -z "$TEMPDIR" ; then
  9. TMPDIR1="${TEMPDIR}"
  10. else
  11. TMPDIR1="/tmp"
  12. fi
  13. TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
  14. TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
  15. TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
  16. TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
  17. TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
  18. # default parameters
  19. prefix="/usr/local"
  20. cross_prefix=""
  21. cc="gcc"
  22. ar="ar"
  23. ranlib="ranlib"
  24. make="make"
  25. strip="strip"
  26. cpu=`uname -m`
  27. tune="generic"
  28. powerpc_perf="no"
  29. mmx="default"
  30. altivec="default"
  31. mmi="default"
  32. case "$cpu" in
  33. i386|i486|i586|i686|i86pc|BePC)
  34. cpu="x86"
  35. ;;
  36. # armv4l is a subset of armv5tel
  37. armv4l|armv5tel)
  38. cpu="armv4l"
  39. ;;
  40. alpha)
  41. cpu="alpha"
  42. ;;
  43. "Power Macintosh"|ppc)
  44. cpu="powerpc"
  45. ;;
  46. mips)
  47. cpu="mips"
  48. ;;
  49. sun4u)
  50. cpu="sparc64"
  51. ;;
  52. *)
  53. cpu="unknown"
  54. ;;
  55. esac
  56. gprof="no"
  57. v4l="yes"
  58. audio_oss="yes"
  59. audio_beos="no"
  60. dv1394="yes"
  61. network="yes"
  62. zlib="yes"
  63. mp3lame="no"
  64. vorbis="no"
  65. faad="no"
  66. faadbin="no"
  67. a52="yes"
  68. a52bin="no"
  69. pp="yes"
  70. shared_pp="no"
  71. win32="no"
  72. mingw32="no"
  73. cygwin="no"
  74. os2="no"
  75. lshared="no"
  76. extralibs="-lm"
  77. simpleidct="yes"
  78. bigendian="no"
  79. vhook="default"
  80. dlfcn="no"
  81. dlopen="no"
  82. mpegaudio_hp="yes"
  83. SHFLAGS=-shared
  84. netserver="no"
  85. need_inet_aton="no"
  86. ffserver="yes"
  87. ffplay="yes"
  88. LDFLAGS=-Wl,--warn-common
  89. FFSLDFLAGS=-Wl,-E
  90. LIBPREF="lib"
  91. LIBSUF=".a"
  92. SLIBPREF="lib"
  93. SLIBSUF=".so"
  94. risky="yes"
  95. small="no"
  96. amr_nb="no"
  97. amr_nb_fixed="no"
  98. # OS specific
  99. targetos=`uname -s`
  100. case $targetos in
  101. BeOS)
  102. prefix="/boot/home/config"
  103. # helps building libavcodec
  104. CFLAGS="-O3 -DPIC -fomit-frame-pointer"
  105. # 3 gcc releases known for BeOS, each with ugly bugs
  106. gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
  107. case "$gcc_version" in
  108. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  109. mmx="no"
  110. ;;
  111. *20010315*) echo "BeBits gcc"
  112. CFLAGS="$CFLAGS -fno-expensive-optimizations"
  113. ;;
  114. esac
  115. SHFLAGS=-nostart
  116. # disable linux things
  117. audio_oss="no"
  118. v4l="no"
  119. dv1394="no"
  120. # enable beos things
  121. audio_beos="yes"
  122. # no need for libm, but the inet stuff
  123. # Check for BONE
  124. if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
  125. extralibs="-lbind -lsocket"
  126. else
  127. netserver="yes"
  128. need_inet_aton="yes"
  129. extralibs="-lnet"
  130. fi ;;
  131. SunOS)
  132. v4l="no"
  133. audio_oss="no"
  134. dv1394="no"
  135. make="gmake"
  136. LDFLAGS=""
  137. FFSLDFLAGS=""
  138. need_inet_aton="yes"
  139. extralibs="$extralibs -lsocket -lnsl"
  140. ;;
  141. FreeBSD)
  142. v4l="no"
  143. audio_oss="yes"
  144. dv1394="no"
  145. make="gmake"
  146. LDFLAGS="$LDFLAGS -export-dynamic"
  147. ;;
  148. BSD/OS)
  149. v4l="no"
  150. audio_oss="yes"
  151. dv1394="no"
  152. extralibs="-lpoll -lgnugetopt -lm"
  153. make="gmake"
  154. ;;
  155. Darwin)
  156. cc="cc"
  157. v4l="no"
  158. audio_oss="no"
  159. dv1394="no"
  160. ffserver="no"
  161. SHFLAGS="-dynamiclib"
  162. extralibs=""
  163. darwin="yes"
  164. strip="strip -x"
  165. LDFLAGS="-d"
  166. FFSLDFLAGS=-Wl,-bind_at_load
  167. gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f4-)"
  168. case "$gcc_version" in
  169. *2.95*)
  170. CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer"
  171. ;;
  172. *)
  173. CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic"
  174. ;;
  175. esac
  176. ;;
  177. MINGW32*)
  178. v4l="no"
  179. audio_oss="no"
  180. dv1394="no"
  181. ffserver="no"
  182. network="no"
  183. mingw32="yes"
  184. ;;
  185. CYGWIN*)
  186. v4l="no"
  187. audio_oss="yes"
  188. dv1394="no"
  189. extralibs=""
  190. cygwin="yes"
  191. test -f /usr/include/inttypes.h || \
  192. test -f /usr/local/include/inttypes.h || \
  193. echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
  194. "/usr/include/inttypes.h !!!"
  195. ;;
  196. Linux)
  197. LDFLAGS="$LDFLAGS -rdynamic"
  198. ;;
  199. OS/2)
  200. TMPE=$TMPE".exe"
  201. ar="emxomfar -p64"
  202. ranlib="echo ignoring ranlib"
  203. strip="echo ignoring strip"
  204. CFLAGS="-Zomf -O3"
  205. LDFLAGS="-Zomf -Zstack 16384 -s"
  206. SHFLAGS=""
  207. FFSLDFLAGS=""
  208. LIBPREF=""
  209. LIBSUF=".lib"
  210. SLIBPREF=""
  211. SLIBSUF=".dll"
  212. extralibs=""
  213. v4l="no"
  214. audio_oss="no"
  215. dv1394="no"
  216. network="no"
  217. ffserver="no"
  218. os2="yes"
  219. ;;
  220. *) ;;
  221. esac
  222. # From mplayer configure. We need TARGET_OS available
  223. # to the Makefile, so it can distinguish between flavors
  224. # of AltiVec on PowerPC
  225. TARGET_OS=`( uname -s ) 2>&1`
  226. case "$TARGET_OS" in
  227. Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
  228. ;;
  229. IRIX*)
  230. TARGET_OS=IRIX
  231. ;;
  232. HP-UX*)
  233. TARGET_OS=HP-UX
  234. ;;
  235. [cC][yY][gG][wW][iI][nN]*)
  236. TARGET_OS=CYGWIN
  237. ;;
  238. *)
  239. TARGET_OS="$TARGET_OS-UNKNOWN"
  240. ;;
  241. esac
  242. # find source path
  243. # XXX: we assume an absolute path is given when launching configure,
  244. # except in './configure' case.
  245. source_path="`echo $0 | sed -e 's#/configure##'`"
  246. source_path_used="yes"
  247. if test -z "$source_path" -o "$source_path" = "." ; then
  248. source_path=`pwd`
  249. source_path_used="no"
  250. fi
  251. for opt do
  252. case "$opt" in
  253. --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
  254. ;;
  255. --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
  256. ;;
  257. --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
  258. ;;
  259. --cc=*) cc=`echo $opt | cut -d '=' -f 2`
  260. ;;
  261. --make=*) make=`echo $opt | cut -d '=' -f 2`
  262. ;;
  263. --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
  264. ;;
  265. --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
  266. ;;
  267. --extra-libs=*) extralibs=${opt#--extra-libs=}
  268. ;;
  269. --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
  270. ;;
  271. --tune=*) tune=`echo $opt | cut -d '=' -f 2`
  272. ;;
  273. --powerpc-perf-enable) powerpc_perf="yes"
  274. ;;
  275. --disable-mmx) mmx="no"
  276. ;;
  277. --disable-altivec) altivec="no"
  278. ;;
  279. --enable-gprof) gprof="yes"
  280. ;;
  281. --disable-v4l) v4l="no"
  282. ;;
  283. --disable-audio-oss) audio_oss="no"
  284. ;;
  285. --disable-audio-beos) audio_beos="no"
  286. ;;
  287. --disable-dv1394) dv1394="no"
  288. ;;
  289. --disable-network) network="no"
  290. ;;
  291. --disable-zlib) zlib="no"
  292. ;;
  293. --disable-a52) a52="no"
  294. ;;
  295. --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
  296. ;;
  297. --disable-pp) pp="no"
  298. ;;
  299. --enable-shared-pp) shared_pp="yes"
  300. ;;
  301. --enable-mp3lame) mp3lame="yes"
  302. ;;
  303. --enable-vorbis) vorbis="yes"
  304. ;;
  305. --enable-faad) faad="yes"
  306. ;;
  307. --enable-faadbin) faadbin="yes"
  308. ;;
  309. --disable-vhook) vhook="no"
  310. ;;
  311. --disable-simple_idct) simpleidct="no"
  312. ;;
  313. --enable-win32) win32="yes"
  314. ;;
  315. --enable-mingw32) mingw32="yes"
  316. ;;
  317. --enable-shared) lshared="yes"
  318. ;;
  319. --disable-mpegaudio-hp) mpegaudio_hp="no"
  320. ;;
  321. --disable-ffserver) ffserver="no"
  322. ;;
  323. --disable-ffplay) ffplay="no"
  324. ;;
  325. --disable-risky) risky="no"
  326. ;;
  327. --enable-small) small="yes"
  328. ;;
  329. --enable-amr_nb) amr_nb="yes"
  330. ;;
  331. --enable-amr_nb-fixed) amr_nb_fixed="yes"
  332. ;;
  333. esac
  334. done
  335. # compute mmx state
  336. if test $mmx = "default"; then
  337. if test $cpu = "x86"; then
  338. mmx="yes"
  339. else
  340. mmx="no"
  341. fi
  342. fi
  343. # Can only do AltiVec on PowerPC
  344. if test $altivec = "default"; then
  345. if test $cpu = "powerpc"; then
  346. altivec="yes"
  347. else
  348. altivec="no"
  349. fi
  350. fi
  351. # Add processor-specific flags
  352. TUNECPU="generic"
  353. if test $tune != "generic"; then
  354. case $tune in
  355. 601|ppc601|PowerPC601)
  356. CFLAGS="$CFLAGS -mcpu=601"
  357. if test $altivec = "yes"; then
  358. echo "WARNING: tuning for PPC601 but altivec enabled !";
  359. fi
  360. TUNECPU=ppc601
  361. ;;
  362. 603*|ppc603*|PowerPC603*)
  363. CFLAGS="$CFLAGS -mcpu=603"
  364. if test $altivec = "yes"; then
  365. echo "WARNING: tuning for PPC603 but altivec enabled !";
  366. fi
  367. TUNECPU=ppc603
  368. ;;
  369. 604*|ppc604*|PowerPC604*)
  370. CFLAGS="$CFLAGS -mcpu=604"
  371. if test $altivec = "yes"; then
  372. echo "WARNING: tuning for PPC604 but altivec enabled !";
  373. fi
  374. TUNECPU=ppc604
  375. ;;
  376. G3|75*|ppc75*|PowerPC75*)
  377. CFLAGS="$CFLAGS -mcpu=750 -mtune=750"
  378. if test $altivec = "yes"; then
  379. echo "WARNING: tuning for PPC75x but altivec enabled !";
  380. fi
  381. TUNECPU=ppc750
  382. ;;
  383. G4|745*|ppc745*|PowerPC745*)
  384. CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450"
  385. if test $altivec = "no"; then
  386. echo "WARNING: tuning for PPC745x but altivec disabled !";
  387. fi
  388. TUNECPU=ppc7450
  389. ;;
  390. 74*|ppc74*|PowerPC74*)
  391. CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400"
  392. if test $altivec = "no"; then
  393. echo "WARNING: tuning for PPC74xx but altivec disabled !";
  394. fi
  395. TUNECPU=ppc7400
  396. ;;
  397. G5|970|ppc970|PowerPC970|power4*|Power4*)
  398. CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
  399. if test $altivec = "no"; then
  400. echo "WARNING: tuning for PPC970 but altivec disabled !";
  401. fi
  402. TUNECPU=ppc970
  403. ;;
  404. *)
  405. echo "WARNING: unknown CPU "$tune", ignored"
  406. ;;
  407. esac
  408. fi
  409. # See if we have <altivec.h>
  410. cat > $TMPC << EOF
  411. #include <altivec.h>
  412. int main( void ) { return 0; }
  413. EOF
  414. _altivec_h="no"
  415. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  416. _altivec_h="yes"
  417. fi
  418. # See does our compiler support Motorola AltiVec C API
  419. if test $altivec = "yes"; then
  420. if test $_altivec_h = "yes"; then
  421. cat > $TMPC << EOF
  422. #include <altivec.h>
  423. int main(void) {
  424. vector signed int v1, v2, v3;
  425. v1 = vec_add(v2,v3);
  426. return 0;
  427. }
  428. EOF
  429. else
  430. cat > $TMPC << EOF
  431. int main(void) {
  432. vector signed int v1, v2, v3;
  433. v1 = vec_add(v2,v3);
  434. return 0;
  435. }
  436. EOF
  437. fi
  438. if test "$darwin" = "yes"; then
  439. $cc -o $TMPE $TMPC -faltivec 2> /dev/null || altivec="no"
  440. else
  441. $cc -o $TMPE $TMPC -maltivec -mabi=altivec 2> /dev/null || altivec="no"
  442. fi
  443. fi
  444. # Can only do mmi on mips
  445. if test $mmi = "default"; then
  446. if test $cpu = "mips"; then
  447. mmi="yes"
  448. else
  449. mmi="no"
  450. fi
  451. fi
  452. # See does our compiler support mmi
  453. if test $mmi = "yes"; then
  454. cat > $TMPC << EOF
  455. int main(void) {
  456. __asm__ ("lq \$2, 0(\$2)");
  457. return 0;
  458. }
  459. EOF
  460. $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
  461. fi
  462. # Checking for CFLAGS
  463. if test -z "$CFLAGS"; then
  464. CFLAGS="-O3"
  465. fi
  466. if test "$win32" = "yes" ; then
  467. cross_prefix="i386-mingw32msvc-"
  468. v4l="no"
  469. audio_oss="no"
  470. dv1394="no"
  471. network="no"
  472. fi
  473. if test "$mingw32" = "yes" ; then
  474. cross_prefix=""
  475. v4l="no"
  476. audio_oss="no"
  477. dv1394="no"
  478. network="no"
  479. fi
  480. cc="${cross_prefix}${cc}"
  481. ar="${cross_prefix}${ar}"
  482. ranlib="${cross_prefix}${ranlib}"
  483. strip="${cross_prefix}${strip}"
  484. if test -z "$cross_prefix" ; then
  485. # ---
  486. # big/little endian test
  487. cat > $TMPC << EOF
  488. #include <inttypes.h>
  489. int main(int argc, char ** argv){
  490. volatile uint32_t i=0x01234567;
  491. return (*((uint8_t*)(&i))) == 0x67;
  492. }
  493. EOF
  494. if $cc -o $TMPE $TMPC 2>/dev/null ; then
  495. $TMPE && bigendian="yes"
  496. else
  497. echo big/little test failed
  498. fi
  499. else
  500. # if cross compiling, cannot launch a program, so make a static guess
  501. if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
  502. bigendian="yes"
  503. fi
  504. fi
  505. # ---
  506. # check availability of some header files
  507. cat > $TMPC << EOF
  508. #include <malloc.h>
  509. int main( void ) { return 0; }
  510. EOF
  511. _memalign=no
  512. _malloc_h=no
  513. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  514. _malloc_h=yes
  515. _memalign=yes
  516. # check for memalign - atmos
  517. cat > $TMPC << EOF
  518. #include <malloc.h>
  519. int main ( void ) {
  520. char *string = NULL;
  521. string = memalign(64, sizeof(char));
  522. return 0;
  523. }
  524. EOF
  525. $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
  526. fi
  527. cat > $TMPC << EOF
  528. #define _GNU_SOURCE
  529. #include <time.h>
  530. int main( void ) { return *strptime("", "", 0); }
  531. EOF
  532. strptime=no
  533. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  534. strptime=yes
  535. fi
  536. if test "$zlib" = "yes"; then
  537. # check for zlib - mmu_man
  538. cat > $TMPC << EOF
  539. #include <zlib.h>
  540. int main ( void ) {
  541. if (zlibVersion() != ZLIB_VERSION)
  542. puts("zlib version differs !!!");
  543. return 1;
  544. return 0;
  545. }
  546. EOF
  547. $cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
  548. # $TMPE 2> /dev/null > /dev/null || zlib="no"
  549. # XXX: more tests needed - runtime test
  550. fi
  551. if test "$zlib" = "yes"; then
  552. extralibs="$extralibs -lz"
  553. fi
  554. # test for lrintf in math.h
  555. cat > $TMPC << EOF
  556. #define _ISOC9X_SOURCE 1
  557. #include <math.h>
  558. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  559. EOF
  560. have_lrintf="no"
  561. if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
  562. have_lrintf="yes"
  563. $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
  564. fi
  565. _restrict=
  566. for restrict_keyword in restrict __restrict__ __restrict; do
  567. echo "void foo(char * $restrict_keyword p);" > $TMPC
  568. if $cc -c -o $TMPO $TMPC 2> /dev/null; then
  569. _restrict=$restrict_keyword
  570. break;
  571. fi
  572. done
  573. # test gcc version to see if vector builtins can be used
  574. # currently only used on i386 for MMX builtins
  575. cat > $TMPC << EOF
  576. int main(void) {
  577. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
  578. return 0;
  579. #else
  580. #error no vector builtins
  581. #endif
  582. }
  583. EOF
  584. builtin_vector=no
  585. if $cc -o $TMPO $TMPC 2> /dev/null ; then
  586. builtin_vector=yes
  587. fi
  588. # dlopen/dlfcn.h probing
  589. cat > $TMPC << EOF
  590. #include <dlfcn.h>
  591. int main( void ) { return (int) dlopen("foo", 0); }
  592. EOF
  593. ldl=-ldl
  594. if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
  595. dlfcn=yes
  596. dlopen=yes
  597. fi
  598. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  599. dlfcn=yes
  600. dlopen=yes
  601. ldl=""
  602. fi
  603. cat > $TMPC << EOF
  604. int main( void ) { return (int) dlopen("foo", 0); }
  605. EOF
  606. if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
  607. dlopen=yes
  608. fi
  609. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  610. dlopen=yes
  611. ldl=""
  612. fi
  613. if test "$vhook" = "default" ; then
  614. vhook="$dlopen"
  615. fi
  616. ##########################################
  617. # imlib probe
  618. cat > $TMPC << EOF
  619. #include <X11/Xlib.h>
  620. #include <Imlib2.h>
  621. int main( void ) { return (int) imlib_load_font("foo"); }
  622. EOF
  623. imlib2=no
  624. if $cc -o $TMPE $TMPC -lImlib2 2> /dev/null ; then
  625. imlib2=yes
  626. fi
  627. ##########################################
  628. # freetype probe
  629. cat > $TMPC << EOF
  630. #include <ft2build.h>
  631. int main( void ) { return (int) FT_Init_FreeType(0); }
  632. EOF
  633. freetype2=no
  634. if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
  635. if test "`which freetype-config`" != ""; then
  636. if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` 2> /dev/null ; then
  637. freetype2=yes
  638. fi
  639. fi
  640. fi
  641. ##########################################
  642. # SDL probe
  643. cat > $TMPC << EOF
  644. #include <SDL.h>
  645. #undef main /* We don't want SDL to override our main() */
  646. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  647. EOF
  648. sdl_too_old=no
  649. sdl=no
  650. if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then
  651. _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
  652. if test "$_sdlversion" -lt 121 ; then
  653. sdl_too_old=yes
  654. else
  655. sdl=yes
  656. fi
  657. fi
  658. if test "$sdl" = "no" ; then
  659. ffplay=no
  660. fi
  661. if test "$small" = "yes"; then
  662. # CFLAGS=${CFLAGS//-O3/-Os}
  663. CFLAGS="$CFLAGS -Os"
  664. fi
  665. if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
  666. cat << EOF
  667. Usage: configure [options]
  668. Options: [defaults in brackets after descriptions]
  669. EOF
  670. echo "Standard options:"
  671. echo " --help print this message"
  672. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  673. echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
  674. echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
  675. echo " --enable-faad enable faad support via libfaad [default=no]"
  676. echo " --enable-faadbin build faad support with runtime linking [default=no]"
  677. echo " --enable-win32 enable win32 cross compile"
  678. echo " --enable-mingw32 enable mingw32 native windows compile"
  679. echo " --disable-a52 disable GPL'ed A52 support [default=no]"
  680. echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
  681. echo " --disable-pp disable GPL'ed post processing support [default=no]"
  682. echo " --enable-shared-pp use libpostproc.so [default=no]"
  683. echo " --enable-shared build shared libraries [default=no]"
  684. echo " --enable-amr_nb enable amr_nb float audio codec"
  685. echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
  686. echo ""
  687. echo "Advanced options (experts only):"
  688. echo " --source-path=PATH path of source code [$source_path]"
  689. echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
  690. echo " --cc=CC use C compiler CC [$cc]"
  691. echo " --make=MAKE use specified make [$make]"
  692. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  693. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  694. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  695. echo " --cpu=CPU force cpu to CPU [$cpu]"
  696. echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
  697. echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
  698. echo " --disable-mmx disable mmx usage"
  699. echo " --disable-altivec disable AltiVec usage"
  700. echo " --disable-audio-oss disable OSS audio support [default=no]"
  701. echo " --disable-audio-beos disable BeOS audio support [default=no]"
  702. echo " --disable-v4l disable video4linux grabbing [default=no]"
  703. echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
  704. echo " --disable-network disable network support [default=no]"
  705. echo " --disable-zlib disable zlib [default=no]"
  706. echo " --disable-simple_idct disable simple IDCT routines [default=no]"
  707. echo " --disable-vhook disable video hooking support"
  708. echo " --enable-gprof enable profiling with gprof [$gprof]"
  709. echo " --disable-mpegaudio-hp faster (but less accurate)"
  710. echo " mpegaudio decoding [default=no]"
  711. echo " --disable-ffserver disable ffserver build"
  712. echo " --disable-ffplay disable ffplay build"
  713. echo " --disable-risky disables patent encumbered codecs"
  714. echo " --enable-small optimize for size instead of speed"
  715. echo ""
  716. echo "NOTE: The object files are build at the place where configure is launched"
  717. exit 1
  718. fi
  719. echo "Install prefix $prefix"
  720. echo "Source path $source_path"
  721. echo "C compiler $cc"
  722. echo "make $make"
  723. echo "CPU $cpu ($tune)"
  724. echo "Big Endian $bigendian"
  725. if test $cpu = "x86"; then
  726. echo "MMX enabled $mmx"
  727. echo "Vector Builtins $builtin_vector"
  728. fi
  729. if test $cpu = "mips"; then
  730. echo "MMI enabled $mmi"
  731. fi
  732. if test $cpu = "powerpc"; then
  733. echo "AltiVec enabled $altivec"
  734. fi
  735. echo "gprof enabled $gprof"
  736. echo "zlib enabled $zlib"
  737. echo "mp3lame enabled $mp3lame"
  738. echo "vorbis enabled $vorbis"
  739. echo "faad enabled $faad"
  740. echo "faadbin enabled $faadbin"
  741. echo "a52 support $a52"
  742. echo "a52 dlopened $a52bin"
  743. echo "pp support $pp"
  744. echo "shared pp $shared_pp"
  745. echo "Video hooking $vhook"
  746. echo "SDL support $sdl"
  747. if test $sdl_too_old = "yes"; then
  748. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
  749. fi
  750. echo "risky / patent encumbered codecs $risky"
  751. echo "optimize for size $small"
  752. if test "$vhook" = "yes" ; then
  753. echo "Imlib2 support $imlib2"
  754. echo "freetype support $freetype2"
  755. fi
  756. echo "AMR-NB float support" $amr_nb
  757. echo "AMR-NB fixed support" $amr_nb_fixed
  758. echo "Creating config.mak and config.h"
  759. echo "# Automatically generated by configure - do not modify" > config.mak
  760. echo "/* Automatically generated by configure - do not modify */" > $TMPH
  761. echo "prefix=$prefix" >> config.mak
  762. echo "MAKE=$make" >> config.mak
  763. echo "CC=$cc" >> config.mak
  764. echo "AR=$ar" >> config.mak
  765. echo "RANLIB=$ranlib" >> config.mak
  766. echo "STRIP=$strip" >> config.mak
  767. echo "OPTFLAGS=$CFLAGS" >> config.mak
  768. echo "LDFLAGS=$LDFLAGS" >> config.mak
  769. echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
  770. echo "SHFLAGS=$SHFLAGS" >> config.mak
  771. echo "LIBPREF=$LIBPREF" >> config.mak
  772. echo "LIBSUF=$LIBSUF" >> config.mak
  773. echo "SLIBPREF=$SLIBPREF" >> config.mak
  774. echo "SLIBSUF=$SLIBSUF" >> config.mak
  775. echo "TARGET_OS=$TARGET_OS" >> config.mak
  776. if test "$cpu" = "x86" ; then
  777. echo "TARGET_ARCH_X86=yes" >> config.mak
  778. echo "#define ARCH_X86 1" >> $TMPH
  779. elif test "$cpu" = "armv4l" ; then
  780. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  781. echo "#define ARCH_ARMV4L 1" >> $TMPH
  782. elif test "$cpu" = "alpha" ; then
  783. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  784. echo "#define ARCH_ALPHA 1" >> $TMPH
  785. elif test "$cpu" = "sparc64" ; then
  786. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  787. echo "#define ARCH_SPARC64 1" >> $TMPH
  788. elif test "$cpu" = "powerpc" ; then
  789. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  790. echo "#define ARCH_POWERPC 1" >> $TMPH
  791. if test "$powerpc_perf" = "yes"; then
  792. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  793. fi
  794. elif test "$cpu" = "mips" ; then
  795. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  796. echo "#define ARCH_MIPS 1" >> $TMPH
  797. fi
  798. echo "#define TUNECPU $TUNECPU" >> $TMPH
  799. if test "$bigendian" = "yes" ; then
  800. echo "WORDS_BIGENDIAN=yes" >> config.mak
  801. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  802. fi
  803. if test "$mmx" = "yes" ; then
  804. echo "TARGET_MMX=yes" >> config.mak
  805. echo "#define HAVE_MMX 1" >> $TMPH
  806. echo "#define __CPU__ 586" >> $TMPH
  807. fi
  808. if test "$builtin_vector" = "yes" ; then
  809. echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
  810. echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
  811. fi
  812. if test "$mmi" = "yes" ; then
  813. echo "TARGET_MMI=yes" >> config.mak
  814. echo "#define HAVE_MMI 1" >> $TMPH
  815. fi
  816. if test "$altivec" = "yes" ; then
  817. echo "TARGET_ALTIVEC=yes" >> config.mak
  818. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  819. echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
  820. echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
  821. if test "$_altivec_h" = "yes" ; then
  822. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  823. else
  824. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  825. fi
  826. fi
  827. if test "$gprof" = "yes" ; then
  828. echo "TARGET_GPROF=yes" >> config.mak
  829. echo "#define HAVE_GPROF 1" >> $TMPH
  830. fi
  831. if test "$strptime" = "yes" ; then
  832. echo "#define HAVE_STRPTIME 1" >> $TMPH
  833. else
  834. echo "BUILD_STRPTIME=yes" >> config.mak
  835. fi
  836. if test "$imlib2" = "yes" ; then
  837. echo "HAVE_IMLIB2=yes" >> config.mak
  838. fi
  839. if test "$freetype2" = "yes" ; then
  840. echo "HAVE_FREETYPE2=yes" >> config.mak
  841. fi
  842. if test "$sdl" = "yes" ; then
  843. echo "CONFIG_SDL=yes" >> config.mak
  844. echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
  845. echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
  846. fi
  847. if test "$have_lrintf" = "yes" ; then
  848. echo "#define HAVE_LRINTF 1" >> $TMPH
  849. fi
  850. if test "$vhook" = "yes" ; then
  851. echo "BUILD_VHOOK=yes" >> config.mak
  852. echo "#define HAVE_VHOOK 1" >> $TMPH
  853. extralibs="$extralibs $ldl"
  854. fi
  855. if test "$lshared" = "yes" ; then
  856. echo "BUILD_SHARED=yes" >> config.mak
  857. echo "PIC=-fPIC" >> config.mak
  858. fi
  859. echo "EXTRALIBS=$extralibs" >> config.mak
  860. echo "VERSION=`head $source_path/VERSION`" >>config.mak
  861. echo "" >>config.mak
  862. # if you do not want to use encoders, disable that.
  863. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  864. echo "CONFIG_ENCODERS=yes" >> config.mak
  865. # if you do not want to use decoders, disable that.
  866. echo "#define CONFIG_DECODERS 1" >> $TMPH
  867. echo "CONFIG_DECODERS=yes" >> config.mak
  868. # AC3
  869. if test "$a52" = "yes" ; then
  870. echo "#define CONFIG_AC3 1" >> $TMPH
  871. echo "CONFIG_AC3=yes" >> config.mak
  872. if test "$a52bin" = "yes" ; then
  873. echo "#define CONFIG_A52BIN 1" >> $TMPH
  874. echo "CONFIG_A52BIN=yes" >> config.mak
  875. fi
  876. fi
  877. # PP
  878. if test "$pp" = "yes" ; then
  879. echo "#define CONFIG_PP 1" >> $TMPH
  880. echo "CONFIG_PP=yes" >> config.mak
  881. if test "$shared_pp" = "yes" ; then
  882. echo "#define SHARED_PP 1" >> $TMPH
  883. echo "SHARED_PP=yes" >> config.mak
  884. fi
  885. fi
  886. # mpeg audio high precision mode
  887. if test "$mpegaudio_hp" = "yes" ; then
  888. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  889. fi
  890. if test "$v4l" = "yes" ; then
  891. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  892. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  893. fi
  894. if test "$dv1394" = "yes" ; then
  895. echo "#define CONFIG_DV1394 1" >> $TMPH
  896. echo "CONFIG_DV1394=yes" >> config.mak
  897. fi
  898. if test "$dlopen" = "yes" ; then
  899. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  900. fi
  901. if test "$dlfcn" = "yes" ; then
  902. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  903. fi
  904. if test "$audio_oss" = "yes" ; then
  905. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  906. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  907. fi
  908. if test "$audio_beos" = "yes" ; then
  909. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  910. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  911. fi
  912. if test "$network" = "yes" ; then
  913. echo "#define CONFIG_NETWORK 1" >> $TMPH
  914. echo "CONFIG_NETWORK=yes" >> config.mak
  915. fi
  916. if test "$zlib" = "yes" ; then
  917. echo "#define CONFIG_ZLIB 1" >> $TMPH
  918. echo "CONFIG_ZLIB=yes" >> config.mak
  919. fi
  920. if test "$mp3lame" = "yes" ; then
  921. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  922. echo "CONFIG_MP3LAME=yes" >> config.mak
  923. fi
  924. if test "$vorbis" = "yes" ; then
  925. echo "#define CONFIG_VORBIS 1" >> $TMPH
  926. echo "CONFIG_VORBIS=yes" >> config.mak
  927. fi
  928. if test "$faad" = "yes" ; then
  929. echo "#define CONFIG_FAAD 1" >> $TMPH
  930. echo "CONFIG_FAAD=yes" >> config.mak
  931. fi
  932. if test "$faadbin" = "yes" ; then
  933. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  934. echo "CONFIG_FAADBIN=yes" >> config.mak
  935. fi
  936. if test "$win32" = "yes" ; then
  937. echo "#define CONFIG_WIN32 1" >> $TMPH
  938. echo "CONFIG_WIN32=yes" >> config.mak
  939. fi
  940. if test "$mingw32" = "yes" ; then
  941. echo "#define CONFIG_WIN32 1" >> $TMPH
  942. echo "CONFIG_WIN32=yes" >> config.mak
  943. echo "#define __MINGW32__ 1" >> $TMPH
  944. echo "__MINGW32__=1" >> config.mak
  945. fi
  946. if test "$cygwin" = "yes" ; then
  947. # setup correct exesuffix
  948. echo "CONFIG_WIN32=yes" >> config.mak
  949. fi
  950. if test "$os2" = "yes" ; then
  951. echo "#define CONFIG_OS2 1" >> $TMPH
  952. echo "CONFIG_OS2=yes" >> config.mak
  953. fi
  954. if test "$TARGET_OS" = "SunOS" ; then
  955. echo "#define CONFIG_SUNOS 1" >> $TMPH
  956. fi
  957. if test "$darwin" = "yes"; then
  958. echo "#define CONFIG_DARWIN 1" >> $TMPH
  959. echo "CONFIG_DARWIN=yes" >> config.mak
  960. fi
  961. if test "$_malloc_h" = "yes" ; then
  962. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  963. else
  964. echo "#undef HAVE_MALLOC_H" >> $TMPH
  965. fi
  966. if test "$_memalign" = "yes" ; then
  967. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  968. else
  969. echo "#undef HAVE_MEMALIGN" >> $TMPH
  970. fi
  971. if test "$netserver" = "yes" ; then
  972. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  973. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  974. fi
  975. if test "$need_inet_aton" = "yes" ; then
  976. echo "NEED_INET_ATON=yes" >> config.mak
  977. fi
  978. if test "$simpleidct" = "yes" ; then
  979. echo "#define SIMPLE_IDCT 1" >> $TMPH
  980. fi
  981. if test "$ffserver" = "yes" ; then
  982. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  983. echo "CONFIG_FFSERVER=yes" >> config.mak
  984. fi
  985. if test "$ffplay" = "yes" ; then
  986. echo "CONFIG_FFPLAY=yes" >> config.mak
  987. fi
  988. if test "$risky" = "yes" ; then
  989. echo "#define CONFIG_RISKY 1" >> $TMPH
  990. echo "CONFIG_RISKY=yes" >> config.mak
  991. fi
  992. echo "#define restrict $_restrict" >> $TMPH
  993. # build tree in object directory if source path is different from current one
  994. if test "$source_path_used" = "yes" ; then
  995. DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
  996. libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
  997. FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
  998. for dir in $DIRS ; do
  999. mkdir -p $dir
  1000. done
  1001. for f in $FILES ; do
  1002. ln -sf $source_path/$f $f
  1003. done
  1004. fi
  1005. echo "SRC_PATH=$source_path" >> config.mak
  1006. if test "$amr_nb" = "yes" ; then
  1007. echo "#define AMR_NB 1" >> $TMPH
  1008. echo "AMR_NB=yes" >> config.mak
  1009. echo
  1010. if test "$amr_nb_fixed" = "yes" ; then
  1011. echo "AMR_NB_FIXED=yes" >> config.mak
  1012. echo "#define AMR_NB_FIXED 1" >> $TMPH
  1013. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  1014. echo "REL-5 version 5.1.0 from "
  1015. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
  1016. echo "and extracted src to libavcodec/amr"
  1017. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  1018. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  1019. echo
  1020. else
  1021. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  1022. echo "REL-5 V5.1.0 from "
  1023. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
  1024. echo "and extracted the source to libavcodec/amr_float"
  1025. echo
  1026. fi
  1027. fi
  1028. diff $TMPH config.h >/dev/null 2>&1
  1029. if test $? -ne 0 ; then
  1030. mv -f $TMPH config.h
  1031. else
  1032. echo "config.h is unchanged"
  1033. fi
  1034. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH