Remove arg-highlight on calculate
[reinteract.git] / configure.ac
blob89496023da53705d1afd069ae36040eedcbad9ce
1 AC_INIT(reinteract, 0.5.9)
3 AC_CONFIG_AUX_DIR(config)
5 AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
6 AM_MAINTAINER_MODE
8 dnl When changing this, make sure to update main.py as well
9 m4_define([min_python_version], [2.6.1])
10 AM_PATH_PYTHON(min_python_version)
12 AC_CONFIG_HEADERS(config.h)
14 AC_PROG_CC
15 AC_PROG_OBJC
17 AC_DEFINE(MIN_PYTHON_VERSION, ["min_python_version"],
18           [Minimum version of Python we require])
20 changequote(,)dnl
21 if test "x$GCC" = "xyes"; then
22   case " $CFLAGS " in
23   *[\ \ ]-Wall[\ \      ]*) ;;
24   *) CFLAGS="$CFLAGS -Wall" ;;
25   esac
27   case " $OBJCFLAGS " in
28   *[\ \ ]-Wall[\ \      ]*) ;;
29   *) OBJCFLAGS="$OBJCFLAGS -Wall" ;;
30   esac
32 changequote([,])dnl
34 APPDIR=
35 AC_ARG_WITH(appdir,
36             [AC_HELP_STRING([--with-appdir=APPDIR],
37                  [On OS X, install Reinteract.app into APPDIR])],
38             [if test x$withval = xyes ; then
39                 AC_MSG_ERROR([Directory must be specified as argument to --with-appdir])
40              elif test x$withval = xno ; then
41                 :
42              else
43                 APPDIR=$withval
44              fi])
46 AM_CONDITIONAL(INSTALL_APP, test "x$APPDIR" != x)
47 AC_SUBST(APPDIR)
49 use_python_thunks=false
50 AC_ARG_ENABLE(python-thunks,
51               [AC_HELP_STRING([--enable-python-thunks],
52                  [On OS X, lazily locate Python at run-time (default is no)])],
53               [if test "x$enableval" != xno ; then use_python_thunks=true ; fi])
55 if $use_python_thunks ; then
56    AC_DEFINE(USE_PYTHON_THUNKS, 1,
57              [Define to locate Python lazily at runtime])
60 AM_CONDITIONAL(USE_PYTHON_THUNKS, $use_python_thunks)
62 dnl A macro to get a variable from distutils.sysconfig
63 dnl reinteract_GET_CONFIG_VAR(SHELL_NAME, SYSCONFIG_NAME)
64 dnl
65 AC_DEFUN([reinteract_GET_CONFIG_VAR],
66     [$1=`$PYTHON -c "import sys; import distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_config_var('$2'))"`])
68 AC_CANONICAL_HOST
70 platform_osx=false
71 case $host in
72      *-*-darwin*)
73         # This will break if someone wants to build the X11 version of reinteract
74         # on OS X. They can just use bin/uninst.py, or they can figure out how
75         # to fix this :-)
76         platform_osx=true
77         PKG_CHECK_MODULES(WRAPPER, [pygobject-2.0 >= 2.16 gtk+-2.0 >= 2.12])
78         JD_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
80         if $use_python_thunks ; then : ; else
81             # Need to figure out how to link against Python at compile time
82             AC_MSG_CHECKING([how to link against Python])
83             reinteract_GET_CONFIG_VAR(python_framework_prefix, PYTHONFRAMEWORKPREFIX)
84             if test x$python_framework_prefix = x ; then
85                 reinteract_GET_CONFIG_VAR(python_libdir, LIBDIR)
86                 PYTHON_LIBS="-L$python_libdir -lpython$PYTHON_VERSION"
87             else
88                 PYTHON_LIBS="-F$python_framework_prefix -framework Python"
89             fi
90             AC_MSG_RESULT($PYTHON_LIBS)
91             AC_SUBST(PYTHON_LIBS)
93             # Test to see if what we found actually works
94             save_CFLAGS="$CFLAGS"
95             CFLAGS="$CFLAGS $PYTHON_INCLUDES"
96             save_LIBS="$LIBS"
97             LIBS="$LIBS $PYTHON_LIBS"
98             AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <Python.h>]], [[Py_Initialize();]])],
99                            :,
100                            [AC_MSG_ERROR([Linking against Python didn't work; see config.log for details])])
101             CFLAGS="$save_CFLAGS"
102             LIBS="$save_LIBS"
103         fi
104      ;;
105 esac
106 AM_CONDITIONAL(PLATFORM_OSX, $platform_osx)
108 REINTERACT_PACKAGE_DIR=${pythondir}/$PACKAGE_NAME
109 AC_SUBST(REINTERACT_PACKAGE_DIR)
111 AC_OUTPUT([ 
112   Makefile
113   dialogs/Makefile
114   data/Makefile
115   bin/reinteract