2 # Process this file with autoconf to produce a configure script.
4 dnl the gi version number
5 m4_define(gi_major_version, 0)
6 m4_define(gi_minor_version, 10)
7 m4_define(gi_micro_version, 2)
8 m4_define(gi_version, gi_major_version.gi_minor_version.gi_micro_version)
11 AC_INIT(gobject-introspection, gi_version,
12 [http://bugzilla.gnome.org/enter_bug.cgi?product=glib&component=introspection])
13 AM_INIT_AUTOMAKE([1.7 dist-bzip2 no-dist-gzip foreign -Wno-portability])
16 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
18 AC_CONFIG_HEADER([config.h])
20 AC_CONFIG_MACRO_DIR([m4])
24 AC_MSG_CHECKING([for Win32])
33 AC_MSG_RESULT([$os_win32])
34 AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
36 # Checks for programs.
43 if test "$LEX" = :; then
44 AC_MSG_ERROR([flex not found but required])
47 AC_CHECK_PROGS(YACC, 'bison -y', :)
48 if test "$YACC" = :; then
49 AC_MSG_ERROR([bison not found but required])
59 *[\ \ ]${flag}[\ \ ]*) ;;
60 *) result="${flag} ${result}" ;;
67 if test "$GCC" = "yes"; then
68 for flag in -Wall -Wchar-subscripts -Wmissing-declarations \
69 -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align \
70 -Wsign-compare -fno-strict-aliasing;
72 CFLAGS="$(ensureflag $flag $CFLAGS)"
76 # Checks for libraries.
77 AC_CHECK_LIB([dl], [dlopen])
79 AC_MSG_CHECKING(for the suffix of shared libraries)
80 # libtool variables are immediately available since 2.0, prior to that we need
81 # to call libtool --config explicitly
82 if test "x$shrext_cmds" = x; then
83 shrext_cmds=`SED=$SED ./libtool --config | grep '^shrext_cmds='`
86 eval std_shrext=$shrext_cmds
87 # chop the initial dot
88 SHLIB_SUFFIX=${std_shrext#.}
89 AC_MSG_RESULT(.$SHLIB_SUFFIX)
90 # any reason it may fail?
91 if test "x$SHLIB_SUFFIX" = x; then
92 AC_MSG_ERROR(Cannot determine shared library suffix from libtool)
94 AC_DEFINE_UNQUOTED([SHLIB_SUFFIX], "$SHLIB_SUFFIX", [Define to the platform's shared library suffix])
96 # Copied from dbus configure.in
97 #### find the actual value for $prefix that we'll end up with
98 ## (I know this is broken and should be done in the Makefile, but
99 ## that's a major pain and almost nobody actually seems to care)
100 AS_AC_EXPAND(EXPANDED_LOCALSTATEDIR, "$localstatedir")
101 AS_AC_EXPAND(EXPANDED_SYSCONFDIR, "$sysconfdir")
102 AS_AC_EXPAND(EXPANDED_BINDIR, "$bindir")
103 AS_AC_EXPAND(EXPANDED_LIBDIR, "$libdir")
104 AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
105 AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
107 #### Directory to install the libexec binaries
108 GOBJECT_INTROSPECTION_LIBDIR="$EXPANDED_LIBDIR"
109 AC_SUBST(GOBJECT_INTROSPECTION_LIBDIR)
110 AC_DEFINE_UNQUOTED(GOBJECT_INTROSPECTION_LIBDIR,"$GOBJECT_INTROSPECTION_LIBDIR", [Directory prefix for typelib installation])
112 #### Directory to install the gir files
115 AC_DEFINE_UNQUOTED(GIR_SUFFIX, "$GIR_SUFFIX", [Name of the gir directory])
117 GIR_DIR="$EXPANDED_DATADIR/$GIR_SUFFIX"
119 AC_DEFINE_UNQUOTED(GIR_DIR, "$GIR_DIR", [Director prefix for gir installation])
121 PKG_CHECK_MODULES(GLIB, [glib-2.0])
122 PKG_CHECK_MODULES(GOBJECT, [gobject-2.0])
123 PKG_CHECK_MODULES(GIO, [gio-2.0])
124 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0], have_gio_unix=true, have_gio_unix=false)
125 AM_CONDITIONAL(HAVE_GIO_UNIX, test x$have_gio_unix = xtrue)
127 AC_ARG_ENABLE(tests,[ --disable-tests disable test libraries ], enable_tests=$enableval,enable_tests=yes)
129 if test x$enable_tests != xno; then
130 PKG_CHECK_MODULES(CAIRO, [cairo], have_cairo=yes, have_cairo=no)
131 if test x$have_cairo != xyes; then
132 AC_MSG_ERROR([Tests enabled but cairo not found; pass --disable-tests or install cairo])
135 AM_CONDITIONAL(BUILD_TESTS, test x$enable_tests != xno)
136 AM_CONDITIONAL(HAVE_CAIRO, test x$have_cairo != xno)
138 PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0 gio-2.0])
141 PKG_CHECK_MODULES(FFI, libffi, have_ffi_pkgconfig=yes, have_ffi_pkgconfig=no)
145 if test x"$have_ffi_pkgconfig" = xyes ; then
146 FFI_PC_PACKAGES="libffi"
148 AC_MSG_CHECKING(for ffi.h)
150 AC_TRY_CPP([#include <ffi.h>], have_ffi_h=yes, have_ffi_h=no)
151 if test x"$have_ffi_h" = x"yes"; then
154 if test x"$with_ffi" = x"yes" || test x"$with_ffi" = x"auto"; then
160 AC_SEARCH_LIBS(ffi_call,ffi,,AC_MSG_ERROR([libffi not found]),$other_LIBS)
161 if test x"$ac_cv_search_ffi_call" = x"none required" ; then
164 FFI_LIBS="$ac_cv_search_ffi_call $other_LIBS"
169 if test x"$have_ffi_h" != x"yes" ; then
170 AC_MSG_ERROR([ffi.h not found])
173 FFI_PC_LIBS=$FFI_LIBS
174 FFI_PC_CFLAGS=$FFI_CFLAGS
176 AC_MSG_RESULT([$have_ffi_h])
180 AC_SUBST(FFI_PC_CFLAGS)
181 AC_SUBST(FFI_PC_LIBS)
182 AC_SUBST(FFI_PC_PACKAGES)
184 AC_CHECK_SIZEOF(char)
185 AC_CHECK_SIZEOF(short)
187 AC_CHECK_SIZEOF(long)
189 PKG_CHECK_MODULES(GIREPO, [glib-2.0 >= 2.24.0 gobject-2.0 gmodule-2.0 gio-2.0])
191 # if we ever remove manual check for ffi and require .pc file, then
192 # just put libffi in the PKG_CHECK_MODULES(GIREPO) deps
193 GIREPO_LIBS="$GIREPO_LIBS $GCOV_LIBS $FFI_LIBS"
194 GIREPO_CFLAGS="$GIREPO_CFLAGS $FFI_CFLAGS"
196 GIREPO_CFLAGS="$GIREPO_CFLAGS $GCOV_CFLAGS"
199 GTK_DOC_CHECK([1.12])
201 # Checks for header files.
203 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
205 # Checks for typedefs, structures, and compiler characteristics.
208 # Checks for library functions.
210 AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull])
211 AC_CHECK_FUNCS([backtrace backtrace_symbols])
215 AC_MSG_CHECKING([whether Python support is requested])
217 AM_PATH_PYTHON([2.5])
220 # Change backslashes to forward slashes in pyexecdir to avoid
222 pyexecdir=`echo $pyexecdir | tr '\\\\' '/'`
225 AM_CHECK_PYTHON_HEADERS(,AC_MSG_ERROR([Python headers not found]))
230 AC_MSG_CHECKING([for glib source directory to use for documentation])
232 AC_ARG_WITH(glib-src,
233 [ --with-glib-src=PATH Source directory for glib - needed to add docs to gir],
236 AM_CONDITIONAL(WITH_GLIBSRC, test x"$GLIBSRC" != x)
238 AC_MSG_RESULT([$GLIBSRC])
247 tests/offsets/Makefile
248 tests/scanner/Makefile
249 tests/repository/Makefile
252 docs/reference/Makefile
253 gobject-introspection-1.0.pc
254 gobject-introspection-no-export-1.0.pc])