Permalink
Browse files

Deduce PYTHON_LIBS in addition to PYTHON_INCLUDES

  • Loading branch information...
svdlinden committed Jan 17, 2011
1 parent bceec75 commit fc7d7f7f153d57ff3866b7bfd5e6479d702cc4d9
Showing with 12 additions and 7 deletions.
  1. +4 −2 gi/Makefile.am
  2. +1 −1 gio/Makefile.am
  3. +1 −1 glib/Makefile.am
  4. +5 −2 m4/python.m4
  5. +1 −1 tests/Makefile.am
View
@@ -24,7 +24,8 @@ _gi_la_LDFLAGS = \
-avoid-version \
-export-symbols-regex "init_gi|PyInit__gi"
_gi_la_LIBADD = \
- $(GI_LIBS)
+ $(GI_LIBS) \
+ $(PYTHON_LIBS)
_gi_la_SOURCES = \
pygi-repository.c \
pygi-repository.h \
@@ -65,7 +66,8 @@ _gi_cairo_la_LDFLAGS = \
-export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
_gi_cairo_la_LIBADD = \
$(GI_LIBS) \
- $(PYCAIRO_LIBS)
+ $(PYCAIRO_LIBS) \
+ $(PYTHON_LIBS)
_gi_cairo_la_SOURCES = pygi-foreign-cairo.c
View
@@ -85,7 +85,7 @@ EXTRA_DIST += $(GIOUNIX_DEFS) unix.override
unix.c: $(GIOUNIX_DEFS) unix.override
unix_la_CFLAGS = $(GIOUNIX_CFLAGS)
unix_la_LDFLAGS = $(common_ldflags) -export-symbols-regex initunix
-unix_la_LIBADD = $(GIOUNIX_LIBS)
+unix_la_LIBADD = $(GIOUNIX_LIBS) $(PYTHON_LIBS)
unix_la_SOURCES = unixmodule.c
nodist_unix_la_SOURCES = unix.c
if BUILD_GIOUNIX
View
@@ -20,7 +20,7 @@ common_ldflags += -no-undefined
endif
libpyglib_2_0_@PYTHON_BASENAME@_la_CFLAGS = $(GLIB_CFLAGS)
-libpyglib_2_0_@PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS)
+libpyglib_2_0_@PYTHON_BASENAME@_la_LIBADD = $(GLIB_LIBS) $(FFI_LIBS) $(PYTHON_LIBS)
libpyglib_2_0_@PYTHON_BASENAME@_la_SOURCES = \
pyglib.c \
pyglib.h \
View
@@ -38,22 +38,25 @@ fi
dnl a macro to check for ability to create python extensions
dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
-dnl function also defines PYTHON_INCLUDES
+dnl function also defines PYTHON_INCLUDES and PYTHON_LIBS
AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
[AC_REQUIRE([AM_PATH_PYTHON])
AC_MSG_CHECKING(for headers required to compile python extensions)
-dnl deduce PYTHON_INCLUDES
+dnl deduce PYTHON_INCLUDES and PYTHON_LIBS
py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`
if test -x "$PYTHON-config"; then
PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
+PYTHON_LIBS=`$PYTHON-config --libs 2>/dev/null`
else
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+PYTHON_LIBS=`-lpython${PYTHON_VERSION}`
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
fi
AC_SUBST(PYTHON_INCLUDES)
+AC_SUBST(PYTHON_LIBS)
dnl check if the headers exist:
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
View
@@ -47,7 +47,7 @@ noinst_LTLIBRARIES += testhelper.la
testhelper_la_CFLAGS = -I$(top_srcdir)/gobject -I$(top_srcdir)/glib $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
testhelper_la_LDFLAGS = -module -avoid-version
-testhelper_la_LIBADD = $(GLIB_LIBS)
+testhelper_la_LIBADD = $(GLIB_LIBS) $(PYTHON_LIBS)
testhelper_la_SOURCES = \
testhelpermodule.c \
test-floating.c \

0 comments on commit fc7d7f7

Please sign in to comment.