configure.ac 5.49 KB
Newer Older
1
2
3
4
5
6
7
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

# Init Autoconf
AC_PREREQ([2.64])

AC_INIT([LaTeXila],
Sébastien Wilmet's avatar
Sébastien Wilmet committed
8
	[3.26.1],
9
	[https://bugzilla.gnome.org/enter_bug.cgi?product=latexila],
10
	[latexila],
11
	[https://wiki.gnome.org/Apps/LaTeXila])
12

Sébastien Wilmet's avatar
Sébastien Wilmet committed
13
14
15
AX_REQUIRE_DEFINED([AX_IS_RELEASE])
AX_IS_RELEASE([git-directory])

16
AC_CONFIG_SRCDIR([src/liblatexila/latexila.h])
17
18
19
20
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

# Init Automake
21
22
# gnu strictness to generate the INSTALL file.
AM_INIT_AUTOMAKE([1.14 gnu tar-ustar no-dist-gzip dist-xz -Wno-portability])
23
24
25
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])

26
27
28
29
# Init Libtool
LT_PREREQ([2.2])
LT_INIT

30
# Required dependencies versions
31
# Update also the --target-glib option in src/Makefile.am.
32
GLIB_REQUIRED_VERSION="2.50"
33
GTK_REQUIRED_VERSION="3.22"
Sébastien Wilmet's avatar
Sébastien Wilmet committed
34
GTKSOURCEVIEW_REQUIRED_VERSION="3.24"
Sébastien Wilmet's avatar
Sébastien Wilmet committed
35
TEPL_REQUIRED_VERSION="3.0"
Sébastien Wilmet's avatar
Sébastien Wilmet committed
36
GSPELL_REQUIRED_VERSION="1.0"
37
VALA_REQUIRED_VERSION="0.34"
38
GEE_REQUIRED_VERSION="0.10"
39
40
41
42

AC_SUBST([GLIB_REQUIRED_VERSION])
AC_SUBST([GTK_REQUIRED_VERSION])
AC_SUBST([GTKSOURCEVIEW_REQUIRED_VERSION])
43
AC_SUBST([TEPL_REQUIRED_VERSION])
44
AC_SUBST([GSPELL_REQUIRED_VERSION])
45
AC_SUBST([VALA_REQUIRED_VERSION])
Sébastien Wilmet's avatar
Sébastien Wilmet committed
46
AC_SUBST([GEE_REQUIRED_VERSION])
47

48
# Some directories
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

# adl_RECURSIVE_EVAL(VALUE, RESULT)
# =================================
# Interpolate the VALUE in loop until it doesn't change,
# and set the result to $RESULT.
# WARNING: It's easy to get an infinite loop with some unsane input.
# For example ${datadir} becomes ${datarootdir}, and then ${prefix}/share, and
# finally ${prefix} is replaced by the prefix.
AC_DEFUN([adl_RECURSIVE_EVAL],
[_lcl_receval="$1"
$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
     _lcl_receval_old=''
     while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
       _lcl_receval_old="[$]_lcl_receval"
       eval _lcl_receval="\"[$]_lcl_receval\""
     done
     echo "[$]_lcl_receval")`])

adl_RECURSIVE_EVAL(["${datadir}/latexila"], [DATA_DIR])
69
AC_DEFINE_UNQUOTED([DATA_DIR],
70
                   ["${DATA_DIR}"],
71
72
		   [latexila data directory])

73
adl_RECURSIVE_EVAL(["${datadir}/icons/hicolor"], [ICONS_DIR])
74
AC_DEFINE_UNQUOTED([ICONS_DIR],
75
                   ["${ICONS_DIR}"],
76
77
		   [icons directory])

78
79
80
81
# Checks for programs
AC_PROG_CC
AC_PROG_INSTALL
AC_PATH_PROG([GLIB_COMPILE_RESOURCES], [glib-compile-resources])
82
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
Sébastien Wilmet's avatar
Sébastien Wilmet committed
83
AC_PATH_PROG([GDBUS_CODEGEN], [gdbus-codegen])
84
AM_PROG_VALAC([${VALA_REQUIRED_VERSION}],
85
	      [found_vala=true]
86
	      [found_vala=false])
87

88
89
AX_REQUIRE_DEFINED([PKG_PROG_PKG_CONFIG])
PKG_PROG_PKG_CONFIG
90

91
92
93
94
95
96
97
# Checks for dependencies
AX_REQUIRE_DEFINED([PKG_CHECK_MODULES])
PKG_CHECK_MODULES([LATEXILA], [
	glib-2.0 >= ${GLIB_REQUIRED_VERSION}
	gio-2.0 >= ${GLIB_REQUIRED_VERSION}
	gtk+-3.0 >= ${GTK_REQUIRED_VERSION}
	gtksourceview-3.0 >= ${GTKSOURCEVIEW_REQUIRED_VERSION}
98
	tepl-3 >= ${TEPL_REQUIRED_VERSION}
99
100
	gspell-1 >= ${GSPELL_REQUIRED_VERSION}
	gee-0.8 >= ${GEE_REQUIRED_VERSION}
101
	gsettings-desktop-schemas
102
])
103
104

# Native Language Support
105
AX_REQUIRE_DEFINED([IT_PROG_INTLTOOL])
106
IT_PROG_INTLTOOL([0.50.1])
107
108
109
110

GETTEXT_PACKAGE=${PACKAGE_TARNAME}
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
111
112
		   ["${GETTEXT_PACKAGE}"],
		   [The domain to use with gettext])
113

114
adl_RECURSIVE_EVAL(["${localedir}"], [LOCALE_DIR])
115
AC_DEFINE_UNQUOTED([LOCALE_DIR],
116
		   ["${LOCALE_DIR}"],
117
118
		   [locale directory])

119
120
121
122
123
# Compile warnings. There can be deprecation warnings at any time, so disable
# -Werror by default with the [yes] argument.
AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS])
AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [yes])

124
# Misc
125
AX_REQUIRE_DEFINED([YELP_HELP_INIT])
126
YELP_HELP_INIT
127
128

AX_REQUIRE_DEFINED([GLIB_GSETTINGS])
129
GLIB_GSETTINGS
130
131

AX_REQUIRE_DEFINED([GOBJECT_INTROSPECTION_CHECK])
132
GOBJECT_INTROSPECTION_CHECK([1.30.0])
133
134

AX_REQUIRE_DEFINED([VAPIGEN_CHECK])
135
VAPIGEN_CHECK
136
137

AX_REQUIRE_DEFINED([GTK_DOC_CHECK])
138
GTK_DOC_CHECK([1.14], [--flavour no-tmpl])
139

140
141
AX_REQUIRE_DEFINED([AX_CODE_COVERAGE])
AX_CODE_COVERAGE
142

Sébastien Wilmet's avatar
Sébastien Wilmet committed
143
144
145
AX_REQUIRE_DEFINED([APPSTREAM_XML])
APPSTREAM_XML

146
# Generate files
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
AC_CONFIG_FILES([
	Makefile
	data/Makefile
	data/org.gnome.latexila.desktop.in
	data/org.gnome.latexila.gschema.xml
	data/build_tools/Makefile
	data/icons/Makefile
	data/icons/16x16/Makefile
	data/icons/16x16/apps/Makefile
	data/icons/22x22/Makefile
	data/icons/22x22/apps/Makefile
	data/icons/24x24/Makefile
	data/icons/24x24/apps/Makefile
	data/icons/32x32/Makefile
	data/icons/32x32/apps/Makefile
	data/icons/48x48/Makefile
	data/icons/48x48/apps/Makefile
	data/icons/128x128/Makefile
	data/icons/128x128/apps/Makefile
	data/icons/256x256/Makefile
	data/icons/256x256/apps/Makefile
	data/icons/scalable/Makefile
	data/icons/scalable/apps/Makefile
	data/images/Makefile
	data/images/app/Makefile
	data/templates/Makefile
	docs/Makefile
	docs/reference/Makefile
	help/Makefile
	man/Makefile
	po/Makefile.in
	src/Makefile
	src/evince/Makefile
	src/liblatexila/Makefile
	src/ui/Makefile
	tests/Makefile
])
184
185
186

AC_OUTPUT

187
if ${found_vala}
188
189
190
191
192
193
then
	vala_compiler="valac >= ${VALA_REQUIRED_VERSION} not found."
else
	vala_compiler=${VALAC}
fi

194
195
196
197
# Print a summary of the configuration
echo "
Configuration:

198
	${PACKAGE_NAME} version ${PACKAGE_VERSION}
199

200
201
202
203
204
205
206
207
	Source code location:	${srcdir}
	Prefix:			${prefix}
	C compiler:		${CC}
	Vala compiler:		${vala_compiler}
	Dev documentation:	${enable_gtk_doc}
	GObject introspection:	${found_introspection}
	Generate latexila.vapi:	${enable_vala}
	Code coverage:		${enable_code_coverage}
208
"