forked from freebsd/pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
550 lines (498 loc) · 16.5 KB
/
configure.ac
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
m4_define([maj_ver], [1])
m4_define([med_ver], [8])
m4_define([min_ver], [99])
m4_define([api_ver], [m4_eval(maj_ver * 1000000 + med_ver * 1000 + min_ver)])
m4_define([dev_ver], m4_expand([m4_normalize(m4_sinclude([dev_version.m4]))]))
m4_ifset([dev_ver],
[m4_define([pkg_version], [maj_ver.med_ver.min_ver.dev_ver])],
[m4_define([pkg_version], [maj_ver.med_ver.min_ver])])
AC_INIT([pkg],m4_expand([pkg_version]),[https://github.com/freebsd/pkg],[pkg])
AC_CONFIG_SRCDIR([configure.ac])
AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-dist-gzip dist-xz])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([enable])
dnl Here are rules for setting version-info for libpkg
dnl we use 3 integers: current, revision and age:
dnl - if you change ABI (meaning add/remove/modify), then always update `current`
dnl - if you modify lib (that means ALL modifies), then increase `revision`
dnl - if you want backward compatibility, then use `age`
LIBPKG_CURRENT=3
LIBPKG_REVISION=0
LIBPKG_AGE=0
LIBPKG_SO_VERSION="$LIBPKG_CURRENT:$LIBPKG_REVISION:$LIBPKG_AGE"
AC_SUBST(LIBPKG_SO_VERSION)
AC_GNU_SOURCE
AC_PROG_CC_C99
LT_INIT()
AC_CONFIG_MACRO_DIR([m4])
AX_CFLAGS_WARN_ALL
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_FUNCS(memmove bcopy)
AC_PROG_LN_S
AC_CHECK_HEADERS_ONCE([fcntl.h unistd.h elf-hints.h])
AC_TYPE_OFF_T
AC_FUNC_MMAP
if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
FILEMAP=unixfilemap
else
FILEMAP=readfilemap
fi
AC_SUBST(FILEMAP)
AC_MSG_CHECKING(for GCC atomic builtins)
AC_LINK_IFELSE([
AC_LANG_SOURCE([[
int main() {
volatile unsigned long val = 1;
__sync_synchronize();
__sync_val_compare_and_swap(&val, 1, 0);
__sync_add_and_fetch(&val, 1);
__sync_sub_and_fetch(&val, 1);
return 0;
}
]])
],
[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_ATOMIC_BUILTINS], [1], [Has gcc/MSVC atomic intrinsics])
],
[
AC_MSG_RESULT([no])
])
gl_LD_VERSION_SCRIPT
AC_CANONICAL_HOST
case $host_os in
linux*)
OS_CFLAGS="-D_XOPEN_SOURCE -D_GNU_SOURCE -pthread"
OS_LDFLAGS="-pthread"
OS_LIBS="-ldl -lrt"
OS_STATIC="false"
;;
openbsd*|bitrig*)
OS_CFLAGS="-D_BSD_SOURCE -I/usr/local/include"
OS_LDFLAGS="-L/usr/local/lib"
OS_LIBS=
OS_STATIC="true"
;;
*)
OS_CFLAGS="-D_BSD_SOURCE"
OS_LDFLAGS=
OS_LIBS=
OS_STATIC="true"
;;
esac
AC_SUBST(OS_CFLAGS)
AC_SUBST(OS_LDFLAGS)
AC_SUBST(OS_LIBS)
AC_SUBST(OS_STATIC)
AM_CONDITIONAL([BUILD_STATIC], [test x$OS_STATIC = xtrue])
CFLAGS="$CFLAGS $OS_CFLAGS"
LDFLAGS="$LDFLAGS $OS_LDFLAGS"
AC_CHECK_HEADERS_ONCE([machine/endian.h])
AC_CHECK_HEADERS_ONCE([endian.h])
AC_CHECK_HEADERS_ONCE([sys/endian.h])
AC_CHECK_HEADERS_ONCE([dlfcn.h])
AC_CHECK_HEADERS_ONCE([stdlib.h])
AC_CHECK_HEADERS_ONCE([string.h])
AC_CHECK_HEADERS_ONCE([memory.h])
AC_CHECK_HEADERS_ONCE([inttypes.h])
AC_CHECK_HEADERS_ONCE([sys/types.h])
AC_CHECK_HEADERS_ONCE([sys/stat.h])
AC_CHECK_HEADERS_ONCE([sys/param.h])
AC_CHECK_HEADERS_ONCE([sys/mman.h])
AC_CHECK_HEADERS_ONCE([sys/elf_common.h])
AC_CHECK_HEADERS_ONCE([link.h])
AC_CHECK_HEADERS_ONCE([stddef.h])
AC_CHECK_HEADERS_ONCE([stdarg.h])
AC_CHECK_HEADERS_ONCE([stdbool.h])
AC_CHECK_HEADERS_ONCE([stdint.h])
AC_CHECK_HEADERS_ONCE([ctype.h])
AC_CHECK_HEADERS_ONCE([errno.h])
AC_CHECK_HEADERS_ONCE([limits.h])
AC_CHECK_HEADERS_ONCE([libgen.h])
AC_CHECK_HEADERS_ONCE([stdio.h])
AC_CHECK_HEADERS_ONCE([float.h])
AC_CHECK_HEADERS_ONCE([math.h])
AC_CHECK_HEADERS_ONCE([readpassphrase.h])
AC_CHECK_HEADERS_ONCE([osreldate.h])
AC_CHECK_HEADERS_ONCE([sys/socket.h])
AC_CHECK_HEADERS_ONCE([netinet/in.h])
AC_CHECK_HEADERS_ONCE([netinet/in6.h])
AC_CHECK_HEADERS_ONCE([sys/statfs.h])
AC_CHECK_HEADERS_ONCE([sys/statvfs.h])
AC_CHECK_HEADERS_ONCE([dirent.h], [sys/ndir.h], [sys/dir.h], [ndir.h])
AC_CHECK_HEADERS_ONCE([sys/capability.h])
AC_CHECK_HEADERS_ONCE([sys/capsicum.h])
AC_CHECK_HEADERS_ONCE([bsd/stdlib.h])
AC_CHECK_HEADERS_ONCE([bsd/string.h])
AC_CHECK_HEADERS_ONCE([bsd/stdio.h])
AC_CHECK_HEADERS_ONCE([bsd/readpassphrase.h])
AC_CHECK_HEADERS_ONCE([bsd/libutil.h])
AC_CHECK_HEADERS_ONCE([bsd/err.h])
AC_CHECK_HEADERS_ONCE([bsd/unistd.h])
AC_CHECK_HEADERS_ONCE([bsd/sys/cdefs.h])
AC_CHECK_HEADERS_ONCE([sys/procctl.h])
AC_CHECK_HEADER([regex.h], [
AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the <regex.h> header file.])
],
[AC_MSG_ERROR([unable to find the regex.h header])],
[#include <sys/types.h>])
AC_CHECK_FUNCS_ONCE([strtofflags])
AC_CHECK_FUNCS_ONCE([posix_fallocate])
AC_CHECK_FUNCS_ONCE([usleep])
AC_CHECK_FUNCS_ONCE([localtime_r])
AC_CHECK_FUNCS_ONCE([gmtime_r])
AC_CHECK_FUNCS_ONCE([strerror_r])
AC_CHECK_FUNCS_ONCE([strtonum])
AC_CHECK_FUNCS_ONCE([strnstr])
AC_CHECK_FUNCS_ONCE([funopen])
AC_CHECK_FUNCS_ONCE([fopencookie])
AC_CHECK_FUNCS_ONCE([sysctlbyname])
AC_CHECK_FUNCS_ONCE([__res_setservers])
AC_CHECK_MEMBERS([struct stat.st_mtim])
AC_CHECK_DECLS(
[[fstatat], [openat], [unlinkat], [readlinkat], [faccessat]],
[], [], [
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
])
AC_CHECK_DECLS(
[[be16dec], [be32dec], [be64dec], [le16dec], [le32dec], [le64dec],
[be16enc], [be32enc], [be64enc], [le16enc], [le32enc], [le64enc]],
[], [], [#include <sys/endian.h>]
)
AC_CHECK_FUNCS_ONCE([eaccess])
AC_CHECK_FUNCS_ONCE([closefrom])
AC_CHECK_FUNCS_ONCE([dirfd])
AC_CHECK_FUNCS_ONCE([sysconf])
AC_CHECK_MEMBERS([struct in6_addr.s6_addr32,
struct in6_addr.s6_addr16,
struct sockaddr_in.sin_len,
struct sockaddr_in6.sin6_len,
struct sockaddr_storage.ss_len,
struct sockaddr_storage.ss_family,
struct sockaddr_storage.__ss_family], [], [],
[#include <sys/types.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])
AC_MSG_CHECKING(for IPv6 support)
AC_CACHE_VAL(ac_cv_ipv6,
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[ int domain = AF_INET6; ],
ac_cv_ipv6=yes,
ac_cv_ipv6=no,
ac_cv_ipv6=no))
AC_MSG_RESULT($ac_cv_ipv6)
if test $ac_cv_ipv6 = yes ; then
CFLAGS="${CFLAGS} -DINET6=1"
AC_DEFINE(INET6,1,"check if system supports IPV6")
fi
PKG_PROG_PKG_CONFIG
AC_DEFUN([AC_PROG_GIT], [AC_CHECK_PROG(GITBIN,git,yes)])
AC_PROG_GIT
if test x"${GITBIN}" = x"yes" ; then
AC_MSG_CHECKING([for git head])
if test -d "${GIT_DIR:-${ac_top_srcdir:-./}/.git}" ; then
GIT_HEAD=`git rev-parse --short HEAD`
if test -n "`git diff-index -m --name-only HEAD`" ; then
GIT_HEAD=${GIT_HEAD}-dirty
fi
if test -n "${GIT_HEAD}" ; then
GIT_HEAD="-${GIT_HEAD}"
fi
fi
fi
AH_TEMPLATE(GIT_HEAD, "Git revision")
AH_TEMPLATE(PKG_API, "Api version")
AC_MSG_RESULT([$GIT_HEAD])
AC_SUBST([GIT_HEAD])
AC_DEFINE_UNQUOTED([GIT_HEAD], $GIT_HEAD)
AC_DEFINE([PKG_API], [api_ver])
AC_CACHE_VAL(ac_cv_seqpacket,
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
int main() { return socket(AF_LOCAL, SOCK_SEQPACKET, 0) == -1 ? -1 : 0; }
],
ac_cv_seqpacket=yes,
ac_cv_seqpacket=no,
ac_cv_seqpacket=no))
AC_MSG_RESULT($ac_cv_seqpacket)
if test $ac_cv_seqpacket = yes ; then
AC_DEFINE([HAVE_SEQPACKET], 1,Define [Define to 1 if you have SOCK_SEQPACKET working])
fi
AC_SUBST([HAVE_SEQPACKET])
AC_SEARCH_LIBS([lzma_version_string], [lzma], [], [
AC_MSG_ERROR([unable to find the liblzma])
])
AC_SEARCH_LIBS([BZ2_bzReadOpen], [bz2], [], [
AC_MSG_ERROR([unable to find the libbz2])
])
AC_SEARCH_LIBS([zlibVersion], [z], [], [
AC_MSG_ERROR([unable to find the zlib])
])
AC_SEARCH_LIBS([archive_read_open], [archive], [], [
AC_MSG_ERROR([unable to find the archive_read() function])
])
AC_SEARCH_LIBS([__res_query], [resolv], [], [])
AC_CHECK_HEADER([archive.h],
[pkg_found_archive_headers=yes])
AS_IF([test "x$pkg_found_archive_headers" != "xyes"],
[AC_MSG_ERROR([Unable to find the libarchive headers])])
AC_SEARCH_LIBS([jail_getid], [jail], [
AC_DEFINE(HAVE_LIBJAIL, 1, [Define to 1 if you have the 'jail' library (-ljail).])
LIBJAIL_LIB="-ljail"
], [])
AC_SEARCH_LIBS([getprogname], [bsd], [
AC_DEFINE(HAVE_LIBBSD, 1, [Define to 1 if you have the 'bsd' library (-lbsd).])
LIBBSD_LIB="-lbsd"
], [
case $host_os in
linux*)
AC_MSG_ERROR([Unable to find the libbsd])
;;
esac
])
AC_CHECK_HEADERS([gelf.h libelf.h], [
AC_CHECK_TYPES([Elf_Note], [
AC_DEFINE(HAVE_GELF_H, 1, [Define to 1 if you have the <gelf.h> header file.])
AC_CHECK_LIB(elf, gelf_getehdr, [
AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
libelf_bundled=no
]) dnl AC_CHECK_LIB
], dnl AC_CHECK_TYPES
[], AC_LANG_SOURCE(
[[
#include "gelf.h"
#include "libelf.h"
]])
)])
AC_ARG_WITH([ldns], AS_HELP_STRING([--with-ldns], [Build with ldns for name resolving]))
AS_IF([test "x$with_ldns" = "xyes"], [
PKG_CHECK_MODULES([LDNS], [libldns], [
AC_DEFINE([HAVE_LDNS], [1], [Use ldns])
AC_SUBST([HAVE_LDNS], [1], [Use ldns])
],
[
AC_CHECK_HEADER([ldns/ldns.h], [
AC_CHECK_LIB(ldns, ldns_resolver_new_frm_file, [
AC_DEFINE([HAVE_LDNS], [1], [Use ldns])
AC_SUBST([HAVE_LDNS], [1], [Use ldns])
AC_SUBST([LDNS_LIBS], [-lldns], [LDNS library])
])
])
])
AS_IF([test "x$HAVE_LDNS" != "x1"],
[AC_MSG_ERROR([Unable to find the libdns])])
])
AC_CHECK_FUNCS(cap_sandboxed, [
AC_DEFINE(HAVE_CAPSICUM, 1, [Define 1 if you have 'capsicum'.])
])
AC_CACHE_CHECK(for arc4random_uniform,
ac_cv_func_arc4random_uniform,
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="-Werror $CFLAGS"
AC_TRY_COMPILE([#include <stdlib.h>],
[arc4random_uniform(255);],
[ac_cv_func_arc4random_uniform=yes],
[ac_cv_func_arc4random_uniform=no])
CFLAGS="$ac_save_CFLAGS"])
if test "$ac_cv_func_arc4random_uniform" = yes ; then
AC_DEFINE(HAVE_ARC4RANDOM, 1, [Define 1 if you have 'arc4random_uniform' function.])
fi
AC_CACHE_CHECK(for arc4random_stir,
ac_cv_func_arc4random_stir,
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="-Werror $CFLAGS"
AC_TRY_COMPILE([#include <stdlib.h>],
[arc4random_stir();],
[ac_cv_func_arc4random_stir=yes],
[ac_cv_func_arc4random_stir=no])
CFLAGS="$ac_save_CFLAGS"])
if test "$ac_cv_func_arc4random_stir" = yes ; then
AC_DEFINE(HAVE_ARC4RANDOM_STIR, 1, [Define 1 if you have 'arc4random_stir' function.])
fi
AC_CACHE_CHECK(for humanize_number,
ac_cv_func_humanize_number,
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="-Werror $CFLAGS"
AC_TRY_COMPILE([#include <libutil.h>],
[humanize_number(NULL, 0, 0, NULL, 0, 0);],
[ac_cv_func_humanize_number=yes],
[ac_cv_func_humanize_number=no])
CFLAGS="$ac_save_CFLAGS"])
if test "$ac_cv_func_humanize_number" = yes ; then
AC_DEFINE(HAVE_HUMANIZE_NUMBER, 1, [Define 1 if you have 'humanize_number' function.])
fi
AC_CACHE_CHECK(for BSD dirname(const char *),
ac_cv_func_dirname,
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="-Werror $CFLAGS"
AC_TRY_COMPILE([#include <libgen.h>],
[static char *(*ac_test_dirname)(const char *) = dirname; ac_test_dirname("");],
[ac_cv_func_dirname=yes],
[ac_cv_func_dirname=no])
CFLAGS="$ac_save_CFLAGS"])
if test "$ac_cv_func_dirname" = yes ; then
AC_DEFINE(HAVE_BSD_DIRNAME, 1, [Define 1 if you have 'dirname(const char *)' function.])
fi
AC_CACHE_CHECK(for BSD statfs(const char *path, struct statfs *buf),
ac_cv_func_statfs,
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="-Werror $CFLAGS"
AC_TRY_COMPILE([#include <sys/param.h>
#include <sys/mount.h>],
[struct statfs stfs; static int (*ac_test_statfs)(const char *path, struct statfs *buf) = statfs; ac_test_statfs("", &stfs);],
[ac_cv_func_statfs=yes],
[ac_cv_func_statfs=no])
CFLAGS="$ac_save_CFLAGS"])
if test "$ac_cv_func_statfs" = yes ; then
AC_DEFINE(HAVE_STATFS, 1, [Define 1 if you have 'statfs(const char *path, struct statfs *buf)' function.])
fi
AC_CHECK_FUNCS(chflags chflagsat)
AC_CHECK_FUNCS(utimensat futimesat)
AC_CHECK_FUNCS(basename_r)
AC_CACHE_CHECK(for BSD basename(const char *),
ac_cv_func_basename,
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="-Werror $CFLAGS"
AC_TRY_COMPILE([#include <libgen.h>],
[static char *(*ac_test_basename)(const char *) = basename; ac_test_basename("");],
[ac_cv_func_basename=yes],
[ac_cv_func_basename=no])
CFLAGS="$ac_save_CFLAGS"])
if test "$ac_cv_func_basename" = yes ; then
AC_DEFINE(HAVE_BSD_BASENAME, 1, [Define 1 if you have 'basename(const char *)' function.])
fi
AC_MSG_CHECKING([for /proc/pid/fd directory])
if test -d "/proc/$$/fd" ; then
AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_CHECK_DECL([F_CLOSEM],
AC_DEFINE([HAVE_FCNTL_CLOSEM], [1], [Use F_CLOSEM fcntl for closefrom]),
[],
[ #include <limits.h>
#include <fcntl.h> ]
)
AC_MSG_CHECKING([whether we should only build the static version of pkg])
AC_ARG_WITH([staticonly],
[AS_HELP_STRING([--with-staticonly],
[Only build the static version (default is no)])])
if test "$with_staticonly" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(DYNAMIC, test "$with_staticonly" != "no")
dnl Select appropriate ABI
AS_CASE(
[$host_os],
[darwin*],
[ac_cv_binary_abi=macho],
[ac_cv_binary_abi=elf]
)
AM_CONDITIONAL(HAVE_MACHO_ABI, test "$ac_cv_binary_abi" = "macho")
AM_CONDITIONAL(HAVE_ELF_ABI, test "$ac_cv_binary_abi" = "elf")
AM_CONDITIONAL(LIBELF_BUNDLED, test "$ac_cv_binary_abi" = "elf" -a "$libelf_bundled" != "no")
AC_SUBST([LIBJAIL_LIB])
AC_SUBST([LIBBSD_LIB])
AC_SUBST([TESTS])
AC_SUBST([LDNS_LIBS])
AC_SUBST([LDNS_CFLAGS])
dnl We now support merely binary repos
m4_define([repos], [binary])
m4_define([repos_ldadd], [])
m4_define([repos_list], [])
m4_define([repos_makefiles], [])
m4_define([repos_ldadd_static], [])
dnl Add ldadd for repo
m4_define([repos_add_ldadd], [
m4_append([$1], [m4_join([], [$(top_builddir)/libpkg/repo/],
[$3], [/librepo_],
[$3], [$2.la ])])
])
dnl Create makefile definition for repo
m4_define([repos_add_makefile], [
m4_append([$1], [m4_join([], [\], m4_newline(), [libpkg/repo/],
[$2], [/Makefile ])])
])
m4_define([repos_add_list], [ m4_append([$1], [m4_join([],[ ],[$2])]) ])
dnl Apply macros to repos list
m4_map([m4_curry([repos_add_ldadd], [repos_ldadd], [])], [repos])
m4_map([m4_curry([repos_add_ldadd], [repos_ldadd_static], [_static])], [repos])
m4_map([m4_curry([repos_add_makefile], [repos_makefiles])], [repos])
m4_map([m4_curry([repos_add_list], [repos_list])], [repos])
REPOS='m4_normalize(m4_expand([repos_list]))'
REPOS_LDADD='m4_normalize(m4_expand([repos_ldadd]))'
REPOS_LDADD_STATIC='m4_normalize(m4_expand([repos_ldadd_static]))'
AC_SUBST([REPOS])
AC_SUBST([REPOS_LDADD])
AC_SUBST([REPOS_LDADD_STATIC])
AC_CONFIG_FILES(Makefile \
Kyuafile \
src/Makefile \
external/Makefile \
external/blake2/Makefile \
scripts/Makefile \
docs/Makefile \
tests/Makefile \
tests/Kyuafile \
tests/frontend/Kyuafile \
tests/frontend/test_environment.sh \
compat/Makefile \
libpkg/Makefile \
libpkg/repo/Makefile \
libpkg/pkg.h \
libpkg/pkg.pc
scripts/periodic/400.status-pkg
scripts/periodic/410.pkg-audit
scripts/periodic/411.pkg-backup
scripts/periodic/460.pkg-checksum
scripts/periodic/490.status-pkg-changes
scripts/sbin/pkg2ng
scripts/completion/_pkg.bash
scripts/completion/_pkg)
AC_CONFIG_FILES(m4_expand([repos_makefiles]))
AC_CONFIG_HEADERS(pkg_config.h)
AC_CONFIG_COMMANDS([pkg_repos.h], [[
NMODULES=pkg_repos.h.new
echo "#ifndef PKG_REPOS_H" > $NMODULES
echo "#define PKG_REPOS_H" >> $NMODULES
for rt in $REPOS ; do
echo "extern struct pkg_repo_ops pkg_repo_${rt}_ops;" >> $NMODULES;
done
echo "struct pkg_repo_ops* repos_ops[] = {" >> $NMODULES
for rt in $REPOS ; do
echo "&pkg_repo_${rt}_ops," >> $NMODULES
done
echo "NULL" >> $NMODULES
echo "};" >> $NMODULES
echo "#endif /* PKG_REPOS_H */" >> $NMODULES
if [ -f pkg_repos.h ] ; then
diff $NMODULES pkg_repos.h > /dev/null 2>&1
if [ $? -ne 0 ] ; then
cp $NMODULES pkg_repos.h
fi
else
cp $NMODULES pkg_repos.h
fi
rm $NMODULES
]], [REPOS="$REPOS"])
AC_CONFIG_COMMANDS([mkdir], [$MKDIR_P tests/frontend])
AC_OUTPUT