diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 2c36235d..38ca4f6d 100644 --- a/configure.ac +++ b/configure.ac @@ -42,9 +42,14 @@ AS_IF([test "x$PLATFORM" = xcygwin], AS_IF([test "x$PLATFORM" = xosx], [AC_DEFINE([PLATFORM_OSX], [1], [OSx])]) +### Environment variables +AC_ARG_VAR([PYTHON_FRAMEWORK], [Set base directory for Python Framework]) + ### 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 +64,34 @@ 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 + AS_IF([test "x$PLATFORM" = xosx], [ + AS_IF([test "x$PYTHON_FRAMEWORK" = x], [ PYTHON_FRAMEWORK="/Library/Frameworks/Python.framework" ]) + AC_MSG_NOTICE([Symlinking Python.framework to $PYTHON_FRAMEWORK]) + rm -f Python.framework + ln -s $PYTHON_FRAMEWORK Python.framework ]) + 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 + AS_IF([test "x$PLATFORM" = xosx], [rm -f Python.framework]) +else + AM_CONDITIONAL([BUILD_PYTHON_API], [false]) +fi + # c LT_INIT if test "x$enable_plugins" = xno; then @@ -232,9 +265,9 @@ 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_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" +LIBS="$glib_LIBS $curl_LIBS $libnotify_LIBS $PYTHON_LIBS $PYTHON_LDFLAGS $LIBS" AC_SUBST(AM_LDFLAGS) AC_SUBST(AM_CFLAGS) |