comparison configure @ 32673:9bb86c2a9dc5

Simplify a bunch of configure checks with the statement_check function.
author diego
date Wed, 05 Jan 2011 16:37:45 +0000
parents 81712a60b4bf
children db882cd69776
comparison
equal deleted inserted replaced
32672:81712a60b4bf 32673:9bb86c2a9dc5
3786 echores "$_termios" 3786 echores "$_termios"
3787 3787
3788 3788
3789 echocheck "shm" 3789 echocheck "shm"
3790 if test "$_shm" = auto ; then 3790 if test "$_shm" = auto ; then
3791 cat > $TMPC << EOF
3792 #include <sys/shm.h>
3793 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3794 EOF
3795 _shm=no 3791 _shm=no
3796 cc_check && _shm=yes 3792 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3797 fi 3793 fi
3798 if test "$_shm" = yes ; then 3794 if test "$_shm" = yes ; then
3799 def_shm='#define HAVE_SHM 1' 3795 def_shm='#define HAVE_SHM 1'
3800 else 3796 else
3801 def_shm='#undef HAVE_SHM' 3797 def_shm='#undef HAVE_SHM'
3802 fi 3798 fi
3803 echores "$_shm" 3799 echores "$_shm"
3804 3800
3805 3801
3806 echocheck "strsep()" 3802 echocheck "strsep()"
3807 cat > $TMPC << EOF
3808 #include <string.h>
3809 int main(void) { char *s = "Hello, world!"; strsep(&s, ","); return 0; }
3810 EOF
3811 _strsep=no 3803 _strsep=no
3812 cc_check && _strsep=yes 3804 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3813 if test "$_strsep" = yes ; then 3805 if test "$_strsep" = yes ; then
3814 def_strsep='#define HAVE_STRSEP 1' 3806 def_strsep='#define HAVE_STRSEP 1'
3815 _need_strsep=no 3807 _need_strsep=no
3816 else 3808 else
3817 def_strsep='#undef HAVE_STRSEP' 3809 def_strsep='#undef HAVE_STRSEP'
3877 fi 3869 fi
3878 echores "$_select" 3870 echores "$_select"
3879 3871
3880 3872
3881 echocheck "gettimeofday()" 3873 echocheck "gettimeofday()"
3882 cat > $TMPC << EOF
3883 #include <sys/time.h>
3884 int main(void) {struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); return 0; }
3885 EOF
3886 _gettimeofday=no 3874 _gettimeofday=no
3887 cc_check && _gettimeofday=yes 3875 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3888 if test "$_gettimeofday" = yes ; then 3876 if test "$_gettimeofday" = yes ; then
3889 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1' 3877 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3890 _need_gettimeofday=no 3878 _need_gettimeofday=no
3891 else 3879 else
3892 def_gettimeofday='#undef HAVE_GETTIMEOFDAY' 3880 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3932 echocheck "sysi86()" 3920 echocheck "sysi86()"
3933 _sysi86=no 3921 _sysi86=no
3934 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes 3922 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3935 if test "$_sysi86" = yes ; then 3923 if test "$_sysi86" = yes ; then
3936 def_sysi86='#define HAVE_SYSI86 1' 3924 def_sysi86='#define HAVE_SYSI86 1'
3937 cat > $TMPC << EOF 3925 statement_check sys/sysi86.h 'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3938 #include <sys/sysi86.h>
3939 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3940 EOF
3941 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3942 else 3926 else
3943 def_sysi86='#undef HAVE_SYSI86' 3927 def_sysi86='#undef HAVE_SYSI86'
3944 fi 3928 fi
3945 echores "$_sysi86" 3929 echores "$_sysi86"
3946 fi #if sunos 3930 fi #if sunos
3947 3931
3948 3932
3949 echocheck "sys/sysinfo.h" 3933 echocheck "sys/sysinfo.h"
3950 cat > $TMPC << EOF
3951 #include <sys/sysinfo.h>
3952 int main(void) { struct sysinfo s_info; sysinfo(&s_info); return 0; }
3953 EOF
3954 _sys_sysinfo=no 3934 _sys_sysinfo=no
3955 cc_check && _sys_sysinfo=yes 3935 statement_check sys/sysinfo.h 'struct sysinfo s_info; sysinfo(&s_info)' && _sys_sysinfo=yes
3956 if test "$_sys_sysinfo" = yes ; then 3936 if test "$_sys_sysinfo" = yes ; then
3957 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1' 3937 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3958 else 3938 else
3959 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H' 3939 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3960 fi 3940 fi
4022 if linux; then 4002 if linux; then
4023 4003
4024 echocheck "Apple IR" 4004 echocheck "Apple IR"
4025 if test "$_apple_ir" = auto ; then 4005 if test "$_apple_ir" = auto ; then
4026 _apple_ir=no 4006 _apple_ir=no
4027 cat > $TMPC <<EOF 4007 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
4028 #include <linux/input.h>
4029 int main(void) { struct input_event ev; struct input_id id; return 0; }
4030 EOF
4031 cc_check && _apple_ir=yes
4032 fi 4008 fi
4033 if test "$_apple_ir" = yes ; then 4009 if test "$_apple_ir" = yes ; then
4034 def_apple_ir='#define CONFIG_APPLE_IR 1' 4010 def_apple_ir='#define CONFIG_APPLE_IR 1'
4035 else 4011 else
4036 def_apple_ir='#undef CONFIG_APPLE_IR' 4012 def_apple_ir='#undef CONFIG_APPLE_IR'
4759 4735
4760 if darwin; then 4736 if darwin; then
4761 4737
4762 echocheck "QuickTime" 4738 echocheck "QuickTime"
4763 if test "$quicktime" = auto ; then 4739 if test "$quicktime" = auto ; then
4764 cat > $TMPC <<EOF
4765 #include <QuickTime/QuickTime.h>
4766 int main(void) {
4767 ImageDescription *desc;
4768 EnterMovies();
4769 ExitMovies();
4770 return 0;
4771 }
4772 EOF
4773 quicktime=no 4740 quicktime=no
4774 cc_check -framework QuickTime && quicktime=yes 4741 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
4775 fi 4742 fi
4776 if test "$quicktime" = yes ; then 4743 if test "$quicktime" = yes ; then
4777 extra_ldflags="$extra_ldflags -framework QuickTime" 4744 extra_ldflags="$extra_ldflags -framework QuickTime"
4778 def_quicktime='#define CONFIG_QUICKTIME 1' 4745 def_quicktime='#define CONFIG_QUICKTIME 1'
4779 else 4746 else
6996 fi 6963 fi
6997 echores "$_xvid" 6964 echores "$_xvid"
6998 6965
6999 echocheck "Xvid two pass plugin" 6966 echocheck "Xvid two pass plugin"
7000 if test "$_mencoder" = yes && test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then 6967 if test "$_mencoder" = yes && test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
7001 cat > $TMPC << EOF 6968 statement_check xvid.h 'xvid_plugin_2pass2_t s; s.vbv_size = 0' && _xvid_lavc=yes
7002 #include <xvid.h>
7003 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
7004 EOF
7005 cc_check && _xvid_lavc=yes
7006 fi 6969 fi
7007 if test "$_xvid_lavc" = yes ; then 6970 if test "$_xvid_lavc" = yes ; then
7008 def_xvid_lavc='#define CONFIG_LIBXVID 1' 6971 def_xvid_lavc='#define CONFIG_LIBXVID 1'
7009 libavencoders="$libavencoders LIBXVID LIBXVID_ENCODER" 6972 libavencoders="$libavencoders LIBXVID LIBXVID_ENCODER"
7010 else 6973 else
7154 fi 7117 fi
7155 echores "$_libvpx_lavc" 7118 echores "$_libvpx_lavc"
7156 7119
7157 echocheck "libnut" 7120 echocheck "libnut"
7158 if test "$_libnut" = auto ; then 7121 if test "$_libnut" = auto ; then
7159 cat > $TMPC << EOF
7160 #include <libnut.h>
7161 nut_context_tt * nut;
7162 int main(void) { nut_error(0); return 0; }
7163 EOF
7164 _libnut=no 7122 _libnut=no
7165 cc_check -lnut && _libnut=yes 7123 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
7166 fi 7124 fi
7167 7125
7168 if test "$_libnut" = yes ; then 7126 if test "$_libnut" = yes ; then
7169 def_libnut='#define CONFIG_LIBNUT 1' 7127 def_libnut='#define CONFIG_LIBNUT 1'
7170 extra_ldflags="$extra_ldflags -lnut" 7128 extra_ldflags="$extra_ldflags -lnut"
7344 7302
7345 echocheck "DirectShow TV interface" 7303 echocheck "DirectShow TV interface"
7346 if test "$_tv_dshow" = auto ; then 7304 if test "$_tv_dshow" = auto ; then
7347 _tv_dshow=no 7305 _tv_dshow=no
7348 if test "$_tv" = yes && win32 ; then 7306 if test "$_tv" = yes && win32 ; then
7349 cat > $TMPC <<EOF 7307 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
7350 #include <ole2.h>
7351 int main(void) {
7352 void* p;
7353 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7354 return 0;
7355 }
7356 EOF
7357 cc_check -lole32 -luuid && _tv_dshow=yes
7358 fi 7308 fi
7359 fi 7309 fi
7360 if test "$_tv_dshow" = yes ; then 7310 if test "$_tv_dshow" = yes ; then
7361 inputmodules="tv-dshow $inputmodules" 7311 inputmodules="tv-dshow $inputmodules"
7362 def_tv_dshow='#define CONFIG_TV_DSHOW 1' 7312 def_tv_dshow='#define CONFIG_TV_DSHOW 1'