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.

1062 lines
25KB

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