4 dnl the pygobject version number
5 m4_define(pygobject_major_version, 2)
6 m4_define(pygobject_minor_version, 21)
7 m4_define(pygobject_micro_version, 1)
8 m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
10 dnl versions of packages we require ...
11 m4_define(glib_required_version, 2.22.4)
12 m4_define(gio_required_version, 2.22.4)
13 m4_define(giounix_required_version, 2.22.4)
15 AC_INIT(pygobject, pygobject_version,
16 [http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject])
17 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I .")
18 AC_CONFIG_MACRO_DIR([m4])
20 AC_DEFINE(PYGOBJECT_MAJOR_VERSION, pygobject_major_version, [pygobject major version])
21 AC_SUBST(PYGOBJECT_MAJOR_VERSION, pygobject_major_version)
22 AC_DEFINE(PYGOBJECT_MINOR_VERSION, pygobject_minor_version, [pygobject minor version])
23 AC_SUBST(PYGOBJECT_MINOR_VERSION, pygobject_minor_version)
24 AC_DEFINE(PYGOBJECT_MICRO_VERSION, pygobject_micro_version, [pygobject micro version])
25 AC_SUBST(PYGOBJECT_MICRO_VERSION, pygobject_micro_version)
27 AC_CONFIG_SRCDIR([gobject/gobjectmodule.c])
28 AM_CONFIG_HEADER(config.h)
32 dnl put the ACLOCAL flags in the makefile
33 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
37 AC_MSG_CHECKING([for some Win32 platform])
39 *-*-mingw*|*-*-cygwin*)
46 AC_MSG_RESULT([$platform_win32])
47 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
49 AC_MSG_CHECKING([for native Win32])
58 AC_MSG_RESULT([$os_win32])
59 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
63 dnl XXXX hack to kill off all the libtool tags ...
64 dnl it isn't like we are using C++ or Fortran.
65 dnl (copied from libglade/configure.in)
66 m4_define([_LT_AC_TAGCONFIG],[])
70 dnl when using libtool 2.x create libtool early, because it's used in configure
71 m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
76 JD_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
78 AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h])
79 py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`
80 if test -x "$PYTHON-config"; then
81 PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
83 PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
85 old_CPPFLAGS=$CPPFLAGS
86 CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES"
87 AC_TRY_COMPILE([#include <Python.h>],
88 [PySignal_SetWakeupFd(0);],
91 AC_MSG_RESULT($setwakeupfd_ok)
92 if test "x$setwakeupfd_ok" != xno; then
93 AC_DEFINE(HAVE_PYSIGNAL_SETWAKEUPFD, 1,
94 [Define to 1 if PySignal_SetWakeupFd is available])
96 CPPFLAGS=$old_CPPFLAGS
98 PLATFORM=`$PYTHON -c "import sys; from distutils import util; sys.stdout.write(util.get_platform())"`
101 AC_ARG_ENABLE(thread,
102 AC_HELP_STRING([--disable-thread], [Disable pygobject threading support]),,
105 dnl Building documentation
107 AC_HELP_STRING([--enable-docs], [Enable documentation building]),enable_docs=$enableval,
109 if test "${enable_docs}" != no; then
111 dnl Check for xsltproc
113 AC_PATH_PROG([XSLTPROC], [xsltproc])
114 if test -z "$XSLTPROC"; then
118 dnl check for DocBook DTD and stylesheets in the local catalog.
119 dnl JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
120 dnl [DocBook XML DTD V4.1.2],,enable_docs=no)
121 dnl JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
122 dnl [DocBook XSL Stylesheets],,enable_docs=no)
125 AM_CONDITIONAL(ENABLE_DOCS, test x$enable_docs != xno)
127 AM_CHECK_PYMOD(thread,,,enable_thread=no)
129 AC_MSG_CHECKING(whether to enable threading in pygobject)
130 if test "x$enable_thread" != xno; then
136 THREADING_CFLAGS="-DDISABLE_THREADING"
139 AC_SUBST(THREADING_CFLAGS)
140 CPPFLAGS="${CPPFLAGS} $THREADING_CFLAGS"
142 dnl get rid of the -export-dynamic stuff from the configure flags ...
143 export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
146 AM_PATH_GLIB_2_0(glib_required_version,,[AC_MSG_ERROR(maybe you want the pygobject-2-4 branch?)],gobject $extra_mods)
147 if test -n "$export_dynamic"; then
148 GLIB_LIBS=`echo $GLIB_LIBS | sed -e "s/$export_dynamic//"`
150 PYTHON_BASENAME=`basename $PYTHON`
151 AC_SUBST([PYTHON_BASENAME])
153 pygobject_CODEGEN_DEFINES=""
154 AC_SUBST([pygobject_CODEGEN_DEFINES])
156 AS_AC_EXPAND(DATADIR, $datadir)
159 AC_MSG_CHECKING(for ffi)
161 AC_HELP_STRING([--without-ffi], [Disable libffi support]),
162 with_libffi=$withval,
164 if test x"$with_libffi" = xno ; then
167 PKG_CHECK_MODULES(FFI, libffi >= 3.0, have_libffi=yes, have_libffi=no)
169 if test x"$with_libffi" = xyes && test x"$have_libffi" = xno ; then
170 AC_MSG_ERROR([ffi requested, but not found])
172 if test x"$have_libffi" = xyes; then
173 AC_DEFINE(HAVE_FFI_H,1,[Have libffi include files])
176 AC_MSG_RESULT([$have_libffi])
177 AM_CONDITIONAL(HAVE_LIBFFI, test "$have_libffi" = "yes")
183 PKG_CHECK_MODULES(GIO, gio-2.0 >= gio_required_version,
184 have_gio=true, have_gio=false)
187 AM_CONDITIONAL(BUILD_GIO, $have_gio)
188 if test -n "$export_dynamic"; then
189 GIO_LIBS=`echo $GIO_LIBS | sed -e "s/$export_dynamic//"`
193 PKG_CHECK_MODULES(GIOUNIX, gio-unix-2.0 >= giounix_required_version,
194 have_giounix=true, have_giounix=false)
195 AC_SUBST(GIOUNIX_CFLAGS)
196 AC_SUBST(GIOUNIX_LIBS)
197 AM_CONDITIONAL(BUILD_GIOUNIX, $have_giounix)
198 if test -n "$export_dynamic"; then
199 GIOUNIX_LIBS=`echo $GIOUNIX_LIBS | sed -e "s/$export_dynamic//"`
203 AC_HELP_STRING([--enable-pygi], [Use PyGI to create wrappers for introspection-enabled types]),
204 enable_pygi=$enableval,
206 if test "$enable_pygi" != no; then
207 AC_DEFINE(ENABLE_PYGI,1,Use PyGI to create wrappers for introspection-enabled types)
210 dnl add required cflags ...
211 if test "x$GCC" = "xyes"; then
212 JH_ADD_CFLAG([-Wall])
213 JH_ADD_CFLAG([-fno-strict-aliasing])
219 JH_ADD_CFLAG([-std=c9x])
228 pygobject-2.0-uninstalled.pc
230 codegen/pygobject-codegen-2.0
232 docs/reference/entities.docbook
243 echo "libffi support: $have_libffi"