-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathconfigure.ac
More file actions
257 lines (233 loc) · 7.85 KB
/
configure.ac
File metadata and controls
257 lines (233 loc) · 7.85 KB
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# Copyright 2011-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
#
# Copyright 2011-2014 Mike Frysinger - <vapier@gentoo.org>
# Copyright 2011- Fabian Groffen - <grobian@gentoo.org>
AC_PREREQ([2.72])
AC_INIT([portage-utils],[git])
AM_INIT_AUTOMAKE([1.11 dist-xz foreign no-dist-gzip silent-rules -Wall])
AM_SILENT_RULES([yes]) # AM_INIT_AUTOMAKE([silent-rules]) is broken atm
AM_MAINTAINER_MODE([enable])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([autotools/m4])
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
AC_OPENMP
AM_PROG_CC_C_O
gl_EARLY
gl_INIT
AM_PROG_AR
AC_PROG_LN_S
headers='#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
'
AC_CHECK_HEADERS([stddef.h unistd.h])
AX_COMPILE_CHECK_SIZEOF([size_t],[${headers}])
AC_CHECK_FUNCS_ONCE(m4_flatten([
fmemopen
scandirat
]))
AC_CHECK_SENDFILE
AC_ARG_WITH([eprefix], [AS_HELP_STRING([--with-eprefix], [path for Gentoo/Prefix project])])
# ensure eprefix ends with a slash, since the code base expects that
case "$with_eprefix" in
*/) with_eprefix="$with_eprefix" ;;
*) with_eprefix="${with_eprefix}/" ;;
esac
AC_DEFINE_UNQUOTED([CONFIG_EPREFIX], ["$with_eprefix"],
[Gentoo Prefix offset path])
AC_SUBST([CONFIG_EPREFIX], ["$with_eprefix"])
AC_ARG_ENABLE([qmanifest], [AS_HELP_STRING([--enable-qmanifest],
[support qmanifest applet])])
AC_ARG_ENABLE([gpkg],
[AS_HELP_STRING([--enable-gpkg],
[support GLEP-78 gpkg packages])])
AC_ARG_ENABLE([gtree],
[AS_HELP_STRING([--enable-gtree],
[support gtree cache])])
# always check libb2, gpgme and libarchive
PKG_CHECK_MODULES([LIBBL2], [libb2],
[
AC_DEFINE([HAVE_BLAKE2B], [1], [Define if you have blake2b])
LIBBL2="yes"
],
[
AS_IF([test "x${enable_qmanifest}" = "xyes"],
[
AC_MSG_FAILURE([--enable-qmanifest was given, but libb2.pc could not be found])
])
LIBBL2="no: missing dependencies"
enable_qmanifest=no
])
PKG_CHECK_MODULES([GPGME], [gpgme],
[
AC_DEFINE([HAVE_GPGME], [1], [Define if you have gpgme])
GPGME="yes"
],
[
AS_IF([test "x${enable_qmanifest}" = "xyes"],
[
AC_MSG_FAILURE([--enable-qmanifest was given, but gpgme.pc could not be found])
])
AS_IF([test "x${enable_gpkg}" = "xyes"],
[
AC_MSG_FAILURE([--enable-gpkg was given, but gpgme.pc could not be found])
])
AS_IF([test "x${enable_gtree}" = "xyes"],
[
AC_MSG_FAILURE([--enable-gtree was given, but gpgme.pc could not be found])
])
GPGME="no: missing dependencies"
enable_qmanifest=no
enable_gpkg=no
enable_gtree=no
])
PKG_CHECK_MODULES([LIBARCHIVE], [libarchive],
[
AC_DEFINE([HAVE_LIBARCHIVE], [1], [Define if you have libarchive])
LIBARCHIVE="yes"
save_LIBS="$LIBS"
LIBS="$LIBS $LIBARCHIVE_LIBS"
AC_MSG_CHECKING([whether for archive_entry_hardlink_is_set])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <archive.h>
#include <archive_entry.h>]], [[archive_entry_hardlink_is_set(NULL);]])],[AC_DEFINE([HAVE_ARCHIVE_ENTRY_HARDLINK_IS_SET],
[1], [Define if you have archive_entry_hardlink_is_set])
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
LIBS="$save_LIBS"
],
[
AS_IF([test "x${enable_gpkg}" = "xyes"],
[
AC_MSG_FAILURE([--enable-gpkg was given, but libarchive.pc could not be found])
])
AS_IF([test "x${enable_gtree}" = "xyes"],
[
AC_MSG_FAILURE([--enable-gtree was given, but libarchive.pc could not be found])
])
LIBARCHIVE="no: missing dependencies"
enable_gpkg=no
enable_gtree=no
])
AS_IF([test "x${enable_qmanifest}" != "xno"], [
PKG_CHECK_MODULES([LIBZ], [zlib], [
AC_DEFINE([HAVE_LIBZ], [1], [Define if you have zlib])
LIBZ="yes"
], [
AS_IF([test "x${enable_qmanifest}" = "xyes"], [
AC_MSG_FAILURE([--enable-qmanifest was given, but zlib.pc could not be found])
])
LIBZ="no: missing dependencies"
enable_qmanifest=no
])
AC_MSG_CHECKING([whether to enable qmanifest])
AS_IF([test "x${LIBBL2}${LIBZ}${GPGME}" = "xyesyesyes"], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no: missing dependencies])
])
], [
AC_MSG_CHECKING([whether to enable qmanifest])
AC_MSG_RESULT([no: disabled by configure argument])
])
do_qmanifest=""
AM_CONDITIONAL([QMANIFEST_ENABLED], [test "x$enable_qmanifest" != xno])
if test "x$enable_qmanifest" != xno ; then
AC_DEFINE([ENABLE_QMANIFEST], [1],
[Define if qmanifest should be compiled])
do_qmanifest="yes"
fi
AS_IF([test "x${enable_gpkg}" != "xno"], [
AC_MSG_CHECKING([whether to enable gpkg])
AS_IF([test "x${GPGME}${LIBARCHIVE}" = "xyesyes"], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no: missing dependencies])
])
], [
AC_MSG_CHECKING([whether to enable gpkg])
AC_MSG_RESULT([no: disabled by configure argument])
])
do_gpkg=""
AM_CONDITIONAL([GPKG_ENABLED], [test "x$enable_gpkg" != xno])
if test "x$enable_gpkg" != xno ; then
AC_DEFINE([ENABLE_GPKG], [1],
[Define if gpkg should be compiled])
do_gpkg="yes"
fi
AS_IF([test "x${enable_gtree}" != "xno"], [
AC_MSG_CHECKING([whether to enable gtree])
AS_IF([test "x${GPGME}${LIBARCHIVE}" = "xyesyes"], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no: missing dependencies])
])
], [
AC_MSG_CHECKING([whether to enable gtree])
AC_MSG_RESULT([no: disabled by configure argument])
])
do_gtree=""
AM_CONDITIONAL([GTREE_ENABLED], [test "x$enable_gtree" != xno])
if test "x$enable_gtree" != xno ; then
AC_DEFINE([ENABLE_GTREE], [1],
[Define if gtree should be compiled])
do_gtree="yes"
fi
AC_SUBST([QMANIFEST_ENABLED], ["$do_qmanifest"])
AC_SUBST([GPKG_ENABLED], ["$do_gpkg"])
AC_SUBST([GTREE_ENABLED], ["$do_gtree"])
AX_CFLAGS_WARN_ALL([CWFLAGS])
AC_DEFUN([PT_CHECK_CFLAG],[AX_CHECK_COMPILER_FLAGS([$1],[CFLAGS="$CFLAGS $1"])])
m4_foreach_w([flag], [
-Wbad-function-cast
-Wcast-align
-Wchar-subscripts
-Wcomment
-Wdiscarded-qualifiers
-Wextra
-Wformat=2
-Wimplicit
-Winline
-Wmissing-declarations
-Wnested-externs
-Wno-sign-compare
-Wold-style-definition
-Wsequence-point
-Wshadow
-Wunused
-Wwrite-strings
], [
AX_CHECK_COMPILE_FLAG(flag, AS_VAR_APPEND([CWFLAGS], " flag"))
])
AC_SUBST([CWFLAGS], ["$CWFLAGS"])
AC_CONFIG_FILES([
Makefile
libq/Makefile
autotools/gnulib/Makefile
tests/init.sh
tests/Makefile
tests/atom_compare/Makefile
tests/atom_explode/Makefile
tests/copy_file/Makefile
tests/install/Makefile
tests/mkdir/Makefile
tests/profile/Makefile
tests/qatom/Makefile
tests/qcheck/Makefile
tests/qdepends/Makefile
tests/qfile/Makefile
tests/qlist/Makefile
tests/qlop/Makefile
tests/qmanifest/Makefile
tests/qmerge/Makefile
tests/qtbz2/Makefile
tests/quse/Makefile
tests/qxpak/Makefile
tests/rmspace/Makefile
tests/source/Makefile
])
AC_OUTPUT
# vim: set ts=2 sw=2 softtabstop=2 expandtab: