actually add the parsed constant nodes
[gnome.gobject-introspection] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 dnl the gi version number
5 m4_define(gi_major_version, 0)
6 m4_define(gi_minor_version, 5)
7 m4_define(gi_micro_version, 1)
8 m4_define(gi_version, gi_major_version.gi_minor_version.gi_micro_version)
9
10 AC_PREREQ(2.59)
11 AC_INIT(gobject-introspection, gi_version,
12         http://bugzilla.gnome.org/enter_bug.cgi?product=glib)
13 AM_INIT_AUTOMAKE([1.7 -Wno-portability])
14 AM_MAINTAINER_MODE
15 AC_CONFIG_HEADER([config.h])
16
17 AC_CONFIG_MACRO_DIR([m4])
18
19 # Check for Win32
20 AC_CANONICAL_HOST
21 AC_MSG_CHECKING([for Win32])
22 case "$host" in
23 *-*-mingw*)
24         os_win32=yes
25         ;;
26 *)
27         os_win32=no
28         ;;
29 esac
30 AC_MSG_RESULT([$os_win32])
31 AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
32
33 # Checks for programs.
34 AC_PROG_CC
35 AM_PROG_CC_C_O
36 AC_PROG_LIBTOOL
37 PKG_PROG_PKG_CONFIG
38
39 AC_PROG_LEX
40 if test "$LEX" = :; then
41         AC_MSG_ERROR([flex not found but required])
42 fi
43
44 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
45 if test "$YACC" = :; then
46         AC_MSG_ERROR([bison not found but required])
47 fi
48
49 # Checks for libraries.
50 GI_ENABLE_GCOV
51
52 AC_CHECK_LIB([dl], [dlopen])
53
54 AC_MSG_CHECKING(for the suffix of shared libraries)
55 export SED
56 shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
57 eval $shrext_cmds
58 eval std_shrext=$shrext_cmds
59 # chop the initial dot
60 SHLIB_SUFFIX=`echo $std_shrext | sed 's/^\.//'`
61 AC_MSG_RESULT(.$SHLIB_SUFFIX)
62 # any reason it may fail?
63 if test "X$SHLIB_SUFFIX" = x; then
64         AC_MSG_ERROR(Cannot determine shared library suffix from libtool)
65 fi
66 AC_DEFINE_UNQUOTED([SHLIB_SUFFIX], "$SHLIB_SUFFIX", [Define to the platform's shared library suffix])
67
68 PKG_CHECK_MODULES(GOBJECT, [gobject-2.0])
69
70 PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0])
71
72 dnl libffi
73 PKG_CHECK_MODULES(FFI, libffi, have_ffi_pkgconfig=yes, have_ffi_pkgconfig=no)
74
75 if test x"$have_ffi_pkgconfig" = xno ; then
76   AC_MSG_CHECKING(for ffi.h)
77
78   AC_TRY_CPP([#include <ffi.h>], have_ffi_h=yes, have_ffi_h=no)
79   if test x"$have_ffi_h" = x"yes"; then
80
81     save_LIBS=$LIBS
82     if test x"$with_ffi" = x"yes" || test x"$with_ffi" = x"auto"; then
83       other_LIBS=
84     else
85       other_LIBS=$with_ffi
86     fi
87
88     AC_SEARCH_LIBS(ffi_call,ffi,,AC_MSG_ERROR([libffi not found]),$other_LIBS)
89     if test x"$ac_cv_search_ffi_call" = x"none required" ; then
90       FFI_LIBS=$other_LIBS
91     else
92       FFI_LIBS="$ac_cv_search_ffi_call $other_LIBS"
93     fi
94
95     LIBS=$save_LIBS
96   fi
97   if test x"$have_ffi_h" != x"yes" ; then
98     AC_MSG_ERROR([ffi.h not found])
99   fi
100
101   FFI_CFLAGS=
102
103   AC_MSG_RESULT([$have_ffi_h])
104   AC_SUBST(FFI_LIBS)
105   AC_SUBST(FFI_CFLAGS)
106 fi
107
108 PKG_CHECK_MODULES(GIREPO, [glib-2.0 gobject-2.0 gmodule-2.0])
109
110 # if we ever remove manual check for ffi and require .pc file, then 
111 # just put libffi in the PKG_CHECK_MODULES(GIREPO) deps
112 GIREPO_LIBS="$GIREPO_LIBS $GCOV_LIBS $FFI_LIBS"
113 GIREPO_CFLAGS="$GIREPO_CFLAGS $FFI_CFLAGS"
114
115 GIREPO_CFLAGS="$GIREPO_CFLAGS $GCOV_CFLAGS"
116
117 # Checks for header files.
118 AC_HEADER_STDC
119 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
120
121 # Checks for typedefs, structures, and compiler characteristics.
122 AC_C_CONST
123
124 # Checks for library functions.
125 AC_FUNC_STRTOD
126 AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull])
127
128 # Python
129
130 AC_MSG_CHECKING([whether Python support is requested])
131
132 AM_PATH_PYTHON([2.5])
133 case "$host" in
134 *-*-mingw*)
135         # Change backslashes to forward slashes in pyexecdir to avoid
136         # quoting issues
137         pyexecdir=`echo $pyexecdir | tr '\\\\' '/'`
138         ;;
139 esac
140 AM_CHECK_PYTHON_HEADERS
141
142 AC_CONFIG_FILES([
143 Makefile
144 gir/Makefile
145 girepository/Makefile
146 giscanner/Makefile
147 giscanner/config.py
148 m4/Makefile
149 tools/Makefile
150 tests/Makefile
151 tests/invoke/Makefile
152 tests/scanner/Makefile
153 tests/repository/Makefile
154 tests/types/Makefile
155 gobject-introspection-1.0.pc])
156 AC_OUTPUT