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.

740 lines
17KB

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