106
dnl -*- mode: autoconf -*-
107
dnl Copyright 2009 Johan Dahlin
109
dnl This file is free software; the author(s) gives unlimited
110
dnl permission to copy and/or distribute it, with or without
111
dnl modifications, as long as this notice is preserved.
116
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
118
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
119
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
120
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
122
dnl enable/disable introspection
123
m4_if([$2], [require],
125
enable_introspection=yes
127
AC_ARG_ENABLE(introspection,
128
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
129
[Enable introspection for this build]),,
130
[enable_introspection=auto])
133
AC_MSG_CHECKING([for gobject-introspection])
135
dnl presence/version checking
136
AS_CASE([$enable_introspection],
138
found_introspection="no (disabled, use --enable-introspection to enable)"
141
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
142
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
143
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
144
found_introspection=yes,
145
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
148
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
151
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
154
AC_MSG_RESULT([$found_introspection])
156
INTROSPECTION_SCANNER=
157
INTROSPECTION_COMPILER=
158
INTROSPECTION_GENERATE=
159
INTROSPECTION_GIRDIR=
160
INTROSPECTION_TYPELIBDIR=
161
if test "x$found_introspection" = "xyes"; then
162
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
163
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
164
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
165
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
166
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
167
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
168
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
169
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
171
AC_SUBST(INTROSPECTION_SCANNER)
172
AC_SUBST(INTROSPECTION_COMPILER)
173
AC_SUBST(INTROSPECTION_GENERATE)
174
AC_SUBST(INTROSPECTION_GIRDIR)
175
AC_SUBST(INTROSPECTION_TYPELIBDIR)
176
AC_SUBST(INTROSPECTION_CFLAGS)
177
AC_SUBST(INTROSPECTION_LIBS)
178
AC_SUBST(INTROSPECTION_MAKEFILE)
180
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
185
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
187
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
189
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
193
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
196
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
198
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
106
201
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
107
202
# serial 1 (pkg-config-0.24)