diff --git a/configure b/configure
index a058176beaabc3f5334e4f9f30a8300a069287fa..eba83657bd41eb8290cc145b116ee7f40f1efbb6 100755
--- a/configure
+++ b/configure
@@ -11188,7 +11188,13 @@ fi
 
 if test x$ARTSCCONFIG != x -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"';
 then
-    ARTSC_CFLAGS=`$ARTSCCONFIG --cflags | sed 's/\-pthread//'`
+    ARTSC_CFLAGS=""
+    for i in `$ARTSCCONFIG --cflags`
+    do
+      case "$i" in
+        -I*) ARTSC_CFLAGS="$ARTSC_CFLAGS $i";;
+      esac
+    done
     ARTSC_LIBS=`$ARTSCCONFIG --libs`
     save_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $ARTSC_CFLAGS"
diff --git a/configure.ac b/configure.ac
index 12e8fc705341372cf7a3bac688aa5a52428975a1..bf0fd1c855cb6c17dd6ca1453e7bd9fb91534d42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -602,7 +602,13 @@ dnl **** Check for aRts Sound Server ****
 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
 if test x$ARTSCCONFIG != x -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"';
 then
-    ARTSC_CFLAGS=`$ARTSCCONFIG --cflags | sed 's/\-pthread//'`
+    ARTSC_CFLAGS=""
+    for i in `$ARTSCCONFIG --cflags`
+    do
+      case "$i" in
+        -I*) ARTSC_CFLAGS="$ARTSC_CFLAGS $i";;
+      esac
+    done
     ARTSC_LIBS=`$ARTSCCONFIG --libs`
     save_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $ARTSC_CFLAGS"