summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 3e165076c3ebf58546896b2eed725c96bbde7c90 (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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
m4_define(gnome_platform, 3)
m4_define(gnome_minor, 30)
m4_define(gnome_micro, 1)
m4_define(gnome_sub,)
dnl gnome_sub is an optional sub-version which will not be advertised to the user
dnl It allows to release a 2.30.1.1 which is just a better 2.30.1
dnl Leave empty if not needed

m4_define(gnome_version, [gnome_platform.gnome_minor.gnome_micro]m4_ifval(gnome_sub, .gnome_sub)),

AC_INIT([gnome-desktop], gnome_version,
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-desktop])
AX_IS_RELEASE([always])
AC_CONFIG_SRCDIR([libgnome-desktop])

AM_INIT_AUTOMAKE([1.11.2 foreign no-dist-gzip dist-xz tar-ustar])
AM_MAINTAINER_MODE([enable])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_CONFIG_HEADERS([config.h])

AC_CONFIG_MACRO_DIR([m4])

# Before making a release, the LT_VERSION string should be modified.
# The string is of the form C:R:A.
# - If interfaces have been changed or added, but binary compatibility has
#   been preserved, change to C+1:0:A+1
# - If binary compatibility has been broken (eg removed or changed interfaces)
#   change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A

LT_VERSION=17:3:0
AC_SUBST(LT_VERSION)

LT_PREREQ([2.2.6])
LT_INIT([dlopen win32-dll disable-static])

AC_PROG_CC
PKG_PROG_PKG_CONFIG

GNOME_PLATFORM=gnome_platform
GNOME_MINOR=gnome_minor
GNOME_MICRO=gnome_micro
GNOME_DISTRIBUTOR="GNOME.Org"
GNOME_DATE=`date +"%Y-%m-%d"`

AC_ARG_WITH(gnome_distributor, [ --with-gnome-distributor=DISTRIBUTOR Specify name of GNOME distributor])

if test "x$with_gnome_distributor" != x ; then
 GNOME_DISTRIBUTOR=$with_gnome_distributor
fi

AC_ARG_ENABLE([date-in-gnome-version],
 [AS_HELP_STRING([--disable-date-in-gnome-version],[do not put the build date in gnome-version.xml])],
 [],[enable_date_in_gnome_version=yes])
if test "$enable_date_in_gnome_version" = "no"; then
 GNOME_DATE=
 GNOME_DATE_COMMENT_START="<!--"
 GNOME_DATE_COMMENT_END="-->"
else
 GNOME_DATE_COMMENT_START=
 GNOME_DATE_COMMENT_END=
fi

AC_SUBST(GNOME_PLATFORM)
AC_SUBST(GNOME_MINOR)
AC_SUBST(GNOME_MICRO)
AC_SUBST(GNOME_DISTRIBUTOR)
AC_SUBST(GNOME_DATE)
AC_SUBST(GNOME_DATE_COMMENT_START)
AC_SUBST(GNOME_DATE_COMMENT_END)

AX_COMPILER_FLAGS([WARN_CFLAGS],[WARN_LDFLAGS])

# Should we build shared desktop docs? Useful for people who
# need to build two gnome-desktop using two different versions of GTK+
AC_ARG_ENABLE([desktop-docs],
	[AS_HELP_STRING([--disable-desktop-docs],[do not build desktop-wide help documents])],
	[],[enable_desktop_docs=yes])
AM_CONDITIONAL(DESKTOP_DOCS_ENABLED, test "x$enable_desktop_docs" = "xyes")

# Should we build debug tools? Useful to bundle the gnome-desktop library
# e.g. with a xdg-app runtime
AC_ARG_ENABLE([debug-tools],
        [AS_HELP_STRING([--disable-debug-tools],[do not build debug tools])],
        [],[enable_debug_tools=yes])
AM_CONDITIONAL(DEBUG_TOOLS_ENABLED, test "x$enable_debug_tools" = "xyes")

GLIB_TESTS

dnl If you add a version number here, you *must* add an AC_SUBST line for
dnl it too, or it will never make it into the spec file!

GDK_PIXBUF_REQUIRED=2.36.5
GTK_REQUIRED=3.3.6
GLIB_REQUIRED=2.53.0
XRANDR_REQUIRED=1.3
GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=3.27.0
XEXT_REQUIRED=1.1

AC_SUBST(GTK_REQUIRED)
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GDK_PIXBUF_REQUIRED)
AC_SUBST(XRANDR_REQUIRED)
AC_SUBST(XEXT_REQUIRED)

LT_LIB_M
AC_SUBST(LIBM)

AC_CHECK_LIB([rt], [clock_gettime], [LIBRT="-lrt"], [LIBRT=""])
AC_SUBST(LIBRT)

AC_CHECK_FUNCS([openat])

dnl we need x11 for GnomeBG

PKG_CHECK_MODULES(XLIB, x11,
    X11_PACKAGE=x11,
    [X11_PACKAGE=
     AC_PATH_XTRA
     if test "x$no_x" = xyes; then
       AC_MSG_ERROR(["no (requires X development libraries)"])
     else
       XLIB_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
       XLIB_CFLAGS=$X_CFLAGS
     fi])
