]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix Cython detection on python >= 3.8
authorEric Bollengier <eric@baculasystems.com>
Fri, 23 Sep 2022 15:50:10 +0000 (17:50 +0200)
committerEric Bollengier <eric@baculasystems.com>
Sat, 18 Feb 2023 09:21:25 +0000 (10:21 +0100)
bacula/autoconf/configure.in

index 6dec88657bbf50553dcfe639c3e190b7621c0a6a..b0945b74d3455b8b9ccd0b980c63d6eabacecd1b 100644 (file)
@@ -1616,8 +1616,13 @@ if test $? = 0; then
       PYTHON=python
       CYTHON="$CYTHON -2"
    fi
-   CYTHON_LIBS=`${PYTHON}-config --libs 2>/dev/null`
-   CYTHON_INC=`${PYTHON}-config --includes 2>/dev/null`
+   # Thanks to Python, in 3.8 the new --embed flag is necessary
+   # but it break any previous version. So, let's do it 2 times
+   CYTHON_LIBS=`${PYTHON}-config --ldflags --embed 2>/dev/null`
+   if test $? != 0; then
+      CYTHON_LIBS=`${PYTHON}-config --ldflags 2>/dev/null`
+   fi
+   CYTHON_INC=`${PYTHON}-config --cflags 2>/dev/null`
 else
    CYTHON=
 fi