aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: e397cb543868897b0bbe77da4f3556b0ca3a4b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253

AC_INIT(libdbusmenu, 0.5.96, ted@canonical.com)
AC_COPYRIGHT([Copyright 2009,2010 Canonical])

AC_PREREQ(2.62)

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(libdbusmenu, 0.5.96, [-Wno-portability])

AM_MAINTAINER_MODE

IT_PROG_INTLTOOL([0.35.0])
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_C_O
AC_STDC_HEADERS
AC_PROG_LIBTOOL

AC_SUBST(VERSION)
AC_CONFIG_MACRO_DIR([m4])

m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])

###########################
# GTK Doc 
###########################

GTK_DOC_CHECK([1.4])
GNOME_DOC_INIT

###########################
# Dependencies - GLib
###########################

GLIB_REQUIRED_VERSION=2.26

PKG_CHECK_MODULES(DBUSMENUGLIB, glib-2.0 >= $GLIB_REQUIRED_VERSION
                                gio-2.0 >= $GLIB_REQUIRED_VERSION)

AC_SUBST(DBUSMENUGLIB_CFLAGS)
AC_SUBST(DBUSMENUGLIB_LIBS)

###########################
# Dependencies - GTK
###########################

GTK_REQUIRED_VERSION=2.16
GTK3_REQUIRED_VERSION=2.91

AC_ARG_ENABLE([gtk],
	AC_HELP_STRING([--disable-gtk], [Disable libdbusmenu-gtk library]),
	[enable_gtk=$enableval], [enable_gtk=auto])
AM_CONDITIONAL([WANT_LIBDBUSMENUGTK], [test "x$enable_gtk" != "xno"])

AC_ARG_WITH([gtk],
  [AS_HELP_STRING([--with-gtk],
    [Which version of gtk to use @<:@default=3@:>@])],
  [],
  [with_gtk=3])
AM_CONDITIONAL([USE_GTK3], [test "x$with_gtk" = "x3"])

AS_IF([test "x$enable_gtk" != "xno"],[
AS_IF([test "x$with_gtk" = x3],
        [PKG_CHECK_MODULES(DBUSMENUGTK,  gtk+-3.0 >= $GTK3_REQUIRED_VERSION
                                         atk
                                         glib-2.0 >= $GLIB_REQUIRED_VERSION,
                                         [have_gtk=yes]
)
         AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available])
        ],
      [test "x$with_gtk" = x2],
        [PKG_CHECK_MODULES(DBUSMENUGTK,  gtk+-2.0 >= $GTK_REQUIRED_VERSION
                                         atk
                                         glib-2.0 >= $GLIB_REQUIRED_VERSION,
                                         [have_gtk=yes]
)
        ],
      [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])]
)
])
AC_SUBST(DBUSMENUGTK_CFLAGS)
AC_SUBST(DBUSMENUGTK_LIBS)

###########################
# Dependencies - dumper
###########################

X11_REQUIRED_VERSION=1.3

AC_ARG_ENABLE([dumper],
	AC_HELP_STRING([--disable-dumper], [Disable dbusmenudumper tool]),
	[enable_dumper=$enableval], [enable_dumper=auto])
AM_CONDITIONAL([WANT_DBUSMENUDUMPER], [test "x$enable_dumper" != "xno"])

AS_IF([test "x$enable_dumper" != "xno"],[
PKG_CHECK_MODULES(DBUSMENUDUMPER, gtk+-2.0 >= $GTK_REQUIRED_VERSION
                                  x11 >= $X11_REQUIRED_VERSION,
                                  [have_dumper=yes]
)
])

AC_SUBST(DBUSMENUDUMPER_CFLAGS)
AC_SUBST(DBUSMENUDUMPER_LIBS)

###########################
# Dependencies - Testing
###########################

JSON_GLIB_REQUIRED_VERSION=0.13.4
GIO_UNIX_REQUIRED_VERSION=2.24

AC_ARG_ENABLE([tests],
	AC_HELP_STRING([--disable-tests], [Disable tests]),
	[enable_tests=$enableval], [enable_tests=auto])
AM_CONDITIONAL([WANT_TESTS], [test "x$enable_tests" != "xno"])

