comparison configure @ 32718:1fc2df65b915

Add return_check() helper function and use it to simplify some checks.
author diego
date Thu, 20 Jan 2011 12:44:08 +0000
parents 465b9f294519
children 1cdf5ed4b9d8
comparison
equal deleted inserted replaced
32717:465b9f294519 32718:1fc2df65b915
77 cat > $TMPC << EOF 77 cat > $TMPC << EOF
78 #include <$1> 78 #include <$1>
79 int main(void) { return 0; } 79 int main(void) { return 0; }
80 EOF 80 EOF
81 shift 81 shift
82 compile_check $TMPC $@
83 }
84
85 return_check() {
86 cat > $TMPC << EOF
87 #include <$1>
88 int main(void) { return $2; }
89 EOF
90 shift 2
82 compile_check $TMPC $@ 91 compile_check $TMPC $@
83 } 92 }
84 93
85 statement_check() { 94 statement_check() {
86 cat > $TMPC << EOF 95 cat > $TMPC << EOF
4403 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT 4412 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4404 # have these new keycodes. 4413 # have these new keycodes.
4405 echocheck "XF86keysym" 4414 echocheck "XF86keysym"
4406 if test "$_xf86keysym" = auto; then 4415 if test "$_xf86keysym" = auto; then
4407 _xf86keysym=no 4416 _xf86keysym=no
4408 cat > $TMPC <<EOF 4417 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
4409 #include <X11/XF86keysym.h>
4410 int main(void) { return XF86XK_AudioPause; }
4411 EOF
4412 cc_check && _xf86keysym=yes
4413 fi 4418 fi
4414 if test "$_xf86keysym" = yes ; then 4419 if test "$_xf86keysym" = yes ; then
4415 def_xf86keysym='#define CONFIG_XF86XK 1' 4420 def_xf86keysym='#define CONFIG_XF86XK 1'
4416 else 4421 else
4417 def_xf86keysym='#undef CONFIG_XF86XK' 4422 def_xf86keysym='#undef CONFIG_XF86XK'
5341 ######### 5346 #########
5342 5347
5343 5348
5344 echocheck "OSS Audio" 5349 echocheck "OSS Audio"
5345 if test "$_ossaudio" = auto ; then 5350 if test "$_ossaudio" = auto ; then
5346 cat > $TMPC << EOF
5347 #include <$_soundcard_header>
5348 int main(void) { return SNDCTL_DSP_SETFRAGMENT; }
5349 EOF
5350 _ossaudio=no 5351 _ossaudio=no
5351 cc_check && _ossaudio=yes 5352 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
5352 fi 5353 fi
5353 if test "$_ossaudio" = yes ; then 5354 if test "$_ossaudio" = yes ; then
5354 def_ossaudio='#define CONFIG_OSS_AUDIO 1' 5355 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5355 aomodules="oss $aomodules" 5356 aomodules="oss $aomodules"
5356 cat > $TMPC << EOF 5357 cat > $TMPC << EOF