1 ###############################################################################
3 # Pakfire - The IPFire package management system #
4 # Copyright (C) 2013 Pakfire development team #
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. #
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. #
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/>. #
19 ###############################################################################
27 [https://git.ipfire.org/?p=pakfire.git;a=summary])
29 AC_CONFIG_MACRO_DIR([m4])
30 AC_CONFIG_HEADERS([config.h])
31 AC_CONFIG_AUX_DIR([build-aux])
33 AC_USE_SYSTEM_EXTENSIONS
35 AC_PREFIX_DEFAULT([/usr])
46 AM_SILENT_RULES([yes])
48 LT_INIT([disable-static])
50 IT_PROG_INTLTOOL([0.40.0])
52 XGETTEXT="${XGETTEXT} --keyword=_:1,2 --keyword=N_:1,2 --no-location"
54 GETTEXT_PACKAGE=pakfire
55 AC_SUBST(GETTEXT_PACKAGE)
61 AC_ARG_ENABLE([debug],
62 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
63 [], [enable_debug=no])
64 AS_IF([test "x$enable_debug" = "xyes"], [
65 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
69 AC_ARG_ENABLE([online-tests],
71 [--enable-online-tests],
72 [enable tests that require internet access @<:@default=disabled@:>@]
73 ), [], [enable_online_tests=no]
75 AS_IF([test "x$enable_online_tests" = "xyes"], [
76 AC_DEFINE(ENABLE_ONLINE_TESTS, [1], [Online Tests])
82 AC_ARG_ENABLE(man_pages, AS_HELP_STRING([--disable-man-pages],
83 [do not install man pages]))
84 AS_IF([test "x$enable_man_pages" != xno], [have_man_pages=yes])
85 AM_CONDITIONAL(ENABLE_MAN_PAGES, [test "x$have_man_pages" = "xyes"])
87 AC_PATH_PROG([XSLTPROC], [xsltproc])
89 AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
90 if test "${have_man_pages}" = "yes" && test -z "${ASCIIDOC}"; then
91 AC_MSG_ERROR([Required program 'asciidoc' not found])
96 # This makes sure pkg.m4 is available.
97 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
102 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
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 \
118 -Werror=override-init \
119 -Werror=return-type \
120 -Werror=shift-count-overflow \
121 -Werror=shift-overflow=2 \
122 -Werror=strict-flex-arrays \
125 -Wimplicit-fallthrough=5 \
128 -Wmissing-include-dirs \
131 -Wold-style-definition \
135 -Wstrict-aliasing=2 \
136 -Wstrict-prototypes \
137 -Wsuggest-attribute=noreturn \
140 -Wzero-length-bounds \
141 -Wno-unused-parameter \
142 -Wno-missing-field-initializers \
143 -fdiagnostics-show-option \
147 # Enable -fanalyzer if requested
148 AC_ARG_ENABLE([analyzer],
149 AS_HELP_STRING([--enable-analyzer], [enable static analyzer (-fanalyzer) @<:@default=disabled@:>@]),
150 [], [enable_analyzer=no])
151 AS_IF([test "x$enable_analyzer" = "xyes"],
152 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-fanalyzer])
155 # Enable -fno-semantic-interposition (if available)
156 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-fno-semantic-interposition])
157 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [-fno-semantic-interposition])
159 AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
160 AC_SUBST([OUR_CFLAGS], $with_cflags)
161 AC_SUBST([OUR_LDFLAGS], $with_ldflags)
178 if test -z "${ac_cv_prog_YACC}"; then
179 echo "*** Error: No suitable bison/yacc found. ***"
180 echo " Please install the 'bison' package."
187 if test -z "${ac_cv_prog_LEX}"; then
188 echo "*** Error: No suitable flex/lex found. ***"
189 echo " Please install the 'flex' package."
194 AC_CHECK_LIB([m], [round])
275 AM_PATH_PYTHON([3.6])
277 AX_PYTHON_MODULE([cpuinfo], [fatal])
278 AX_PYTHON_MODULE([kerberos], [fatal])
279 AX_PYTHON_MODULE([progressbar2], [fatal])
280 AX_PYTHON_MODULE([psutil], [fatal])
281 AX_PYTHON_MODULE([setproctitle], [fatal])
282 AX_PYTHON_MODULE([systemd], [fatal])
283 AX_PYTHON_MODULE([tornado], [fatal])
285 # Libraries we depend on
286 PKG_CHECK_MODULES([ARCHIVE], [libarchive >= 3.4.0])
287 PKG_CHECK_MODULES([BPF], [libbpf])
288 PKG_CHECK_MODULES([CAP], [libcap])
289 PKG_CHECK_MODULES([CURL], [libcurl])
290 PKG_CHECK_MODULES([ELF], [libelf])
291 PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}-embed],
292 [], [PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}])])
293 PKG_CHECK_MODULES([JSON_C], [json-c >= 0.15])
294 PKG_CHECK_MODULES([LZMA], [liblzma])
295 PKG_CHECK_MODULES([MAGIC], [libmagic])
296 PKG_CHECK_MODULES([MOUNT], [mount])
297 PKG_CHECK_MODULES([NL3], [libnl-3.0])
298 PKG_CHECK_MODULES([NL3_ROUTE], [libnl-route-3.0])
299 PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.1.1])
300 PKG_CHECK_MODULES([PCRE2], [libpcre2-8])
301 PKG_CHECK_MODULES([SECCOMP], [libseccomp])
302 PKG_CHECK_MODULES([SOLV], [libsolv >= 0.7.5])
303 PKG_CHECK_MODULES([SQLITE3], [sqlite3])
304 PKG_CHECK_MODULES([SYSTEMD], [libsystemd],
305 [AC_DEFINE([HAVE_SYSTEMD], [1], [Use systemd])])
306 PKG_CHECK_MODULES([UUID], [uuid])
307 PKG_CHECK_MODULES([ZSTD], [libzstd])
313 #AC_SEARCH_LIBS([subid_init], [subid],
314 # [AC_DEFINE([HAVE_SUBID], [], [subid is present])],
315 # [AC_MSG_WARN([*** subid library not found])])
317 #AC_SUBST(SUBID_LIBS)
321 AC_ARG_WITH([systemdsystemunitdir],
322 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
323 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
324 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
325 AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
327 AC_DEFINE_UNQUOTED([PAKFIRE_CONFIG_DIR], ["${sysconfdir}/${PACKAGE_NAME}"],
328 [The path where Pakfire stores configuration files])
329 AC_DEFINE_UNQUOTED([PAKFIRE_CACHE_DIR], ["/var/cache/${PACKAGE_NAME}"],
330 [The path where Pakfire caches downloaded data])
331 AC_DEFINE_UNQUOTED([PAKFIRE_PRIVATE_DIR], ["/var/lib/${PACKAGE_NAME}"],
332 [The path where Pakfire stores its private data])
333 AC_DEFINE_UNQUOTED([PAKFIRE_SCRIPTS_DIR], ["${PREFIX}/lib/${PACKAGE_NAME}"],
334 [The path where Pakfire stores its scripts])
335 AC_DEFINE_UNQUOTED([PAKFIRE_TMP_DIR], ["/var/tmp"],
336 [The path where Pakfire stores temporary data])
341 src/pakfire/__version__.py
346 $PACKAGE_NAME $VERSION
348 Debug: ${enable_debug}
349 Online Tests: ${enable_online_tests}
351 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
352 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
353 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
354 PYTHON_CFLAGS: ${PYTHON_DEVEL_CFLAGS}
355 PYTHON_LIBS: ${PYTHON_DEVEL_LIBS}