Bug 4109 - package config depends on python unconditionally
package config depends on python unconditionally
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.7.2
x86_64 Linux
: P5 minor
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-26 19:15 CEST by Petr Menšík
Modified: 2018-06-27 07:45 CEST (History)
3 users (show)

See Also:


Attachments
patch using pythonX from pkg-config (9.35 KB, patch)
2018-06-26 19:15 CEST, Petr Menšík
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Menšík 2018-06-26 19:15:20 CEST
Created attachment 507 [details]
patch using pythonX from pkg-config

When --with-pythonmodule --with-pyunbound enabled, libunbound.pc will contain requirement to python.

If ./configure --with-pythonmodule --with-pyunbound PYTHON=python3 
is used, it will require python.pc anyway. On both Fedora and Debian they point to python2. I want python3 module only, but there is no way to not depend on python2. On both Debian and Fedora there are available pkg-config for python2, python3 and versions with minor versions as well. I think they should be used if possible.
Comment 1 Wouter Wijngaards 2018-06-27 07:45:45 CEST
Hi Petr,

I have turned it into the patch below, to move the AC_REQUIRE into the option branch for python.  autoconf errors on the AC_REQUIRE not inside a function.

Thanks for the patch!

Index: configure.ac
===================================================================
--- configure.ac (revision 4756)
+++ configure.ac (working copy)
@@ -586,7 +586,10 @@
         CPPFLAGS="$PYTHON_CPPFLAGS"
       fi
       ub_have_python=yes
-      PC_PY_DEPENDENCY="python"
+      PKG_PROG_PKG_CONFIG
+      PKG_CHECK_EXISTS(["python${PY_MAJOR_VERSION}"],
+                       [PC_PY_DEPENDENCY="python${PY_MAJOR_VERSION}"],
+                       [PC_PY_DEPENDENCY="python"])
       AC_SUBST(PC_PY_DEPENDENCY)
 
       # Check for SWIG

Best regards, Wouter