about summary refs log tree commit diff stats
path: root/configure.ac
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-02-24 00:31:55 +0000
committerJames Booth <boothj5@gmail.com>2016-02-24 00:31:55 +0000
commit0fc0b3eeecccface462733f42b3acb636bcd3622 (patch)
tree111b3ce89ce9d0cd9a18eb023f8091ef1f00e990 /configure.ac
parentac91e7ef8578fda44704d264f78bc5004c81d947 (diff)
downloadprofani-tty-0fc0b3eeecccface462733f42b3acb636bcd3622.tar.gz
Added python plugins code
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 26 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 2c36235d..43e0ec4d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,8 @@ AS_IF([test "x$PLATFORM" = xosx],
 ### Options
 AC_ARG_ENABLE([notifications],
     [AS_HELP_STRING([--enable-notifications], [enable desktop notifications])])
+AC_ARG_ENABLE([python-plugins],
+    [AS_HELP_STRING([--enable-python-plugins], [enable Python plugins])])
 AC_ARG_ENABLE([c-plugins],
     [AS_HELP_STRING([--enable-c-plugins], [enable C plugins])])
 AC_ARG_ENABLE([plugins],
@@ -59,6 +61,28 @@ AC_ARG_WITH([themes],
     [AS_HELP_STRING([--with-themes[[=PATH]]], [install themes (default yes)])])
 
 ### plugins
+
+# python
+if test "x$enable_plugins" = xno; then
+    AM_CONDITIONAL([BUILD_PYTHON_API], [false])
+elif test "x$enable_python_plugins" != xno; then
+    AC_CHECK_PROG(PYTHON_CONFIG_EXISTS, python-config, yes, no)
+    if test "$PYTHON_CONFIG_EXISTS" == "yes"; then
+        AX_PYTHON_DEVEL
+        AM_CONDITIONAL([BUILD_PYTHON_API], [true])
+        AC_DEFINE([HAVE_PYTHON], [1], [Python support])
+    else
+        if test "x$enable_python_plugins" = xyes; then
+            AC_MSG_ERROR([Python not found, cannot enable Python plugins.])
+        else
+            AM_CONDITIONAL([BUILD_PYTHON_API], [false])
+            AC_MSG_NOTICE([Python development package not found, Python plugin support disabled.])
+        fi
+    fi
+else
+    AM_CONDITIONAL([BUILD_PYTHON_API], [false])
+fi
+
 # c
 LT_INIT
 if test "x$enable_plugins" = xno; then
@@ -231,8 +255,8 @@ AC_CHECK_HEADERS([ncurses.h], [], [])
 AM_CFLAGS="-Wall -Wno-deprecated-declarations"
 AS_IF([test "x$PACKAGE_STATUS" = xdevelopment],
     [AM_CFLAGS="$AM_CFLAGS -Wunused -Werror"])
-AM_LDFLAGS="$AM_LDFLAGS -export-dynamic"
-AM_CPPFLAGS="$AM_CPPFLAGS $glib_CFLAGS $curl_CFLAGS $libnotify_CFLAGS"
+AM_LDFLAGS="$AM_LDFLAGS $PYTHON_LDFLAGS -export-dynamic"
+AM_CPPFLAGS="$AM_CPPFLAGS $glib_CFLAGS $curl_CFLAGS $libnotify_CFLAGS $PYTHON_CPPFLAGS"
 AM_CPPFLAGS="$AM_CPPFLAGS -DTHEMES_PATH=\"\\\"$THEMES_PATH\\\"\""
 LIBS="$glib_LIBS $curl_LIBS $libnotify_LIBS $LIBS"