]> git.ipfire.org Git - people/ms/pakfire.git/blame - configure.ac
mount: Check list for duplicates to only umount everything once
[people/ms/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
21AC_PREREQ([2.64])
22
23AC_INIT([pakfire],
48b888dc 24 [0.9.27],
b55979b4
MT
25 [info@ipfire.org],
26 [pakfire],
27 [http://git.ipfire.org/?p=pakfire.git;a=summary])
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
b55979b4
MT
68# pkg-config
69PKG_PROG_PKG_CONFIG
70# This makes sure pkg.m4 is available.
71m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
72
73# C Compiler
74AC_PROG_CC
75AC_PROG_CC_C99
76AC_PROG_CC_C_O
77AC_PROG_GCC_TRADITIONAL
78AC_OPENMP
79
80CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
81 -pipe \
82 -Wall \
83 -Wextra \
84 -Wno-inline \
85 -Wundef \
86 "-Wformat=2 -Wformat-security -Wformat-nonliteral" \
87 -Wno-unused-parameter \
88 -Wno-unused-result \
89 -fno-strict-aliasing \
90 -ffunction-sections \
91 -fdata-sections \
92 -fstack-protector-all \
93 --param=ssp-buffer-size=4])
94AC_SUBST([OUR_CFLAGS], $with_cflags)
95
96AS_CASE([$CFLAGS], [*-O[[12345g\ ]]*],
97 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
98 -Wp,-D_FORTIFY_SOURCE=2])],
99 [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
100AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
101
102CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
103 -Wl,--as-needed \
104 -Wl,--no-undefined \
105 -Wl,--gc-sections \
106 -Wl,-z,relro \
107 -Wl,-z,now])
108AC_SUBST([OUR_LDFLAGS], $with_ldflags)
109
201c0ac0 110# Bison
dee8ae80
MT
111AC_PROG_YACC
112AC_PATH_PROG([BISON],[bison])
201c0ac0
MT
113
114# Flex
73e181f6
MT
115AM_PROG_LEX
116
b55979b4 117# Python
2e708cdf 118AM_PATH_PYTHON([3.6])
b55979b4 119
221cc3ce
MT
120AC_C_CONST
121AC_CHECK_LIB([m], [round])
122
123AC_CHECK_HEADERS([ \
5f548bf0 124 ctypes.h \
31f64b2c 125 fcntl.h \
221cc3ce 126 math.h \
0ba52fbe 127 regex.h \
d0759555 128 sched.h \
5f548bf0 129 stdarg.h \
221cc3ce
MT
130 stdlib.h \
131 string.h \
5f548bf0 132 syslog.h \
31f64b2c 133 sys/epoll.h \
9dd163f4 134 sys/personality.h \
221cc3ce
MT
135 sys/stat.h \
136 unistd.h
137])
138
139AC_CHECK_FUNCS([ \
140 assert \
31f64b2c
MT
141 epoll_ctl \
142 epoll_create1 \
143 epoll_wait \
144 fnctl \
9dd163f4 145 personality \
5f548bf0 146 secure_getenv \
221cc3ce 147 strcmp \
d0759555 148 strdup \
2b04f43c 149 qsort \
d0759555 150 unshare
221cc3ce
MT
151])
152
b55979b4
MT
153save_LIBS="$LIBS"
154
b55979b4
MT
155# libdl
156LIBS=
157AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
158DL_LIBS="$LIBS"
159AC_SUBST(DL_LIBS)
160
b55979b4
MT
161LIBS="$save_LIBS"
162
b26b766c 163PKG_CHECK_MODULES([ARCHIVE], [libarchive >= 3.3.3])
9d017afc 164PKG_CHECK_MODULES([CURL], [libcurl])
b55979b4 165PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}])
6b2e1ec2 166PKG_CHECK_MODULES([JSON_C], [json-c])
b55979b4 167PKG_CHECK_MODULES([LZMA], [liblzma])
36230729 168PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.1.1])
ae83d808 169PKG_CHECK_MODULES([PCRE2], [libpcre2-8])
3350b942 170PKG_CHECK_MODULES([SOLV], [libsolv])
26affd69 171PKG_CHECK_MODULES([SQLITE3], [sqlite3])
df552c32 172PKG_CHECK_MODULES([UUID], [uuid])
2f5d648d 173PKG_CHECK_MODULES([ZSTD], [libzstd])
b55979b4 174
0e75ae24
MT
175AM_PATH_GPGME([1.6.0], [], [AC_MSG_ERROR([*** GPGME not found])])
176
b55979b4
MT
177AC_ARG_WITH([systemdsystemunitdir],
178 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
179 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
180AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
181AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
182
54bf8fba
MT
183AC_DEFINE_UNQUOTED([PAKFIRE_CONFIG_PATH], ["${sysconfdir}/${PACKAGE_NAME}"],
184 [The path where Pakfire stores configuration files])
0e389481
MT
185AC_DEFINE_UNQUOTED([PAKFIRE_CACHE_PATH], ["/var/cache/${PACKAGE_NAME}"],
186 [The path where Pakfire stores temporary data])
9ad608aa
MT
187AC_DEFINE_UNQUOTED([PAKFIRE_PRIVATE_DIR], ["/var/lib/${PACKAGE_NAME}"],
188 [The path where Pakfire stores its private data])
189
b55979b4
MT
190AC_CONFIG_FILES([
191 Makefile
192 po/Makefile.in
b55979b4
MT
193 src/pakfire/__version__.py
194])
195
196AC_OUTPUT
197AC_MSG_RESULT([
198 $PACKAGE_NAME $VERSION
199
a5fc19b7
MT
200 Debug: ${enable_debug}
201
b55979b4
MT
202 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
203 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
204 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
205 PYTHON_CFLAGS: ${PYTHON_DEVEL_CFLAGS}
206 PYTHON_LIBS: ${PYTHON_DEVEL_LIBS}
207])