hplip/hplip-3.20.6-python-includes.patch
Martin Wilck 95e3708c4c - Add hplip-pserror-c99.patch hplip-scan-hpaio-include.patch
hplip-scan-orblite-c99.patch hplip-sclpml-strcasestr.patch
  hplip-hpaio-gcc14.patch to avoid C99 violations which prevent
  building with GCC 14. [boo#1225777]

The patches were taken from
bbb19dff5e
and
d726b77698

If the request is OK, please forward it to Factory soon-ish too so
that we can switch the default compiler.  Thanks!

OBS-URL: https://build.opensuse.org/package/show/Printing/hplip?expand=0&rev=252
2024-07-15 19:10:46 +00:00

57 lines
1.8 KiB
Diff

Index: b/configure.in
===================================================================
--- a/configure.in
+++ b/configure.in
@@ -628,20 +628,31 @@ if test "$class_driver" = "no" && test "
fi
fi
-SAVE_CPPFLAGS="$CPPFLAGS"
-CFLAGS=`python-config --includes`
-if [ $? -eq 0 ]
-then
- echo $FLAGS
-else
-CFLAGS=`python3-config --includes`
- if [ $? -eq 0 ]
- then
- echo $FLAGS
- fi
+AC_PATH_PROG(python3_config_path, python3-config, [AC_MSG_ERROR([python3-config not installed], 6)])
+
+PYTHON_INCLUDES=`$python3_config_path --includes`
+if test "X$PYTHON_INCLUDES" = "X" ; then
+ AC_MSG_ERROR([Cannot get Python includes via python3-config], 6)
+fi
+
+PYTHON_LIBS=`$python3_config_path --libs`
+if test "X$PYTHON_LIBS" = "X" ; then
+ AC_MSG_ERROR([Cannot get Python libs via python3-config], 6)
+fi
+
+SAVE_CFLAGS=$CFLAGS
+SAVE_LIBS=$LIBS
+
+CFLAGS="$CFLAGS $PYTHON_INCLUDES"
+LIBS="$LIBS $PYTHON_LIBS"
+
+AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); python_includes="ok", AC_MSG_ERROR([no: PYTHON DISABLED], 6))
+
+if test "X$python_includes" != "Xok" ; then
+ CFLAGS="$SAVE_CFLAGS"
+ LIBS="$SAVE_LIBS"
fi
-#CFLAGS=`(python-config --includes)`
if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$lite_build" = "no" && test "$hpcups_only_build" = "no"; then
AC_ARG_VAR([PYTHON], [Python interpreter/compiler command])
AC_CHECK_PROGS(PYTHON,[python python3 python2])
@@ -655,7 +666,6 @@ if test "$class_driver" = "no" && test "
AS_IF([test "x$FOUND_HEADER" != "xyes"],
[AC_MSG_ERROR([cannot find python-devel support], 6)])
fi
-CFLAGS="$save_CFLAGS"
if test "$hpijs_only_build" = "no" && test "$scan_build" = "yes" && test "$hpcups_only_build" = "no"; then
AC_CHECK_LIB([sane], [sane_open], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find sane-backends-devel support (or --disable-scan-build)], 12)])