Files
main/hardware/virtualization/virtualbox/files/VirtualBox-5.1.14-linux-4.9-buildfix.patch
T
2017-03-03 23:19:49 +03:00

43 lines
1.2 KiB
Diff

Index: trunk/configure
===================================================================
--- trunk/configure
+++ trunk/configure
@@ -1921,9 +1921,32 @@
else
if test_execute; then
- cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
- fi
- fi
-}
-
+ cat > $ODIR.tmp_src.c << EOF
+#include <linux/version.h>
+int printf(const char *format, ...);
+int main(void)
+{
+ return LINUX_VERSION_CODE > KERNEL_VERSION(4,8,0) ? 1 : 0;
+}
+EOF
+ echo "compiling the following source file:" >> $LOG
+ cat $ODIR.tmp_src.c >> $LOG
+ echo "using the following command line:" >> $LOG
+ echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include " \
+ "-I$LINUX/include/generated/uapi" >> $LOG
+ $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include \
+ -I$LINUX/include/generated/uapi >> $LOG 2>&1
+ if [ $? -eq 0 ]; then
+ $ODIR.tmp_out
+ if [ $? -ne 0 ]; then
+ cnf_append "VBOX_WITH_VBOXDRV" ""
+ cnf_append "VBOX_WITH_ADDITION_DRIVERS" ""
+ echo "Detected Linux >= 4.8 -- disabling compiling of Linux kernel modules."
+ else
+ cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
+ fi
+ fi
+ fi
+ fi
+}
#