1dnl Process this file with autoconf to create configure.
2
3dnl ################################################################
4dnl # Initialize autoconf
5dnl ################################################################
6AC_INIT([mate-notification-daemon], [1.26.0], [https://mate-desktop.org])
7AC_PREREQ(2.63)
8
9AC_CONFIG_HEADERS([config.h])
10AC_CONFIG_SRCDIR([config.h.in])
11AC_CONFIG_MACRO_DIR([m4])
12
13dnl ################################################################
14dnl # Version information
15dnl ################################################################
16NOTIFICATION_DAEMON_MAJOR_VERSION=1
17NOTIFICATION_DAEMON_MINOR_VERSION=3
18NOTIFICATION_DAEMON_MICRO_VERSION=0
19NOTIFICATION_DAEMON_DEVEL_VERSION=0
20
21NOTIFICATION_DAEMON_VERSION=$NOTIFICATION_DAEMON_MAJOR_VERSION.$NOTIFICATION_DAEMON_MINOR_VERSION.$NOTIFICATION_DAEMON_MICRO_VERSION
22
23if test "x$NOTIFICATION_DAEMON_DEVEL_VERSION" != "x0"; then
24	if test "x$NOTIFICATION_DAEMON_MICRO_VERSION" = "x0"; then
25		NOTIFICATION_DAEMON_MICRO_VERSION=$NOTIFICATION_DAEMON_DEVEL_VERSION
26		NOTIFICATION_DAEMON_VERSION=$NOTIFICATION_DAEMON_MAJOR_VERSION.$NOTIFICATION_DAEMON_MINOR_VERSION.$NOTIFICATION_DAEMON_DEVEL_VERSION
27	else
28		NOTIFICATION_DAEMON_VERSION=$NOTIFICATION_DAEMON_VERSION.$NOTIFICATION_DAEMON_DEVEL_VERSION
29	fi
30fi
31
32AC_DEFINE_UNQUOTED(NOTIFICATION_DAEMON_MAJOR_VERSION, $NOTIFICATION_DAEMON_MAJOR_VERSION,
33	[mate-notification-daemon major version.])
34AC_DEFINE_UNQUOTED(NOTIFICATION_DAEMON_MINOR_VERSION, $NOTIFICATION_DAEMON_MINOR_VERSION,
35	[mate-notification-daemon minor version.])
36AC_DEFINE_UNQUOTED(NOTIFICATION_DAEMON_MICRO_VERSION, $NOTIFICATION_DAEMON_MICRO_VERSION,
37	[mate-notification-daemon micro version.])
38AC_DEFINE_UNQUOTED(NOTIFICATION_DAEMON_VERSION, "$NOTIFICATION_DAEMON_VERSION",
39	[mate-notification-daemon version.])
40
41dnl ################################################################
42dnl # Initialize automake
43dnl ################################################################
44AM_INIT_AUTOMAKE([1.10 no-dist-gzip dist-xz foreign check-news])
45AM_MAINTAINER_MODE
46m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
47
48dnl ################################################################
49dnl # Check for some standard stuff.
50dnl ################################################################
51# Checks for programs
52AC_PROG_CC
53AC_PROG_CPP
54AC_PROG_MAKE_SET
55AC_PROG_LN_S
56AC_PROG_INSTALL
57
58# Checks for typedefs, structures, and compiler characteristics.
59AC_TYPE_SIZE_T
60
61dnl ---------------------------------------------------------------------------
62dnl Warning flags
63dnl ---------------------------------------------------------------------------
64MATE_MAINTAINER_MODE_DEFINES
65MATE_COMPILE_WARNINGS
66
67dnl ---------------------------------------------------------------------------
68dnl Initialize Libtool
69dnl ---------------------------------------------------------------------------
70LT_PREREQ([2.2.6])
71LT_INIT
72
73
74dnl ---------------------------------------------------------------------------
75dnl i18n stuff
76dnl ---------------------------------------------------------------------------
77
78AM_GNU_GETTEXT([external])
79AM_GNU_GETTEXT_VERSION([0.19.8])
80AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.8])
81AM_CONDITIONAL([USE_NLS], [test "x${USE_NLS}" = "xyes"])
82
83AC_SUBST([GETTEXT_PACKAGE], [mate-notification-daemon])
84AC_DEFINE([GETTEXT_PACKAGE], [PACKAGE_TARNAME], [Define to the gettext package name.])
85
86
87dnl ---------------------------------------------------------------------------
88dnl GLIB_COMPILE_RESOURCES
89dnl ---------------------------------------------------------------------------
90AC_ARG_VAR([GLIB_COMPILE_RESOURCES],[glib-compile-resources bin])
91AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources],[])
92if test -z "$GLIB_COMPILE_RESOURCES"; then
93  AC_MSG_ERROR([glib-compile-resources not found])
94fi
95
96dnl ---------------------------------------------------------------------------
97dnl XMLLINT
98dnl ---------------------------------------------------------------------------
99AC_ARG_VAR([XMLLINT],[xmllint bin])
100AC_PATH_PROG([XMLLINT],[xmllint],[])
101if test -z "$XMLLINT"; then
102  AC_MSG_ERROR([xmllint not found])
103fi
104
105dnl ---------------------------------------------------------------------------
106dnl Requirements for the themes
107dnl ---------------------------------------------------------------------------
108
109GTK_REQUIRED=3.22.0
110XML_REQUIRED=2.9.0
111
112PKG_CHECK_MODULES(THEME,
113  gtk+-3.0 >= $GTK_REQUIRED
114  libxml-2.0 >= $XML_REQUIRED
115)
116AC_SUBST(THEME_CFLAGS)
117AC_SUBST(THEME_LIBS)
118
119dnl ---------------------------------------------------------------------------
120dnl Requirements for the daemon
121dnl ---------------------------------------------------------------------------
122REQ_GLIB_VERSION=2.50.0
123REQ_LIBCANBERRA_GTK_VERSION=0.4
124PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""])
125pkg_modules="
126	gtk+-3.0 >= $GTK_REQUIRED, \
127	glib-2.0 >= $REQ_GLIB_VERSION, \
128	gio-2.0 >= $REQ_GLIB_VERSION, \
129        $GMODULE_ADD \
130        libcanberra-gtk3 >= $REQ_LIBCANBERRA_GTK_VERSION \
131"
132PKG_CHECK_MODULES(NOTIFICATION_DAEMON, $pkg_modules)
133
134dnl ---------------------------------------------------------------------------
135dnl Requirements for panel applet
136dnl ---------------------------------------------------------------------------
137LIBPANEL4_REQUIRED=1.17.0
138LIBMATE_DESKTOP_REQUIRED=1.17.0
139PKG_CHECK_MODULES(NOTIFICATION_APPLET, mate-desktop-2.0 >= $LIBMATE_DESKTOP_REQUIRED libmatepanelapplet-4.0 >= $LIBPANEL4_REQUIRED gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $REQ_GLIB_VERSION)
140AC_SUBST(NOTIFICATION_APPLET_CFLAGS)
141AC_SUBST(NOTIFICATION_APPLET_LIBS)
142
143dnl Will call AC_SUBSET on NOTIFICATION_DAEMON_* below after appending X11 and Wayland flags
144
145dnl ---------------------------------------------------------------------------
146dnl Support X11, Wayland or both for the daemon
147dnl ---------------------------------------------------------------------------
148
149dnl $enable_x11 and $enable_wayland will be set to "yes", "no" or "auto"
150AC_ARG_ENABLE(x11,
151	[AC_HELP_STRING([--enable-x11],
152		[Explicitly enable or disable X11 support
153		(default is to enable only if X development libraries are detected)])],
154	[enable_x11=$enableval],
155	[enable_x11=auto])
156
157AC_ARG_ENABLE(wayland,
158	[AC_HELP_STRING([--enable-wayland],
159		[Explicitly enable or disable Wayland support
160		(default is to enable only if Wayland client development library is detected)])],
161	[enable_wayland=$enableval],
162	[enable_wayland=auto])
163
164dnl Check if we have gtk-layer-shell installed, and thus should build with Wayland support
165have_wayland=no
166if test "x$enable_wayland" != "xno"; then
167	PKG_CHECK_MODULES(NOTIFICATION_DAEMON_WAYLAND, gtk-layer-shell-0, [
168		have_wayland=yes
169		AC_DEFINE(HAVE_WAYLAND, 1, [Have the Wayland development library])
170		NOTIFICATION_DAEMON_CFLAGS="$NOTIFICATION_DAEMON_CFLAGS $NOTIFICATION_DAEMON_WAYLAND_CFLAGS"
171		NOTIFICATION_DAEMON_LIBS="$NOTIFICATION_DAEMON_LIBS $NOTIFICATION_DAEMON_WAYLAND_LIBS"
172	], [
173		if test "x$enable_wayland" = "xyes"; then
174			AC_MSG_ERROR([Wayland enabled but GTK Layer Shell library not found])
175		fi
176	])
177fi
178
179dnl Check if we have the X development libraries
180have_x11=no
181if test "x$enable_x11" != "xno"; then
182	x11_pkg_modules="libwnck-3.0, x11"
183	PKG_CHECK_MODULES(NOTIFICATION_DAEMON_X11, $x11_pkg_modules, [
184		have_x11=yes
185		AC_DEFINE(HAVE_X11, 1, [Have the X11 development library])
186		NOTIFICATION_DAEMON_CFLAGS="$NOTIFICATION_DAEMON_CFLAGS $NOTIFICATION_DAEMON_X11_CFLAGS"
187		NOTIFICATION_DAEMON_LIBS="$NOTIFICATION_DAEMON_LIBS $NOTIFICATION_DAEMON_X11_LIBS"
188	], [
189		if test "x$enable_x11" = "xyes"; then
190			AC_MSG_ERROR([X development libraries not found])
191		fi
192	])
193fi
194
195AM_CONDITIONAL(ENABLE_WAYLAND, [test "x$have_wayland" = "xyes"])
196
197if test "x$have_x11" != "xyes" -a "x$have_wayland" != "xyes"; then
198  AC_MSG_ERROR([At least one backend must be enabled (--enable-x11 or --enable-wayland)])
199fi
200
201AC_SUBST(NOTIFICATION_DAEMON_CFLAGS)
202AC_SUBST(NOTIFICATION_DAEMON_LIBS)
203
204dnl ---------------------------------------------------------------------------
205dnl Requirements for the setup tool
206dnl ---------------------------------------------------------------------------
207PKG_CHECK_MODULES(NOTIFICATION_CAPPLET, glib-2.0 >= $REQ_GLIB_VERSION gio-2.0 >= $REQ_GLIB_VERSION gtk+-3.0 >= $GTK_REQUIRED libnotify)
208AC_SUBST(NOTIFICATION_CAPPLET_CFLAGS)
209AC_SUBST(NOTIFICATION_CAPPLET_LIBS)
210
211gdk_modules="
212	gdk-3.0 >= $GTK_REQUIRED, \
213	gdk-pixbuf-2.0 >= 2.22.0 \
214"
215PKG_CHECK_MODULES(GDK, $gdk_modules, have_gdk=yes,
216[
217	have_gdk=no
218	AC_MSG_WARN("Some test apps will not be built")
219])
220
221AM_CONDITIONAL(HAVE_GDK, test "x$have_gdk" = "xyes")
222
223AC_SUBST(GDK_CFLAGS)
224AC_SUBST(GDK_LIBS)
225
226dnl
227dnl Enable gsettings schema macros
228dnl
229
230GLIB_GSETTINGS
231
232dnl
233dnl Check the D-BUS version.
234dnl
235
236AC_MSG_CHECKING([dbus version])
237DBUS_VERSION=`$PKG_CONFIG --modversion dbus-1`
238DBUS_MAJOR_VER=`echo $DBUS_VERSION | cut -d. -f 1`
239DBUS_MINOR_VER=`echo $DBUS_VERSION | cut -d. -f 2`
240DBUS_MICRO_VER=`echo $DBUS_VERSION | cut -d. -f 3`
241
242AC_MSG_RESULT($DBUS_VERSION)
243AC_DEFINE_UNQUOTED(DBUS_MAJOR_VER, $DBUS_MAJOR_VER, [D-BUS major version.])
244AC_DEFINE_UNQUOTED(DBUS_MINOR_VER, $DBUS_MINOR_VER, [D-BUS minor version.])
245AC_DEFINE_UNQUOTED(DBUS_MICRO_VER, $DBUS_MICRO_VER, [D-BUS micro version.])
246
247AC_DEFINE_UNQUOTED(DBUS_API_SUBJECT_TO_CHANGE, ,DBUS API is subject to change)
248
249AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
250AS_AC_EXPAND(LIBDIR, $libdir)
251AS_AC_EXPAND(DATADIR, $datadir)
252AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
253
254AC_ARG_WITH(dbus-sys, [  --with-dbus-sys=<dir>   where D-BUS system.d directory is])
255AC_ARG_WITH(dbus-services, [  --with-dbus-services=<dir>   where D-BUS services directory is])
256
257if ! test -z "$with_dbus_sys" ; then
258	DBUS_SYS_DIR="$with_dbus_sys"
259else
260	DBUS_SYS_DIR="$SYSCONFDIR/dbus-1/system.d"
261fi
262
263if ! test -z "$with_dbus_services" ; then
264	DBUS_SERVICES_DIR="$with_dbus_services"
265else
266	DBUS_SERVICES_DIR="$DATADIR/dbus-1/services"
267fi
268
269AC_SUBST(DBUS_SYS_DIR)
270AC_SUBST(DBUS_SERVICES_DIR)
271AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, "$DBUS_SYS_DIR", [Where system.d dir for DBUS is])
272AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
273
274dnl ---------------------------------------------------------------------------
275dnl Enabel/disable icon cache generation
276dnl ---------------------------------------------------------------------------
277AC_ARG_ENABLE(icon-update, AC_HELP_STRING([--disable-icon-update],
278                                        [Disable icon cache update]))
279if (test "$enable_icon_update" != no); then
280        AC_PATH_PROG(UPDATE_ICON_CACHE, [gtk-update-icon-cache])
281fi
282AM_CONDITIONAL([ICON_UPDATE], [test -n "$UPDATE_ICON_CACHE"])
283
284AC_CONFIG_FILES([
285Makefile
286data/Makefile
287data/org.freedesktop.mate.Notifications.service
288data/org.mate.applets.MateNotificationApplet.desktop.in
289data/org.mate.NotificationDaemon.gschema.xml
290data/org.mate.panel.applet.MateNotificationAppletFactory.service
291po/Makefile.in
292src/Makefile
293src/daemon/Makefile
294src/capplet/Makefile
295src/themes/Makefile
296src/themes/coco/Makefile
297src/themes/nodoka/Makefile
298src/themes/slider/Makefile
299src/themes/standard/Makefile
300])
301
302AC_OUTPUT
303
304echo "
305			$PACKAGE_NAME $PACKAGE_VERSION
306			================================
307
308	prefix:                   ${prefix}
309	exec_prefix:              ${exec_prefix}
310	bindir:                   ${bindir}
311	datadir:                  ${datadir}
312	source code location:     ${srcdir}
313	compiler:                 ${CC}
314	cflags:	                  ${CFLAGS}
315	warning flags:            ${WARN_CFLAGS}
316	Wayland support:          ${have_wayland}
317	X11 support:              ${have_x11}
318	Native Language support:  ${USE_NLS}
319
320	dbus-1 system.d           $DBUS_SYS_DIR
321	dbus-1 services           $DBUS_SERVICES_DIR
322
323"
324