AS_IF([test "x$enable_tests" != "xno"],[
PKG_CHECK_MODULES(DBUSMENUTESTS,  json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION
                                  gio-unix-2.0  >= $GIO_UNIX_REQUIRED_VERSION
                                  valgrind,
                                  [have_tests=yes]
)
])

AC_SUBST(DBUSMENUTESTS_CFLAGS)
AC_SUBST(DBUSMENUTESTS_LIBS)

###########################
# GObject Introspection
###########################

GOBJECT_INTROSPECTION_CHECK([0.6.7])

PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.10],
				 introspection_ten=yes,
				 introspection_ten=no)

AM_CONDITIONAL(INTROSPECTION_TEN, [test "x$introspection_ten" = "xyes"])

###########################
# Vala API Generation
###########################

AC_ARG_ENABLE([vala],
	AC_HELP_STRING([--disable-vala], [Disable vala]),
	[enable_vala=$enableval], [enable_vala=auto])

AS_IF([test "x$enable_vala" != "xno"],[
	AM_COND_IF([HAVE_INTROSPECTION],,[
		AC_MSG_ERROR([Vala bindings require introspection support, please --enable-introspection])
	])
AC_PATH_PROG([VALA_API_GEN], [vapigen])
])
AM_CONDITIONAL([HAVE_VALA], [test -n "$VALA_API_GEN"])

###########################
# XSLT Processor
###########################

AC_PATH_PROG([XSLT_PROC], [xsltproc])

###########################
# Lib versioning 
###########################

LIBDBUSMENU_CURRENT=4
LIBDBUSMENU_REVISION=12
LIBDBUSMENU_AGE=0

AC_SUBST(LIBDBUSMENU_CURRENT)
AC_SUBST(LIBDBUSMENU_REVISION)
AC_SUBST(LIBDBUSMENU_AGE)

###########################
# Internationalization
###########################

GETTEXT_PACKAGE=libdbusmenu
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default gettext domain])

AM_GLIB_GNU_GETTEXT

###########################
# Massive Debugging
###########################

with_massivedebugging="no"
AC_ARG_ENABLE(massivedebugging, AS_HELP_STRING([--enable-massivedebugging], [Print out so much information your brain will hurt]), with_massivedebugging=$enableval, with_massivedebugging=no)
if test "x$with_massivedebugging" = "xyes"; then
	AC_DEFINE([MASSIVEDEBUGGING], [1], [Print everyting])
fi

###########################
# Files
###########################

AC_OUTPUT([
Makefile
po/Makefile.in
libdbusmenu-glib/Makefile
libdbusmenu-glib/dbusmenu-glib-0.4.pc
libdbusmenu-gtk/Makefile
libdbusmenu-gtk/dbusmenu-gtk-0.4.pc
libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc
tools/Makefile
tools/testapp/Makefile
tests/Makefile
tests/dbusmenu-jsonloader-0.4.pc
docs/Makefile
docs/libdbusmenu-glib/Makefile
docs/libdbusmenu-glib/reference/Makefile
docs/libdbusmenu-glib/reference/version.xml
docs/libdbusmenu-gtk/Makefile
docs/libdbusmenu-gtk/reference/Makefile
docs/libdbusmenu-gtk/reference/version.xml
])

###########################
# Results
###########################

AC_MSG_NOTICE([

libdbusmenu Configuration:

	Prefix:                 $prefix
	Massive Debugging:      $with_massivedebugging
	GTK+ Version:           $with_gtk
])

AS_IF([test "x$have_tests" = "xyes"],
	AC_MSG_NOTICE([	Tests:                  yes]),
	AC_MSG_NOTICE([	Tests:                  no])
)

AS_IF([test "x$enable_gtk" = "xno"],
	AC_MSG_NOTICE([	Gtk:                    no]),
	AC_MSG_NOTICE([	Gtk:                    yes (gtk$with_gtk)])
)

AM_COND_IF([HAVE_VALA],
	AC_MSG_NOTICE([	Vala bindings:          yes]),
	AC_MSG_NOTICE([	Vala bindings           no])
)

AS_IF([test "x$have_dumper" = "xyes"],
   AC_MSG_NOTICE([	Dumper:                 yes]),
   AC_MSG_NOTICE([	Dumper:                 no])
)