+# kqemu support
+if test $kqemu = "yes" ; then
+ # test if the source code is installed
+ if test '!' -f "kqemu/Makefile" ; then
+ kqemu="no"
+ fi
+fi
+
+# Linux specific kqemu configuration
+if test $kqemu = "yes" -a $linux = "yes" ; then
+# find the kernel path
+if test -z "$kernel_path" ; then
+kernel_version=`uname -r`
+kernel_path="/lib/modules/$kernel_version/build"
+if test '!' -d "$kernel_path/include" ; then
+ kernel_path="/usr/src/linux"
+ if test '!' -d "$kernel_path/include" ; then
+ echo "Could not find kernel includes in /lib/modules or /usr/src/linux - cannot build the kqemu module"
+ kqemu="no"
+ fi
+fi
+fi
+
+if test $kqemu = "yes" ; then
+
+# test that the kernel config is present
+if test '!' -f "$kernel_path/Makefile" ; then
+ echo "No Makefile file present in $kernel_path - kqemu cannot be built"
+ kqemu="no"
+fi
+
+# find build system (2.6 or legacy)
+kbuild26="yes"
+if grep -q "PATCHLEVEL = 4" $kernel_path/Makefile ; then
+kbuild26="no"
+fi
+
+fi # kqemu
+
+fi # kqemu and linux
+
+