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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
|
m4_define([gt_version_major],[3])
m4_define([gt_version_minor],[27])
m4_define([gt_version_micro],[5])
m4_define([gt_version_extra],[])
m4_define([gt_version],[gt_version_major().gt_version_minor().gt_version_micro()gt_version_extra])
m4_define([gt_api_version],[0])
AC_INIT([GNOME Terminal],[gt_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-terminal],[gnome-terminal])
AC_CONFIG_SRCDIR([src/terminal.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-bzip2])
AC_USE_SYSTEM_EXTENSIONS
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
GETTEXT_PACKAGE=gnome-terminal
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
if test -z "$enable_maintainer_mode"; then
enable_maintainer_mode=yes
fi
AM_MAINTAINER_MODE([enable])
PKG_PROG_PKG_CONFIG
AC_PROG_MKDIR_P
AC_PROG_CC_C99
AC_ISC_POSIX
AC_HEADER_STDC
AM_PROG_LIBTOOL
IT_PROG_INTLTOOL([0.50.0])
AM_GLIB_GNU_GETTEXT
AX_PTHREAD([],[AC_MSG_ERROR([pthreads are required])])
GLIB_REQUIRED=2.42.0
GLIB_MIN_REQUIRED=2.42
GLIB_MAX_ALLOWED=2.50
GIO_REQUIRED=2.34.0
GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=0.1.0
DCONF_REQUIRED=0.14.0
PCRE2_REQUIRED=10.00
AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=3.0],[which gtk+ version to compile against (default: 3.0)])],
[case "$with_gtk" in
3.0) ;;
2.0) AC_MSG_ERROR([unsupported gtk version $with_gtk specified]) ;;
*) AC_MSG_ERROR([invalid gtk version $with_gtk specified]) ;;
esac],
[with_gtk=3.0])
AC_MSG_RESULT([$with_gtk])
case "$with_gtk" in
3.0) GTK_API_VERSION=3.0
GTK_REQUIRED=3.12.0
GTK_MIN_REQUIRED=3.8
GTK_MAX_ALLOWED=3.20
VTE_API_VERSION=2.91
VTE_REQUIRED=0.51.3
;;
esac
#
PLATFORM_DEPS=
for target in $($PKG_CONFIG --variable targets gdk-$GTK_API_VERSION); do
case "$target" in
x11) PLATFORM_DEPS="$PLATFORM_DEPS x11" ;;
broadway) ;;
wayland) ;;
win32|quartz) AC_MSG_WARN([unsupported GDK backend $target]) ;;
*) AC_MSG_WARN([unknown GDK backend $target]) ;;
esac
done
# pkg-config checks
PKG_CHECK_MODULES([TERM],
[vte-$VTE_API_VERSION >= $VTE_REQUIRED
glib-2.0 >= $GLIB_REQUIRED
gio-2.0 >= $GIO_REQUIRED
gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
dconf >= $DCONF_REQUIRED
uuid
libpcre2-8 >= $PCRE2_REQUIRED
$PLATFORM_DEPS])
# ****
# DBus
# ****
AC_ARG_WITH([dbus-interface-dir],
[AS_HELP_STRING([--with-dbus-interface-dir=PATH],[dbus interace file directory])],
[dbusinterfacedir="$withval"],
[dbusinterfacedir='${datadir}/dbus-1/interfaces'])
AC_SUBST([dbusinterfacedir])
AC_ARG_WITH([dbus-service-dir],
[AS_HELP_STRING([--with-dbus-service-dir=PATH],[dbus service file directory])],
[dbusservicedir="$withval"],
[dbusservicedir='${datadir}/dbus-1/services'])
AC_SUBST([dbusservicedir])
# *********
# GSettings
# *********
GLIB_GSETTINGS
# *************************
# GConf-GSettings Migration
# *************************
GCONF_REQUIRED=2.31.3
AC_MSG_CHECKING([whether to build the GConf to GSettings migrator])
AC_ARG_ENABLE([migration],
[AS_HELP_STRING([--disable-migration],[Disable prefs migration from GConf to GSettings])],
[],[enable_migration=yes])
AC_MSG_RESULT([$enable_migration])
if test "$enable_migration" = "yes"; then
PKG_CHECK_MODULES([MIGRATOR],[
gio-2.0 >= $GIO_REQUIRED
vte-$VTE_API_VERSION >= $VTE_REQUIRED
gconf-2.0 >= $GCONF_REQUIRED
dconf >= $DCONF_REQUIRED
uuid])
AC_DEFINE([ENABLE_MIGRATION],[1],[Define to 1 to enable prefs migration from GConf to GSettings])
fi
AM_CONDITIONAL([ENABLE_MIGRATION],[test "$enable_migration" = "yes"])
# ***********
# Build tools
# ***********
AC_ARG_VAR([GLIB_GENMARSHAL],[the glib-genmarschal programme])
if test -z "$GLIB_GENMARSHAL"; then
AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal],[])
if test -z "$GLIB_GENMARSHAL"; then
AC_MSG_ERROR([glib-genmarshal not found])
fi
fi
AC_ARG_VAR([GLIB_MKENUMS],[the glib-mkenums programme])
if test -z "$GLIB_MKENUMS"; then
AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums],[])
if test -z "$GLIB_MKENUMS"; then
AC_MSG_ERROR([glib-mkenums not found])
fi
fi
AC_ARG_VAR([GLIB_COMPILE_RESOURCES],[the glib-compile-resources programme])
if test -z "$GLIB_COMPILE_RESOURCES"; then
AC_PATH_PROG([GLIB_COMPILE_RESOURCES],[glib-compile-resources],[])
if test -z "$GLIB_COMPILE_RESOURCES"; then
AC_MSG_ERROR([glib-compile-resources not found])
fi
fi
AC_ARG_VAR([GDBUS_CODEGEN],[the gdbus-codegen programme])
if test -z "$GDBUS_CODEGEN"; then
AC_PATH_PROG([GDBUS_CODEGEN],[gdbus-codegen],[])
if test -z "$GDBUS_CODEGEN"; then
AC_MSG_ERROR([gdbus-codegen not found])
fi
fi
AC_ARG_VAR([XMLLINT],[the xmllint programme])
if test -z "$XMLLINT"; then
AC_PATH_PROG([XMLLINT],[xmllint],[])
if test -z "$XMLLINT"; then
AC_MSG_ERROR([xmllint not found])
fi
fi
AC_ARG_VAR([DESKTOP_FILE_VALIDATE],[the desktop-file-validate programme])
if test -z "$DESKTOP_FILE_VALIDATE"; then
AC_PATH_PROG([DESKTOP_FILE_VALIDATE],[desktop-file-validate],[])
if test -z "$DESKTOP_FILE_VALIDATE"; then
AC_MSG_ERROR([desktop-file-validate not found])
fi
fi
# ***************************
# GNOME Shell search provider
# ***************************
AC_MSG_CHECKING([whether to build the gnome-shell search provider])
AC_ARG_ENABLE([search-provider],
[AS_HELP_STRING([--disable-search-provider],[Disable gnome-shell search provider])],
[],[enable_search_provider=yes])
AC_MSG_RESULT([$enable_search_provider])
if test "$enable_search_provider" = "yes"; then
AC_CHECK_FILE([$(eval echo $(eval echo $(eval echo ${dbusinterfacedir})))/org.gnome.ShellSearchProvider2.xml],[],
[AC_MSG_ERROR([gnome-shell search provider requested but interface definition file not found])])
AC_DEFINE([ENABLE_SEARCH_PROVIDER],[1],[Define to enable gnome-shell search provider])
fi
AM_CONDITIONAL([ENABLE_SEARCH_PROVIDER],[test "$enable_search_provider" = "yes"])
# ******************
# Nautilus extension
# ******************
AC_ARG_WITH([nautilus-extension],
[AS_HELP_STRING([--without-nautilus-extension],[Disable nautilus extension])],
[],
[with_nautilus_extension=yes])
if test "$with_nautilus_extension" = "yes"; then
NAUTILUS_REQUIRED=3.0.0
PKG_CHECK_MODULES([NAUTILUS],[
libnautilus-extension >= $NAUTILUS_REQUIRED
gio-2.0
gio-unix-2.0])
AC_ARG_WITH([nautilus-dir],
[AS_HELP_STRING([--with-nautilus-dir=PATH],[Nautilus extensions directory])],
[nautilusextensiondir="$withval"],
[nautilusextensiondir='${libdir}/nautilus/extensions-3.0'])
AC_SUBST([nautilusextensiondir])
fi
AM_CONDITIONAL([WITH_NAUTILUS_EXTENSION],[test "$with_nautilus_extension" = "yes"])
# ***********
# Compilation
# ***********
WARN_CFLAGS=
CC_CHECK_FLAGS_APPEND([WARN_CFLAGS],[CFLAGS],[ \
-pipe \
-Waggregate-return \
-Wall \
-Wcast-align \
-Wendif-labels \
"-Werror=format=2 -Werror=format-nonliteral -Werror=format-security" \
-Werror=implicit-function-declaration \
-Werror=init-self \
-Werror=missing-include-dirs \
-Werror=missing-prototypes \
-Werror=pointer-arith \
-Wextra \
-Wfloat-equal \
-Wimplicit \
-Wlogical-op \
-Wmissing-declarations \
-Wmissing-include-dirs \
-Wmissing-format-attribute \
-Wmissing-noreturn \
-Wnested-externs \
-Wno-missing-field-initializers \
-Wno-switch-enum \
-Wno-unused-parameter \
-Wold-style-definition \
-Wpacked \
-Wshadow \
-Wsign-compare \
-Wstrict-aliasing=2 \
-Wstrict-prototypes \
-Wundef \
-Wuninitialized \
-Wunsafe-loop-optimizations \
-Wwrite-strings \
-Wformat-signedness \
-fno-common \
-fdiagnostics-show-option \
-fno-strict-aliasing \
-fvisibility=hidden \
-fstack-protector \
-fstack-protector-strong \
])
# *********
# Debugging
# *********
AC_MSG_CHECKING([whether to enable special debug support])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],[Enable special debug support])],
[],[enable_debug=no])
AC_MSG_RESULT([$enable_debug])
if test "$enable_debug" = "yes"; then
AC_DEFINE([ENABLE_DEBUG],[1],[Define to 1 to enable special debug support])
fi
# *************
# Documentation
# *************
YELP_HELP_INIT([no-lc-media-links no-lc-dist])
# ****************************
AC_SUBST([TERMINAL_MAJOR_VERSION],[gt_version_major])
AC_SUBST([TERMINAL_MINOR_VERSION],[gt_version_minor])
AC_SUBST([TERMINAL_MICRO_VERSION],[gt_version_micro])
AC_SUBST([TERMINAL_API_VERSION],[gt_api_version])
AC_SUBST([GTK_API_VERSION])
AC_SUBST([WARN_CFLAGS])
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_DEFINE_UNQUOTED([GLIB_VERSION_MIN_REQUIRED],[G_ENCODE_VERSION($(echo $GLIB_MIN_REQUIRED | tr . ,))],[Define the min required glib version])
AC_DEFINE_UNQUOTED([GLIB_VERSION_MAX_ALLOWED],[G_ENCODE_VERSION($(echo $GLIB_MAX_ALLOWED | tr . ,))],[Define the max allowed glib version])
AC_DEFINE_UNQUOTED([GDK_VERSION_MIN_REQUIRED],[G_ENCODE_VERSION($(echo $GTK_MIN_REQUIRED | tr . ,))],[Define the min required gtk version])
AC_DEFINE_UNQUOTED([GDK_VERSION_MAX_ALLOWED],[G_ENCODE_VERSION($(echo $GTK_MAX_ALLOWED | tr . ,))],[Define the max allowed gtk version])
# ****************************
AC_CONFIG_FILES([
Makefile
org.gnome.Terminal.desktop.in
src/Makefile
src/terminal-version.h
help/Makefile
po/Makefile.in
])
AC_OUTPUT
# ****************************
echo "
gnome-terminal-$VERSION:
prefix: ${prefix}
source code location: ${srcdir}
compiler: ${CC}
gterminal: ${enable_gterminal}
DBus interface dir: ${dbusinterfacedir}
DBus service dir: ${dbusservicedir}
Debug: ${enable_debug}
Prefs migration: ${enable_migration}
Search provider: ${enable_search_provider}
Nautilus extension: ${with_nautilus_extension}
Nautilus extension dir: ${nautilusextensiondir}
"
|