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, 6)
7 m4_define(gi_micro_version, 3)
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 -Wno-portability])
15 AC_CONFIG_HEADER([config.h])
17 AC_CONFIG_MACRO_DIR([m4])
21 AC_MSG_CHECKING([for Win32])
30 AC_MSG_RESULT([$os_win32])
31 AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
33 # Checks for programs.
40 if test "$LEX" = :; then
41 AC_MSG_ERROR([flex not found but required])
44 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
45 if test "$YACC" = :; then
46 AC_MSG_ERROR([bison not found but required])
56 *[\ \ ]${flag}[\ \ ]*) ;;
57 *) result="${flag} ${result}" ;;
64 if test "$GCC" = "yes"; then
65 for flag in -Wall -Wchar-subscripts -Wmissing-declarations \
66 -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align \
67 -Wsign-compare -fno-strict-aliasing;
69 CFLAGS="$(ensureflag $flag $CFLAGS)"
73 # Checks for libraries.
76 AC_CHECK_LIB([dl], [dlopen])
78 AC_MSG_CHECKING(for the suffix of shared libraries)
79 # libtool variables are immediately available since 2.0, prior to that we need
80 # to call libtool --config explicitly
81 if test "x$shrext_cmds" = x; then
82 shrext_cmds=`SED=$SED ./libtool --config | grep '^shrext_cmds='`
85 eval std_shrext=$shrext_cmds
86 # chop the initial dot
87 SHLIB_SUFFIX=${std_shrext#.}
88 AC_MSG_RESULT(.$SHLIB_SUFFIX)
89 # any reason it may fail?
90 if test "x$SHLIB_SUFFIX" = x; then
91 AC_MSG_ERROR(Cannot determine shared library suffix from libtool)
93 AC_DEFINE_UNQUOTED([SHLIB_SUFFIX], "$SHLIB_SUFFIX", [Define to the platform's shared library suffix])
95 # Copied from dbus configure.in
96 #### find the actual value for $prefix that we'll end up with
97 ## (I know this is broken and should be done in the Makefile, but
98 ## that's a major pain and almost nobody actually seems to care)
99 AS_AC_EXPAND(EXPANDED_LOCALSTATEDIR, "$localstatedir")
100 AS_AC_EXPAND(EXPANDED_SYSCONFDIR, "$sysconfdir")
101 AS_AC_EXPAND(EXPANDED_BINDIR, "$bindir")
102 AS_AC_EXPAND(EXPANDED_LIBDIR, "$libdir")
103 AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
104 AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
106 #### Directory to install the libexec binaries
107 GOBJECT_INTROSPECTION_LIBDIR="$EXPANDED_LIBDIR"
108 AC_SUBST(GOBJECT_INTROSPECTION_LIBDIR)
109 AC_DEFINE_UNQUOTED(GOBJECT_INTROSPECTION_LIBDIR,"$GOBJECT_INTROSPECTION_LIBDIR", [Directory prefix for typelib installation])
111 PKG_CHECK_MODULES(GOBJECT, [gobject-2.0 gio-2.0])
112 PKG_CHECK_MODULES(GTHREAD, [gthread-2.0])
113 PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0], have_gio_unix=true, have_gio_unix=false)
114 AM_CONDITIONAL(HAVE_GIO_UNIX, test x$have_gio_unix = xtrue)
116 PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gthread-2.0 gio-2.0])
119 PKG_CHECK_MODULES(FFI, libffi, have_ffi_pkgconfig=yes, have_ffi_pkgconfig=no)
121 if test x"$have_ffi_pkgconfig" = xno ; then
122 AC_MSG_CHECKING(for ffi.h)
124 AC_TRY_CPP([#include <ffi.h>], have_ffi_h=yes, have_ffi_h=no)
125 if test x"$have_ffi_h" = x"yes"; then
128 if test x"$with_ffi" = x"yes" || test x"$with_ffi" = x"auto"; then
134 AC_SEARCH_LIBS(ffi_call,ffi,,AC_MSG_ERROR([libffi not found]),$other_LIBS)
135 if test x"$ac_cv_search_ffi_call" = x"none required" ; then
138 FFI_LIBS="$ac_cv_search_ffi_call $other_LIBS"
143 if test x"$have_ffi_h" != x"yes" ; then
144 AC_MSG_ERROR([ffi.h not found])
149 AC_MSG_RESULT([$have_ffi_h])
154 AC_CHECK_SIZEOF(time_t, [], [#include <time.h>])
156 PKG_CHECK_MODULES(GIREPO, [glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0])
158 # if we ever remove manual check for ffi and require .pc file, then
159 # just put libffi in the PKG_CHECK_MODULES(GIREPO) deps
160 GIREPO_LIBS="$GIREPO_LIBS $GCOV_LIBS $FFI_LIBS"
161 GIREPO_CFLAGS="$GIREPO_CFLAGS $FFI_CFLAGS"
163 GIREPO_CFLAGS="$GIREPO_CFLAGS $GCOV_CFLAGS"
166 GTK_DOC_CHECK([1.12])
168 # Checks for header files.
170 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h])
172 # Checks for typedefs, structures, and compiler characteristics.
175 # Checks for library functions.
177 AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull])
178 AC_CHECK_FUNCS([backtrace backtrace_symbols])
182 AC_MSG_CHECKING([whether Python support is requested])
184 AM_PATH_PYTHON([2.5])
187 # Change backslashes to forward slashes in pyexecdir to avoid
189 pyexecdir=`echo $pyexecdir | tr '\\\\' '/'`
192 AM_CHECK_PYTHON_HEADERS(,AC_MSG_ERROR([Python headers not found]))
194 SHAVE_INIT([scripts])
198 girepository/Makefile
203 scripts/shave-libtool
206 tests/invoke/Makefile
207 tests/offsets/Makefile
208 tests/scanner/Makefile
209 tests/repository/Makefile
212 docs/reference/Makefile
213 gobject-introspection-1.0.pc])