m4macros/introspection.m4

Sun, 13 Mar 2016 17:08:29 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sun, 13 Mar 2016 17:08:29 -0500
changeset 37605
599b01f2f5a7
parent 36811
41b0483c482e
permissions
-rw-r--r--

This should do it for the jabber tests

36811
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
1 dnl -*- mode: autoconf -*-
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
2 dnl Copyright 2009 Johan Dahlin
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
3 dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
4 dnl This file is free software; the author(s) gives unlimited
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
5 dnl permission to copy and/or distribute it, with or without
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
6 dnl modifications, as long as this notice is preserved.
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
7 dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
8
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
9 # serial 1
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
10
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
11 m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
12 [
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
13 AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
14 AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
15 AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
16
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
17 dnl enable/disable introspection
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
18 m4_if([$2], [require],
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
19 [dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
20 enable_introspection=yes
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
21 ],[dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
22 AC_ARG_ENABLE(introspection,
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
23 AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
24 [Enable introspection for this build]),,
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
25 [enable_introspection=auto])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
26 ])dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
27
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
28 AC_MSG_CHECKING([for gobject-introspection])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
29
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
30 dnl presence/version checking
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
31 AS_CASE([$enable_introspection],
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
32 [no], [dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
33 found_introspection="no (disabled, use --enable-introspection to enable)"
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
34 ],dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
35 [yes],[dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
36 PKG_CHECK_EXISTS([gobject-introspection-1.0],,
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
37 AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
38 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
39 found_introspection=yes,
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
40 AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
41 ],dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
42 [auto],[dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
43 PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
44 dnl Canonicalize enable_introspection
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
45 enable_introspection=$found_introspection
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
46 ],dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
47 [dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
48 AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
49 ])dnl
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
50
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
51 AC_MSG_RESULT([$found_introspection])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
52
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
53 INTROSPECTION_SCANNER=
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
54 INTROSPECTION_COMPILER=
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
55 INTROSPECTION_GENERATE=
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
56 INTROSPECTION_GIRDIR=
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
57 INTROSPECTION_TYPELIBDIR=
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
58 if test "x$found_introspection" = "xyes"; then
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
59 INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
60 INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
61 INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
62 INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
63 INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
64 INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
65 INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
66 INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
67 fi
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
68 AC_SUBST(INTROSPECTION_SCANNER)
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
69 AC_SUBST(INTROSPECTION_COMPILER)
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
70 AC_SUBST(INTROSPECTION_GENERATE)
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
71 AC_SUBST(INTROSPECTION_GIRDIR)
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
72 AC_SUBST(INTROSPECTION_TYPELIBDIR)
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
73 AC_SUBST(INTROSPECTION_CFLAGS)
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
74 AC_SUBST(INTROSPECTION_LIBS)
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
75 AC_SUBST(INTROSPECTION_MAKEFILE)
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
76
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
77 AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
78 ])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
79
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
80
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
81 dnl Usage:
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
82 dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
83
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
84 AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
85 [
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
86 _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
87 ])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
88
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
89 dnl Usage:
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
90 dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
91
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
92
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
93 AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
94 [
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
95 _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
41b0483c482e Started integrating gobject introspection with the build system
Ankit Vani <a@nevitus.org>
parents:
diff changeset
96 ])

mercurial