AC_SUBST(X11_PACKAGE)
AC_SUBST(XLIB_CFLAGS)
AC_SUBST(XLIB_LIBS)

dnl ---------------------------------------------------------------------------
dnl - hwdb for pnp IDs (default enabled)
dnl ---------------------------------------------------------------------------
UDEV_PKG=""
AC_ARG_ENABLE(udev, AS_HELP_STRING([--disable-udev],[Disable udev support]), enable_udev=$enableval)
if test x$enable_udev != xno; then
	PKG_CHECK_MODULES(UDEV, libudev, have_udev="yes", have_udev="no")
	if test "x$have_udev" = "xyes"; then
		AC_DEFINE(HAVE_UDEV, 1, [define if udev is available])
		UDEV_PKG="libudev"
	else
		if test x$enable_udev = xyes; then
			AC_MSG_ERROR([udev enabled but not found])
		fi
	fi
else
	have_udev=no
fi

SECCOMP_PKG=""
enable_seccomp="no"
dnl Check for bubblewrap compatible platform
case $host_os in
  linux*)
    case $host_cpu in
      alpha|ia64|m68k|sh4|sparc64)
        enable_seccomp="no (not available on this architecture)"
        AC_MSG_WARN("seccomp not available on this architecture")
        ;;
      *)
        PKG_CHECK_MODULES(LIBSECCOMP, [libseccomp])
        SECCOMP_PKG="libseccomp"
        AC_DEFINE([ENABLE_SECCOMP], [1], [Define if using seccomp])
        enable_seccomp="yes"
        ;;
    esac
    AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define to include GNU extensions])
    AC_DEFINE_UNQUOTED(HAVE_BWRAP, 1, [Define to 1 if Bubblewrap support is available])
    AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "$prefix", [Path to library install prefix])
    ;;
esac

dnl pkg-config dependency checks

PKG_CHECK_MODULES(GNOME_DESKTOP, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED
                                 gtk+-3.0 >= $GTK_REQUIRED
                                 glib-2.0 >= $GLIB_REQUIRED
                                 gio-2.0 >= $GLIB_REQUIRED
                                 gio-unix-2.0 >= $GLIB_REQUIRED
                                 gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
                                 xkeyboard-config
                                 iso-codes
                                 $UDEV_PKG $SECCOMP_PKG)

XKB_BASE=$($PKG_CONFIG --variable xkb_base xkeyboard-config)
AC_SUBST(XKB_BASE)

ISO_CODES_PREFIX=$($PKG_CONFIG --variable prefix iso-codes)
AC_SUBST(ISO_CODES_PREFIX)

AC_CACHE_CHECK(for timerfd_create(2) system call,
    gnome_cv_timerfd,AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <sys/timerfd.h>
#include <unistd.h>
],[
int
main (void)
{
  timerfd_create (CLOCK_MONOTONIC, TFD_CLOEXEC);
  return 0;
}
])],gnome_cv_timerfd=yes,gnome_cv_timerfd=no))
if test x"$gnome_cv_timerfd" = x"yes"; then
  AC_DEFINE(HAVE_TIMERFD, 1, [we have the timerfd_create(2) system call])
fi

dnl Documentation support

YELP_HELP_INIT

dnl Language Support
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.8])

GETTEXT_PACKAGE=gnome-desktop-3.0
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
		   [The gettext translation domain])
AC_SUBST(GETTEXT_PACKAGE)

GOBJECT_INTROSPECTION_CHECK([0.9.7])

# check for gtk-doc
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])

AC_CONFIG_FILES([
Makefile
libgnome-desktop/Makefile
libgnome-desktop/gnome-desktop-3.0.pc
libgnome-desktop/gnome-desktop-3.0-uninstalled.pc
docs/Makefile
docs/reference/Makefile
docs/reference/gnome-desktop3/Makefile
gnome-version.xml
po/Makefile.in
desktop-docs/Makefile
desktop-docs/fdl/Makefile
desktop-docs/gpl/Makefile
desktop-docs/lgpl/Makefile
tests/Makefile
])

AC_OUTPUT

dnl ---------------------------------------------------------------------------
dnl - Show summary
dnl ---------------------------------------------------------------------------

echo "
              gnome-desktop $VERSION
              `echo gnome-desktop $VERSION | sed "s/./=/g"`

        prefix:                       ${prefix}
        exec_prefix:                  ${exec_prefix}
        libdir:                       ${libdir}
        bindir:                       ${bindir}
        sbindir:                      ${sbindir}
        sysconfdir:                   ${sysconfdir}
        localstatedir:                ${localstatedir}
        datadir:                      ${datadir}
        source code location:         ${srcdir}
        compiler:                     ${CC}
        cflags:                       ${CFLAGS}
        Maintainer mode:              ${USE_MAINTAINER_MODE}

        GNOME Distributor:            ${GNOME_DISTRIBUTOR}
        Build desktop-wide docs:      ${enable_desktop_docs}
        Build debug tools:            ${enable_debug_tools}
        Date in gnome-version.xml:    ${enable_date_in_gnome_version}
        Build gtk-doc documentation:  ${enable_gtk_doc}
        Build with udev support:      ${enable_udev}
        Build with seccomp support:   ${enable_seccomp}

"