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, 2)
14 m4_define(pygobject_minor_version, 90)
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, 0.10.2)
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.24.0)
23 m4_define(gio_required_version, 2.24.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(foreign)
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(could not find Python headers)])
106 AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h])
107 old_CPPFLAGS=$CPPFLAGS
108 CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES"
109 AC_TRY_COMPILE([#include <Python.h>],
110 [PySignal_SetWakeupFd(0);],
113 AC_MSG_RESULT($setwakeupfd_ok)
114 if test "x$setwakeupfd_ok" != xno; then
115 AC_DEFINE(HAVE_PYSIGNAL_SETWAKEUPFD, 1,
116 [Define to 1 if PySignal_SetWakeupFd is available])
118 CPPFLAGS=$old_CPPFLAGS
120 PLATFORM=`$PYTHON -c "import sys; from distutils import util; sys.stdout.write(util.get_platform())"`
123 AC_ARG_ENABLE(thread,
124 AC_HELP_STRING([--disable-thread], [Disable pygobject threading support]),,
127 dnl Building documentation
129 AC_HELP_STRING([--enable-docs], [Enable documentation building]),enable_docs=$enableval,
131 if test "${enable_docs}" != no; then
133 dnl Check for xsltproc
135 AC_PATH_PROG([XSLTPROC], [xsltproc])
136 if test -z "$XSLTPROC"; then
140 dnl check for DocBook DTD and stylesheets in the local catalog.
141 dnl JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
142 dnl [DocBook XML DTD V4.1.2],,enable_docs=no)
143 dnl JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
144 dnl [DocBook XSL Stylesheets],,enable_docs=no)
147 AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs != xno)
149 AM_CHECK_PYMOD(thread,,,enable_thread=check_for_py3_module)
150 if test "x$enable_thread" = xcheck_for_py3_module; then
151 dnl Python 3 uses the _thread module so check for that
152 AM_CHECK_PYMOD(_thread,,,enable_thread=no)
155 AC_MSG_CHECKING(whether to enable threading in pygobject)
156 if test "x$enable_thread" != xno; then
162 THREADING_CFLAGS="-DDISABLE_THREADING"
165 AC_SUBST(THREADING_CFLAGS)
166 CPPFLAGS="${CPPFLAGS} $THREADING_CFLAGS"
168 dnl get rid of the -export-dynamic stuff from the configure flags ...
169 export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
172 AM_PATH_GLIB_2_0(glib_required_version,,[AC_MSG_ERROR(maybe you want the pygobject-2-4 branch?)],gobject $extra_mods)
173 if test -n "$export_dynamic"; then
174 GLIB_LIBS=`echo $GLIB_LIBS | sed -e "s/$export_dynamic//"`
176 PYTHON_BASENAME=`basename $PYTHON`
177 AC_SUBST([PYTHON_BASENAME])
179 AS_AC_EXPAND(DATADIR, $datadir)
182 AC_MSG_CHECKING(for ffi)
184 AC_HELP_STRING([--without-ffi], [Disable libffi support]),
185 with_libffi=$withval,
187 if test x"$with_libffi" = xno ; then
190 PKG_CHECK_MODULES(FFI, libffi >= 3.0, have_libffi=yes, have_libffi=no)
192 if test x"$with_libffi" = xyes && test x"$have_libffi" = xno ; then
193 AC_MSG_ERROR([ffi requested, but not found])
195 if test x"$have_libffi" = xyes; then
196 AC_DEFINE(HAVE_FFI_H,1,[Have libffi include files])
199 AM_CONDITIONAL(HAVE_LIBFFI, test "$have_libffi" = "yes")
205 PKG_CHECK_MODULES(GIO, gio-2.0 >= gio_required_version)
208 AC_HELP_STRING([--enable-cairo], [Enable Cairo bindings using introspection information]),
209 enable_cairo=$enableval,
212 PKG_CHECK_MODULES(GI,
213 glib-2.0 >= glib_required_version
214 gobject-introspection-1.0 >= introspection_required_version
217 GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
220 if test "$enable_cairo" != no; then
221 if test $build_py3k = true; then
222 PKG_CHECK_MODULES(PYCAIRO,
223 py3cairo >= py3cairo_required_version
226 PKG_CHECK_MODULES(PYCAIRO,
227 pycairo >= py2cairo_required_version
231 AM_CONDITIONAL(ENABLE_CAIRO, test "$enable_cairo" = "yes")
233 INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
234 INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
236 AC_SUBST(INTROSPECTION_SCANNER)
237 AC_SUBST(INTROSPECTION_COMPILER)
239 dnl add required cflags ...
240 if test "x$GCC" = "xyes"; then
241 JH_ADD_CFLAG([-Wall])
242 JH_ADD_CFLAG([-fno-strict-aliasing])
248 JH_ADD_CFLAG([-std=c9x])
257 pygobject-3.0-uninstalled.pc
259 docs/reference/entities.docbook
262 gi/repository/Makefile
263 gi/overrides/Makefile
272 echo "libffi support: $have_libffi"