summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 4f80d9427540f7d64232eed71ca1a1259611142c (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
# Copyright © 2000-2004 Marco Pesenti Gritti
# Copyright © 2003, 2004, 2005, 2006, 2007 Christian Persch
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

m4_define([epiphany_version_major],[3])
m4_define([epiphany_version_minor],[22])
m4_define([epiphany_version_micro],[6])
m4_define([epiphany_version],[epiphany_version_major.epiphany_version_minor.epiphany_version_micro])

AC_INIT([GNOME Web Browser],[epiphany_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany])
AX_IS_RELEASE([git-directory])

AC_PREREQ([2.59])

AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIRS([m4 libgd])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([configure.ac])

AC_SUBST([EPIPHANY_MAJOR],[epiphany_version_major.epiphany_version_minor])

AX_CHECK_ENABLE_DEBUG([yes])
AX_CODE_COVERAGE
AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [$ax_is_release], [],
	dnl TODO: Remove! These warnings should be fixed, not silenced.
	[-Wno-deprecated-declarations])

AC_PROG_CC

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

dnl Note: I want to enable subdir-objects here, to silence Automake's many
dnl warnings about not using it. But we can't do this until we require Automake
dnl 1.16 (which has not been released as of June 2015), due to GNU bug #13928.
dnl If Automake 2.0 comes out next instead of 1.16, we will need to bump our
dnl requirement straight to that, and then there is no need to use
dnl subdir-objects here as it will be implied. It is unfortunate that there is
dnl no way our build can be compatible with both future and older Automake, but
dnl it is a bug after all, and updating for bugfixes is just how software works.
dnl Note also: the issue is that a directory _literally_ named $(top_srcdir)
dnl will be created under embed/web-extension, and the build will fail due to
dnl misplaced .Plo files (used for dependency tracking).
AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip tar-ustar])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])

# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([dlopen disable-static])

AX_REQUIRE_DEFINED([APPSTREAM_XML])
APPSTREAM_XML

AX_REQUIRE_DEFINED([GLIB_GSETTINGS])
GLIB_GSETTINGS

AX_REQUIRE_DEFINED([YELP_HELP_INIT])
YELP_HELP_INIT

GLIB_REQUIRED=2.44.0
GTK_REQUIRED=3.19.1
LIBXML_REQUIRED=2.6.12
LIBXSLT_REQUIRED=1.1.7
WEBKIT_GTK_REQUIRED=2.14.2
LIBSOUP_REQUIRED=2.48.0
GNOME_DESKTOP_REQUIRED=2.91.2
LIBSECRET_REQUIRED=0.14
GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=0.0.1
LIBNOTIFY_REQUIRED=0.5.1
GCR_REQUIRED=3.5.5
AVAHI_REQUIRED=0.6.22

# Tests

AC_MSG_CHECKING([whether to build tests])
AC_ARG_ENABLE([tests],
	AS_HELP_STRING([--enable-tests],[Whether to build tests (default: yes)]),
	[], [enable_tests=yes])
AC_MSG_RESULT([$enable_tests])

AM_CONDITIONAL([ENABLE_TESTS],[test "$enable_tests" = "yes"])

LIBGD_INIT([_view-common static])

PKG_CHECK_MODULES([DEPENDENCIES], [
		  glib-2.0 >= $GLIB_REQUIRED
		  gthread-2.0
		  gio-unix-2.0 >= $GLIB_REQUIRED
		  gtk+-3.0 >= $GTK_REQUIRED
		  gtk+-unix-print-3.0 >= $GTK_REQUIRED
		  x11
		  libxml-2.0 >= $LIBXML_REQUIRED
		  libxslt >= $LIBXSLT_REQUIRED
		  webkit2gtk-4.0 >= $WEBKIT_GTK_REQUIRED
		  libsoup-2.4 >= $LIBSOUP_REQUIRED
		  libsecret-1 >= $LIBSECRET_REQUIRED
		  gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED
		  gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
		  libnotify >= $LIBNOTIFY_REQUIRED
		  sqlite3
		  gcr-3 >= $GCR_REQUIRED
		  avahi-gobject >= $AVAHI_REQUIRED
		  avahi-client >= $AVAHI_REQUIRED
		  ])

PKG_CHECK_MODULES([WEB_EXTENSION], [
                  webkit2gtk-web-extension-4.0 >= $WEBKIT_GTK_REQUIRED
                  libsecret-1 >= $LIBSECRET_REQUIRED
                  ])
AC_SUBST([WEB_EXTENSION_CFLAGS])
AC_SUBST([WEB_EXTENSION_LIBS])

# ******************
# Portability checks
# ******************

# for backtrace()
AC_CHECK_HEADERS([execinfo.h])
AC_SEARCH_LIBS([backtrace], [c execinfo])

# ***************
# Multimedia keys
# ***************

AC_CHECK_HEADERS([X11/XF86keysym.h])

# *******************************
# Internationalization
# ******************************* 

ISO_CODES_REQUIRED=0.35

PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED],
	[have_iso_codes=yes],[have_iso_codes=no])

if test "$have_iso_codes" = "yes"; then
	AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
	if $PKG_CONFIG --variable=domains iso-codes | grep -q 639 && \
	   $PKG_CONFIG --variable=domains iso-codes | grep -q 3166 ; then
		result=yes
	else
		result=no
		have_iso_codes=no
	fi
	AC_MSG_RESULT([$result])
fi

if test "$have_iso_codes" = "yes"; then
	AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
	AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package])
else
	AC_MSG_ERROR([iso-codes is required])
fi

IT_PROG_INTLTOOL([0.50.0])
AC_SUBST([GETTEXT_PACKAGE], [epiphany])

# ****************
# Distributor name
# ****************

AC_ARG_WITH([distributor-name],
  AS_HELP_STRING([--with-distributor-name=name],[Set the distributor name]),
  [LSB_DISTRIBUTOR="$withval"])

if test -z "$LSB_DISTRIBUTOR"; then
	AC_CHECK_PROGS([LSB_RELEASE], [lsb_release],)
	if test -n "$LSB_RELEASE"; then
		# Fallback on lsb_release if available
		LSB_DISTRIBUTOR=$($LSB_RELEASE -i -s)
	else
		# Fallback on the product name
		LSB_DISTRIBUTOR="Epiphany"
	fi
fi

AC_DEFINE_UNQUOTED([LSB_DISTRIBUTOR],["$LSB_DISTRIBUTOR"],[Distributor name])

# ************
# Output files
# ************

AC_CONFIG_FILES([
Makefile
data/Makefile
data/pages/Makefile
doc/Makefile
help/Makefile
libgd/Makefile
lib/Makefile
lib/egg/Makefile
lib/history/Makefile
lib/widgets/Makefile
embed/Makefile
embed/web-extension/Makefile
src/Makefile
src/bookmarks/Makefile
po/Makefile.in
tests/Makefile
tests/data/Makefile
])

AC_OUTPUT

# *************************************
# *************************************

echo "
Epiphany was configured with the following options:
        
	Source code location	   : $srcdir
	Compiler		   : $CC
	Prefix			   : $prefix
	Extra debugging support	   : $enable_debug
	Build tests		   : $enable_tests
	Code coverage		   : $enable_code_coverage
"