From 2ec3cd5055e70b29b013baee4b904bf690a0624b Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 7 Aug 2016 13:10:14 +0200 Subject: [PATCH] python: use LIBPYTHON_LIBS too python-config --ldflags returns -lpython (yeah I know) autoconf prepends ldflags in its configuration tests so conftest.c will never look for symbols in -lpython. python-config --libs also returns -lpython, but this is appended. --- configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index da332a9f..1bc02bc1 100644 --- a/configure.ac +++ b/configure.ac @@ -4017,6 +4017,7 @@ AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS]) # --with-libpython {{{ AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython]) AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython]) +AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython]) AC_ARG_WITH([libpython], [AS_HELP_STRING([--with-libpython], @@ -4049,13 +4050,19 @@ if test "$PYTHON_CONFIG" != ""; then if test $? -ne 0; then with_libpython="no" fi + LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`" + if test $? -ne 0; then + with_libpython="no" + fi fi if test "$with_libpython" != "xno"; then SAVE_CPPFLAGS="$CPPFLAGS" SAVE_LDFLAGS="$LDFLAGS" + SAVE_LIBS="$LIBS" CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS" LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS" + LIBS="$LIBPYTHON_LIBS $LIBS" AC_CHECK_HEADERS([Python.h], [ AC_MSG_CHECKING([for libpython]) @@ -4072,6 +4079,7 @@ if test "$with_libpython" != "xno"; then ) CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" + LIBS="$SAVE_LIBS" fi # }}} --with-libpython -- 2.11.0