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.

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