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.

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