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.

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