forked from flatpak/flatpak-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
230 lines (197 loc) · 7.67 KB
/
configure.ac
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
AC_PREREQ([2.63])
# Making releases:
# FLATPAK_MICRO_VERSION += 1;
# FLATPAK_INTERFACE_AGE += 1;
# FLATPAK_BINARY_AGE += 1;
# if any functions have been added, set FLATPAK_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set FLATPAK_BINARY_AGE and FLATPAK_INTERFACE_AGE to 0.
#
# in easier to understand terms:
#
# on the stable branch, interface age == micro
# on the unstable (ie master), interface age = 0
m4_define([flatpak_builder_major_version], [1])
m4_define([flatpak_builder_minor_version], [0])
m4_define([flatpak_builder_micro_version], [6])
m4_define([flatpak_builder_version],
[flatpak_builder_major_version.flatpak_builder_minor_version.flatpak_builder_micro_version])
AC_INIT([flatpak-builder],
[flatpak_builder_version],
[https://github.com/flatpak/flatpak-builder/issues],
[flatpak-builder],
[http://flatpak.org/])
GLIB_REQS=2.44
OSTREE_REQS=2017.14
FLATPAK_REQS=0.99.1
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
LIBGLNX_CONFIGURE
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CC_STDC
AC_DISABLE_STATIC
AC_CHECK_PROG([FLATPAK], [flatpak], [flatpak], [false])
if test "x$FLATPAK" = xfalse; then
AC_MSG_ERROR([You need flatpak installed])
else
FLATPAK_VERSION=`$FLATPAK --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
AX_COMPARE_VERSION([$FLATPAK_REQS],[gt],[$FLATPAK_VERSION],
[AC_MSG_ERROR([You need at least version $FLATPAK_REQS of flatpak, your version is $FLATPAK_VERSION])])
fi
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
AC_CONFIG_SRCDIR([src/builder-main.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.13.4 no-define no-dist-gzip dist-xz tar-ustar foreign subdir-objects])
AC_PROG_SED
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18.2])
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$PACKAGE", [gettext domain])
# Enable silent rules is available
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])
dnl This list is shared with https://github.com/ostreedev/ostree
CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\
-pipe \
-Wall \
-Werror=empty-body \
-Werror=strict-prototypes \
-Werror=missing-prototypes \
-Werror=implicit-function-declaration \
"-Werror=format=2 -Werror=format-security -Werror=format-nonliteral" \
-Werror=pointer-arith -Werror=init-self \
-Werror=missing-declarations \
-Werror=return-type \
-Werror=overflow \
-Werror=int-conversion \
-Werror=parenthesis \
-Werror=incompatible-pointer-types \
-Werror=misleading-indentation \
-Werror=missing-include-dirs \
])
AC_SUBST(WARN_CFLAGS)
AX_VALGRIND_CHECK
PKG_PROG_PKG_CONFIG([0.24])
AC_CHECK_FUNCS(fdwalk)
AC_CHECK_HEADER([sys/xattr.h], [], [AC_MSG_ERROR([You must have sys/xattr.h from glibc])])
AC_CHECK_HEADER([sys/capability.h], have_caps=yes, [AC_MSG_ERROR([sys/capability.h header not found])])
PKG_CHECK_MODULES(BASE, [glib-2.0 >= $GLIB_REQS gio-2.0 gio-unix-2.0 libsoup-2.4 ostree-1 >= $OSTREE_REQS json-glib-1.0 libxml-2.0 >= 2.4 libcurl])
dnl ************************
dnl *** check for libelf ***
dnl ************************
PKG_CHECK_MODULES([LIBELF], [libelf >= 0.8.12], [have_libelf=yes], [have_libelf=maybe])
AS_IF([ test $have_libelf = maybe ], [
save_LIBS=$LIBS
AC_CHECK_LIB([elf], [elf_begin], [:], [have_libelf=no])
AC_CHECK_LIB([elf], [elf_getshdrstrndx], [:], [have_libelf=no])
AC_CHECK_LIB([elf], [elf_getshdrnum], [:], [have_libelf=no])
AC_CHECK_HEADER([libelf.h], [:], [have_libelf=no])
LIBS=$save_LIBS
if test $have_libelf != no; then
LIBELF_LIBS=-lelf
have_libelf=yes
fi
])
if test x$have_libelf != xyes; then
AC_MSG_ERROR([libelf not found])
fi
dnl This only checks for the header, not the library.
AC_ARG_WITH([dwarf-header],
[AS_HELP_STRING([--with-dwarf-header],
[path containing dwarf.h])],
[AS_IF([test "x$with_dwarf_header" = "xno"],
[AC_MSG_WARN([either a path containing dwarf.h must be
provided, or it will be searched for in includedir])])],
[with_dwarf_header=yes])
# We need to check these exist, because otherwise -Werror=missing-include-dirs errors out
LIBDWARF_INCLUDES=
if test -d $(eval echo \"$includedir\")/libdwarf; then
LIBDWARF_INCLUDES="$LIBDWARF_INCLUDES -I$(eval echo \"$includedir\")/libdwarf"
fi
if test -d /usr/include/libdwarf; then
LIBDWARF_INCLUDES="$LIBDWARF_INCLUDES -I/usr/include/libdwarf"
fi
AS_IF([test "x$with_dwarf_header" = "xyes"],
[CPPFLAGS="$CPPFLAGS $LIBDWARF_INCLUDES"
AC_CHECK_HEADER([dwarf.h])
AS_IF([test "x$ac_cv_header_dwarf_h" != "xyes"],
[AC_MSG_ERROR([dwarf.h is required but was not found; locate it using --with-dwarf-header=/path/containing/header])])],
[CPPFLAGS="$CPPFLAGS -I$with_dwarf_header"
AC_CHECK_HEADER([dwarf.h])
AS_IF([test "x$ac_cv_header_dwarf_h" != "xyes"],
[AC_MSG_ERROR([dwarf.h is required but was not found])])])
AC_ARG_WITH([yaml],
[AS_HELP_STRING([--without-yaml],
[Disable YAML support [default=auto]])])
AS_IF([test "x$with_yaml" != "xno"],[
PKG_CHECK_MODULES(YAML, [yaml-0.1], [have_yaml=yes], [have_yaml=no])
], [have_yaml=no])
AS_IF([test "x$have_yaml" = "xno"],[
AS_IF([test "x$with_yaml" = "xyes"],
[AC_MSG_ERROR([yaml-0.1 was not found, which is needed for --with-yaml])])
], [AC_DEFINE([FLATPAK_BUILDER_ENABLE_YAML],[1],[Define if yaml supported])])
AC_ARG_ENABLE(documentation,
AC_HELP_STRING([--enable-documentation], [Build documentation]),,
enable_documentation=yes)
if test x$enable_documentation = xyes; then
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test x$XSLTPROC = x; then
AC_MSG_ERROR([xsltproc is required to build documentation])
fi
dnl check for DocBook DTD in the local catalog
JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],
[DocBook XML DTD V4.1.2], [have_docbook_dtd=yes], [have_docbook_dtd=no])
if test "$have_docbook_dtd" != yes; then
AC_MSG_ERROR([DocBook DTD is required for --enable-documentation])
fi
dnl check for DocBook XSL stylesheets in the local catalog
JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl],
[DocBook XSL Stylesheets], [have_docbook_style=yes],[have_docbook_style=no])
if test "$have_docbook_style" != yes; then
AC_MSG_ERROR([DocBook XSL Stylesheets are required for --enable-documentation])
fi
fi
AM_CONDITIONAL(BUILD_DOCUMENTATION, test x$enable_documentation = xyes)
AC_ARG_ENABLE(docbook-docs,
[AS_HELP_STRING([--enable-docbook-docs],[build documentation (requires xmlto)])],
enable_docbook_docs=$enableval, enable_docbook_docs=auto)
AC_PATH_PROG(XMLTO, xmlto, no)
AC_MSG_CHECKING([whether to build DocBook documentation])
if test x$XMLTO = xno ; then
have_docbook=no
else
have_docbook=yes
fi
if test x$enable_docbook_docs = xauto ; then
if test x$have_docbook = xno ; then
enable_docbook_docs=no
else
enable_docbook_docs=yes
fi
fi
if test x$enable_docbook_docs = xyes; then
if test x$have_docbook = xno; then
AC_MSG_ERROR([Building DocBook docs explicitly required, but DocBook not found])
fi
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes)
AC_ARG_VAR([XMLTO],[Define/override the 'xmlto' location.])
AC_ARG_VAR([XMLTO_FLAGS],[Define/override 'xmlto' options, like '--skip-validation'.])
GLIB_TESTS
FLATPAK_BUILDER_VERSION=flatpak_builder_version
AC_SUBST(FLATPAK_BUILDER_VERSION)
AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/flatpak-builder-docs.xml
])
AC_OUTPUT
echo ""
echo " flatpak-builder $FLATPAK_BUILDER_VERSION"
echo " ============================="
echo ""