4 # The version of python used is determined by the executable pointed to by
5 # the PYTHON environment variable. For instance if your system installs
6 # Python 3 as python3 to configure to compile pygobject under Python 3
8 # $> PYTHON=python3 ./configure
9 m4_define(python_min_ver, 2.5.2)
10 m4_define(python3_min_ver, 3.1)
12 dnl the pygobject version number
13 m4_define(pygobject_major_version, 3)
14 m4_define(pygobject_minor_version, 2)
15 m4_define(pygobject_micro_version, 1)
16 m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
18 dnl versions of packages we require ...
19 m4_define(introspection_required_version, 1.31.20)
20 m4_define(py2cairo_required_version, 1.2.0)
21 m4_define(py3cairo_required_version, 1.10.0)
22 m4_define(glib_required_version, 2.31.0)
23 m4_define(gio_required_version, 2.31.0)
25 AC_INIT(pygobject, pygobject_version,
26 [http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject])
27 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .")
28 AC_CONFIG_MACRO_DIR([m4])
29 AC_CONFIG_SRCDIR([gi/gimodule.c])
31 AC_DEFINE(PYGOBJECT_MAJOR_VERSION, pygobject_major_version, [pygobject major version])
32 AC_SUBST(PYGOBJECT_MAJOR_VERSION, pygobject_major_version)
33 AC_DEFINE(PYGOBJECT_MINOR_VERSION, pygobject_minor_version, [pygobject minor version])
34 AC_SUBST(PYGOBJECT_MINOR_VERSION, pygobject_minor_version)
35 AC_DEFINE(PYGOBJECT_MICRO_VERSION, pygobject_micro_version, [pygobject micro version])
36 AC_SUBST(PYGOBJECT_MICRO_VERSION, pygobject_micro_version)
38 AM_CONFIG_HEADER(config.h)
39 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
40 AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
41 AM_MAINTAINER_MODE([enable])
43 dnl put the ACLOCAL flags in the makefile
44 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
48 AC_MSG_CHECKING([for some Win32 platform])
50 *-*-mingw*|*-*-cygwin*)
57 AC_MSG_RESULT([$platform_win32])
58 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
60 AC_MSG_CHECKING([for native Win32])
69 AC_MSG_RESULT([$os_win32])
70 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
74 dnl XXXX hack to kill off all the libtool tags ...
75 dnl it isn't like we are using C++ or Fortran.
76 dnl (copied from libglade/configure.in)
77 m4_define([_LT_AC_TAGCONFIG],[])
81 dnl when using libtool 2.x create libtool early, because it's used in configure
82 m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
88 # check that we have the minimum version of python necisary to build
89 JD_PATH_PYTHON(python_min_ver)
91 # check if we are building for python 3
92 JD_PYTHON_CHECK_VERSION([$PYTHON], [3.0],
96 # if building for python 3 make sure we have the minimum version supported
97 if test $build_py3k = true ; then
98 AC_MSG_CHECKING([for $PYTHON >=] python3_min_ver)
99 JD_PYTHON_CHECK_VERSION([$PYTHON], python3_min_ver,
100 [AC_MSG_RESULT(yes)],
101 [AC_MSG_ERROR(too old)])
104 AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found]))
105 if test "x$os_win32" = "xyes"; then
106 AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.]))
109 AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h])
110 old_CPPFLAGS=$CPPFLAGS
111 CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES"
112 AC_TRY_COMPILE([#include <Python.h>],
113 [PySignal_SetWakeupFd(0);],
116 AC_MSG_RESULT($setwakeupfd_ok)
117 if test "x$setwakeupfd_ok" != xno; then
118 AC_DEFINE(HAVE_PYSIGNAL_SETWAKEUPFD, 1,
119 [Define to 1 if PySignal_SetWakeupFd is available])
121 CPPFLAGS=$old_CPPFLAGS
123 PLATFORM=`$PYTHON -c "import sys; from distutils import util; sys.stdout.write(util.get_platform())"`
126 AC_ARG_ENABLE(thread,
127 AC_HELP_STRING([--disable-thread], [Disable pygobject threading support]),,
130 AM_CHECK_PYMOD(thread,,,enable_thread=check_for_py3_module)
131 if test "x$enable_thread" = xcheck_for_py3_module; then
132 dnl Python 3 uses the _thread module so check for that
133 AM_CHECK_PYMOD(_thread,,,enable_thread=no)
136 AC_MSG_CHECKING(whether to enable threading in pygobject)
137 if test "x$enable_thread" != xno; then
143 THREADING_CFLAGS="-DDISABLE_THREADING"
146 AC_SUBST(THREADING_CFLAGS)
147 CPPFLAGS="${CPPFLAGS} $THREADING_CFLAGS"
149 dnl get rid of the -export-dynamic stuff from the configure flags ...
150 export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
153 AM_PATH_GLIB_2_0(glib_required_version,,[AC_MSG_ERROR(maybe you want the pygobject-2-4 branch?)],gobject $extra_mods)
154 if test -n "$export_dynamic"; then
155 GLIB_LIBS=`echo $GLIB_LIBS | sed -e "s/$export_dynamic//"`
157 PYTHON_BASENAME=`basename $PYTHON`
158 AC_SUBST([PYTHON_BASENAME])
160 AS_AC_EXPAND(DATADIR, $datadir)
163 AC_MSG_CHECKING(for ffi)
165 AC_HELP_STRING([--without-ffi], [Disable libffi support]),
166 with_libffi=$withval,
168 if test x"$with_libffi" = xno ; then
171 PKG_CHECK_MODULES(FFI, libffi >= 3.0, have_libffi=yes, have_libffi=no)
173 if test x"$with_libffi" = xyes && test x"$have_libffi" = xno ; then
174 AC_MSG_ERROR([ffi requested, but not found])
176 if test x"$have_libffi" = xyes; then
179 AM_CONDITIONAL(HAVE_LIBFFI, test "$have_libffi" = "yes")
185 PKG_CHECK_MODULES(GIO, gio-2.0 >= gio_required_version)
188 AC_HELP_STRING([--enable-cairo], [Enable Cairo bindings using introspection information]),
189 enable_cairo=$enableval,
192 PKG_CHECK_MODULES(GI,
193 glib-2.0 >= glib_required_version
194 gobject-introspection-1.0 >= introspection_required_version
197 GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
200 if test "$enable_cairo" != no; then
201 if test $build_py3k = true; then
202 PKG_CHECK_MODULES(PYCAIRO,
203 py3cairo >= py3cairo_required_version
206 PKG_CHECK_MODULES(PYCAIRO,
207 pycairo >= py2cairo_required_version
211 AM_CONDITIONAL(ENABLE_CAIRO, test "$enable_cairo" = "yes")
213 INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
214 INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
216 AC_SUBST(INTROSPECTION_SCANNER)
217 AC_SUBST(INTROSPECTION_COMPILER)
219 dnl add required cflags ...
220 if test "x$GCC" = "xyes"; then
221 JH_ADD_CFLAG([-Wall])
222 JH_ADD_CFLAG([-fno-strict-aliasing])
228 JH_ADD_CFLAG([-std=c9x])
237 pygobject-3.0-uninstalled.pc
239 gi/repository/Makefile
240 gi/overrides/Makefile
249 echo "libffi support: $have_libffi"