]> git.ipfire.org Git - pakfire.git/blame - configure.ac
compress: Remove legacy logger
[pakfire.git] / configure.ac
CommitLineData
b55979b4
MT
1###############################################################################
2# #
3# Pakfire - The IPFire package management system #
4# Copyright (C) 2013 Pakfire development team #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19###############################################################################
20
7af48a1e 21AC_PREREQ([2.69])
b55979b4
MT
22
23AC_INIT([pakfire],
e1052a7f 24 [0.9.29],
b55979b4
MT
25 [info@ipfire.org],
26 [pakfire],
6d3d31c5 27 [https://git.ipfire.org/?p=pakfire.git;a=summary])
b55979b4
MT
28
29AC_CONFIG_MACRO_DIR([m4])
30AC_CONFIG_HEADERS([config.h])
31AC_CONFIG_AUX_DIR([build-aux])
32
33AC_USE_SYSTEM_EXTENSIONS
34AC_SYS_LARGEFILE
35AC_PREFIX_DEFAULT([/usr])
36
37AM_INIT_AUTOMAKE([
38 foreign
39 1.11
40 -Wall
41 -Wno-portability
42 silent-rules
43 tar-pax
44 subdir-objects
45])
46AM_SILENT_RULES([yes])
47LT_PREREQ(2.2)
48LT_INIT([disable-static])
49
50IT_PROG_INTLTOOL([0.40.0])
51
b5da7e9a
MT
52XGETTEXT="${XGETTEXT} --keyword=_:1,2 --keyword=N_:1,2 --no-location"
53
b55979b4
MT
54GETTEXT_PACKAGE=pakfire
55AC_SUBST(GETTEXT_PACKAGE)
56
57AC_PROG_LN_S
58AC_PROG_MKDIR_P
59AC_PROG_SED
60
a5fc19b7
MT
61AC_ARG_ENABLE([debug],
62 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
63 [], [enable_debug=no])
64AS_IF([test "x$enable_debug" = "xyes"], [
65 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
66])
67
5f14f4ce
MT
68# Online Tests
69AC_ARG_ENABLE([online-tests],
70 AS_HELP_STRING(
71 [--enable-online-tests],
72 [enable tests that require internet access @<:@default=disabled@:>@]
73 ), [], [enable_online_tests=no]
74)
75AS_IF([test "x$enable_online_tests" = "xyes"], [
76 AC_DEFINE(ENABLE_ONLINE_TESTS, [1], [Online Tests])
77])
78
d6962dba
MT
79# Man Pages
80
81have_man_pages=no
82AC_ARG_ENABLE(man_pages, AS_HELP_STRING([--disable-man-pages],
83 [do not install man pages]))
84AS_IF([test "x$enable_man_pages" != xno], [have_man_pages=yes])
85AM_CONDITIONAL(ENABLE_MAN_PAGES, [test "x$have_man_pages" = "xyes"])
86
87AC_PATH_PROG([XSLTPROC], [xsltproc])
88
89AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
90if test "${have_man_pages}" = "yes" && test -z "${ASCIIDOC}"; then
91 AC_MSG_ERROR([Required program 'asciidoc' not found])
92fi
93
b55979b4
MT
94# pkg-config
95PKG_PROG_PKG_CONFIG
96# This makes sure pkg.m4 is available.
97m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
98
99# C Compiler
599fd61d 100AC_PROG_CC
b55979b4
MT
101
102CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
42034590 103 -std=gnu11 \
b55979b4 104 -Wall \
42034590
MT
105 -Wextra \
106 -Warray-bounds=2 \
107 -Wdate-time \
108 -Wendif-labels \
109 -Werror=format=2 \
110 -Werror=format-signedness \
111 -Werror=implicit-function-declaration \
112 -Werror=implicit-int \
113 -Werror=incompatible-pointer-types \
114 -Werror=int-conversion \
115 -Werror=missing-declarations \
116 -Werror=missing-prototypes \
117 -Werror=overflow \
118 -Werror=override-init \
119 -Werror=return-type \
120 -Werror=shift-count-overflow \
121 -Werror=shift-overflow=2 \
122 -Werror=strict-flex-arrays \
123 -Werror=undef \
124 -Wfloat-equal \
125 -Wimplicit-fallthrough=5 \
126 -Winit-self \
127 -Wlogical-op \
128 -Wmissing-include-dirs \
129 -Wmissing-noreturn \
a3c50656 130 -Wnested-externs \
42034590 131 -Wold-style-definition \
a3c50656 132 -Wpointer-arith \
42034590 133 -Wredundant-decls \
a3c50656 134 -Wshadow \
42034590 135 -Wstrict-aliasing=2 \
a3c50656 136 -Wstrict-prototypes \
42034590
MT
137 -Wsuggest-attribute=noreturn \
138 -Wunused-function \
139 -Wwrite-strings \
140 -Wzero-length-bounds \
141 -Wno-unused-parameter \
142 -Wno-missing-field-initializers \
143 -fdiagnostics-show-option \
144 -fno-common \
a3c50656 145])
9413f094
MT
146
147# Enable -fanalyzer if requested
148AC_ARG_ENABLE([analyzer],
149 AS_HELP_STRING([--enable-analyzer], [enable static analyzer (-fanalyzer) @<:@default=disabled@:>@]),
150 [], [enable_analyzer=no])
151AS_IF([test "x$enable_analyzer" = "xyes"],
152 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-fanalyzer])
31c03998 153)
9413f094 154
c5781c8f 155# Enable -fno-semantic-interposition (if available)
cd2b5647
MT
156CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-fno-semantic-interposition])
157CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [-fno-semantic-interposition])
c5781c8f
MT
158
159AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
160AC_SUBST([OUR_CFLAGS], $with_cflags)
b55979b4
MT
161AC_SUBST([OUR_LDFLAGS], $with_ldflags)
162
b23cd304
MT
163# C Types
164AC_TYPE_INT64_T
165AC_TYPE_INTMAX_T
166AC_TYPE_INTPTR_T
167AC_TYPE_MODE_T
168AC_TYPE_OFF_T
169AC_TYPE_PID_T
170AC_TYPE_SIZE_T
171AC_TYPE_SSIZE_T
172AC_TYPE_UID_T
173AC_TYPE_UINT64_T
174
201c0ac0 175# Bison
dee8ae80 176AC_PROG_YACC
dbcf80a3
MT
177
178if test -z "${ac_cv_prog_YACC}"; then
179 echo "*** Error: No suitable bison/yacc found. ***"
180 echo " Please install the 'bison' package."
181 exit 1
182fi
201c0ac0
MT
183
184# Flex
73e181f6
MT
185AM_PROG_LEX
186
dbcf80a3
MT
187if test -z "${ac_cv_prog_LEX}"; then
188 echo "*** Error: No suitable flex/lex found. ***"
189 echo " Please install the 'flex' package."
190 exit 1
191fi
192
221cc3ce
MT
193AC_C_CONST
194AC_CHECK_LIB([m], [round])
195
196AC_CHECK_HEADERS([ \
280ffaee 197 ctype.h \
e44d46cd
MT
198 dirent.h \
199 errno.h \
31f64b2c 200 fcntl.h \
e44d46cd
MT
201 fnmatch.h \
202 fts.h \
203 ftw.h \
204 glob.h \
205 grp.h \
206 libgen.h \
207 libintl.h \
a05ecc0d 208 linux/bpf.h \
d40cf8d4 209 linux/capability.h \
e44d46cd
MT
210 linux/limits.h \
211 linux/magic.h \
212 linux/sched.h \
221cc3ce 213 math.h \
e44d46cd 214 pwd.h \
0ba52fbe 215 regex.h \
d0759555 216 sched.h \
e44d46cd 217 signal.h \
5f548bf0 218 stdarg.h \
e44d46cd
MT
219 stdint.h \
220 stdio.h \
221cc3ce
MT
221 stdlib.h \
222 string.h \
5f548bf0 223 syslog.h \
d40cf8d4 224 sys/capability.h \
31f64b2c 225 sys/epoll.h \
b5cc6424 226 sys/file.h \
e44d46cd
MT
227 sys/ioctl.h \
228 sys/mount.h \
9dd163f4 229 sys/personality.h \
d40cf8d4 230 sys/prctl.h \
e44d46cd
MT
231 sys/random.h \
232 sys/resource.h \
285b2758 233 sys/sendfile.h \
221cc3ce 234 sys/stat.h \
e44d46cd
MT
235 sys/sysmacros.h \
236 sys/types.h \
237 sys/user.h \
238 sys/utsname.h \
239 sys/vfs.h \
240 sys/wait.h \
241 time.h \
242 unistd.h \
243 utime.h
221cc3ce
MT
244])
245
246AC_CHECK_FUNCS([ \
e44d46cd 247 asprintf \
a05ecc0d 248 bpf \
31f64b2c
MT
249 epoll_ctl \
250 epoll_create1 \
251 epoll_wait \
b5cc6424 252 flock \
31f64b2c 253 fnctl \
e44d46cd
MT
254 getpid \
255 glob \
256 nftw \
257 openlog \
9dd163f4 258 personality \
d40cf8d4 259 prctl \
e44d46cd 260 remove \
5f548bf0 261 secure_getenv \
285b2758 262 sendfile \
e44d46cd 263 snprintf \
221cc3ce 264 strcmp \
d0759555 265 strdup \
e44d46cd 266 syslog \
2b04f43c 267 qsort \
e44d46cd
MT
268 uname \
269 unlink \
270 vasprintf \
271 vsnprintf
221cc3ce
MT
272])
273
8e4ddb5f 274# Python Stuff
9861f185 275AM_PATH_PYTHON([3.6])
8e4ddb5f 276
6284f1f2 277AX_PYTHON_MODULE([kerberos], [fatal])
cb7def8a 278AX_PYTHON_MODULE([setproctitle], [fatal])
09ccdffa
MT
279AX_PYTHON_MODULE([systemd], [fatal])
280AX_PYTHON_MODULE([tornado], [fatal])
a40b356c 281
8e4ddb5f 282# Libraries we depend on
dc69c071 283PKG_CHECK_MODULES([ARCHIVE], [libarchive >= 3.4.0])
a05ecc0d 284PKG_CHECK_MODULES([BPF], [libbpf])
e85ac87d 285PKG_CHECK_MODULES([CAP], [libcap])
9d017afc 286PKG_CHECK_MODULES([CURL], [libcurl])
df71dc60 287PKG_CHECK_MODULES([ELF], [libelf])
a5180a26
MT
288PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}-embed],
289 [], [PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}])])
705a7c99 290PKG_CHECK_MODULES([JSON_C], [json-c >= 0.15])
ebedf6b4 291PKG_CHECK_MODULES([KRB5], [krb5])
b55979b4 292PKG_CHECK_MODULES([LZMA], [liblzma])
46ac6db7 293PKG_CHECK_MODULES([MAGIC], [libmagic])
fec79a33
MT
294PKG_CHECK_MODULES([NL3], [libnl-3.0])
295PKG_CHECK_MODULES([NL3_ROUTE], [libnl-route-3.0])
36230729 296PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.1.1])
ae83d808 297PKG_CHECK_MODULES([PCRE2], [libpcre2-8])
c10adb37 298PKG_CHECK_MODULES([SECCOMP], [libseccomp])
113a6d68 299PKG_CHECK_MODULES([SOLV], [libsolv >= 0.7.5])
26affd69 300PKG_CHECK_MODULES([SQLITE3], [sqlite3])
eba8ae92
MT
301PKG_CHECK_MODULES([SYSTEMD], [libsystemd],
302 [AC_DEFINE([HAVE_SYSTEMD], [1], [Use systemd])])
df552c32 303PKG_CHECK_MODULES([UUID], [uuid])
2f5d648d 304PKG_CHECK_MODULES([ZSTD], [libzstd])
b55979b4 305
ffaa6362
MT
306save_LIBS="$LIBS"
307
308# subid
309#LIBS=
310#AC_SEARCH_LIBS([subid_init], [subid],
311# [AC_DEFINE([HAVE_SUBID], [], [subid is present])],
312# [AC_MSG_WARN([*** subid library not found])])
313#SUBID_LIBS="$LIBS"
314#AC_SUBST(SUBID_LIBS)
315
316LIBS="$save_LIBS"
317
b55979b4
MT
318AC_ARG_WITH([systemdsystemunitdir],
319 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
320 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
321AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
322AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
323
3f559dd0 324AC_DEFINE_UNQUOTED([PAKFIRE_CONFIG_DIR], ["${sysconfdir}/${PACKAGE_NAME}"],
54bf8fba 325 [The path where Pakfire stores configuration files])
3f559dd0 326AC_DEFINE_UNQUOTED([PAKFIRE_CACHE_DIR], ["/var/cache/${PACKAGE_NAME}"],
93d45f3c 327 [The path where Pakfire caches downloaded data])
9ad608aa
MT
328AC_DEFINE_UNQUOTED([PAKFIRE_PRIVATE_DIR], ["/var/lib/${PACKAGE_NAME}"],
329 [The path where Pakfire stores its private data])
8d0f3a35
MT
330AC_DEFINE_UNQUOTED([PAKFIRE_SCRIPTS_DIR], ["${PREFIX}/lib/${PACKAGE_NAME}"],
331 [The path where Pakfire stores its scripts])
6bf2cf50 332AC_DEFINE_UNQUOTED([PAKFIRE_TMP_DIR], ["/var/tmp"],
93d45f3c 333 [The path where Pakfire stores temporary data])
9ad608aa 334
b55979b4
MT
335AC_CONFIG_FILES([
336 Makefile
337 po/Makefile.in
b55979b4
MT
338 src/pakfire/__version__.py
339])
340
341AC_OUTPUT
342AC_MSG_RESULT([
343 $PACKAGE_NAME $VERSION
344
a5fc19b7 345 Debug: ${enable_debug}
5f14f4ce 346 Online Tests: ${enable_online_tests}
a5fc19b7 347
b55979b4 348 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
cd2b5647 349 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
b55979b4
MT
350 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
351 PYTHON_CFLAGS: ${PYTHON_DEVEL_CFLAGS}
352 PYTHON_LIBS: ${PYTHON_DEVEL_LIBS}
353])