changeset 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
files configure
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Thu Jan 20 11:27:32 2011 +0000
+++ b/configure	Thu Jan 20 12:44:08 2011 +0000
@@ -82,6 +82,15 @@
   compile_check $TMPC $@
 }
 
+return_check() {
+  cat > $TMPC << EOF
+#include <$1>
+int main(void) { return $2; }
+EOF
+  shift 2
+  compile_check $TMPC $@
+}
+
 statement_check() {
   cat > $TMPC << EOF
 #include <$1>
@@ -4405,11 +4414,7 @@
 echocheck "XF86keysym"
 if test "$_xf86keysym" = auto; then
   _xf86keysym=no
-  cat > $TMPC <<EOF
-#include <X11/XF86keysym.h>
-int main(void) { return XF86XK_AudioPause; }
-EOF
-  cc_check && _xf86keysym=yes
+  return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
 fi
 if test "$_xf86keysym" = yes ; then
   def_xf86keysym='#define CONFIG_XF86XK 1'
@@ -5343,12 +5348,8 @@
 
 echocheck "OSS Audio"
 if test "$_ossaudio" = auto ; then
-  cat > $TMPC << EOF
-#include <$_soundcard_header>
-int main(void) { return SNDCTL_DSP_SETFRAGMENT; }
-EOF
   _ossaudio=no
-  cc_check && _ossaudio=yes
+  return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
 fi
 if test "$_ossaudio" = yes ; then
   def_ossaudio='#define CONFIG_OSS_AUDIO 1'