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.

765 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. 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. if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
  433. cat << EOF
  434. Usage: configure [options]
  435. Options: [defaults in brackets after descriptions]
  436. EOF
  437. echo "Standard options:"
  438. echo " --help print this message"
  439. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  440. echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
  441. echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
  442. echo " --enable-win32 enable win32 cross compile"
  443. echo " --enable-mingw32 enable mingw32 native windows compile"
  444. echo " --disable-a52 disable GPL'ed A52 support [default=no]"
  445. echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
  446. echo " --enable-shared build shared libraries [default=no]"
  447. echo ""
  448. echo "Advanced options (experts only):"
  449. echo " --source-path=PATH path of source code [$source_path]"
  450. echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
  451. echo " --cc=CC use C compiler CC [$cc]"
  452. echo " --make=MAKE use specified make [$make]"
  453. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  454. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  455. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  456. echo " --cpu=CPU force cpu to CPU [$cpu]"
  457. echo " --disable-mmx disable mmx usage"
  458. echo " --disable-altivec disable AltiVec usage"
  459. echo " --disable-audio-oss disable OSS audio support [default=no]"
  460. echo " --disable-audio-beos disable BeOS audio support [default=no]"
  461. echo " --disable-v4l disable video4linux grabbing [default=no]"
  462. echo " --disable-network disable network support [default=no]"
  463. echo " --disable-zlib disable zlib [default=no]"
  464. echo " --disable-simple_idct disable simple IDCT routines [default=no]"
  465. echo " --disable-vhook disable video hooking support"
  466. echo " --enable-gprof enable profiling with gprof [$gprof]"
  467. echo " --disable-mpegaudio-hp faster (but less accurate)"
  468. echo " mpegaudio decoding [default=no]"
  469. echo " --disable-ffserver disable ffserver build"
  470. echo ""
  471. echo "NOTE: The object files are build at the place where configure is launched"
  472. exit 1
  473. fi
  474. echo "Install prefix $prefix"
  475. echo "Source path $source_path"
  476. echo "C compiler $cc"
  477. echo "make $make"
  478. echo "CPU $cpu"
  479. echo "Big Endian $bigendian"
  480. if test $cpu = "x86"; then
  481. echo "MMX enabled $mmx"
  482. fi
  483. if test $cpu = "mips"; then
  484. echo "MMI enabled $mmi"
  485. fi
  486. if test $cpu = "powerpc"; then
  487. echo "AltiVec enabled $altivec"
  488. fi
  489. echo "gprof enabled $gprof"
  490. echo "zlib enabled $zlib"
  491. echo "mp3lame enabled $mp3lame"
  492. echo "vorbis enabled $vorbis"
  493. echo "a52 support $a52"
  494. echo "a52 dlopened $a52bin"
  495. echo "Video hooking $vhook"
  496. if test "$vhook" = "yes" ; then
  497. echo "Imlib2 support $imlib2"
  498. fi
  499. echo "Creating config.mak and config.h"
  500. echo "# Automatically generated by configure - do not modify" > config.mak
  501. echo "/* Automatically generated by configure - do not modify */" > $TMPH
  502. echo "prefix=$prefix" >> config.mak
  503. echo "MAKE=$make" >> config.mak
  504. echo "CC=$cc" >> config.mak
  505. echo "AR=$ar" >> config.mak
  506. echo "RANLIB=$ranlib" >> config.mak
  507. echo "STRIP=$strip" >> config.mak
  508. echo "OPTFLAGS=$CFLAGS" >> config.mak
  509. echo "LDFLAGS=$LDFLAGS" >> config.mak
  510. echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
  511. echo "SHFLAGS=$SHFLAGS" >> config.mak
  512. if test "$cpu" = "x86" ; then
  513. echo "TARGET_ARCH_X86=yes" >> config.mak
  514. echo "#define ARCH_X86 1" >> $TMPH
  515. elif test "$cpu" = "armv4l" ; then
  516. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  517. echo "#define ARCH_ARMV4L 1" >> $TMPH
  518. elif test "$cpu" = "alpha" ; then
  519. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  520. echo "#define ARCH_ALPHA 1" >> $TMPH
  521. elif test "$cpu" = "sparc64" ; then
  522. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  523. echo "#define ARCH_SPARC64 1" >> $TMPH
  524. elif test "$cpu" = "powerpc" ; then
  525. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  526. echo "#define ARCH_POWERPC 1" >> $TMPH
  527. elif test "$cpu" = "mips" ; then
  528. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  529. echo "#define ARCH_MIPS 1" >> $TMPH
  530. fi
  531. if test "$bigendian" = "yes" ; then
  532. echo "WORDS_BIGENDIAN=yes" >> config.mak
  533. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  534. fi
  535. if test "$mmx" = "yes" ; then
  536. echo "TARGET_MMX=yes" >> config.mak
  537. echo "#define HAVE_MMX 1" >> $TMPH
  538. fi
  539. if test "$mmi" = "yes" ; then
  540. echo "TARGET_MMI=yes" >> config.mak
  541. echo "#define HAVE_MMI 1" >> $TMPH
  542. fi
  543. if test "$altivec" = "yes" ; then
  544. echo "TARGET_ALTIVEC=yes" >> config.mak
  545. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  546. fi
  547. if test "$gprof" = "yes" ; then
  548. echo "TARGET_GPROF=yes" >> config.mak
  549. echo "#define HAVE_GPROF 1" >> $TMPH
  550. fi
  551. if test "$strptime" = "yes" ; then
  552. echo "#define HAVE_STRPTIME 1" >> $TMPH
  553. else
  554. echo "BUILD_STRPTIME=yes" >> config.mak
  555. fi
  556. if test "$imlib2" = "yes" ; then
  557. echo "HAVE_IMLIB2=yes" >> config.mak
  558. fi
  559. if test "$have_lrintf" = "yes" ; then
  560. echo "#define HAVE_LRINTF 1" >> $TMPH
  561. fi
  562. if test "$vhook" = "yes" ; then
  563. echo "BUILD_VHOOK=yes" >> config.mak
  564. echo "#define HAVE_VHOOK 1" >> $TMPH
  565. extralibs="$extralibs $ldl"
  566. fi
  567. if test "$lshared" = "yes" ; then
  568. echo "BUILD_SHARED=yes" >> config.mak
  569. echo "PIC=-fPIC" >> config.mak
  570. fi
  571. echo "EXTRALIBS=$extralibs" >> config.mak
  572. echo -n "VERSION=" >>config.mak
  573. head $source_path/VERSION >>config.mak
  574. echo "" >>config.mak
  575. # if you do not want to use encoders, disable that.
  576. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  577. echo "CONFIG_ENCODERS=yes" >> config.mak
  578. # if you do not want to use decoders, disable that.
  579. echo "#define CONFIG_DECODERS 1" >> $TMPH
  580. echo "CONFIG_DECODERS=yes" >> config.mak
  581. # AC3
  582. if test "$a52" = "yes" ; then
  583. echo "#define CONFIG_AC3 1" >> $TMPH
  584. echo "CONFIG_AC3=yes" >> config.mak
  585. if test "$a52bin" = "yes" ; then
  586. echo "#define CONFIG_A52BIN 1" >> $TMPH
  587. echo "CONFIG_A52BIN=yes" >> config.mak
  588. fi
  589. fi
  590. # mpeg audio high precision mode
  591. if test "$mpegaudio_hp" = "yes" ; then
  592. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  593. fi
  594. if test "$v4l" = "yes" ; then
  595. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  596. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  597. fi
  598. if test "$dlopen" = "yes" ; then
  599. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  600. fi
  601. if test "$dlfcn" = "yes" ; then
  602. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  603. fi
  604. if test "$audio_oss" = "yes" ; then
  605. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  606. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  607. fi
  608. if test "$audio_beos" = "yes" ; then
  609. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  610. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  611. fi
  612. if test "$network" = "yes" ; then
  613. echo "#define CONFIG_NETWORK 1" >> $TMPH
  614. echo "CONFIG_NETWORK=yes" >> config.mak
  615. fi
  616. if test "$zlib" = "yes" ; then
  617. echo "#define CONFIG_ZLIB 1" >> $TMPH
  618. echo "CONFIG_ZLIB=yes" >> config.mak
  619. fi
  620. if test "$mp3lame" = "yes" ; then
  621. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  622. echo "CONFIG_MP3LAME=yes" >> config.mak
  623. fi
  624. if test "$vorbis" = "yes" ; then
  625. echo "#define CONFIG_VORBIS 1" >> $TMPH
  626. echo "CONFIG_VORBIS=yes" >> config.mak
  627. fi
  628. if test "$win32" = "yes" ; then
  629. echo "#define CONFIG_WIN32 1" >> $TMPH
  630. echo "CONFIG_WIN32=yes" >> config.mak
  631. fi
  632. if test "$mingw32" = "yes" ; then
  633. echo "#define CONFIG_WIN32 1" >> $TMPH
  634. echo "CONFIG_WIN32=yes" >> config.mak
  635. echo "#define __MINGW32__ 1" >> $TMPH
  636. echo "__MINGW32__=1" >> config.mak
  637. fi
  638. if test "$cygwin" = "yes" ; then
  639. # setup correct exesuffix
  640. echo "CONFIG_WIN32=yes" >> config.mak
  641. fi
  642. if test "$darwin" = "yes"; then
  643. echo "#define CONFIG_DARWIN 1" >> $TMPH
  644. echo "CONFIG_DARWIN=yes" >> config.mak
  645. fi
  646. if test "$_malloc_h" = "yes" ; then
  647. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  648. else
  649. echo "#undef HAVE_MALLOC_H" >> $TMPH
  650. fi
  651. if test "$_memalign" = "yes" ; then
  652. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  653. else
  654. echo "#undef HAVE_MEMALIGN" >> $TMPH
  655. fi
  656. if test "$netserver" = "yes" ; then
  657. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  658. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  659. fi
  660. if test "$need_inet_aton" = "yes" ; then
  661. echo "NEED_INET_ATON=yes" >> config.mak
  662. fi
  663. if test "$simpleidct" = "yes" ; then
  664. echo "#define SIMPLE_IDCT 1" >> $TMPH
  665. fi
  666. if test "$ffserver" = "yes" ; then
  667. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  668. echo "CONFIG_FFSERVER=yes" >> config.mak
  669. fi
  670. echo "#define restrict $_restrict" >> $TMPH
  671. # build tree in object directory if source path is different from current one
  672. if test "$source_path_used" = "yes" ; then
  673. DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
  674. libavcodec/ppc libavcodec/liba52 libavcodec/mlib tests vhook"
  675. FILES="Makefile libavformat/Makefile libavcodec/Makefile tests/Makefile vhook/Makefile"
  676. for dir in $DIRS ; do
  677. mkdir -p $dir
  678. done
  679. for f in $FILES ; do
  680. ln -sf $source_path/$f $f
  681. done
  682. fi
  683. echo "SRC_PATH=$source_path" >> config.mak
  684. diff $TMPH config.h >/dev/null 2>&1
  685. if test $? -ne 0 ; then
  686. mv -f $TMPH config.h
  687. else
  688. echo "config.h is unchanged"
  689. fi
  690. rm -f $TMPO $TMPC $TMPS $TMPH