From f2a1c67e2b3b60ba54f506cf806437924b5242ca Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Tue, 12 Mar 2019 20:21:48 -0700 Subject: [PATCH] configure.ac: allow PYTHON values to be passed via env Allow the recipe can specify specific values for PYTHON. Upstream-Status: Inappropriate [embedded specific] Signed-off-by: Yi Zhao [Hongzhi: minor adjust the patch on v5.4] Signed-off-by: Hongzhi.Song --- configure.ac | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d55a7b2..36b0980 100644 --- a/configure.ac +++ b/configure.ac @@ -650,12 +650,20 @@ if test "x${PYTHON_VERSION}" = "x2.6"; then PYTHON_CFLAGS=$(python-config --includes) PYTHON_LIBS=$(python-config --libs) else - PKG_CHECK_MODULES([PYTHON], "python-${PYTHON_VERSION}",,true) + PKG_CHECK_MODULES([PYTHONDEV], "python-$PYTHON_VERSION", [AC_SUBST(PYTHONDEV_CPPFLAGS) AC_SUBST(PYTHONDEV_LDFLAGS)], AC_MSG_ERROR([Can not find python])) fi PYTHON_CFLAGS=$(echo ${PYTHON_CFLAGS} | sed -e 's|-I|-isystem |') -BUILD_PYTHON_SITE_PACKAGES=${pythondir} +if test -z "${BUILD_PYTHON_SITE_PACKAGES}"; then + BUILD_PYTHON_SITE_PACKAGES=${pythondir} +fi +if test -z "${BUILD_PYTHON_INC}"; then + BUILD_PYTHON_INC=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_inc())" 2>/dev/null` +fi +if test -z "${BUILD_PYTHON_LIB}"; then + BUILD_PYTHON_LIB=python$PYTHON_VERSION +fi AC_SUBST(BUILD_PYTHON_SITE_PACKAGES) # Eval two times to expand fully. First eval replaces $exec_prefix into $prefix -- 2.17.1