]> git.ipfire.org Git - pakfire.git/blob - configure.ac
configure: Require libsolv >= 0.7.5
[pakfire.git] / configure.ac
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
21 AC_PREREQ([2.64])
22
23 AC_INIT([pakfire],
24 [0.9.27],
25 [info@ipfire.org],
26 [pakfire],
27 [http://git.ipfire.org/?p=pakfire.git;a=summary])
28
29 AC_CONFIG_MACRO_DIR([m4])
30 AC_CONFIG_HEADERS([config.h])
31 AC_CONFIG_AUX_DIR([build-aux])
32
33 AC_USE_SYSTEM_EXTENSIONS
34 AC_SYS_LARGEFILE
35 AC_PREFIX_DEFAULT([/usr])
36
37 AM_INIT_AUTOMAKE([
38 foreign
39 1.11
40 -Wall
41 -Wno-portability
42 silent-rules
43 tar-pax
44 subdir-objects
45 ])
46 AM_SILENT_RULES([yes])
47 LT_PREREQ(2.2)
48 LT_INIT([disable-static])
49
50 IT_PROG_INTLTOOL([0.40.0])
51
52 XGETTEXT="${XGETTEXT} --keyword=_:1,2 --keyword=N_:1,2 --no-location"
53
54 GETTEXT_PACKAGE=pakfire
55 AC_SUBST(GETTEXT_PACKAGE)
56
57 AC_PROG_LN_S
58 AC_PROG_MKDIR_P
59 AC_PROG_SED
60
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.])
66 ])
67
68 # pkg-config
69 PKG_PROG_PKG_CONFIG
70 # This makes sure pkg.m4 is available.
71 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
72
73 # C Compiler
74 AC_PROG_CC
75 AC_PROG_CC_C99
76 AC_PROG_CC_C_O
77 AC_PROG_GCC_TRADITIONAL
78 AC_OPENMP
79
80 CC_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])
94 AC_SUBST([OUR_CFLAGS], $with_cflags)
95
96 AS_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])])
100 AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
101
102 CC_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])
108 AC_SUBST([OUR_LDFLAGS], $with_ldflags)
109
110 # Bison
111 AC_PROG_YACC
112
113 if test -z "${ac_cv_prog_YACC}"; then
114 echo "*** Error: No suitable bison/yacc found. ***"
115 echo " Please install the 'bison' package."
116 exit 1
117 fi
118
119 # Flex
120 AM_PROG_LEX
121
122 if test -z "${ac_cv_prog_LEX}"; then
123 echo "*** Error: No suitable flex/lex found. ***"
124 echo " Please install the 'flex' package."
125 exit 1
126 fi
127
128 # Python
129 AM_PATH_PYTHON([3.6])
130
131 AC_C_CONST
132 AC_CHECK_LIB([m], [round])
133
134 AC_CHECK_HEADERS([ \
135 ctypes.h \
136 fcntl.h \
137 math.h \
138 regex.h \
139 sched.h \
140 stdarg.h \
141 stdlib.h \
142 string.h \
143 syslog.h \
144 sys/epoll.h \
145 sys/personality.h \
146 sys/stat.h \
147 unistd.h
148 ])
149
150 AC_CHECK_FUNCS([ \
151 assert \
152 epoll_ctl \
153 epoll_create1 \
154 epoll_wait \
155 fnctl \
156 personality \
157 secure_getenv \
158 strcmp \
159 strdup \
160 qsort \
161 unshare
162 ])
163
164 PKG_CHECK_MODULES([ARCHIVE], [libarchive >= 3.3.3])
165 PKG_CHECK_MODULES([CURL], [libcurl])
166 PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}-embed],
167 [], [PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}])])
168 PKG_CHECK_MODULES([JSON_C], [json-c])
169 PKG_CHECK_MODULES([LZMA], [liblzma])
170 PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.1.1])
171 PKG_CHECK_MODULES([PCRE2], [libpcre2-8])
172 PKG_CHECK_MODULES([SOLV], [libsolv >= 0.7.5])
173 PKG_CHECK_MODULES([SQLITE3], [sqlite3])
174 PKG_CHECK_MODULES([UUID], [uuid])
175 PKG_CHECK_MODULES([ZSTD], [libzstd])
176
177 AM_PATH_GPGME([1.6.0], [], [AC_MSG_ERROR([*** GPGME not found])])
178
179 AC_ARG_WITH([systemdsystemunitdir],
180 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
181 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
182 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
183 AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
184
185 AC_DEFINE_UNQUOTED([PAKFIRE_CONFIG_PATH], ["${sysconfdir}/${PACKAGE_NAME}"],
186 [The path where Pakfire stores configuration files])
187 AC_DEFINE_UNQUOTED([PAKFIRE_CACHE_PATH], ["/var/cache/${PACKAGE_NAME}"],
188 [The path where Pakfire stores temporary data])
189 AC_DEFINE_UNQUOTED([PAKFIRE_PRIVATE_DIR], ["/var/lib/${PACKAGE_NAME}"],
190 [The path where Pakfire stores its private data])
191 AC_DEFINE_UNQUOTED([PAKFIRE_SCRIPTS_DIR], ["${PREFIX}/lib/${PACKAGE_NAME}"],
192 [The path where Pakfire stores its scripts])
193
194 AC_CONFIG_FILES([
195 Makefile
196 po/Makefile.in
197 src/pakfire/__version__.py
198 ])
199
200 AC_OUTPUT
201 AC_MSG_RESULT([
202 $PACKAGE_NAME $VERSION
203
204 Debug: ${enable_debug}
205
206 CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
207 CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
208 LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
209 PYTHON_CFLAGS: ${PYTHON_DEVEL_CFLAGS}
210 PYTHON_LIBS: ${PYTHON_DEVEL_LIBS}
211 ])