hplip-configure-python.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. diff -up hplip-3.20.9/configure.in.configure-python hplip-3.20.9/configure.in
  2. --- hplip-3.20.9/configure.in.configure-python 2020-09-23 07:24:27.000000000 +0200
  3. +++ hplip-3.20.9/configure.in 2020-10-02 07:27:09.082331431 +0200
  4. @@ -604,17 +604,29 @@ if test "$class_driver" = "no" && test "
  5. fi
  6. fi
  7. -SAVE_CPPFLAGS="$CPPFLAGS"
  8. -CFLAGS=`python-config --includes`
  9. -if [ $? -eq 0 ]
  10. -then
  11. - echo $FLAGS
  12. -else
  13. -CFLAGS=`python3-config --includes`
  14. - if [ $? -eq 0 ]
  15. - then
  16. - echo $FLAGS
  17. - fi
  18. +AC_PATH_PROG(python3_config_path, python3-config, [AC_MSG_ERROR([python3-config not installed], 6)])
  19. +
  20. +PYTHON_INCLUDES=`$python3_config_path --includes`
  21. +if test "X$PYTHON_INCLUDES" = "X" ; then
  22. + AC_MSG_ERROR([Cannot get Python includes via python3-config], 6)
  23. +fi
  24. +
  25. +PYTHON_LIBS=`$python3_config_path --libs`
  26. +if test "X$PYTHON_LIBS" = "X" ; then
  27. + AC_MSG_ERROR([Cannot get Python libs via python3-config], 6)
  28. +fi
  29. +
  30. +SAVE_CFLAGS=$CFLAGS
  31. +SAVE_LIBS=$LIBS
  32. +
  33. +CFLAGS="$CFLAGS $PYTHON_INCLUDES"
  34. +LIBS="$LIBS $PYTHON_LIBS"
  35. +
  36. +AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); python_includes="ok", AC_MSG_ERROR([no: PYTHON DISABLED], 6))
  37. +
  38. +if test "X$python_includes" != "Xok" ; then
  39. + CFLAGS="$SAVE_CFLAGS"
  40. + LIBS="$SAVE_LIBS"
  41. fi
  42. #CFLAGS=`(python-config --includes)`
  43. @@ -631,7 +643,6 @@ if test "$class_driver" = "no" && test "
  44. AS_IF([test "x$FOUND_HEADER" != "xyes"],
  45. [AC_MSG_ERROR([cannot find python-devel support], 6)])
  46. fi
  47. -CFLAGS="$save_CFLAGS"
  48. if test "$hpijs_only_build" = "no" && test "$scan_build" = "yes" && test "$hpcups_only_build" = "no"; then
  49. AC_CHECK_LIB([sane], [sane_open], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find sane-backends-devel support (or --disable-scan-build)], 12)])