Commit 9a5a1e8e authored by Edward Hervey's avatar Edward Hervey 🤘

Python plugin loader implementation.

Fixes #304361.
parent 3a000eca
SUBDIRS = common codegen gst examples testsuite pkgconfig
SUBDIRS = common codegen gst examples plugin testsuite pkgconfig
common_cflags = $(PYTHON_INCLUDES) $(PYGOBJECT_CFLAGS) $(GST_CFLAGS) $(GST_OPTION_CFLAGS) -fno-strict-aliasing
common_libadd = $(GST_LIBS) $(GST_OPTION_LIBS)
......
......@@ -64,3 +64,24 @@ $1],dnl
$2])
CPPFLAGS="$save_CPPFLAGS"
])
dnl a macro to check for ability to embed python
dnl AM_CHECK_PYTHON_LIBS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
dnl function also defines PYTHON_LIBS
AC_DEFUN([AM_CHECK_PYTHON_LIBS],
[AC_REQUIRE([AM_CHECK_PYTHON_HEADERS])
AC_MSG_CHECKING(for libraries required to embed python)
dnl deduce PYTHON_LIBS
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
PYTHON_LIBS="-L${py_prefix}/lib -lpython${PYTHON_VERSION}"
PYTHON_LIB_LOC="${py_prefix}/lib"
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_LIB_LOC)
dnl check if the headers exist:
save_LIBS="$LIBS"
LIBS="$LIBS $PYTHON_LIBS"
AC_TRY_LINK_FUNC(Py_Initialize, dnl
[LIBS="$save_LIBS"; AC_MSG_RESULT(yes); $1], dnl
[LIBS="$save_LIBS"; AC_MSG_RESULT(no); $2])
])
......@@ -83,6 +83,7 @@ dnl check for GStreamer
GST_MAJORMINOR=0.10
AC_SUBST(GST_MAJORMINOR)
PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ)
AC_DEFINE_UNQUOTED(GST_MAJORMINOR, "$GST_MAJORMINOR", [Gst MajorMinor version])
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)
......@@ -358,6 +359,13 @@ dnl add debugging options ...
AG_GST_VALGRIND_CHECK
dnl Stuff needed for the python plugin loader
AM_CHECK_PYTHON_LIBS(,[AC_MSG_ERROR(could not find Python lib)])
AG_GST_SET_PLUGINDIR
AC_OUTPUT([
Makefile
codegen/Makefile
......@@ -370,6 +378,7 @@ AC_OUTPUT([
pkgconfig/Makefile
pkgconfig/gst-python.pc
pkgconfig/gst-python-uninstalled.pc
plugin/Makefile
testsuite/Makefile
win32/common/config.h
gst-python.spec
......
plugin_LTLIBRARIES = libgstpython.la
INCLUDES = $(PYGOBJECT_CFLAGS) $(GST_CFLAGS)\
-DPYTHON_VERSION=\"$(PYTHON_VERSION)\" \
-DPY_LIB_LOC="\"$(PYTHON_LIB_LOC)\"" \
$(PYTHON_INCLUDES)
libgstpython_la_SOURCES = gstpythonplugin.c
#libgstpython_la_CFLAGS = $(PYGTK_CFLAGS) $(GST_CFLAGS)
#libgstpython_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -avoid-version -module # $(PYTHON_LIBS) -lpython2.4
libgstpython_la_LDFLAGS = -module -avoid-version
libgstpython_la_LIBADD = $(GST_LIBS) $(PYTHON_LIBS)
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment