comparison configure @ 32162:0fb9d0e105a8

Simplify a bunch of configure checks through the use of function_check().
author diego
date Tue, 14 Sep 2010 17:04:06 +0000
parents 9b6e0f5a982f
children 51622e94f85a
comparison
equal deleted inserted replaced
32161:9b6e0f5a982f 32162:0fb9d0e105a8
2926 fi 2926 fi
2927 2927
2928 2928
2929 echocheck "langinfo" 2929 echocheck "langinfo"
2930 if test "$_langinfo" = auto ; then 2930 if test "$_langinfo" = auto ; then
2931 cat > $TMPC <<EOF
2932 #include <langinfo.h>
2933 int main(void) { nl_langinfo(CODESET); return 0; }
2934 EOF
2935 _langinfo=no 2931 _langinfo=no
2936 cc_check && _langinfo=yes 2932 function_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2937 fi 2933 fi
2938 if test "$_langinfo" = yes ; then 2934 if test "$_langinfo" = yes ; then
2939 def_langinfo='#define HAVE_LANGINFO 1' 2935 def_langinfo='#define HAVE_LANGINFO 1'
2940 else 2936 else
2941 def_langinfo='#undef HAVE_LANGINFO' 2937 def_langinfo='#undef HAVE_LANGINFO'
3055 echores "$_kstat" 3051 echores "$_kstat"
3056 3052
3057 3053
3058 echocheck "posix4" 3054 echocheck "posix4"
3059 # required for nanosleep on some systems 3055 # required for nanosleep on some systems
3060 cat > $TMPC << EOF
3061 #include <time.h>
3062 int main(void) { nanosleep(0, 0); return 0; }
3063 EOF
3064 _posix4=no 3056 _posix4=no
3065 function_check time.h "nanosleep(0, 0)" -lposix4 && _posix4=yes 3057 function_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
3066 if test "$_posix4" = yes ; then 3058 if test "$_posix4" = yes ; then
3067 extra_ldflags="$extra_ldflags -lposix4" 3059 extra_ldflags="$extra_ldflags -lposix4"
3068 fi 3060 fi
3069 echores "$_posix4" 3061 echores "$_posix4"
3070 3062
3096 fi 3088 fi
3097 echores "$_mkstemp" 3089 echores "$_mkstemp"
3098 3090
3099 3091
3100 echocheck "nanosleep" 3092 echocheck "nanosleep"
3101 # also check for nanosleep
3102 cat > $TMPC << EOF
3103 #include <time.h>
3104 int main(void) { nanosleep(0, 0); return 0; }
3105 EOF
3106 _nanosleep=no 3093 _nanosleep=no
3107 cc_check && _nanosleep=yes 3094 function_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
3108 if test "$_nanosleep" = yes ; then 3095 if test "$_nanosleep" = yes ; then
3109 def_nanosleep='#define HAVE_NANOSLEEP 1' 3096 def_nanosleep='#define HAVE_NANOSLEEP 1'
3110 else 3097 else
3111 def_nanosleep='#undef HAVE_NANOSLEEP' 3098 def_nanosleep='#undef HAVE_NANOSLEEP'
3112 fi 3099 fi
3126 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break 3113 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3127 done 3114 done
3128 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no 3115 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3129 if test $_winsock2_h = auto ; then 3116 if test $_winsock2_h = auto ; then
3130 _winsock2_h=no 3117 _winsock2_h=no
3131 cat > $TMPC << EOF 3118 function_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3132 #include <winsock2.h>
3133 int main(void) { gethostbyname(0); return 0; }
3134 EOF
3135 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3136 fi 3119 fi
3137 test "$_ld_sock" && res_comment="using $_ld_sock" 3120 test "$_ld_sock" && res_comment="using $_ld_sock"
3138 echores "$_socklib" 3121 echores "$_socklib"
3139 3122
3140 3123
3328 echores "$_socklen_t" 3311 echores "$_socklen_t"
3329 3312
3330 3313
3331 echocheck "closesocket()" 3314 echocheck "closesocket()"
3332 _closesocket=no 3315 _closesocket=no
3333 cat > $TMPC << EOF 3316 function_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
3334 #include <winsock2.h>
3335 int main(void) { closesocket(~0); return 0; }
3336 EOF
3337 cc_check $_ld_sock && _closesocket=yes
3338 if test "$_closesocket" = yes ; then 3317 if test "$_closesocket" = yes ; then
3339 def_closesocket='#define HAVE_CLOSESOCKET 1' 3318 def_closesocket='#define HAVE_CLOSESOCKET 1'
3340 else 3319 else
3341 def_closesocket='#define HAVE_CLOSESOCKET 0' 3320 def_closesocket='#define HAVE_CLOSESOCKET 0'
3342 fi 3321 fi
3459 3438
3460 3439
3461 echocheck "memalign()" 3440 echocheck "memalign()"
3462 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ? 3441 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3463 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0' 3442 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3464 cat > $TMPC << EOF
3465 #include <malloc.h>
3466 int main(void) { memalign(64, sizeof(char)); return 0; }
3467 EOF
3468 _memalign=no 3443 _memalign=no
3469 cc_check && _memalign=yes 3444 function_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3470 if test "$_memalign" = yes ; then 3445 if test "$_memalign" = yes ; then
3471 def_memalign='#define HAVE_MEMALIGN 1' 3446 def_memalign='#define HAVE_MEMALIGN 1'
3472 else 3447 else
3473 def_memalign='#define HAVE_MEMALIGN 0' 3448 def_memalign='#define HAVE_MEMALIGN 0'
3474 def_map_memalign='#define memalign(a,b) malloc(b)' 3449 def_map_memalign='#define memalign(a,b) malloc(b)'
3488 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1' 3463 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3489 echores "$posix_memalign" 3464 echores "$posix_memalign"
3490 3465
3491 3466
3492 echocheck "alloca.h" 3467 echocheck "alloca.h"
3493 cat > $TMPC << EOF
3494 #include <alloca.h>
3495 int main(void) { alloca(0); return 0; }
3496 EOF
3497 _alloca=no 3468 _alloca=no
3498 cc_check && _alloca=yes 3469 function_check alloca.h 'alloca(0)' && _alloca=yes
3499 if cc_check ; then 3470 if cc_check ; then
3500 def_alloca_h='#define HAVE_ALLOCA_H 1' 3471 def_alloca_h='#define HAVE_ALLOCA_H 1'
3501 else 3472 else
3502 def_alloca_h='#undef HAVE_ALLOCA_H' 3473 def_alloca_h='#undef HAVE_ALLOCA_H'
3503 fi 3474 fi
3969 fi 3940 fi
3970 echores "$_glob" 3941 echores "$_glob"
3971 3942
3972 3943
3973 echocheck "setenv()" 3944 echocheck "setenv()"
3974 cat > $TMPC << EOF
3975 #include <stdlib.h>
3976 int main(void) { setenv("","",0); return 0; }
3977 EOF
3978 _setenv=no 3945 _setenv=no
3979 cc_check && _setenv=yes 3946 function_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3980 if test "$_setenv" = yes ; then 3947 if test "$_setenv" = yes ; then
3981 def_setenv='#define HAVE_SETENV 1' 3948 def_setenv='#define HAVE_SETENV 1'
3982 _need_setenv=no 3949 _need_setenv=no
3983 else 3950 else
3984 def_setenv='#undef HAVE_SETENV' 3951 def_setenv='#undef HAVE_SETENV'
3988 3955
3989 3956
3990 echocheck "setmode()" 3957 echocheck "setmode()"
3991 _setmode=no 3958 _setmode=no
3992 def_setmode='#define HAVE_SETMODE 0' 3959 def_setmode='#define HAVE_SETMODE 0'
3993 cat > $TMPC << EOF 3960 function_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3994 #include <io.h>
3995 int main(void) { setmode(0, 0); return 0; }
3996 EOF
3997 cc_check && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3998 echores "$_setmode" 3961 echores "$_setmode"
3999 3962
4000 3963
4001 if sunos; then 3964 if sunos; then
4002 echocheck "sysi86()" 3965 echocheck "sysi86()"
4003 cat > $TMPC << EOF
4004 #include <sys/sysi86.h>
4005 int main(void) { sysi86(0); return 0; }
4006 EOF
4007 _sysi86=no 3966 _sysi86=no
4008 cc_check && _sysi86=yes 3967 function_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
4009 if test "$_sysi86" = yes ; then 3968 if test "$_sysi86" = yes ; then
4010 def_sysi86='#define HAVE_SYSI86 1' 3969 def_sysi86='#define HAVE_SYSI86 1'
4011 cat > $TMPC << EOF 3970 cat > $TMPC << EOF
4012 #include <sys/sysi86.h> 3971 #include <sys/sysi86.h>
4013 int main(void) { int sysi86(int, void*); sysi86(0); return 0; } 3972 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
4137 echocheck "Samba support (libsmbclient)" 4096 echocheck "Samba support (libsmbclient)"
4138 if test "$_smb" = yes; then 4097 if test "$_smb" = yes; then
4139 extra_ldflags="$extra_ldflags -lsmbclient" 4098 extra_ldflags="$extra_ldflags -lsmbclient"
4140 fi 4099 fi
4141 if test "$_smb" = auto; then 4100 if test "$_smb" = auto; then
4142 _smb=no 4101 _smb=no
4143 cat > $TMPC << EOF
4144 #include <libsmbclient.h>
4145 int main(void) { smbc_opendir("smb://"); return 0; }
4146 EOF
4147 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do 4102 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
4148 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \ 4103 function_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
4149 _smb=yes && break 4104 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
4150 done 4105 done
4151 fi 4106 fi
4152 4107
4153 if test "$_smb" = yes; then 4108 if test "$_smb" = yes; then
4154 def_smb="#define CONFIG_LIBSMBCLIENT 1" 4109 def_smb="#define CONFIG_LIBSMBCLIENT 1"
4760 fi 4715 fi
4761 4716
4762 4717
4763 echocheck "GGI" 4718 echocheck "GGI"
4764 if test "$_ggi" = auto ; then 4719 if test "$_ggi" = auto ; then
4765 cat > $TMPC << EOF
4766 #include <ggi/ggi.h>
4767 int main(void) { ggiInit(); return 0; }
4768 EOF
4769 _ggi=no 4720 _ggi=no
4770 cc_check -lggi && _ggi=yes 4721 function_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4771 fi 4722 fi
4772 if test "$_ggi" = yes ; then 4723 if test "$_ggi" = yes ; then
4773 def_ggi='#define CONFIG_GGI 1' 4724 def_ggi='#define CONFIG_GGI 1'
4774 libs_mplayer="$libs_mplayer -lggi" 4725 libs_mplayer="$libs_mplayer -lggi"
4775 vomodules="ggi $vomodules" 4726 vomodules="ggi $vomodules"
4953 fi 4904 fi
4954 echores $quicktime 4905 echores $quicktime
4955 4906
4956 echocheck "Quartz" 4907 echocheck "Quartz"
4957 if test "$_quartz" = auto ; then 4908 if test "$_quartz" = auto ; then
4958 cat > $TMPC <<EOF
4959 #include <Carbon/Carbon.h>
4960 int main(void) {
4961 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
4962 return 0;
4963 }
4964 EOF
4965 _quartz=no 4909 _quartz=no
4966 cc_check -framework Carbon && _quartz=yes 4910 function_check Carbon/Carbon.h 'CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false)' -framework Carbon && _quartz=yes
4967 fi 4911 fi
4968 if test "$_quartz" = yes ; then 4912 if test "$_quartz" = yes ; then
4969 libs_mplayer="$libs_mplayer -framework Carbon" 4913 libs_mplayer="$libs_mplayer -framework Carbon"
4970 def_quartz='#define CONFIG_QUARTZ 1' 4914 def_quartz='#define CONFIG_QUARTZ 1'
4971 vomodules="quartz $vomodules" 4915 vomodules="quartz $vomodules"
5119 _gif=auto 5063 _gif=auto
5120 fi 5064 fi
5121 5065
5122 if test "$_gif" = auto ; then 5066 if test "$_gif" = auto ; then
5123 _gif=no 5067 _gif=no
5124 cat > $TMPC << EOF
5125 #include <gif_lib.h>
5126 int main(void) { QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0); return 0; }
5127 EOF
5128 for _ld_gif in "-lungif" "-lgif" ; do 5068 for _ld_gif in "-lungif" "-lgif" ; do
5129 cc_check $_ld_gif && _gif=yes && break 5069 function_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
5130 done 5070 done
5131 fi 5071 fi
5132 5072
5133 # If no library was found, and the user wants support forced, 5073 # If no library was found, and the user wants support forced,
5134 # then we force it on with libgif, as this is the safest 5074 # then we force it on with libgif, as this is the safest
5201 esac 5141 esac
5202 5142
5203 5143
5204 echocheck "VESA support" 5144 echocheck "VESA support"
5205 if test "$_vesa" = auto ; then 5145 if test "$_vesa" = auto ; then
5206 cat > $TMPC << EOF
5207 #include <vbe.h>
5208 int main(void) { vbeVersion(); return 0; }
5209 EOF
5210 _vesa=no 5146 _vesa=no
5211 cc_check -lvbe -llrmi && _vesa=yes 5147 function_check vbe.h 'vbeVersion()' -lvbe -llrmi && _vesa=yes
5212 fi 5148 fi
5213 if test "$_vesa" = yes ; then 5149 if test "$_vesa" = yes ; then
5214 def_vesa='#define CONFIG_VESA 1' 5150 def_vesa='#define CONFIG_VESA 1'
5215 libs_mplayer="$libs_mplayer -lvbe -llrmi" 5151 libs_mplayer="$libs_mplayer -lvbe -llrmi"
5216 vomodules="vesa $vomodules" 5152 vomodules="vesa $vomodules"
5733 5669
5734 5670
5735 echocheck "JACK" 5671 echocheck "JACK"
5736 if test "$_jack" = auto ; then 5672 if test "$_jack" = auto ; then
5737 _jack=yes 5673 _jack=yes
5738 5674 if function_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' -ljack ; then
5739 cat > $TMPC << EOF
5740 #include <jack/jack.h>
5741 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5742 EOF
5743 if cc_check -ljack ; then
5744 libs_mplayer="$libs_mplayer -ljack" 5675 libs_mplayer="$libs_mplayer -ljack"
5745 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then 5676 elif function_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' $($_pkg_config --libs --cflags --silence-errors jack) ; then
5746 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)" 5677 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5747 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)"" 5678 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5748 else 5679 else
5749 _jack=no 5680 _jack=no
5750 fi 5681 fi
5913 def_mlib='#define CONFIG_MLIB 0' 5844 def_mlib='#define CONFIG_MLIB 0'
5914 if sunos; then 5845 if sunos; then
5915 echocheck "Sun mediaLib" 5846 echocheck "Sun mediaLib"
5916 if test "$_mlib" = auto ; then 5847 if test "$_mlib" = auto ; then
5917 _mlib=no 5848 _mlib=no
5918 cat > $TMPC << EOF 5849 cc_check mlib.h "mlib_VideoColorYUV2ABGR420(0, 0, 0, 0, 0, 0, 0, 0, 0)" -lmlib &&
5919 #include <mlib.h> 5850 _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5920 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5921 EOF
5922 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5923 fi 5851 fi
5924 echores "$_mlib" 5852 echores "$_mlib"
5925 fi #if sunos 5853 fi #if sunos
5926 5854
5927 5855
6454 fi 6382 fi
6455 echores "$_enca" 6383 echores "$_enca"
6456 6384
6457 6385
6458 echocheck "zlib" 6386 echocheck "zlib"
6459 cat > $TMPC << EOF
6460 #include <zlib.h>
6461 int main(void) { inflate(0, Z_NO_FLUSH); return 0; }
6462 EOF
6463 _zlib=no 6387 _zlib=no
6464 cc_check -lz && _zlib=yes 6388 function_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
6465 if test "$_zlib" = yes ; then 6389 if test "$_zlib" = yes ; then
6466 def_zlib='#define CONFIG_ZLIB 1' 6390 def_zlib='#define CONFIG_ZLIB 1'
6467 extra_ldflags="$extra_ldflags -lz" 6391 extra_ldflags="$extra_ldflags -lz"
6468 else 6392 else
6469 def_zlib='#define CONFIG_ZLIB 0' 6393 def_zlib='#define CONFIG_ZLIB 0'
6474 6398
6475 6399
6476 echocheck "bzlib" 6400 echocheck "bzlib"
6477 bzlib=no 6401 bzlib=no
6478 def_bzlib='#define CONFIG_BZLIB 0' 6402 def_bzlib='#define CONFIG_BZLIB 0'
6479 cat > $TMPC << EOF 6403 function_check bzlib.h 'BZ2_bzlibVersion()' -lbz2 && bzlib=yes
6480 #include <bzlib.h>
6481 int main(void) { BZ2_bzlibVersion(); return 0; }
6482 EOF
6483 cc_check -lbz2 && bzlib=yes
6484 if test "$bzlib" = yes ; then 6404 if test "$bzlib" = yes ; then
6485 def_bzlib='#define CONFIG_BZLIB 1' 6405 def_bzlib='#define CONFIG_BZLIB 1'
6486 extra_ldflags="$extra_ldflags -lbz2" 6406 extra_ldflags="$extra_ldflags -lbz2"
6487 fi 6407 fi
6488 echores "$bzlib" 6408 echores "$bzlib"
6513 6433
6514 6434
6515 echocheck "liblzo2 support" 6435 echocheck "liblzo2 support"
6516 if test "$_liblzo" = auto ; then 6436 if test "$_liblzo" = auto ; then
6517 _liblzo=no 6437 _liblzo=no
6518 cat > $TMPC << EOF 6438 function_check lzo/lzo1x.h 'lzo_init()' -llzo2 && _liblzo=yes
6519 #include <lzo/lzo1x.h>
6520 int main(void) { lzo_init(); return 0; }
6521 EOF
6522 cc_check -llzo2 && _liblzo=yes
6523 fi 6439 fi
6524 if test "$_liblzo" = yes ; then 6440 if test "$_liblzo" = yes ; then
6525 def_liblzo='#define CONFIG_LIBLZO 1' 6441 def_liblzo='#define CONFIG_LIBLZO 1'
6526 extra_ldflags="$extra_ldflags -llzo2" 6442 extra_ldflags="$extra_ldflags -llzo2"
6527 codecmodules="liblzo $codecmodules" 6443 codecmodules="liblzo $codecmodules"
6547 fi 6463 fi
6548 echores "$_mad" 6464 echores "$_mad"
6549 6465
6550 echocheck "Twolame" 6466 echocheck "Twolame"
6551 if test "$_twolame" = auto ; then 6467 if test "$_twolame" = auto ; then
6552 cat > $TMPC <<EOF
6553 #include <twolame.h>
6554 int main(void) { twolame_init(); return 0; }
6555 EOF
6556 _twolame=no 6468 _twolame=no
6557 cc_check -ltwolame $_ld_lm && _twolame=yes 6469 function_check twolame.h 'twolame_init()' -ltwolame $_ld_lm && _twolame=yes
6558 fi 6470 fi
6559 if test "$_twolame" = yes ; then 6471 if test "$_twolame" = yes ; then
6560 def_twolame='#define CONFIG_TWOLAME 1' 6472 def_twolame='#define CONFIG_TWOLAME 1'
6561 libs_mencoder="$libs_mencoder -ltwolame" 6473 libs_mencoder="$libs_mencoder -ltwolame"
6562 codecmodules="twolame $codecmodules" 6474 codecmodules="twolame $codecmodules"
6570 if test "$_toolame" = auto ; then 6482 if test "$_toolame" = auto ; then
6571 _toolame=no 6483 _toolame=no
6572 if test "$_twolame" = yes ; then 6484 if test "$_twolame" = yes ; then
6573 res_comment="disabled by twolame" 6485 res_comment="disabled by twolame"
6574 else 6486 else
6575 cat > $TMPC <<EOF 6487 function_check toolame.h 'toolame_init()' -ltoolame $_ld_lm && _toolame=yes
6576 #include <toolame.h>
6577 int main(void) { toolame_init(); return 0; }
6578 EOF
6579 cc_check -ltoolame $_ld_lm && _toolame=yes
6580 fi 6488 fi
6581 fi 6489 fi
6582 if test "$_toolame" = yes ; then 6490 if test "$_toolame" = yes ; then
6583 def_toolame='#define CONFIG_TOOLAME 1' 6491 def_toolame='#define CONFIG_TOOLAME 1'
6584 libs_mencoder="$libs_mencoder -ltoolame" 6492 libs_mencoder="$libs_mencoder -ltoolame"
6595 echocheck "OggVorbis support" 6503 echocheck "OggVorbis support"
6596 if test "$_tremor_internal" = yes; then 6504 if test "$_tremor_internal" = yes; then
6597 _libvorbis=no 6505 _libvorbis=no
6598 elif test "$_tremor" = auto; then 6506 elif test "$_tremor" = auto; then
6599 _tremor=no 6507 _tremor=no
6600 cat > $TMPC << EOF 6508 function_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6601 #include <tremor/ivorbiscodec.h>
6602 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6603 EOF
6604 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6605 fi 6509 fi
6606 if test "$_libvorbis" = auto; then 6510 if test "$_libvorbis" = auto; then
6607 _libvorbis=no 6511 _libvorbis=no
6608 cat > $TMPC << EOF 6512 function_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes
6609 #include <vorbis/codec.h>
6610 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6611 EOF
6612 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6613 fi 6513 fi
6614 if test "$_tremor_internal" = yes ; then 6514 if test "$_tremor_internal" = yes ; then
6615 _vorbis=yes 6515 _vorbis=yes
6616 def_vorbis='#define CONFIG_OGGVORBIS 1' 6516 def_vorbis='#define CONFIG_OGGVORBIS 1'
6617 def_tremor='#define CONFIG_TREMOR 1' 6517 def_tremor='#define CONFIG_TREMOR 1'
6662 echores "$_speex" 6562 echores "$_speex"
6663 6563
6664 echocheck "libgsm" 6564 echocheck "libgsm"
6665 if test "$_libgsm" = auto ; then 6565 if test "$_libgsm" = auto ; then
6666 _libgsm=no 6566 _libgsm=no
6667 cat > $TMPC << EOF 6567 function_check gsm/gsm.h 'gsm_create()' -lgsm && _libgsm=yes
6668 #include <gsm/gsm.h>
6669 int main(void) { gsm_create(); return 0; }
6670 EOF
6671 cc_check -lgsm && _libgsm=yes
6672 fi 6568 fi
6673 if test "$_libgsm" = yes ; then 6569 if test "$_libgsm" = yes ; then
6674 def_libgsm='#define CONFIG_LIBGSM 1' 6570 def_libgsm='#define CONFIG_LIBGSM 1'
6675 extra_ldflags="$extra_ldflags -lgsm" 6571 extra_ldflags="$extra_ldflags -lgsm"
6676 libavencoders="$libavencoders LIBGSM_ENCODER LIBGSM_MS_ENCODER" 6572 libavencoders="$libavencoders LIBGSM_ENCODER LIBGSM_MS_ENCODER"
6766 # Any version of libmpg123 shall be fine. 6662 # Any version of libmpg123 shall be fine.
6767 echocheck "mpg123 support" 6663 echocheck "mpg123 support"
6768 def_mpg123='#undef CONFIG_MPG123' 6664 def_mpg123='#undef CONFIG_MPG123'
6769 if test "$_mpg123" = auto; then 6665 if test "$_mpg123" = auto; then
6770 _mpg123=no 6666 _mpg123=no
6771 cat > $TMPC <<EOF 6667 function_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
6772 #include <mpg123.h>
6773 int main(void){ mpg123_init(); return 0; }
6774 EOF
6775 cc_check -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
6776 fi 6668 fi
6777 if test "$_mpg123" = yes ; then 6669 if test "$_mpg123" = yes ; then
6778 def_mpg123='#define CONFIG_MPG123 1' 6670 def_mpg123='#define CONFIG_MPG123 1'
6779 codecmodules="mpg123 $codecmodules" 6671 codecmodules="mpg123 $codecmodules"
6780 else 6672 else
7277 7169
7278 7170
7279 echocheck "libopencore_amr narrowband" 7171 echocheck "libopencore_amr narrowband"
7280 if test "$_libopencore_amrnb" = auto ; then 7172 if test "$_libopencore_amrnb" = auto ; then
7281 _libopencore_amrnb=no 7173 _libopencore_amrnb=no
7282 cat > $TMPC << EOF 7174 function_check opencore-amrnb/interf_dec.h 'Decoder_Interface_init()' -lopencore-amrnb && _libopencore_amrnb=yes
7283 #include <opencore-amrnb/interf_dec.h>
7284 int main(void) { Decoder_Interface_init(); return 0; }
7285 EOF
7286 cc_check -lopencore-amrnb && _libopencore_amrnb=yes
7287 if test "$ffmpeg_a" != yes ; then 7175 if test "$ffmpeg_a" != yes ; then
7288 _libopencore_amrnb=no 7176 _libopencore_amrnb=no
7289 res_comment="ffmpeg (static) is required by libopencore_amrnb, sorry" 7177 res_comment="ffmpeg (static) is required by libopencore_amrnb, sorry"
7290 fi 7178 fi
7291 fi 7179 fi
7304 7192
7305 7193
7306 echocheck "libopencore_amr wideband" 7194 echocheck "libopencore_amr wideband"
7307 if test "$_libopencore_amrwb" = auto ; then 7195 if test "$_libopencore_amrwb" = auto ; then
7308 _libopencore_amrwb=no 7196 _libopencore_amrwb=no
7309 cat > $TMPC << EOF 7197 function_check opencore-amrwb/dec_if.h 'D_IF_init()' -lopencore-amrwb && _libopencore_amrwb=yes
7310 #include <opencore-amrwb/dec_if.h>
7311 int main(void) { D_IF_init(); return 0; }
7312 EOF
7313 cc_check -lopencore-amrwb && _libopencore_amrwb=yes
7314 if test "$ffmpeg_a" != yes ; then 7198 if test "$ffmpeg_a" != yes ; then
7315 _libopencore_amrwb=no 7199 _libopencore_amrwb=no
7316 res_comment="ffmpeg (static) is required by libopencore_amrwb, sorry" 7200 res_comment="ffmpeg (static) is required by libopencore_amrwb, sorry"
7317 fi 7201 fi
7318 fi 7202 fi
7345 7229
7346 7230
7347 echocheck "Xvid" 7231 echocheck "Xvid"
7348 if test "$_xvid" = auto ; then 7232 if test "$_xvid" = auto ; then
7349 _xvid=no 7233 _xvid=no
7350 cat > $TMPC << EOF
7351 #include <xvid.h>
7352 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
7353 EOF
7354 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do 7234 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
7355 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break 7235 function_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
7236 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
7356 done 7237 done
7357 fi 7238 fi
7358 7239
7359 if test "$_xvid" = yes ; then 7240 if test "$_xvid" = yes ; then
7360 def_xvid='#define CONFIG_XVID4 1' 7241 def_xvid='#define CONFIG_XVID4 1'
7586 fi 7467 fi
7587 if test "$_mp3lame" = yes ; then 7468 if test "$_mp3lame" = yes ; then
7588 def_mp3lame="#define CONFIG_MP3LAME 1" 7469 def_mp3lame="#define CONFIG_MP3LAME 1"
7589 _ld_mp3lame=-lmp3lame 7470 _ld_mp3lame=-lmp3lame
7590 libs_mencoder="$libs_mencoder $_ld_mp3lame" 7471 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7591 cat > $TMPC << EOF 7472 function_check lame/lame.h 'lame_set_preset(NULL, STANDARD_FAST)' $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7592 #include <lame/lame.h> 7473 function_check lame/lame.h 'lame_set_preset(NULL, MEDIUM_FAST)' $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7593 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7594 EOF
7595 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7596 cat > $TMPC << EOF
7597 #include <lame/lame.h>
7598 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7599 EOF
7600 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7601 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes 7474 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
7602 if test "$_mp3lame_lavc" = yes ; then 7475 if test "$_mp3lame_lavc" = yes ; then
7603 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1" 7476 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
7604 libavencoders="$libavencoders LIBMP3LAME_ENCODER" 7477 libavencoders="$libavencoders LIBMP3LAME_ENCODER"
7605 libs_mplayer="$libs_mplayer $_ld_mp3lame" 7478 libs_mplayer="$libs_mplayer $_ld_mp3lame"
8212 # Detect maemo development platform libraries availability (http://www.maemo.org), 8085 # Detect maemo development platform libraries availability (http://www.maemo.org),
8213 # they are used when run on Nokia 770|8x0 8086 # they are used when run on Nokia 770|8x0
8214 echocheck "maemo (Nokia 770|8x0)" 8087 echocheck "maemo (Nokia 770|8x0)"
8215 if test "$_maemo" = auto ; then 8088 if test "$_maemo" = auto ; then
8216 _maemo=no 8089 _maemo=no
8217 cat > $TMPC << EOF 8090 function_check libosso.h 'osso_initialize('', '', 0, NULL)' $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
8218 #include <libosso.h>
8219 int main(void) { osso_initialize("", "", 0, NULL); return 0; }
8220 EOF
8221 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
8222 fi 8091 fi
8223 if test "$_maemo" = yes ; then 8092 if test "$_maemo" = yes ; then
8224 def_maemo='#define CONFIG_MAEMO 1' 8093 def_maemo='#define CONFIG_MAEMO 1'
8225 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)" 8094 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
8226 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp" 8095 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"