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.

790 lines
18KB

  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. TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
  16. TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
  17. # default parameters
  18. prefix="/usr/local"
  19. cross_prefix=""
  20. cc="gcc"
  21. ar="ar"
  22. ranlib="ranlib"
  23. make="make"
  24. strip="strip"
  25. cpu=`uname -m`
  26. mmx="default"
  27. altivec="default"
  28. mmi="default"
  29. case "$cpu" in
  30. i386|i486|i586|i686|i86pc|BePC)
  31. cpu="x86"
  32. ;;
  33. armv4l)
  34. cpu="armv4l"
  35. ;;
  36. alpha)
  37. cpu="alpha"
  38. ;;
  39. "Power Macintosh"|ppc)
  40. cpu="powerpc"
  41. ;;
  42. mips)
  43. cpu="mips"
  44. ;;
  45. *)
  46. cpu="unknown"
  47. ;;
  48. esac
  49. gprof="no"
  50. v4l="yes"
  51. audio_oss="yes"
  52. audio_beos="no"
  53. network="yes"
  54. zlib="yes"
  55. mp3lame="no"
  56. vorbis="no"
  57. a52="yes"
  58. a52bin="no"
  59. win32="no"
  60. mingw32="no"
  61. cygwin="no"
  62. lshared="no"
  63. extralibs="-lm"
  64. simpleidct="yes"
  65. bigendian="no"
  66. vhook="no"
  67. dlfcn="no"
  68. dlopen="no"
  69. mpegaudio_hp="yes"
  70. SHFLAGS=-shared
  71. netserver="no"
  72. need_inet_aton="no"
  73. ffserver="yes"
  74. LDFLAGS=-Wl,--warn-common
  75. FFSLDFLAGS=-Wl,-E
  76. # OS specific
  77. targetos=`uname -s`
  78. case $targetos in
  79. BeOS)
  80. prefix="/boot/home/config"
  81. # helps building libavcodec
  82. CFLAGS="-O3 -DPIC -fomit-frame-pointer"
  83. # 3 gcc releases known for BeOS, each with ugly bugs
  84. gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
  85. case "$gcc_version" in
  86. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  87. mmx="no"
  88. ;;
  89. *20010315*) echo "BeBits gcc"
  90. CFLAGS="$CFLAGS -fno-expensive-optimizations"
  91. ;;
  92. esac
  93. SHFLAGS=-nostart
  94. # disable linux things
  95. audio_oss="no"
  96. v4l="no"
  97. # enable beos things
  98. audio_beos="yes"
  99. # no need for libm, but the inet stuff
  100. # Check for BONE
  101. if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
  102. extralibs="-lbind -lsocket"
  103. else
  104. netserver="yes"
  105. need_inet_aton="yes"
  106. extralibs="-lnet"
  107. fi ;;
  108. SunOS)
  109. v4l="no"
  110. audio_oss="no"
  111. make="gmake"
  112. LDFLAGS=""
  113. FFSLDFLAGS=""
  114. need_inet_aton="yes"
  115. extralibs="$extralibs -lsocket -lnsl"
  116. ;;
  117. FreeBSD)
  118. v4l="no"
  119. audio_oss="yes"
  120. make="gmake"
  121. LDFLAGS="$LDFLAGS -export-dynamic"
  122. ;;
  123. BSD/OS)
  124. v4l="no"
  125. audio_oss="yes"
  126. extralibs="-lpoll -lgnugetopt -lm"
  127. make="gmake"
  128. ;;
  129. Darwin)
  130. cc="cc"
  131. v4l="no"
  132. audio_oss="no"
  133. SHFLAGS="-dynamiclib"
  134. extralibs=""
  135. darwin="yes"
  136. strip="strip -x"
  137. LDFLAGS="-d"
  138. FFSLDFLAGS=-Wl,-bind_at_load
  139. gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f4-)"
  140. case "$gcc_version" in
  141. *2.95*)
  142. CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer"
  143. ;;
  144. *)
  145. CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic"
  146. ;;
  147. esac
  148. ;;
  149. MINGW32*)
  150. v4l="no"
  151. audio_oss="no"
  152. ffserver="no"
  153. network="no"
  154. mingw32="yes"
  155. ;;
  156. CYGWIN*)
  157. v4l="no"
  158. audio_oss="yes"
  159. extralibs=""
  160. cygwin="yes"
  161. test -f /usr/include/inttypes.h || \
  162. test -f /usr/local/include/inttypes.h || \
  163. echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
  164. "/usr/include/inttypes.h !!!"
  165. ;;
  166. Linux)
  167. LDFLAGS="$LDFLAGS -rdynamic"
  168. ;;
  169. *) ;;
  170. esac
  171. # find source path
  172. # XXX: we assume an absolute path is given when launching configure,
  173. # except in './configure' case.
  174. source_path=${0%configure}
  175. source_path=${source_path%/}
  176. source_path_used="yes"
  177. if test -z "$source_path" -o "$source_path" = "." ; then
  178. source_path=`pwd`
  179. source_path_used="no"
  180. fi
  181. cat > $TMPC << EOF
  182. #include <dlfcn.h>
  183. int main( void ) { return (int) dlopen("foo", 0); }
  184. EOF
  185. ldl=-ldl
  186. if $cc -o $TMPO $TMPC -ldl 2> /dev/null ; then
  187. vhook=yes
  188. dlfcn=yes
  189. dlopen=yes
  190. fi
  191. if $cc -o $TMPO $TMPC 2> /dev/null ; then
  192. vhook=yes
  193. dlfcn=yes
  194. dlopen=yes
  195. ldl=""
  196. fi
  197. cat > $TMPC << EOF
  198. int main( void ) { return (int) dlopen("foo", 0); }
  199. EOF
  200. if $cc -o $TMPO $TMPC -ldl 2> /dev/null ; then
  201. vhook=yes
  202. dlopen=yes
  203. fi
  204. if $cc -o $TMPO $TMPC 2> /dev/null ; then
  205. vhook=yes
  206. dlopen=yes
  207. ldl=""
  208. fi
  209. cat > $TMPC << EOF
  210. #include <X11/Xlib.h>
  211. #include <Imlib2.h>
  212. int main( void ) { return (int) imlib_load_font("foo"); }
  213. EOF
  214. imlib2=no
  215. if $cc -o $TMPO $TMPC -lImlib2 2> /dev/null ; then
  216. imlib2=yes
  217. fi
  218. for opt do
  219. case "$opt" in
  220. --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
  221. ;;
  222. --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
  223. ;;
  224. --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
  225. ;;
  226. --cc=*) cc=`echo $opt | cut -d '=' -f 2`
  227. ;;
  228. --make=*) make=`echo $opt | cut -d '=' -f 2`
  229. ;;
  230. --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
  231. ;;
  232. --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
  233. ;;
  234. --extra-libs=*) extralibs=${opt#--extra-libs=}
  235. ;;
  236. --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
  237. ;;
  238. --disable-mmx) mmx="no"
  239. ;;
  240. --disable-altivec) altivec="no"
  241. ;;
  242. --enable-gprof) gprof="yes"
  243. ;;
  244. --disable-v4l) v4l="no"
  245. ;;
  246. --disable-audio-oss) audio_oss="no"
  247. ;;
  248. --disable-audio-beos) audio_beos="no"
  249. ;;
  250. --disable-network) network="no"
  251. ;;
  252. --disable-zlib) zlib="no"
  253. ;;
  254. --disable-a52) a52="no"
  255. ;;
  256. --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
  257. ;;
  258. --enable-mp3lame) mp3lame="yes"
  259. ;;
  260. --enable-vorbis) vorbis="yes"
  261. ;;
  262. --disable-vhook) vhook="no"
  263. ;;
  264. --disable-simple_idct) simpleidct="no"
  265. ;;
  266. --enable-win32) win32="yes"
  267. ;;
  268. --enable-mingw32) mingw32="yes"
  269. ;;
  270. --enable-shared) lshared="yes"
  271. ;;
  272. --disable-mpegaudio-hp) mpegaudio_hp="no"
  273. ;;
  274. --disable-ffserver) ffserver="no"
  275. ;;
  276. esac
  277. done
  278. # compute mmx state
  279. if test $mmx = "default"; then
  280. if test $cpu = "x86"; then
  281. mmx="yes"
  282. else
  283. mmx="no"
  284. fi
  285. fi
  286. # Can only do AltiVec on PowerPC
  287. if test $altivec = "default"; then
  288. if test $cpu = "powerpc"; then
  289. altivec="yes"
  290. else
  291. altivec="no"
  292. fi
  293. fi
  294. # See does our compiler support Motorola AltiVec C API
  295. if test $altivec = "yes"; then
  296. cat > $TMPC << EOF
  297. int main(void) {
  298. vector signed int v1, v2, v3;
  299. v1 = vec_add(v2,v3);
  300. return 0;
  301. }
  302. EOF
  303. $cc -o $TMPO $TMPC -faltivec 2> /dev/null || altivec="no"
  304. fi
  305. # Can only do mmi on mips
  306. if test $mmi = "default"; then
  307. if test $cpu = "mips"; then
  308. mmi="yes"
  309. else
  310. mmi="no"
  311. fi
  312. fi
  313. # See does our compiler support mmi
  314. if test $mmi = "yes"; then
  315. cat > $TMPC << EOF
  316. int main(void) {
  317. __asm__ ("lq \$2, 0(\$2)");
  318. return 0;
  319. }
  320. EOF
  321. $cc -o $TMPO $TMPC 2> /dev/null || mmi="no"
  322. fi
  323. # Checking for CFLAGS
  324. if test -z "$CFLAGS"; then
  325. CFLAGS="-O3"
  326. fi
  327. if test "$win32" = "yes" ; then
  328. cross_prefix="i386-mingw32msvc-"
  329. v4l="no"
  330. audio_oss="no"
  331. network="no"
  332. fi
  333. if test "$mingw32" = "yes" ; then
  334. cross_prefix=""
  335. v4l="no"
  336. audio_oss="no"
  337. network="no"
  338. fi
  339. cc="${cross_prefix}${cc}"
  340. ar="${cross_prefix}${ar}"
  341. ranlib="${cross_prefix}${ranlib}"
  342. strip="${cross_prefix}${strip}"
  343. if test -z "$cross_prefix" ; then
  344. # ---
  345. # big/little endian test
  346. cat > $TMPC << EOF
  347. #include <inttypes.h>
  348. int main(int argc, char ** argv){
  349. volatile uint32_t i=0x01234567;
  350. return (*((uint8_t*)(&i))) == 0x67;
  351. }
  352. EOF
  353. if $cc -o $TMPO $TMPC 2>/dev/null ; then
  354. $TMPO && bigendian="yes"
  355. else
  356. echo big/little test failed
  357. fi
  358. else
  359. # if cross compiling, cannot launch a program, so make a static guess
  360. if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
  361. bigendian="yes"
  362. fi
  363. fi
  364. # ---
  365. # check availability of some header files
  366. cat > $TMPC << EOF
  367. #include <malloc.h>
  368. int main( void ) { return 0; }
  369. EOF
  370. _memalign=no
  371. _malloc_h=no
  372. if $cc -o $TMPO $TMPC 2> /dev/null ; then
  373. _malloc_h=yes
  374. _memalign=yes
  375. # check for memalign - atmos
  376. cat > $TMPC << EOF
  377. #include <malloc.h>
  378. int main ( void ) {
  379. char *string = NULL;
  380. string = memalign(64, sizeof(char));
  381. return 0;
  382. }
  383. EOF
  384. $cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
  385. fi
  386. cat > $TMPC << EOF
  387. #define _GNU_SOURCE
  388. #include <time.h>
  389. int main( void ) { return *strptime("", "", 0); }
  390. EOF
  391. strptime=no
  392. if $cc -o $TMPO $TMPC 2> /dev/null ; then
  393. strptime=yes
  394. fi
  395. if test "$zlib" = "yes"; then
  396. # check for zlib - mmu_man
  397. cat > $TMPC << EOF
  398. #include <zlib.h>
  399. int main ( void ) {
  400. if (zlibVersion() != ZLIB_VERSION)
  401. puts("zlib version differs !!!");
  402. return 1;
  403. return 0;
  404. }
  405. EOF
  406. $cc -o $TMPO $TMPC -lz 2> /dev/null || zlib="no"
  407. # $TMPO 2> /dev/null > /dev/null || zlib="no"
  408. # XXX: more tests needed - runtime test
  409. fi
  410. if test "$zlib" = "yes"; then
  411. extralibs="$extralibs -lz"
  412. fi
  413. # test for lrintf in math.h
  414. cat > $TMPC << EOF
  415. #define _ISOC9X_SOURCE 1
  416. #include <math.h>
  417. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  418. EOF
  419. have_lrintf="no"
  420. if $cc $extralibs -o $TMPO $TMPC 2> /dev/null ; then
  421. have_lrintf="yes"
  422. $TMPO 2> /dev/null > /dev/null || have_lrintf="no"
  423. fi
  424. _restrict=
  425. for restrict_keyword in restrict __restrict__ __restrict; do
  426. echo "void foo(char * $restrict_keyword p);" > $TMPC
  427. if $cc -c -o $TMPO $TMPC 2> /dev/null; then
  428. _restrict=$restrict_keyword
  429. break;
  430. fi
  431. done
  432. # test gcc version to see if vector builtins can be used
  433. # currently only used on i386 for MMX builtins
  434. cat > $TMPC << EOF
  435. int main(void) {
  436. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
  437. return 0;
  438. #else
  439. #error no vector builtins
  440. #endif
  441. }
  442. EOF
  443. builtin_vector=no
  444. if $cc -o $TMPO $TMPC 2> /dev/null ; then
  445. builtin_vector=yes
  446. if test "$mmx" = "yes" ; then
  447. CFLAGS="$CFLAGS -msse"
  448. fi
  449. fi
  450. if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
  451. cat << EOF
  452. Usage: configure [options]
  453. Options: [defaults in brackets after descriptions]
  454. EOF
  455. echo "Standard options:"
  456. echo " --help print this message"
  457. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  458. echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
  459. echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
  460. echo " --enable-win32 enable win32 cross compile"
  461. echo " --enable-mingw32 enable mingw32 native windows compile"
  462. echo " --disable-a52 disable GPL'ed A52 support [default=no]"
  463. echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
  464. echo " --enable-shared build shared libraries [default=no]"
  465. echo ""
  466. echo "Advanced options (experts only):"
  467. echo " --source-path=PATH path of source code [$source_path]"
  468. echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
  469. echo " --cc=CC use C compiler CC [$cc]"
  470. echo " --make=MAKE use specified make [$make]"
  471. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  472. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  473. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  474. echo " --cpu=CPU force cpu to CPU [$cpu]"
  475. echo " --disable-mmx disable mmx usage"
  476. echo " --disable-altivec disable AltiVec usage"
  477. echo " --disable-audio-oss disable OSS audio support [default=no]"
  478. echo " --disable-audio-beos disable BeOS audio support [default=no]"
  479. echo " --disable-v4l disable video4linux grabbing [default=no]"
  480. echo " --disable-network disable network support [default=no]"
  481. echo " --disable-zlib disable zlib [default=no]"
  482. echo " --disable-simple_idct disable simple IDCT routines [default=no]"
  483. echo " --disable-vhook disable video hooking support"
  484. echo " --enable-gprof enable profiling with gprof [$gprof]"
  485. echo " --disable-mpegaudio-hp faster (but less accurate)"
  486. echo " mpegaudio decoding [default=no]"
  487. echo " --disable-ffserver disable ffserver build"
  488. echo ""
  489. echo "NOTE: The object files are build at the place where configure is launched"
  490. exit 1
  491. fi
  492. echo "Install prefix $prefix"
  493. echo "Source path $source_path"
  494. echo "C compiler $cc"
  495. echo "make $make"
  496. echo "CPU $cpu"
  497. echo "Big Endian $bigendian"
  498. if test $cpu = "x86"; then
  499. echo "MMX enabled $mmx"
  500. echo "Vector Builtins $builtin_vector"
  501. fi
  502. if test $cpu = "mips"; then
  503. echo "MMI enabled $mmi"
  504. fi
  505. if test $cpu = "powerpc"; then
  506. echo "AltiVec enabled $altivec"
  507. fi
  508. echo "gprof enabled $gprof"
  509. echo "zlib enabled $zlib"
  510. echo "mp3lame enabled $mp3lame"
  511. echo "vorbis enabled $vorbis"
  512. echo "a52 support $a52"
  513. echo "a52 dlopened $a52bin"
  514. echo "Video hooking $vhook"
  515. if test "$vhook" = "yes" ; then
  516. echo "Imlib2 support $imlib2"
  517. fi
  518. echo "Creating config.mak and config.h"
  519. echo "# Automatically generated by configure - do not modify" > config.mak
  520. echo "/* Automatically generated by configure - do not modify */" > $TMPH
  521. echo "prefix=$prefix" >> config.mak
  522. echo "MAKE=$make" >> config.mak
  523. echo "CC=$cc" >> config.mak
  524. echo "AR=$ar" >> config.mak
  525. echo "RANLIB=$ranlib" >> config.mak
  526. echo "STRIP=$strip" >> config.mak
  527. echo "OPTFLAGS=$CFLAGS" >> config.mak
  528. echo "LDFLAGS=$LDFLAGS" >> config.mak
  529. echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
  530. echo "SHFLAGS=$SHFLAGS" >> config.mak
  531. if test "$cpu" = "x86" ; then
  532. echo "TARGET_ARCH_X86=yes" >> config.mak
  533. echo "#define ARCH_X86 1" >> $TMPH
  534. elif test "$cpu" = "armv4l" ; then
  535. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  536. echo "#define ARCH_ARMV4L 1" >> $TMPH
  537. elif test "$cpu" = "alpha" ; then
  538. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  539. echo "#define ARCH_ALPHA 1" >> $TMPH
  540. elif test "$cpu" = "sparc64" ; then
  541. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  542. echo "#define ARCH_SPARC64 1" >> $TMPH
  543. elif test "$cpu" = "powerpc" ; then
  544. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  545. echo "#define ARCH_POWERPC 1" >> $TMPH
  546. elif test "$cpu" = "mips" ; then
  547. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  548. echo "#define ARCH_MIPS 1" >> $TMPH
  549. fi
  550. if test "$bigendian" = "yes" ; then
  551. echo "WORDS_BIGENDIAN=yes" >> config.mak
  552. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  553. fi
  554. if test "$mmx" = "yes" ; then
  555. echo "TARGET_MMX=yes" >> config.mak
  556. echo "#define HAVE_MMX 1" >> $TMPH
  557. fi
  558. if test "$builtin_vector" = "yes" ; then
  559. echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
  560. echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
  561. fi
  562. if test "$mmi" = "yes" ; then
  563. echo "TARGET_MMI=yes" >> config.mak
  564. echo "#define HAVE_MMI 1" >> $TMPH
  565. fi
  566. if test "$altivec" = "yes" ; then
  567. echo "TARGET_ALTIVEC=yes" >> config.mak
  568. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  569. fi
  570. if test "$gprof" = "yes" ; then
  571. echo "TARGET_GPROF=yes" >> config.mak
  572. echo "#define HAVE_GPROF 1" >> $TMPH
  573. fi
  574. if test "$strptime" = "yes" ; then
  575. echo "#define HAVE_STRPTIME 1" >> $TMPH
  576. else
  577. echo "BUILD_STRPTIME=yes" >> config.mak
  578. fi
  579. if test "$imlib2" = "yes" ; then
  580. echo "HAVE_IMLIB2=yes" >> config.mak
  581. fi
  582. if test "$have_lrintf" = "yes" ; then
  583. echo "#define HAVE_LRINTF 1" >> $TMPH
  584. fi
  585. if test "$vhook" = "yes" ; then
  586. echo "BUILD_VHOOK=yes" >> config.mak
  587. echo "#define HAVE_VHOOK 1" >> $TMPH
  588. extralibs="$extralibs $ldl"
  589. fi
  590. if test "$lshared" = "yes" ; then
  591. echo "BUILD_SHARED=yes" >> config.mak
  592. echo "PIC=-fPIC" >> config.mak
  593. fi
  594. echo "EXTRALIBS=$extralibs" >> config.mak
  595. echo -n "VERSION=" >>config.mak
  596. head $source_path/VERSION >>config.mak
  597. echo "" >>config.mak
  598. # if you do not want to use encoders, disable that.
  599. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  600. echo "CONFIG_ENCODERS=yes" >> config.mak
  601. # if you do not want to use decoders, disable that.
  602. echo "#define CONFIG_DECODERS 1" >> $TMPH
  603. echo "CONFIG_DECODERS=yes" >> config.mak
  604. # AC3
  605. if test "$a52" = "yes" ; then
  606. echo "#define CONFIG_AC3 1" >> $TMPH
  607. echo "CONFIG_AC3=yes" >> config.mak
  608. if test "$a52bin" = "yes" ; then
  609. echo "#define CONFIG_A52BIN 1" >> $TMPH
  610. echo "CONFIG_A52BIN=yes" >> config.mak
  611. fi
  612. fi
  613. # mpeg audio high precision mode
  614. if test "$mpegaudio_hp" = "yes" ; then
  615. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  616. fi
  617. if test "$v4l" = "yes" ; then
  618. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  619. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  620. fi
  621. if test "$dlopen" = "yes" ; then
  622. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  623. fi
  624. if test "$dlfcn" = "yes" ; then
  625. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  626. fi
  627. if test "$audio_oss" = "yes" ; then
  628. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  629. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  630. fi
  631. if test "$audio_beos" = "yes" ; then
  632. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  633. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  634. fi
  635. if test "$network" = "yes" ; then
  636. echo "#define CONFIG_NETWORK 1" >> $TMPH
  637. echo "CONFIG_NETWORK=yes" >> config.mak
  638. fi
  639. if test "$zlib" = "yes" ; then
  640. echo "#define CONFIG_ZLIB 1" >> $TMPH
  641. echo "CONFIG_ZLIB=yes" >> config.mak
  642. fi
  643. if test "$mp3lame" = "yes" ; then
  644. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  645. echo "CONFIG_MP3LAME=yes" >> config.mak
  646. fi
  647. if test "$vorbis" = "yes" ; then
  648. echo "#define CONFIG_VORBIS 1" >> $TMPH
  649. echo "CONFIG_VORBIS=yes" >> config.mak
  650. fi
  651. if test "$win32" = "yes" ; then
  652. echo "#define CONFIG_WIN32 1" >> $TMPH
  653. echo "CONFIG_WIN32=yes" >> config.mak
  654. fi
  655. if test "$mingw32" = "yes" ; then
  656. echo "#define CONFIG_WIN32 1" >> $TMPH
  657. echo "CONFIG_WIN32=yes" >> config.mak
  658. echo "#define __MINGW32__ 1" >> $TMPH
  659. echo "__MINGW32__=1" >> config.mak
  660. fi
  661. if test "$cygwin" = "yes" ; then
  662. # setup correct exesuffix
  663. echo "CONFIG_WIN32=yes" >> config.mak
  664. fi
  665. if test "$darwin" = "yes"; then
  666. echo "#define CONFIG_DARWIN 1" >> $TMPH
  667. echo "CONFIG_DARWIN=yes" >> config.mak
  668. fi
  669. if test "$_malloc_h" = "yes" ; then
  670. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  671. else
  672. echo "#undef HAVE_MALLOC_H" >> $TMPH
  673. fi
  674. if test "$_memalign" = "yes" ; then
  675. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  676. else
  677. echo "#undef HAVE_MEMALIGN" >> $TMPH
  678. fi
  679. if test "$netserver" = "yes" ; then
  680. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  681. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  682. fi
  683. if test "$need_inet_aton" = "yes" ; then
  684. echo "NEED_INET_ATON=yes" >> config.mak
  685. fi
  686. if test "$simpleidct" = "yes" ; then
  687. echo "#define SIMPLE_IDCT 1" >> $TMPH
  688. fi
  689. if test "$ffserver" = "yes" ; then
  690. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  691. echo "CONFIG_FFSERVER=yes" >> config.mak
  692. fi
  693. echo "#define restrict $_restrict" >> $TMPH
  694. # build tree in object directory if source path is different from current one
  695. if test "$source_path_used" = "yes" ; then
  696. DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
  697. libavcodec/ppc libavcodec/liba52 libavcodec/mlib tests vhook"
  698. FILES="Makefile libavformat/Makefile libavcodec/Makefile tests/Makefile vhook/Makefile"
  699. for dir in $DIRS ; do
  700. mkdir -p $dir
  701. done
  702. for f in $FILES ; do
  703. ln -sf $source_path/$f $f
  704. done
  705. fi
  706. echo "SRC_PATH=$source_path" >> config.mak
  707. diff $TMPH config.h >/dev/null 2>&1
  708. if test $? -ne 0 ; then
  709. mv -f $TMPH config.h
  710. else
  711. echo "config.h is unchanged"
  712. fi
  713. rm -f $TMPO $TMPC $TMPS $TMPH