summaryrefslogtreecommitdiff
path: root/plugins/javadesc
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/javadesc')
-rw-r--r--plugins/javadesc/Makefile.am23
-rw-r--r--plugins/javadesc/core.c16
2 files changed, 31 insertions, 8 deletions
diff --git a/plugins/javadesc/Makefile.am b/plugins/javadesc/Makefile.am
index bc55192..9474a87 100644
--- a/plugins/javadesc/Makefile.am
+++ b/plugins/javadesc/Makefile.am
@@ -4,6 +4,18 @@ lib_LTLIBRARIES = libjavadesc.la
libdir = $(pluginslibdir)
+if BUILD_PYTHON3_BINDINGS
+
+PYTHON3_LIBADD = python/libjavadescpython.la
+
+PYTHON3_LDFLAGS = -Wl,-rpath,$(abs_top_srcdir)/plugins/pychrysalide/.libs \
+ -L$(top_srcdir)/plugins/pychrysalide/.libs -l:pychrysalide.so
+
+PYTHON3_SUBDIRS = python
+
+endif
+
+
libjavadesc_la_SOURCES = \
context.h context.c \
core.h core.c \
@@ -12,12 +24,11 @@ libjavadesc_la_SOURCES = \
method.h method.c
libjavadesc_la_LIBADD = \
- python/libjavadescpython.la
+ $(PYTHON3_LIBADD)
-libjavadesc_la_LDFLAGS = \
- -L$(top_srcdir)/src/.libs -lchrysacore \
- -Wl,-rpath,$(abs_top_srcdir)/plugins/pychrysalide/.libs \
- -L$(top_srcdir)/plugins/pychrysalide/.libs -l:pychrysalide.so
+libjavadesc_la_LDFLAGS = \
+ -L$(top_srcdir)/src/.libs -lchrysacore \
+ $(PYTHON3_LDFLAGS)
devdir = $(includedir)/chrysalide-$(subdir)
@@ -29,4 +40,4 @@ AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) -I$(top_srcdir)/src
AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-SUBDIRS = python
+SUBDIRS = $(PYTHON3_SUBDIRS)
diff --git a/plugins/javadesc/core.c b/plugins/javadesc/core.c
index 41c4789..84c96e8 100644
--- a/plugins/javadesc/core.c
+++ b/plugins/javadesc/core.c
@@ -24,17 +24,27 @@
#include "core.h"
+#include <config.h>
#include <core/demanglers.h>
#include <plugins/plugin-def.h>
#include "demangler.h"
-#include "python/module.h"
+#ifdef HAVE_PYTHON3_BINDINGS
+# include "python/module.h"
+#endif
+
+
+#ifdef HAVE_PYTHON3_BINDINGS
+# define PG_REQ RL("PyChrysalide")
+#else
+# define PG_REQ NO_REQ
+#endif
DEFINE_CHRYSALIDE_PLUGIN("GJavaDescPlugin", "javadesc", "Symbol demangler for Java", "0.1.0",
- RL("PyChrysalide"), AL(PGA_PLUGIN_INIT));
+ PG_REQ, AL(PGA_PLUGIN_INIT));
@@ -56,8 +66,10 @@ G_MODULE_EXPORT bool chrysalide_plugin_init(GPluginModule *plugin)
result = register_demangler_type("java", G_TYPE_JAVA_DEMANGLER);
+#ifdef HAVE_PYTHON3_BINDINGS
if (result)
result = add_mangling_javadesc_module_to_python_module();
+#endif
return result;