reviewed by: Johan Dahlin <johan@gnome.org>
[gnome.gobject-introspection] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.59)
5 AC_INIT(gobject-introspection, 0.1, http://bugzilla.gnome.org/enter_bug.cgi?product=glib)
6 AM_INIT_AUTOMAKE([1.7])
7 AM_MAINTAINER_MODE
8 AC_CONFIG_SRCDIR([src/ginvoke.c])
9 AC_CONFIG_HEADER([config.h])
10
11 # Checks for programs.
12 AC_PROG_CC
13 AM_PROG_CC_C_O
14 AC_PROG_LIBTOOL
15 PKG_PROG_PKG_CONFIG
16
17 AC_PROG_LEX
18 if test "$LEX" = :; then
19         AC_MSG_ERROR([flex not found but required])
20 fi
21
22 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
23 if test "$YACC" = :; then
24         AC_MSG_ERROR([bison not found but required])
25 fi
26
27 # Checks for libraries.
28 AC_CHECK_LIB([dl], [dlopen])
29
30 LIBFFI_DEP=""
31 AC_SUBST(LIBFFI_DEP)
32 PKG_CHECK_MODULES(GIREPO, [glib-2.0 gobject-2.0 gmodule-2.0 gthread-2.0 libffi],
33                   [have_libffi=true], [have_libffi=false])
34
35 if $have_libffi; then
36    AC_DEFINE(HAVE_LIBFFI,[],[Defined if libffi was found])
37    LIBFFI_DEP=libffi
38 else
39    dnl if libffi is not found, g_function_info_invoke is not available,
40    dnl but everything else still works
41    PKG_CHECK_MODULES(GIREPO, [glib-2.0 gobject-2.0 gmodule-2.0 gthread-2.0])
42 fi
43
44 # Checks for header files.
45 AC_HEADER_STDC
46 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
47
48 # Checks for typedefs, structures, and compiler characteristics.
49 AC_C_CONST
50
51 # Checks for library functions.
52 AC_FUNC_STRTOD
53 AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull])
54
55 AC_CONFIG_FILES([Makefile
56                  src/Makefile
57                  tests/Makefile
58                  tests/invoke/Makefile
59                  gobject-introspection.pc])
60 AC_OUTPUT