Post release version bump to 2.21.1
[pygobject.git] / configure.ac
blob75fd4553b2a656ab30b80c7594b799e1cb41780e
1 -*- mode: m4 -*-
2 AC_PREREQ(2.52)
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)
30 AM_INIT_AUTOMAKE
32 dnl put the ACLOCAL flags in the makefile
33 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
35 AC_CANONICAL_BUILD
36 AC_CANONICAL_HOST
37 AC_MSG_CHECKING([for some Win32 platform])
38 case "$host" in
39   *-*-mingw*|*-*-cygwin*)
40     platform_win32=yes
41     ;;
42   *)
43     platform_win32=no
44     ;;
45 esac
46 AC_MSG_RESULT([$platform_win32])
47 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
49 AC_MSG_CHECKING([for native Win32])
50 case "$host" in
51   *-*-mingw*)
52     os_win32=yes
53     ;;
54   *)
55     os_win32=no
56     ;;
57 esac
58 AC_MSG_RESULT([$os_win32])
59 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
61 AC_DISABLE_STATIC
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],[])
68 AC_LIBTOOL_WIN32_DLL
69 AC_PROG_LIBTOOL
70 dnl when using libtool 2.x create libtool early, because it's used in configure
71 m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) 
72 AM_PROG_CC_C_O
74 JD_PATH_PYTHON(2.3.5)
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`
82 else
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);],
89   setwakeupfd_ok=yes,
90   setwakeupfd_ok=no)
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())"`
99 AC_SUBST(PLATFORM)
101 AC_ARG_ENABLE(thread,
102   AC_HELP_STRING([--disable-thread], [Disable pygobject threading support]),,
103   enable_thread=yes)
105 dnl Building documentation
106 AC_ARG_ENABLE(docs,
107   AC_HELP_STRING([--enable-docs], [Enable documentation building]),enable_docs=$enableval,
108   enable_docs=no)
109 if test "${enable_docs}" != no; then
110   dnl
111   dnl Check for xsltproc
112   dnl
113   AC_PATH_PROG([XSLTPROC], [xsltproc])
114   if test -z "$XSLTPROC"; then
115     enable_docs=no
116   fi
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
131   extra_mods=gthread
132   THREADING_CFLAGS=
133   AC_MSG_RESULT(yes)
134 else
135   extra_mods=
136   THREADING_CFLAGS="-DDISABLE_THREADING"
137   AC_MSG_RESULT(no)
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`
145 dnl glib
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)
158 dnl libffi
159 AC_MSG_CHECKING(for ffi)
160 AC_ARG_WITH(ffi,
161   AC_HELP_STRING([--without-ffi], [Disable libffi support]),
162   with_libffi=$withval,
163   with_libffi=auto)
164 if test x"$with_libffi" = xno ; then
165   have_libffi=false
166 else
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])
174   LIBFFI_PC=libffi
176 AC_MSG_RESULT([$have_libffi])
177 AM_CONDITIONAL(HAVE_LIBFFI, test "$have_libffi" = "yes")
178 AC_SUBST(FFI_CFLAGS)
179 AC_SUBST(FFI_LIBS)
180 AC_SUBST(LIBFFI_PC)
182 dnl gio
183 PKG_CHECK_MODULES(GIO, gio-2.0 >= gio_required_version,
184         have_gio=true, have_gio=false)
185 AC_SUBST(GIO_CFLAGS)
186 AC_SUBST(GIO_LIBS)
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//"`
192 dnl giounix
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//"`
202 AC_ARG_ENABLE(pygi,
203   AC_HELP_STRING([--enable-pygi], [Use PyGI to create wrappers for introspection-enabled types]),
204   enable_pygi=$enableval,
205   enable_pygi=no)
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])
215   case $host_os in
216   solaris*)
217     ;;
218   *)
219     JH_ADD_CFLAG([-std=c9x])
220     ;;
221   esac
225 AC_CONFIG_FILES(
226   Makefile
227   pygobject-2.0.pc
228   pygobject-2.0-uninstalled.pc
229   codegen/Makefile
230   codegen/pygobject-codegen-2.0
231   docs/Makefile
232   docs/reference/entities.docbook
233   docs/xsl/fixxref.py
234   glib/Makefile
235   gobject/Makefile
236   gio/Makefile
237   examples/Makefile
238   tests/Makefile
239   PKG-INFO)
240 AC_OUTPUT
242 echo
243 echo "libffi support: $have_libffi"
244 echo