1
AC_INIT(reinteract, 0.5.0)
3
AC_CONFIG_AUX_DIR(config)
5
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
9
AC_CONFIG_HEADERS(config.h)
15
if test "x$GCC" = "xyes"; then
17
*[\ \ ]-Wall[\ \ ]*) ;;
18
*) CFLAGS="$CFLAGS -Wall" ;;
21
case " $OBJCFLAGS " in
22
*[\ \ ]-Wall[\ \ ]*) ;;
23
*) OBJCFLAGS="$OBJCFLAGS -Wall" ;;
30
[AC_HELP_STRING([--with-appdir=APPDIR],
31
[On OS X, install Reinteract.app into APPDIR])],
32
[if test x$withval = xyes ; then
33
AC_MSG_ERROR([Directory must be specified as argument to --with-appdir])
34
elif test x$withval = xno ; then
40
AM_CONDITIONAL(INSTALL_APP, test "x$APPDIR" != x)
43
use_python_thunks=false
44
AC_ARG_ENABLE(python-thunks,
45
[AC_HELP_STRING([--enable-python-thunks],
46
[On OS X, lazily locate Python at run-time (default is no)])],
47
[if test "x$enableval" != xno ; then use_python_thunks=true ; fi])
49
if $use_python_thunks ; then
50
AC_DEFINE(USE_PYTHON_THUNKS, 1,
51
[Define to locate Python lazily at runtime])
54
AM_CONDITIONAL(USE_PYTHON_THUNKS, $use_python_thunks)
56
dnl A macro to get a variable from distutils.sysconfig
57
dnl reinteract_GET_CONFIG_VAR(SHELL_NAME, SYSCONFIG_NAME)
59
AC_DEFUN([reinteract_GET_CONFIG_VAR],
60
[$1=`$PYTHON -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_config_var('$2'))"`])
67
# This will break if someone wants to build the X11 version of reinteract
68
# on OS X. They can just use bin/uninst.py, or they can figure out how
71
PKG_CHECK_MODULES(WRAPPER, [pygobject-2.0 >= 2.12 gtk+-2.0 >= 2.12])
72
JD_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
74
if $use_python_thunks ; then : ; else
75
# Need to figure out how to link against Python at compile time
76
AC_MSG_CHECKING([how to link against Python])
77
reinteract_GET_CONFIG_VAR(python_framework_prefix, PYTHONFRAMEWORKPREFIX)
78
if test x$python_framework_prefix = x ; then
79
reinteract_GET_CONFIG_VAR(python_libdir, LIBDIR)
80
PYTHON_LIBS="-L$python_libdir -lpython$PYTHON_VERSION"
82
PYTHON_LIBS="-F$python_framework_prefix -framework Python"
84
AC_MSG_RESULT($PYTHON_LIBS)
87
# Test to see if what we found actually works
89
CFLAGS="$CFLAGS $PYTHON_INCLUDES"
91
LIBS="$LIBS $PYTHON_LIBS"
92
AC_LINK_IFELSE(AC_LANG_PROGRAM([#include <Python.h>], [Py_Initialize();]),
94
AC_MSG_ERROR([Linking against Python didn't work; see config.log for details]))
100
AM_CONDITIONAL(PLATFORM_OSX, $platform_osx)
102
REINTERACT_PACKAGE_DIR=${pythondir}/$PACKAGE_NAME
103
AC_SUBST(REINTERACT_PACKAGE_DIR)