Add data type constants
[platform/upstream/gobject-introspection.git] / 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 -Wno-portability])
7 AM_MAINTAINER_MODE
8 AC_CONFIG_HEADER([config.h])
9
10 AC_CONFIG_MACRO_DIR([m4])
11
12 # Checks for programs.
13 AC_PROG_CC
14 AM_PROG_CC_C_O
15 AC_PROG_LIBTOOL
16 PKG_PROG_PKG_CONFIG
17
18 AC_PROG_LEX
19 if test "$LEX" = :; then
20         AC_MSG_ERROR([flex not found but required])
21 fi
22
23 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
24 if test "$YACC" = :; then
25         AC_MSG_ERROR([bison not found but required])
26 fi
27
28 # Checks for libraries.
29 GI_ENABLE_GCOV
30
31 AC_CHECK_LIB([dl], [dlopen])
32
33 PKG_CHECK_MODULES(GOBJECT, [gobject-2.0])
34
35 PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0])
36
37 dnl libffi
38 PKG_CHECK_MODULES(FFI, libffi, have_ffi_pkgconfig=yes, have_ffi_pkgconfig=no)
39
40 if test x"$have_ffi_pkgconfig" = xno ; then
41   AC_MSG_CHECKING(for ffi.h)
42
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
45
46     save_LIBS=$LIBS
47     if test x"$with_ffi" = x"yes" || test x"$with_ffi" = x"auto"; then
48       other_LIBS=
49     else
50       other_LIBS=$with_ffi
51     fi
52
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
55       FFI_LIBS=$other_LIBS
56     else
57       FFI_LIBS="$ac_cv_search_ffi_call $other_LIBS"
58     fi
59
60     LIBS=$save_LIBS
61   fi
62   if test x"$have_ffi_h" != x"yes" ; then
63     AC_MSG_ERROR([ffi.h not found])
64   fi
65
66   FFI_CFLAGS=
67
68   AC_MSG_RESULT([$have_ffi_h])
69   AC_SUBST(FFI_LIBS)
70   AC_SUBST(FFI_CFLAGS)
71 fi
72
73 PKG_CHECK_MODULES(GIREPO, [glib-2.0 gobject-2.0 gmodule-2.0])
74
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"
79
80 GIREPO_CFLAGS="$GIREPO_CFLAGS $GCOV_CFLAGS"
81
82 # Checks for header files.
83 AC_HEADER_STDC
84 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
85
86 # Checks for typedefs, structures, and compiler characteristics.
87 AC_C_CONST
88
89 # Checks for library functions.
90 AC_FUNC_STRTOD
91 AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull])
92
93 # Python
94
95 AC_MSG_CHECKING([whether Python support is requested])
96
97 AM_PATH_PYTHON([2.5])
98 AM_CHECK_PYTHON_HEADERS
99
100 AC_CONFIG_FILES([Makefile
101                  gir/Makefile
102                  girepository/Makefile
103                  giscanner/Makefile
104                  m4/Makefile
105                  tools/Makefile
106                  tests/Makefile
107                  tests/invoke/Makefile
108                  tests/parser/Makefile
109                  gobject-introspection.pc])
110 AC_OUTPUT