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.

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