VirtualBox-5.1.14-linux-4.9-buildfix.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Index: trunk/configure
  2. ===================================================================
  3. --- trunk/configure
  4. +++ trunk/configure
  5. @@ -1921,9 +1921,32 @@
  6. else
  7. if test_execute; then
  8. - cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
  9. - fi
  10. - fi
  11. -}
  12. -
  13. + cat > $ODIR.tmp_src.c << EOF
  14. +#include <linux/version.h>
  15. +int printf(const char *format, ...);
  16. +int main(void)
  17. +{
  18. + return LINUX_VERSION_CODE > KERNEL_VERSION(4,8,0) ? 1 : 0;
  19. +}
  20. +EOF
  21. + echo "compiling the following source file:" >> $LOG
  22. + cat $ODIR.tmp_src.c >> $LOG
  23. + echo "using the following command line:" >> $LOG
  24. + echo "$CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include " \
  25. + "-I$LINUX/include/generated/uapi" >> $LOG
  26. + $CC -O -Wall -o $ODIR.tmp_out $ODIR.tmp_src.c -nostdinc -I$LINUX/include \
  27. + -I$LINUX/include/generated/uapi >> $LOG 2>&1
  28. + if [ $? -eq 0 ]; then
  29. + $ODIR.tmp_out
  30. + if [ $? -ne 0 ]; then
  31. + cnf_append "VBOX_WITH_VBOXDRV" ""
  32. + cnf_append "VBOX_WITH_ADDITION_DRIVERS" ""
  33. + echo "Detected Linux >= 4.8 -- disabling compiling of Linux kernel modules."
  34. + else
  35. + cnf_append "VBOX_LINUX_SRC" "`cd $LINUX ; pwd`"
  36. + fi
  37. + fi
  38. + fi
  39. + fi
  40. +}
  41. #