2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(gobject-introspection, 0.1, http://bugzilla.gnome.org/enter_bug.cgi?product=glib)
6 AM_INIT_AUTOMAKE([1.7 -Wno-portability])
8 AC_CONFIG_HEADER([config.h])
10 AC_CONFIG_MACRO_DIR([m4])
12 # Checks for programs.
19 if test "$LEX" = :; then
20 AC_MSG_ERROR([flex not found but required])
23 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
24 if test "$YACC" = :; then
25 AC_MSG_ERROR([bison not found but required])
28 # Checks for libraries.
31 AC_CHECK_LIB([dl], [dlopen])
33 PKG_CHECK_MODULES(GOBJECT, [gobject-2.0])
35 PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0])
38 PKG_CHECK_MODULES(FFI, libffi, have_ffi_pkgconfig=yes, have_ffi_pkgconfig=no)
40 if test x"$have_ffi_pkgconfig" = xno ; then
41 AC_MSG_CHECKING(for ffi.h)
43 AC_TRY_CPP([#include <ffi.h>], have_ffi_h=yes, have_ffi_h=no)
44 if test x"$have_ffi_h" = x"yes"; then
47 if test x"$with_ffi" = x"yes" || test x"$with_ffi" = x"auto"; then
53 AC_SEARCH_LIBS(ffi_call,ffi,,AC_MSG_ERROR([libffi not found]),$other_LIBS)
54 if test x"$ac_cv_search_ffi_call" = x"none required" ; then
57 FFI_LIBS="$ac_cv_search_ffi_call $other_LIBS"
62 if test x"$have_ffi_h" != x"yes" ; then
63 AC_MSG_ERROR([ffi.h not found])
68 AC_MSG_RESULT([$have_ffi_h])
73 PKG_CHECK_MODULES(GIREPO, [glib-2.0 gobject-2.0 gmodule-2.0])
75 # if we ever remove manual check for ffi and require .pc file, then
76 # just put libffi in the PKG_CHECK_MODULES(GIREPO) deps
77 GIREPO_LIBS="$GIREPO_LIBS $GCOV_LIBS $FFI_LIBS"
78 GIREPO_CFLAGS="$GIREPO_CFLAGS $FFI_CFLAGS"
80 GIREPO_CFLAGS="$GIREPO_CFLAGS $GCOV_CFLAGS"
82 # Checks for header files.
84 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
86 # Checks for typedefs, structures, and compiler characteristics.
89 # Checks for library functions.
91 AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull])
95 AC_MSG_CHECKING([whether Python support is requested])
98 AM_CHECK_PYTHON_HEADERS
100 AC_CONFIG_FILES([Makefile
102 girepository/Makefile
107 tests/invoke/Makefile
108 tests/parser/Makefile
109 gobject-introspection.pc])