Index: plugins/ao/configure
===================================================================
--- plugins/ao/configure	(revision 1740)
+++ plugins/ao/configure	(revision 1742)
@@ -45,29 +45,6 @@
 }
 
-echo -n 'testing for C compiler... '
-CC=$(which gcc cc 2> /dev/null | head -n 1)
-if [ -x "$CC" ]
-then
- echo $CC
-else
- echo no.
- on_error;
-fi
-
-echo -n "checking for pkg-config... "
-if [ "$PKG_CONFIG" = '' ]
-then
- PKG_CONFIG=$(which pkg-config false 2> /dev/null | grep ^/ | head -n 1)
- if $PKG_CONFIG --help > /dev/null 2> /dev/null
- then
-  echo $PKG_CONFIG
- else
-  PKG_CONFIG=''
-  echo no
-  on_error;
- fi
-else
-  echo $PKG_CONFIG '(forced)'
-fi
+check_cc;
+check_pkg_config;
 
 echo -n 'testing for libao... '
@@ -103,25 +80,6 @@
 fi
 
-echo -n 'testing for libroar... '
-if $HAVE_ROAR
-then
- echo 'yes (forced)'
-else
- cat > tests.c << EOF
-#include <roaraudio.h>
-int main (void) { return 0; }
-EOF
+check_libroar;
 
- $CC -o tests tests.c -lroar 2> /dev/null
- ./tests 2> /dev/null
-
- if [ "$?" = '0' ]
- then
-  echo yes
- else
-  echo no.
-  on_error
- fi
-fi
 rm -f tests tests.c
 
Index: plugins/audacious/configure
===================================================================
--- plugins/audacious/configure	(revision 1740)
+++ plugins/audacious/configure	(revision 1742)
@@ -42,29 +42,6 @@
 }
 
-echo -n 'testing for C compiler... '
-CC=$(which gcc cc 2> /dev/null | head -n 1)
-if [ -x "$CC" ]
-then
- echo $CC
-else
- echo no.
- on_error;
-fi
-
-echo -n "checking for pkg-config... "
-if [ "$PKG_CONFIG" = '' ]
-then
- PKG_CONFIG=$(which pkg-config false 2> /dev/null | grep ^/ | head -n 1)
- if $PKG_CONFIG --help > /dev/null 2> /dev/null
- then
-  echo $PKG_CONFIG
- else
-  PKG_CONFIG=''
-  echo no
-  on_error;
- fi
-else
-  echo $PKG_CONFIG '(forced)'
-fi
+check_cc;
+check_pkg_config;
 
 echo -n 'testing for gtk... '
@@ -124,25 +101,6 @@
 fi
 
-echo -n 'testing for libroar... '
-if $HAVE_ROAR
-then
- echo 'yes (forced)'
-else
- cat > tests.c << EOF
-#include <roaraudio.h>
-int main (void) { return 0; }
-EOF
+check_libroar;
 
- $CC -o tests tests.c -lroar 2> /dev/null
- ./tests 2> /dev/null
-
- if [ "$?" = '0' ]
- then
-  echo yes
- else
-  echo no.
-  on_error
- fi
-fi
 rm -f tests tests.c
 
Index: plugins/configure.inc
===================================================================
--- plugins/configure.inc	(revision 1741)
+++ plugins/configure.inc	(revision 1742)
@@ -9,3 +9,61 @@
 fi
 
+
+TF_C=test.c
+TF=./test
+
+check_cc() {
+ echo -n 'testing for C compiler... '
+ CC=$(which gcc cc 2> /dev/null | head -n 1)
+ if [ -x "$CC" ]
+ then
+  echo $CC
+ else
+  echo no.
+  on_error;
+ fi
+}
+
+check_pkg_config() {
+ echo -n "checking for pkg-config... "
+ if [ "$PKG_CONFIG" = '' ]
+ then
+  PKG_CONFIG=$(which pkg-config false 2> /dev/null | grep ^/ | head -n 1)
+  if $PKG_CONFIG --help > /dev/null 2> /dev/null
+  then
+   echo $PKG_CONFIG
+  else
+   PKG_CONFIG=''
+   echo no
+   on_error;
+  fi
+ else
+   echo $PKG_CONFIG '(forced)'
+ fi
+}
+
+check_libroar() {
+ echo -n 'testing for libroar... '
+ if $HAVE_ROAR
+ then
+  echo 'yes (forced)'
+ else
+  cat > $TF_C << EOF
+#include <roaraudio.h>
+int main (void) { return 0; }
+EOF
+
+  $CC -o $TF $TF_C -lroar 2> /dev/null
+  $TF 2> /dev/null
+
+  if [ "$?" = '0' ]
+  then
+   echo yes
+  else
+   echo no.
+   on_error
+  fi
+ fi
+}
+
 #ll
Index: plugins/xmms/configure
===================================================================
--- plugins/xmms/configure	(revision 1740)
+++ plugins/xmms/configure	(revision 1742)
@@ -42,28 +42,6 @@
 }
 
-echo -n 'testing for C compiler... '
-CC=$(which gcc cc 2> /dev/null | head -n 1)
-if [ -x "$CC" ]
-then
- echo $CC
-else
- echo no.
- on_error;
-fi
-
-echo -n "checking for pkg-config... "
-if [ "$PKG_CONFIG" = '' ]
-then
- PKG_CONFIG=$(which pkg-config false 2> /dev/null | grep ^/ | head -n 1)
- if $PKG_CONFIG --help > /dev/null 2> /dev/null
- then
-  echo $PKG_CONFIG
- else
-  PKG_CONFIG=''
-  echo no
- fi
-else
-  echo $PKG_CONFIG '(forced)'
-fi
+check_cc;
+check_pkg_config;
 
 echo -n 'testing for gtk... '
@@ -115,25 +93,6 @@
 fi
 
-echo -n 'testing for libroar... '
-if $HAVE_ROAR
-then
- echo 'yes (forced)'
-else
- cat > tests.c << EOF
-#include <roaraudio.h>
-int main (void) { return 0; }
-EOF
+check_libroar;
 
- $CC -o tests tests.c -lroar 2> /dev/null
- ./tests 2> /dev/null
-
- if [ "$?" = '0' ]
- then
-  echo yes
- else
-  echo no.
-  on_error
- fi
-fi
 rm -f tests tests.c
 
