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.

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