Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
revert the Makefile.autosetup -> Makefile.in
Baptiste Daroussin committed 21 days ago
commit 61a7a2d2b295108062f5591c909db8789cc689dc
parent ee156e7
43 files changed +1275 -1275
added Makefile.autosetup
@@ -0,0 +1,82 @@
+
include @builddir@/mk/defs.mk
+
DIRS=	external compat libpkg/repo libpkg src docs scripts
+
@if TESTS
+
DIRS+=	tests
+
@endif
+

+
include $(MK)/dir.mk
+
include $(MK)/common.mk
+

+
VPATH=	$(top_srcdir)
+

+
@if coverage
+
check: clean-profiles
+

+
clean-profiles:
+
	rm -f /tmp/pkg.*.profraw
+
@endif
+

+
configure_call: auto.def @CONF_GEN_FILES@
+
	sh configure_call
+
	${MAKE}
+

+
Makefile: configure_call
+

+
check: all
+

+
@if TESTS
+
all: Kyuafile Makefile
+

+
check: UndefinedBehaviour.suppress Leak.suppress
+
	export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1:suppressions=$(top_builddir)/UndefinedBehaviour.suppress; \
+
	export LSAN_OPTIONS=print_suppressions=0:exitcode=0:suppressions=$(top_builddir)/Leak.suppress; \
+
	if [ "$$(uname)" != "FreeBSD" ]; then \
+
		export ASAN_OPTIONS=detect_leaks=1 ; \
+
	fi ; \
+
	export LLVM_PROFILE_FILE=/tmp/pkg.%p.profraw; \
+
	if [ "$(HTML)" != "" ]; then \
+
		args="-r $(top_builddir)/res.db" ; \
+
	fi ; \
+
	parallel=$$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN ) ; \
+
	kyua --config=none \
+
		--variable parallelism=$${parallel} \
+
		test $$args \
+
		--kyuafile='$(top_builddir)/Kyuafile' \
+
		--build-root='$(top_builddir)' || FAILED=1 ; \
+
	if [ "$(HTML)" != "" ]; then \
+
		kyua report-html --force $$args --output=$(HTML) ; \
+
		rm -f $(top_builddir)/res.db ; \
+
	fi ; \
+
	exit $${FAILED}
+
@endif
+

+
@if coverage
+
check-coverage: check
+
	llvm-profdata merge --output=pkg.profdata /tmp/pkg.*.profraw
+

+
report-coverage:
+
	llvm-cov report ./src/pkg -instr-profile=pkg.profdata --use-color -ignore-filename-regex=external -ignore-filename-regex=compat
+
@endif
+

+
COCCI_ARGS=	-I ${top_srcdir} \
+
		-I /usr/include \
+
		-I /usr/local/include \
+
		-I ${top_srcdir}/compat \
+
		-I ${top_srcdir}/libpkg \
+
		-I ${top_srcdir}/src \
+
		-I ${top_srcdir}/external/yxml \
+
		-I ${top_srcdir}/external/libucl/include \
+
		-I ${top_srcdir}/external/uthash \
+
		-I ${top_srcdir}/external/sqlite  \
+
		-I ${top_srcdir}/external/elf
+

+
1cocci:
+
	spatch ${COCCI_ARGS} -in_place -sp_file $(top_srcdir)/tests/cocci/${COCCITEST} -dir ${top_srcdir}/libpkg ; \
+
	spatch ${COCCI_ARGS} -in_place -sp_file $(top_srcdir)/tests/cocci/${COCCITEST} -dir ${top_srcdir}/src ;
+

+
cocci:
+
	for c in ${top_srcdir}/tests/cocci/*.cocci ; do \
+
		echo "Passing $$c" ; \
+
		spatch ${COCCI_ARGS} -in_place -sp_file $$c -dir ${top_srcdir}/libpkg ; \
+
		spatch ${COCCI_ARGS} -in_place -sp_file $$c -dir ${top_srcdir}/src ; \
+
	done
deleted Makefile.in
@@ -1,82 +0,0 @@
-
include @builddir@/mk/defs.mk
-
DIRS=	external compat libpkg/repo libpkg src docs scripts
-
@if TESTS
-
DIRS+=	tests
-
@endif
-

-
include $(MK)/dir.mk
-
include $(MK)/common.mk
-

-
VPATH=	$(top_srcdir)
-

-
@if coverage
-
check: clean-profiles
-

-
clean-profiles:
-
	rm -f /tmp/pkg.*.profraw
-
@endif
-

-
configure_call: auto.def @CONF_GEN_FILES@
-
	sh configure_call
-
	${MAKE}
-

-
Makefile: configure_call
-

-
check: all
-

-
@if TESTS
-
all: Kyuafile Makefile
-

-
check: UndefinedBehaviour.suppress Leak.suppress
-
	export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1:suppressions=$(top_builddir)/UndefinedBehaviour.suppress; \
-
	export LSAN_OPTIONS=print_suppressions=0:exitcode=0:suppressions=$(top_builddir)/Leak.suppress; \
-
	if [ "$$(uname)" != "FreeBSD" ]; then \
-
		export ASAN_OPTIONS=detect_leaks=1 ; \
-
	fi ; \
-
	export LLVM_PROFILE_FILE=/tmp/pkg.%p.profraw; \
-
	if [ "$(HTML)" != "" ]; then \
-
		args="-r $(top_builddir)/res.db" ; \
-
	fi ; \
-
	parallel=$$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN ) ; \
-
	kyua --config=none \
-
		--variable parallelism=$${parallel} \
-
		test $$args \
-
		--kyuafile='$(top_builddir)/Kyuafile' \
-
		--build-root='$(top_builddir)' || FAILED=1 ; \
-
	if [ "$(HTML)" != "" ]; then \
-
		kyua report-html --force $$args --output=$(HTML) ; \
-
		rm -f $(top_builddir)/res.db ; \
-
	fi ; \
-
	exit $${FAILED}
-
@endif
-

-
@if coverage
-
check-coverage: check
-
	llvm-profdata merge --output=pkg.profdata /tmp/pkg.*.profraw
-

-
report-coverage:
-
	llvm-cov report ./src/pkg -instr-profile=pkg.profdata --use-color -ignore-filename-regex=external -ignore-filename-regex=compat
-
@endif
-

-
COCCI_ARGS=	-I ${top_srcdir} \
-
		-I /usr/include \
-
		-I /usr/local/include \
-
		-I ${top_srcdir}/compat \
-
		-I ${top_srcdir}/libpkg \
-
		-I ${top_srcdir}/src \
-
		-I ${top_srcdir}/external/yxml \
-
		-I ${top_srcdir}/external/libucl/include \
-
		-I ${top_srcdir}/external/uthash \
-
		-I ${top_srcdir}/external/sqlite  \
-
		-I ${top_srcdir}/external/elf
-

-
1cocci:
-
	spatch ${COCCI_ARGS} -in_place -sp_file $(top_srcdir)/tests/cocci/${COCCITEST} -dir ${top_srcdir}/libpkg ; \
-
	spatch ${COCCI_ARGS} -in_place -sp_file $(top_srcdir)/tests/cocci/${COCCITEST} -dir ${top_srcdir}/src ;
-

-
cocci:
-
	for c in ${top_srcdir}/tests/cocci/*.cocci ; do \
-
		echo "Passing $$c" ; \
-
		spatch ${COCCI_ARGS} -in_place -sp_file $$c -dir ${top_srcdir}/libpkg ; \
-
		spatch ${COCCI_ARGS} -in_place -sp_file $$c -dir ${top_srcdir}/src ; \
-
	done
modified auto.def
@@ -343,8 +343,8 @@ foreach in [list mk/defs.mk.in libpkg/pkg.h.in libpkg/pkg.pc.in \
	make-template $in
	define-append CONF_GEN_FILES $in
}
-
make-template Makefile.in
-
define-append CONF_GEN_FILES Makefile.in
+
make-template Makefile.autosetup Makefile
+
define-append CONF_GEN_FILES Makefile.autosetup

foreach dir [list external/libblake2 external/libpicosat \
	external/liblinenoise external/libsqlite external/libfetch \
@@ -352,8 +352,8 @@ foreach dir [list external/libblake2 external/libpicosat \
	external/libucl external/libelf tests docs \
	external/liblua external/libyxml scripts external/libder \
	external/libecc] {
-
	make-template $dir/Makefile.in
-
	define-append CONF_GEN_FILES $dir/Makefile.in
+
	make-template $dir/Makefile.autosetup $dir/Makefile
+
	define-append CONF_GEN_FILES $dir/Makefile.autosetup
}

set out [open "configure_call" w+]
added compat/Makefile.autosetup
@@ -0,0 +1,16 @@
+
include @builddir@/mk/defs.mk
+
LIB=	bsd_compat
+
SRCS=	closefrom.c \
+
	humanize_number.c \
+
	strtonum.c \
+
	funopen.c
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
+
		-I$(top_srcdir)/libpkg \
+
		-I$(top_srcdir) \
+
		-I$(top_builddir)
+

+
VPATH=	$(top_srcdir)/compat
+

+
include $(MK)/static-lib.mk
+

deleted compat/Makefile.in
@@ -1,16 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	bsd_compat
-
SRCS=	closefrom.c \
-
	humanize_number.c \
-
	strtonum.c \
-
	funopen.c
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
-
		-I$(top_srcdir)/libpkg \
-
		-I$(top_srcdir) \
-
		-I$(top_builddir)
-

-
VPATH=	$(top_srcdir)/compat
-

-
include $(MK)/static-lib.mk
-

added docs/Makefile.autosetup
@@ -0,0 +1,84 @@
+
include @builddir@/mk/defs.mk
+

+
MAN3=	pkg_printf.3 \
+
	pkg_create.3 \
+
	pkg_repo_create.3 \
+
	pkg_repos.3
+
MAN5=	pkg-repository.5 \
+
	pkg-keywords.5 \
+
	pkg-script.5 \
+
	pkg-lua-script.5 \
+
	pkg-triggers.5 \
+
	pkg.conf.5
+
MAN8=	pkg-add.8 \
+
	pkg-alias.8 \
+
	pkg-annotate.8 \
+
	pkg-audit.8 \
+
	pkg-autoremove.8 \
+
	pkg-check.8 \
+
	pkg-clean.8 \
+
	pkg-config.8 \
+
	pkg-create.8 \
+
	pkg-delete.8 \
+
	pkg-fetch.8 \
+
	pkg-help.8 \
+
	pkg-info.8 \
+
	pkg-install.8 \
+
	pkg-key.8 \
+
	pkg-lock.8 \
+
	pkg-plugins.8 \
+
	pkg-query.8 \
+
	pkg-register.8 \
+
	pkg-repo.8 \
+
	pkg-repositories.8 \
+
	pkg-rquery.8 \
+
	pkg-search.8 \
+
	pkg-set.8 \
+
	pkg-shell.8 \
+
	pkg-shlib.8 \
+
	pkg-ssh.8 \
+
	pkg-stats.8 \
+
	pkg-triggers.8 \
+
	pkg-unregister.8 \
+
	pkg-update.8 \
+
	pkg-updating.8 \
+
	pkg-upgrade.8 \
+
	pkg-version.8 \
+
	pkg-which.8 \
+
	pkg.8
+

+
MAN3GZ=	$(MAN3:.3=.3.gz)
+
MAN5GZ=	$(MAN5:.5=.5.gz)
+
MAN8GZ=	$(MAN8:.8=.8.gz)
+

+
VPATH=	$(top_srcdir)/docs
+

+
.SUFFIXES: .3.gz .5.gz .8.gz .3 .5 .8
+

+
all: $(MAN3GZ) $(MAN5GZ) $(MAN8GZ)
+

+
.3.3.gz:
+
	gzip -knc $< > $@
+

+
.5.5.gz:
+
	gzip -knc $< > $@
+

+
.8.8.gz:
+
	gzip -knc $< > $@
+

+
clean:
+
	rm -f *.gz
+

+
run-fix-xrefs:
+
	./fix-xrefs $(MAN3) $(MAN5) $(MAN8)
+

+
install:
+
	install -d $(DESTDIR)$(mandir)/man3
+
	install -d $(DESTDIR)$(mandir)/man5
+
	install -d $(DESTDIR)$(mandir)/man8
+
	install -m 644 *.3.gz $(DESTDIR)$(mandir)/man3/
+
	install -m 644 *.5.gz $(DESTDIR)$(mandir)/man5/
+
	install -m 644 *.8.gz $(DESTDIR)$(mandir)/man8/
+
	ln -sf pkg-delete.8.gz $(DESTDIR)$(mandir)/man8/pkg-remove.8.gz
+
	ln -sf pkg.8.gz $(DESTDIR)$(mandir)/man8/pkg-static.8.gz
+
	ln -sf pkg-lock.8.gz $(DESTDIR)$(mandir)/man8/pkg-unlock.8.gz
deleted docs/Makefile.in
@@ -1,84 +0,0 @@
-
include @builddir@/mk/defs.mk
-

-
MAN3=	pkg_printf.3 \
-
	pkg_create.3 \
-
	pkg_repo_create.3 \
-
	pkg_repos.3
-
MAN5=	pkg-repository.5 \
-
	pkg-keywords.5 \
-
	pkg-script.5 \
-
	pkg-lua-script.5 \
-
	pkg-triggers.5 \
-
	pkg.conf.5
-
MAN8=	pkg-add.8 \
-
	pkg-alias.8 \
-
	pkg-annotate.8 \
-
	pkg-audit.8 \
-
	pkg-autoremove.8 \
-
	pkg-check.8 \
-
	pkg-clean.8 \
-
	pkg-config.8 \
-
	pkg-create.8 \
-
	pkg-delete.8 \
-
	pkg-fetch.8 \
-
	pkg-help.8 \
-
	pkg-info.8 \
-
	pkg-install.8 \
-
	pkg-key.8 \
-
	pkg-lock.8 \
-
	pkg-plugins.8 \
-
	pkg-query.8 \
-
	pkg-register.8 \
-
	pkg-repo.8 \
-
	pkg-repositories.8 \
-
	pkg-rquery.8 \
-
	pkg-search.8 \
-
	pkg-set.8 \
-
	pkg-shell.8 \
-
	pkg-shlib.8 \
-
	pkg-ssh.8 \
-
	pkg-stats.8 \
-
	pkg-triggers.8 \
-
	pkg-unregister.8 \
-
	pkg-update.8 \
-
	pkg-updating.8 \
-
	pkg-upgrade.8 \
-
	pkg-version.8 \
-
	pkg-which.8 \
-
	pkg.8
-

-
MAN3GZ=	$(MAN3:.3=.3.gz)
-
MAN5GZ=	$(MAN5:.5=.5.gz)
-
MAN8GZ=	$(MAN8:.8=.8.gz)
-

-
VPATH=	$(top_srcdir)/docs
-

-
.SUFFIXES: .3.gz .5.gz .8.gz .3 .5 .8
-

-
all: $(MAN3GZ) $(MAN5GZ) $(MAN8GZ)
-

-
.3.3.gz:
-
	gzip -knc $< > $@
-

-
.5.5.gz:
-
	gzip -knc $< > $@
-

-
.8.8.gz:
-
	gzip -knc $< > $@
-

-
clean:
-
	rm -f *.gz
-

-
run-fix-xrefs:
-
	./fix-xrefs $(MAN3) $(MAN5) $(MAN8)
-

-
install:
-
	install -d $(DESTDIR)$(mandir)/man3
-
	install -d $(DESTDIR)$(mandir)/man5
-
	install -d $(DESTDIR)$(mandir)/man8
-
	install -m 644 *.3.gz $(DESTDIR)$(mandir)/man3/
-
	install -m 644 *.5.gz $(DESTDIR)$(mandir)/man5/
-
	install -m 644 *.8.gz $(DESTDIR)$(mandir)/man8/
-
	ln -sf pkg-delete.8.gz $(DESTDIR)$(mandir)/man8/pkg-remove.8.gz
-
	ln -sf pkg.8.gz $(DESTDIR)$(mandir)/man8/pkg-static.8.gz
-
	ln -sf pkg-lock.8.gz $(DESTDIR)$(mandir)/man8/pkg-unlock.8.gz
added external/Makefile.autosetup
@@ -0,0 +1,6 @@
+
include @builddir@/mk/defs.mk
+
DIRS=	libblake2 libpicosat liblinenoise libfetch libsqlite libucl liblua libyxml libder libecc
+
@if libelf-internal
+
DIRS+=	libelf
+
@endif
+
include $(MK)/dir.mk
deleted external/Makefile.in
@@ -1,6 +0,0 @@
-
include @builddir@/mk/defs.mk
-
DIRS=	libblake2 libpicosat liblinenoise libfetch libsqlite libucl liblua libyxml libder libecc
-
@if libelf-internal
-
DIRS+=	libelf
-
@endif
-
include $(MK)/dir.mk
added external/libblake2/Makefile.autosetup
@@ -0,0 +1,8 @@
+
include @builddir@/mk/defs.mk
+
LIB=	blake2
+
SRCS=	blake2b-ref.c blake2s-ref.c
+
LOCAL_CFLAGS=	-I$(top_srcdir)/compat -O3
+

+
VPATH=	$(top_srcdir)/external/blake2
+

+
include $(MK)/static-lib.mk
deleted external/libblake2/Makefile.in
@@ -1,8 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	blake2
-
SRCS=	blake2b-ref.c blake2s-ref.c
-
LOCAL_CFLAGS=	-I$(top_srcdir)/compat -O3
-

-
VPATH=	$(top_srcdir)/external/blake2
-

-
include $(MK)/static-lib.mk
added external/libder/Makefile.autosetup
@@ -0,0 +1,15 @@
+
include @builddir@/mk/defs.mk
+

+
LIB=	der
+

+
VPATH=	$(top_srcdir)/external/libder/libder
+
.PATH:	$(top_srcdir)/external/libder/libder
+

+
SRCS=	libder.c \
+
	libder_error.c \
+
	libder_obj.c \
+
	libder_read.c \
+
	libder_type.c \
+
	libder_write.c
+

+
include $(MK)/static-lib.mk
deleted external/libder/Makefile.in
@@ -1,15 +0,0 @@
-
include @builddir@/mk/defs.mk
-

-
LIB=	der
-

-
VPATH=	$(top_srcdir)/external/libder/libder
-
.PATH:	$(top_srcdir)/external/libder/libder
-

-
SRCS=	libder.c \
-
	libder_error.c \
-
	libder_obj.c \
-
	libder_read.c \
-
	libder_type.c \
-
	libder_write.c
-

-
include $(MK)/static-lib.mk
added external/libecc/Makefile.autosetup
@@ -0,0 +1,147 @@
+
include @builddir@/mk/defs.mk
+

+
LIB=	ecc
+

+
.PATH: $(top_srcdir)/external/libecc
+
VPATH+= $(top_srcdir)/external/libecc
+
SRCS+=	pkg_libecc_rand.c
+

+
# curves_mod_src
+
.PATH:	$(top_srcdir)/external/libecc/src/curves
+
VPATH+=	$(top_srcdir)/external/libecc/src/curves
+
SRCS+=	aff_pt.c \
+
	aff_pt_montgomery.c \
+
	ec_edwards.c \
+
	ec_montgomery.c \
+
	ec_params.c \
+
	ec_shortw.c \
+
	aff_pt_edwards.c \
+
	curves.c \
+
	prj_pt.c
+

+
# utils_ec_src
+
.PATH:	$(top_srcdir)/external/libecc/src/utils
+
VPATH+=	$(top_srcdir)/external/libecc/src/utils
+
SRCS+=	print_curves.c
+

+
# fp_mod_src
+
.PATH:	$(top_srcdir)/external/libecc/src/fp
+
VPATH+=	$(top_srcdir)/external/libecc/src/fp
+
SRCS+=	fp_add.c \
+
	fp.c \
+
	fp_montgomery.c \
+
	fp_mul.c \
+
	fp_mul_redc1.c \
+
	fp_pow.c \
+
	fp_rand.c \
+
	fp_sqrt.c
+

+
# nn_mod_src
+
.PATH:	$(top_srcdir)/external/libecc/src/nn
+
VPATH+=	$(top_srcdir)/external/libecc/src/nn
+
SRCS+=	nn_add.c \
+
	nn.c \
+
	nn_div.c \
+
	nn_logical.c \
+
	nn_modinv.c \
+
	nn_mod_pow.c \
+
	nn_mul.c \
+
	nn_mul_redc1.c \
+
	nn_rand.c
+

+
# utils_arith_src
+
SRCS+=	utils.c \
+
	utils_rand.c \
+
	print_buf.c \
+
	print_fp.c \
+
	print_nn.c
+

+
## libsign bits
+
# hash_mod_src
+
.PATH:	$(top_srcdir)/external/libecc/src/hash
+
VPATH+=	$(top_srcdir)/external/libecc/src/hash
+
SRCS+=	hash_algs.c \
+
	sm3.c \
+
	streebog.c \
+
	ripemd160.c \
+
	belt-hash.c \
+
	hmac.c \
+
	bash224.c \
+
	bash256.c \
+
	bash384.c \
+
	bash512.c \
+
	bash.c \
+
	sha224.c \
+
	sha256.c \
+
	sha3-224.c \
+
	sha3-256.c \
+
	sha3-384.c \
+
	sha3-512.c \
+
	sha384.c \
+
	sha3.c \
+
	sha512-224.c \
+
	sha512-256.c \
+
	sha512.c \
+
	sha512_core.c \
+
	shake256.c \
+
	shake.c
+

+
# sig_mod_src
+
.PATH:	$(top_srcdir)/external/libecc/src/sig
+
VPATH+=	$(top_srcdir)/external/libecc/src/sig
+
SRCS+=	decdsa.c \
+
	ecdsa.c \
+
	ecfsdsa.c \
+
	ecgdsa.c \
+
	eckcdsa.c \
+
	ecosdsa.c \
+
	ecrdsa.c \
+
	ecsdsa.c \
+
	eddsa.c \
+
	fuzzing_ecdsa.c \
+
	fuzzing_ecgdsa.c \
+
	fuzzing_ecrdsa.c \
+
	ecdsa_common.c \
+
	ecsdsa_common.c \
+
	sig_algs.c \
+
	sm2.c \
+
	bign_common.c \
+
	bign.c \
+
	dbign.c \
+
	bip0340.c
+

+
# key_mod_src
+
SRCS+=	ec_key.c
+

+
# utils_sign_src
+
.PATH:	$(top_srcdir)/external/libecc/src/sig
+
VPATH+=	$(top_srcdir)/external/libecc/src/sig
+
SRCS+=	print_keys.c
+

+
# ecdh_mod_src
+
.PATH:	$(top_srcdir)/external/libecc/src/ecdh
+
VPATH+=	$(top_srcdir)/external/libecc/src/ecdh
+
SRCS+=	ecccdh.c \
+
	x25519_448.c
+

+
# external_deps
+
.PATH:	$(top_srcdir)/external/libecc/src/external_deps
+
VPATH+=	$(top_srcdir)/external/libecc/src/external_deps
+
SRCS+=	print.c
+

+
CONFLICTS=	-Dsha256_init=_libecc_sha256_init \
+
		-Dsha256_update=_libecc_sha256_update \
+
		-Dsha256_final=_libecc_sha256_final \
+
		-Dsha512_224_init=_libecc_sha512_224_init \
+
		-Dsha512_256_init=_libecc_sha512_256_init
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/external/libecc/include \
+
		-I$(top_srcdir)/compat \
+
		-I$(top_builddir)/ \
+
		-fno-builtin \
+
		-fstack-protector-strong \
+
		-DUSE_WARN_UNUSED_RET \
+
		-DWITH_STDLIB \
+
		$(CONFLICTS)
+

+
include $(MK)/static-lib.mk
deleted external/libecc/Makefile.in
@@ -1,147 +0,0 @@
-
include @builddir@/mk/defs.mk
-

-
LIB=	ecc
-

-
.PATH: $(top_srcdir)/external/libecc
-
VPATH+= $(top_srcdir)/external/libecc
-
SRCS+=	pkg_libecc_rand.c
-

-
# curves_mod_src
-
.PATH:	$(top_srcdir)/external/libecc/src/curves
-
VPATH+=	$(top_srcdir)/external/libecc/src/curves
-
SRCS+=	aff_pt.c \
-
	aff_pt_montgomery.c \
-
	ec_edwards.c \
-
	ec_montgomery.c \
-
	ec_params.c \
-
	ec_shortw.c \
-
	aff_pt_edwards.c \
-
	curves.c \
-
	prj_pt.c
-

-
# utils_ec_src
-
.PATH:	$(top_srcdir)/external/libecc/src/utils
-
VPATH+=	$(top_srcdir)/external/libecc/src/utils
-
SRCS+=	print_curves.c
-

-
# fp_mod_src
-
.PATH:	$(top_srcdir)/external/libecc/src/fp
-
VPATH+=	$(top_srcdir)/external/libecc/src/fp
-
SRCS+=	fp_add.c \
-
	fp.c \
-
	fp_montgomery.c \
-
	fp_mul.c \
-
	fp_mul_redc1.c \
-
	fp_pow.c \
-
	fp_rand.c \
-
	fp_sqrt.c
-

-
# nn_mod_src
-
.PATH:	$(top_srcdir)/external/libecc/src/nn
-
VPATH+=	$(top_srcdir)/external/libecc/src/nn
-
SRCS+=	nn_add.c \
-
	nn.c \
-
	nn_div.c \
-
	nn_logical.c \
-
	nn_modinv.c \
-
	nn_mod_pow.c \
-
	nn_mul.c \
-
	nn_mul_redc1.c \
-
	nn_rand.c
-

-
# utils_arith_src
-
SRCS+=	utils.c \
-
	utils_rand.c \
-
	print_buf.c \
-
	print_fp.c \
-
	print_nn.c
-

-
## libsign bits
-
# hash_mod_src
-
.PATH:	$(top_srcdir)/external/libecc/src/hash
-
VPATH+=	$(top_srcdir)/external/libecc/src/hash
-
SRCS+=	hash_algs.c \
-
	sm3.c \
-
	streebog.c \
-
	ripemd160.c \
-
	belt-hash.c \
-
	hmac.c \
-
	bash224.c \
-
	bash256.c \
-
	bash384.c \
-
	bash512.c \
-
	bash.c \
-
	sha224.c \
-
	sha256.c \
-
	sha3-224.c \
-
	sha3-256.c \
-
	sha3-384.c \
-
	sha3-512.c \
-
	sha384.c \
-
	sha3.c \
-
	sha512-224.c \
-
	sha512-256.c \
-
	sha512.c \
-
	sha512_core.c \
-
	shake256.c \
-
	shake.c
-

-
# sig_mod_src
-
.PATH:	$(top_srcdir)/external/libecc/src/sig
-
VPATH+=	$(top_srcdir)/external/libecc/src/sig
-
SRCS+=	decdsa.c \
-
	ecdsa.c \
-
	ecfsdsa.c \
-
	ecgdsa.c \
-
	eckcdsa.c \
-
	ecosdsa.c \
-
	ecrdsa.c \
-
	ecsdsa.c \
-
	eddsa.c \
-
	fuzzing_ecdsa.c \
-
	fuzzing_ecgdsa.c \
-
	fuzzing_ecrdsa.c \
-
	ecdsa_common.c \
-
	ecsdsa_common.c \
-
	sig_algs.c \
-
	sm2.c \
-
	bign_common.c \
-
	bign.c \
-
	dbign.c \
-
	bip0340.c
-

-
# key_mod_src
-
SRCS+=	ec_key.c
-

-
# utils_sign_src
-
.PATH:	$(top_srcdir)/external/libecc/src/sig
-
VPATH+=	$(top_srcdir)/external/libecc/src/sig
-
SRCS+=	print_keys.c
-

-
# ecdh_mod_src
-
.PATH:	$(top_srcdir)/external/libecc/src/ecdh
-
VPATH+=	$(top_srcdir)/external/libecc/src/ecdh
-
SRCS+=	ecccdh.c \
-
	x25519_448.c
-

-
# external_deps
-
.PATH:	$(top_srcdir)/external/libecc/src/external_deps
-
VPATH+=	$(top_srcdir)/external/libecc/src/external_deps
-
SRCS+=	print.c
-

-
CONFLICTS=	-Dsha256_init=_libecc_sha256_init \
-
		-Dsha256_update=_libecc_sha256_update \
-
		-Dsha256_final=_libecc_sha256_final \
-
		-Dsha512_224_init=_libecc_sha512_224_init \
-
		-Dsha512_256_init=_libecc_sha512_256_init
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/external/libecc/include \
-
		-I$(top_srcdir)/compat \
-
		-I$(top_builddir)/ \
-
		-fno-builtin \
-
		-fstack-protector-strong \
-
		-DUSE_WARN_UNUSED_RET \
-
		-DWITH_STDLIB \
-
		$(CONFLICTS)
-

-
include $(MK)/static-lib.mk
added external/libelf/Makefile.autosetup
@@ -0,0 +1,76 @@
+
include @builddir@/mk/defs.mk
+
LIB=	elf
+
SRCS=	elf_begin.c \
+
	elf_cntl.c \
+
	elf_data.c \
+
	elf_end.c \
+
	elf_errmsg.c \
+
	elf_errno.c \
+
	elf_fill.c \
+
	elf_flag.c \
+
	elf_getarhdr.c \
+
	elf_getarsym.c \
+
	elf_getbase.c \
+
	elf_getident.c \
+
	elf_hash.c \
+
	elf_kind.c \
+
	elf_memory.c \
+
	elf_next.c \
+
	elf_open.c \
+
	elf_phnum.c \
+
	elf_rand.c \
+
	elf_rawfile.c \
+
	elf_scn.c \
+
	elf_shnum.c \
+
	elf_shstrndx.c \
+
	elf_strptr.c \
+
	elf_update.c \
+
	elf_version.c \
+
	elf.c \
+
	gelf_cap.c \
+
	gelf_checksum.c \
+
	gelf_dyn.c \
+
	gelf_ehdr.c \
+
	gelf_fsize.c \
+
	gelf_getclass.c \
+
	gelf_move.c \
+
	gelf_phdr.c \
+
	gelf_rel.c \
+
	gelf_rela.c \
+
	gelf_shdr.c \
+
	gelf_sym.c \
+
	gelf_syminfo.c \
+
	gelf_symshndx.c \
+
	gelf_xlate.c \
+
	libelf_align.c \
+
	libelf_allocate.c \
+
	libelf_ar_util.c \
+
	libelf_ar.c \
+
	libelf_checksum.c \
+
	libelf_convert.c \
+
	libelf_data.c \
+
	libelf_ehdr.c \
+
	libelf_extended.c \
+
	libelf_fsize.c \
+
	libelf_memory.c \
+
	libelf_msize.c \
+
	libelf_open.c \
+
	libelf_phdr.c \
+
	libelf_shdr.c \
+
	libelf_xlate.c
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/external/elf -I$(top_builddir)/external/elf
+

+
VPATH=	$(top_srcdir)/external/elf
+

+
libelf_fsize.c: libelf_fsize.m4 elf_types.m4
+
	m4 -D SRCDIR=$(top_srcdir)/external/elf $(top_srcdir)/external/elf/elf_types.m4 $(top_srcdir)/external/elf/libelf_fsize.m4 > $@
+

+
libelf_convert.c: libelf_convert.m4 elf_types.m4
+
	m4 -D SRCDIR=$(top_srcdir)/external/elf $(top_srcdir)/external/elf/elf_types.m4 $(top_srcdir)/external/elf/libelf_convert.m4 > $@
+

+
libelf_msize.c: libelf_msize.m4 elf_types.m4
+
	@m4 -D SRCDIR=$(top_srcdir)/external/elf $(top_srcdir)/external/elf/elf_types.m4 $(top_srcdir)/external/elf/libelf_msize.m4 > $@
+

+

+
include $(MK)/static-lib.mk
deleted external/libelf/Makefile.in
@@ -1,76 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	elf
-
SRCS=	elf_begin.c \
-
	elf_cntl.c \
-
	elf_data.c \
-
	elf_end.c \
-
	elf_errmsg.c \
-
	elf_errno.c \
-
	elf_fill.c \
-
	elf_flag.c \
-
	elf_getarhdr.c \
-
	elf_getarsym.c \
-
	elf_getbase.c \
-
	elf_getident.c \
-
	elf_hash.c \
-
	elf_kind.c \
-
	elf_memory.c \
-
	elf_next.c \
-
	elf_open.c \
-
	elf_phnum.c \
-
	elf_rand.c \
-
	elf_rawfile.c \
-
	elf_scn.c \
-
	elf_shnum.c \
-
	elf_shstrndx.c \
-
	elf_strptr.c \
-
	elf_update.c \
-
	elf_version.c \
-
	elf.c \
-
	gelf_cap.c \
-
	gelf_checksum.c \
-
	gelf_dyn.c \
-
	gelf_ehdr.c \
-
	gelf_fsize.c \
-
	gelf_getclass.c \
-
	gelf_move.c \
-
	gelf_phdr.c \
-
	gelf_rel.c \
-
	gelf_rela.c \
-
	gelf_shdr.c \
-
	gelf_sym.c \
-
	gelf_syminfo.c \
-
	gelf_symshndx.c \
-
	gelf_xlate.c \
-
	libelf_align.c \
-
	libelf_allocate.c \
-
	libelf_ar_util.c \
-
	libelf_ar.c \
-
	libelf_checksum.c \
-
	libelf_convert.c \
-
	libelf_data.c \
-
	libelf_ehdr.c \
-
	libelf_extended.c \
-
	libelf_fsize.c \
-
	libelf_memory.c \
-
	libelf_msize.c \
-
	libelf_open.c \
-
	libelf_phdr.c \
-
	libelf_shdr.c \
-
	libelf_xlate.c
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/external/elf -I$(top_builddir)/external/elf
-

-
VPATH=	$(top_srcdir)/external/elf
-

-
libelf_fsize.c: libelf_fsize.m4 elf_types.m4
-
	m4 -D SRCDIR=$(top_srcdir)/external/elf $(top_srcdir)/external/elf/elf_types.m4 $(top_srcdir)/external/elf/libelf_fsize.m4 > $@
-

-
libelf_convert.c: libelf_convert.m4 elf_types.m4
-
	m4 -D SRCDIR=$(top_srcdir)/external/elf $(top_srcdir)/external/elf/elf_types.m4 $(top_srcdir)/external/elf/libelf_convert.m4 > $@
-

-
libelf_msize.c: libelf_msize.m4 elf_types.m4
-
	@m4 -D SRCDIR=$(top_srcdir)/external/elf $(top_srcdir)/external/elf/elf_types.m4 $(top_srcdir)/external/elf/libelf_msize.m4 > $@
-

-

-
include $(MK)/static-lib.mk
added external/libfetch/Makefile.autosetup
@@ -0,0 +1,22 @@
+
include @builddir@/mk/defs.mk
+
LIB=	fetch
+
SRCS=	common.c \
+
	fetch.c \
+
	http.c
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
+
		-I$(top_srcdir) \
+
		-I$(top_builddir) \
+
		-Wno-unused-parameter \
+
		-Wno-pointer-sign \
+
		-DWITH_SSL \
+
		-DINET6 \
+
		-DOPENSSL_API_COMPAT=0x10100000L
+

+
@if PKG_OPENSSL_CFLAGS
+
CFLAGS+=	@PKG_OPENSSL_CFLAGS@
+
@endif
+

+
VPATH=	$(top_srcdir)/external/fetch
+

+
include $(MK)/static-lib.mk
deleted external/libfetch/Makefile.in
@@ -1,22 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	fetch
-
SRCS=	common.c \
-
	fetch.c \
-
	http.c
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
-
		-I$(top_srcdir) \
-
		-I$(top_builddir) \
-
		-Wno-unused-parameter \
-
		-Wno-pointer-sign \
-
		-DWITH_SSL \
-
		-DINET6 \
-
		-DOPENSSL_API_COMPAT=0x10100000L
-

-
@if PKG_OPENSSL_CFLAGS
-
CFLAGS+=	@PKG_OPENSSL_CFLAGS@
-
@endif
-

-
VPATH=	$(top_srcdir)/external/fetch
-

-
include $(MK)/static-lib.mk
added external/liblinenoise/Makefile.autosetup
@@ -0,0 +1,6 @@
+
include @builddir@/mk/defs.mk
+
LIB=	linenoise
+
SRCS=	linenoise.c stringbuf.c utf8.c
+
VPATH=	$(top_srcdir)/external/linenoise
+

+
include $(MK)/static-lib.mk
deleted external/liblinenoise/Makefile.in
@@ -1,6 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	linenoise
-
SRCS=	linenoise.c stringbuf.c utf8.c
-
VPATH=	$(top_srcdir)/external/linenoise
-

-
include $(MK)/static-lib.mk
added external/liblua/Makefile.autosetup
@@ -0,0 +1,42 @@
+
include @builddir@/mk/defs.mk
+

+
LIB=	lua
+
.PATH:	$(top_srcdir)/external/lua/src/
+
VPATH=	$(top_srcdir)/external/lua/src/
+

+
SRCS=	lapi.c \
+
	lcode.c \
+
	lctype.c \
+
	ldebug.c \
+
	ldo.c \
+
	ldump.c \
+
	lfunc.c \
+
	lgc.c \
+
	llex.c \
+
	lmem.c \
+
	lobject.c \
+
	lopcodes.c \
+
	lparser.c \
+
	lstate.c \
+
	lstring.c \
+
	ltable.c \
+
	ltm.c \
+
	lundump.c \
+
	lvm.c \
+
	lzio.c \
+
	lauxlib.c \
+
	lbaselib.c \
+
	lcorolib.c \
+
	ldblib.c \
+
	liolib.c \
+
	lmathlib.c \
+
	loslib.c \
+
	lstrlib.c \
+
	ltablib.c \
+
	lutf8lib.c \
+
	loadlib.c \
+
	linit.c
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/external/lua/src -DLUA_USE_POSIX
+

+
include $(MK)/static-lib.mk
deleted external/liblua/Makefile.in
@@ -1,42 +0,0 @@
-
include @builddir@/mk/defs.mk
-

-
LIB=	lua
-
.PATH:	$(top_srcdir)/external/lua/src/
-
VPATH=	$(top_srcdir)/external/lua/src/
-

-
SRCS=	lapi.c \
-
	lcode.c \
-
	lctype.c \
-
	ldebug.c \
-
	ldo.c \
-
	ldump.c \
-
	lfunc.c \
-
	lgc.c \
-
	llex.c \
-
	lmem.c \
-
	lobject.c \
-
	lopcodes.c \
-
	lparser.c \
-
	lstate.c \
-
	lstring.c \
-
	ltable.c \
-
	ltm.c \
-
	lundump.c \
-
	lvm.c \
-
	lzio.c \
-
	lauxlib.c \
-
	lbaselib.c \
-
	lcorolib.c \
-
	ldblib.c \
-
	liolib.c \
-
	lmathlib.c \
-
	loslib.c \
-
	lstrlib.c \
-
	ltablib.c \
-
	lutf8lib.c \
-
	loadlib.c \
-
	linit.c
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/external/lua/src -DLUA_USE_POSIX
-

-
include $(MK)/static-lib.mk
added external/libpicosat/Makefile.autosetup
@@ -0,0 +1,10 @@
+
include @builddir@/mk/defs.mk
+
LIB=	picosat
+
SRCS=	picosat.c \
+
	version.c
+
LOCAL_CFLAGS=	-Wno-strict-aliasing \
+
		-Wno-unused -DNGETRUSAGE
+

+
VPATH=	$(top_srcdir)/external/picosat
+

+
include $(MK)/static-lib.mk
deleted external/libpicosat/Makefile.in
@@ -1,10 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	picosat
-
SRCS=	picosat.c \
-
	version.c
-
LOCAL_CFLAGS=	-Wno-strict-aliasing \
-
		-Wno-unused -DNGETRUSAGE
-

-
VPATH=	$(top_srcdir)/external/picosat
-

-
include $(MK)/static-lib.mk
added external/libsqlite/Makefile.autosetup
@@ -0,0 +1,45 @@
+
include @builddir@/mk/defs.mk
+
LIB=	sqlite
+
SRCS=	sqlite3.c \
+
	shell.c
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/external/linenoise \
+
		-I$(top_builddir)/external/libsqlite \
+
		-D_HAVE_SQLITE_CONFIG_H \
+
		-DHAVE_LINENOISE=2 \
+
		-Wno-unused-variable \
+
		-Wno-unused-function \
+
		-Wno-strict-aliasing \
+
		-Wno-unused-parameter \
+
		-DSQLITE_OS_UNIX=1 \
+
		-DDHAVE_MALLOC_USABLE_SIZE=1 \
+
		-DSQLITE_OMIT_AUTOVACUUM \
+
		-DSQLITE_OMIT_BLOB_LITERAL \
+
		-DSQLITE_OMIT_DECLTYPE \
+
		-DSQLITE_OMIT_EXPLAIN \
+
		-DSQLITE_OMIT_DEPRECATED \
+
		-DSQLITE_OMIT_LOAD_EXTENSION \
+
		-DSQLITE_OMIT_PROGRESS_CALLBACK \
+
		-DSQLITE_OMIT_TCL_VARIABLE \
+
		-DSQLITE_OMIT_UTF16 \
+
		-DSQLITE_OMIT_CAT \
+
		-DSQLITE_OMIT_CHECK \
+
		-DSQLITE_OMIT_AUTOINIT \
+
		-DSQLITE_OMIT_COMPILEOPTION_DIAGS \
+
		-DSQLITE_OMIT_INTEGRITY_CHECK \
+
		-DSQLITE_OMIT_BUILTIN_TEST \
+
		-DSQLITE_OMIT_SHARED_CACHE \
+
		-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
+
		-DUSE_PREAD \
+
		-DUSE_PWRITE \
+
		-DSQLITE_THREADSAFE=0 \
+
		-DSQLITE_TEMP_STORE=3 \
+
		-DSQLITE_ENABLE_FTS4 \
+
		-DSQLITE_SHELL_DBNAME_PROC=pkgshell_opendb \
+
		-DSQLITE_SHELL_INIT_PROC=pkgdb_init_proc \
+
		-Dmain=sqlite3_shell \
+
		-DNDEBUG
+

+
VPATH=	$(top_srcdir)/external/sqlite
+

+
include $(MK)/static-lib.mk
deleted external/libsqlite/Makefile.in
@@ -1,45 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	sqlite
-
SRCS=	sqlite3.c \
-
	shell.c
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/external/linenoise \
-
		-I$(top_builddir)/external/libsqlite \
-
		-D_HAVE_SQLITE_CONFIG_H \
-
		-DHAVE_LINENOISE=2 \
-
		-Wno-unused-variable \
-
		-Wno-unused-function \
-
		-Wno-strict-aliasing \
-
		-Wno-unused-parameter \
-
		-DSQLITE_OS_UNIX=1 \
-
		-DDHAVE_MALLOC_USABLE_SIZE=1 \
-
		-DSQLITE_OMIT_AUTOVACUUM \
-
		-DSQLITE_OMIT_BLOB_LITERAL \
-
		-DSQLITE_OMIT_DECLTYPE \
-
		-DSQLITE_OMIT_EXPLAIN \
-
		-DSQLITE_OMIT_DEPRECATED \
-
		-DSQLITE_OMIT_LOAD_EXTENSION \
-
		-DSQLITE_OMIT_PROGRESS_CALLBACK \
-
		-DSQLITE_OMIT_TCL_VARIABLE \
-
		-DSQLITE_OMIT_UTF16 \
-
		-DSQLITE_OMIT_CAT \
-
		-DSQLITE_OMIT_CHECK \
-
		-DSQLITE_OMIT_AUTOINIT \
-
		-DSQLITE_OMIT_COMPILEOPTION_DIAGS \
-
		-DSQLITE_OMIT_INTEGRITY_CHECK \
-
		-DSQLITE_OMIT_BUILTIN_TEST \
-
		-DSQLITE_OMIT_SHARED_CACHE \
-
		-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
-
		-DUSE_PREAD \
-
		-DUSE_PWRITE \
-
		-DSQLITE_THREADSAFE=0 \
-
		-DSQLITE_TEMP_STORE=3 \
-
		-DSQLITE_ENABLE_FTS4 \
-
		-DSQLITE_SHELL_DBNAME_PROC=pkgshell_opendb \
-
		-DSQLITE_SHELL_INIT_PROC=pkgdb_init_proc \
-
		-Dmain=sqlite3_shell \
-
		-DNDEBUG
-

-
VPATH=	$(top_srcdir)/external/sqlite
-

-
include $(MK)/static-lib.mk
added external/libucl/Makefile.autosetup
@@ -0,0 +1,22 @@
+
include @builddir@/mk/defs.mk
+
LIB=	ucl
+
SRCS=	src/ucl_emitter_streamline.c \
+
	src/ucl_emitter_utils.c \
+
	src/ucl_emitter.c \
+
	src/ucl_hash.c \
+
	src/ucl_msgpack.c \
+
	src/ucl_parser.c \
+
	src/ucl_schema.c \
+
	src/ucl_sexp.c \
+
	src/ucl_util.c
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/external/libucl/include \
+
		-I$(top_srcdir)/external/libucl/uthash \
+
		-I$(top_srcdir)/external/libucl/klib \
+
		-I$(top_srcdir)/external/libucl/src/ \
+
		-Wno-unused-parameter \
+
		-Wno-pointer-sign
+

+
VPATH=	$(top_srcdir)/external/libucl
+

+
include $(MK)/static-lib.mk
deleted external/libucl/Makefile.in
@@ -1,22 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	ucl
-
SRCS=	src/ucl_emitter_streamline.c \
-
	src/ucl_emitter_utils.c \
-
	src/ucl_emitter.c \
-
	src/ucl_hash.c \
-
	src/ucl_msgpack.c \
-
	src/ucl_parser.c \
-
	src/ucl_schema.c \
-
	src/ucl_sexp.c \
-
	src/ucl_util.c
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/external/libucl/include \
-
		-I$(top_srcdir)/external/libucl/uthash \
-
		-I$(top_srcdir)/external/libucl/klib \
-
		-I$(top_srcdir)/external/libucl/src/ \
-
		-Wno-unused-parameter \
-
		-Wno-pointer-sign
-

-
VPATH=	$(top_srcdir)/external/libucl
-

-
include $(MK)/static-lib.mk
added external/libyxml/Makefile.autosetup
@@ -0,0 +1,13 @@
+
include @builddir@/mk/defs.mk
+

+
LIB=	yxml
+

+
SRCS=	yxml.c
+

+
LOCAL_CFLAGS=	-Wno-unused-parameter -I. -I$(top_srcdir)/external/yxml
+

+
VPATH=	$(top_srcdir)/external/yxml
+

+
include $(MK)/static-lib.mk
+

+

deleted external/libyxml/Makefile.in
@@ -1,13 +0,0 @@
-
include @builddir@/mk/defs.mk
-

-
LIB=	yxml
-

-
SRCS=	yxml.c
-

-
LOCAL_CFLAGS=	-Wno-unused-parameter -I. -I$(top_srcdir)/external/yxml
-

-
VPATH=	$(top_srcdir)/external/yxml
-

-
include $(MK)/static-lib.mk
-

-

added libpkg/Makefile.autosetup
@@ -0,0 +1,211 @@
+
include @builddir@/mk/defs.mk
+
LIB=	pkg
+
SRCS=	backup_lib.c \
+
	merge3.c \
+
	pkg_audit.c \
+
	pkg_deps.c \
+
	pkg_repo_meta.c \
+
	pkg.c \
+
	pkg_key.c \
+
	pkgsign.c \
+
	pkgsign_ecc.c \
+
	pkgsign_ossl.c \
+
	clean_cache.c \
+
	metalog.c \
+
	pkg_checksum.c \
+
	pkg_manifest.c \
+
	pkg_repo_update.c \
+
	pkgdb_iterator.c \
+
	lua.c \
+
	lua_scripts.c \
+
	scripts.c \
+
	diff.c \
+
	packing.c \
+
	pkg_config.c \
+
	pkg_event.c \
+
	pkg_object.c \
+
	pkg_osvf.c \
+
	pkg_repo.c \
+
	pkgdb_query.c \
+
	sha256.c dns_utils.c \
+
	pkg_add.c \
+
	pkg_create.c \
+
	pkg_jobs_conflicts.c pkg_ports.c \
+
	pkg_solve.c \
+
	pkgdb.c \
+
	pkg_abi.c \
+
	pkg_elf.c \
+
	pkg_abi_macho.c \
+
	binfmt_macho.c \
+
	ssh.c \
+
	pkgbase.c \
+
	pkg_arch.c \
+
	pkg_cudf.c \
+
	pkg_cpe.c \
+
	pkg_jobs_universe.c  pkg_printf.c \
+
	pkg_status.c \
+
	plugins.c \
+
	utils.c fetch.c \
+
	pkg_sandbox.c \
+
	pkg_attributes.c \
+
	pkg_delete.c \
+
	pkg_jobs.c \
+
	pkg_jobs_schedule.c \
+
	pkg_repo_create.c \
+
	pkg_version.c \
+
	rcscripts.c \
+
	flags.c \
+
	fetch_ssh.c \
+
	fetch_libfetch.c \
+
	fetch_file.c \
+
	triggers.c \
+
	pkghash.c \
+
	yuarel.c \
+
	json.c
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
+
		-I$(top_srcdir)/external/blake2 \
+
		-I$(top_srcdir)/external/sqlite \
+
		-I$(top_srcdir)/external/uthash \
+
		-I$(top_srcdir)/external/picosat \
+
		-I$(top_srcdir)/external/yxml \
+
		-I$(top_srcdir)/external/uthash \
+
		-I$(top_srcdir)/external/include \
+
		-I$(top_srcdir)/external/libucl/include \
+
		-I$(top_srcdir)/external/lua/src \
+
		-I$(top_srcdir)/external/liblua/ \
+
		-I$(top_srcdir)/external/libder/libder \
+
		-I$(top_srcdir)/external/libecc/include \
+
		-I$(top_srcdir)/external/fetch \
+
		-I$(top_srcdir)/libpkg/repo \
+
		-I$(top_builddir)/libpkg/repo \
+
		-I$(top_srcdir)/libpkg \
+
		-I$(top_builddir)/libpkg \
+
		-I$(top_srcdir) \
+
		-I$(top_builddir) \
+
		-Wl,--as-needed \
+
		-Wno-pointer-sign \
+
		-Wno-missing-field-initializers \
+
		-Wno-sign-compare \
+
		-DPREFIX=\"$(PREFIX)\" \
+
		-DHAVE_CONFIG_H
+

+
LOCAL_LDFLAGS=	@waflags@ \
+
		@REPOS_LDFLAGS@ \
+
		-L$(top_builddir)/external/libsqlite -lsqlite_pic \
+
		-L$(top_builddir)/external/libucl -lucl_pic \
+
		-L$(top_builddir)/external/libpicosat -lpicosat_pic \
+
		-L$(top_builddir)/external/liblinenoise -llinenoise_pic \
+
		-L$(top_builddir)/external/libyxml -lyxml_pic \
+
		-L$(top_builddir)/external/libblake2 -lblake2_pic \
+
		-L$(top_builddir)/compat -lbsd_compat_pic \
+
		-L$(top_builddir)/external/liblua -llua_pic \
+
		-L$(top_builddir)/external/libder -lder_pic \
+
		-L$(top_builddir)/external/libecc -lecc_pic \
+
		-L$(top_builddir)/external/libfetch -lfetch_pic \
+
		@nowaflags@ \
+
		-lm
+

+
STATIC_LIBS=	@REPOS_STATIC_LIBS@ \
+
		$(top_builddir)/external/libsqlite/libsqlite.a \
+
		$(top_builddir)/external/libucl/libucl.a \
+
		$(top_builddir)/external/libpicosat/libpicosat.a \
+
		$(top_builddir)/external/liblinenoise/liblinenoise.a \
+
		$(top_builddir)/external/libyxml/libyxml.a \
+
		$(top_builddir)/external/libblake2/libblake2.a \
+
		$(top_builddir)/external/liblua/liblua.a \
+
		$(top_builddir)/compat/libbsd_compat.a \
+
		$(top_builddir)/external/libder/libder.a \
+
		$(top_builddir)/external/libecc/libecc.a \
+
		$(top_builddir)/external/libfetch/libfetch.a \
+
		lib$(LIB).a
+

+
@if HAVE_LIBUTIL
+
LOCAL_LDFLAGS+=	-lutil
+
@endif
+
@if HAVE_LIBFTS
+
LOCAL_LDFLAGS+=	-lfts
+
@endif
+
@if HAVE_LIBDL
+
LOCAL_LDFLAGS+= -ldl
+
@endif
+

+
@if pkgos_darwin
+
LOCAL_LDFLAGS+=	-lresolv
+
@else
+
@if pkgos_freebsd
+
LOCAL_LDFLAGS+=	-Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver,--undefined-version
+
@else
+
### --undefined-version is a FreeBSD ld option
+
LOCAL_LDFLAGS+=	-Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver
+
@endif
+
@endif
+

+
@if libelf-internal
+
LOCAL_CFLAGS+= -I$(top_srcdir)/external/elf
+
STATIC_LIBS+=	$(top_builddir)/external/libelf/libelf.a
+
LOCAL_LDFLAGS+=	-L$(top_builddir)/external/libelf -lelf
+
@endif
+

+
@if libelf-external
+
LOCAL_LDFLAGS+=	-lelf
+
@endif
+

+
@if PKG_LIBARCHIVE_LIBS
+
LOCAL_CFLAGS+=	@PKG_LIBARCHIVE_CFLAGS@
+
LOCAL_LDFLAGS+=	@PKG_LIBARCHIVE_LDFLAGS@ @PKG_LIBARCHIVE_LIBS@
+
@else
+
LOCAL_LDFLAGS+=	-larchive
+
@endif
+

+
@if PKG_OPENSSL_LIBS
+
LOCAL_CFLAGS+=	@PKG_OPENSSL_CFLAGS@
+
LOCAL_LDFLAGS+=	@PKG_OPENSSL_LDFLAGS@ @PKG_OPENSSL_LIBS@
+
@else
+
LOCAL_LDFLAGS+=	-lssl -lcrypto
+
@endif
+

+
@if PKG_LIBLDNS_LIBS
+
LOCAL_CFLAGS+=	@PKG_LIBLDNS_CFLAGS@
+
LOCAL_LDFLAGS+=	@PKG_LIBLDNS_LDFLAGS@ @PKG_LIBLDNS_LIBS@
+
@endif
+

+
VPATH=	$(top_srcdir)/libpkg
+
.PATH:	$(top_srcdir)/libpkg
+

+
include $(MK)/lib.mk
+

+
$(OBJS) $(SHOBJS): $(top_builddir)/pkg_config.h
+

+
all: lib$(LIB)_flat.a
+

+
lib$(LIB)$(LIBSOEXT): $(STATIC_LIBS)
+

+
@if pkgos_darwin
+
lib$(LIB)_flat.a: $(STATIC_LIBS)
+
	libtool -static -o lib$(LIB)_flat.a $(STATIC_LIBS)
+
@else
+
lib$(LIB)_flat.a: ${STATIC_LIBS} mergelib_script
+
	$(AR) -M < mergelib_script
+
@endif
+

+
mergelib_script: $(STATIC_LIBS)
+
	@echo "CREATE lib$(LIB)_flat.a" > $@
+
	@for l in $(STATIC_LIBS); do \
+
		echo "ADDLIB $$l"; \
+
	done >> $@
+
	@echo "SAVE" >> $@
+
	@echo "END" >> $@
+

+
install: all pkg.h lib$(LIB)$(LIBSOEXT) lib$(LIB)_flat.a
+
	install -d -m 755 $(DESTDIR)$(libdir)
+
	install -d -m 755 $(DESTDIR)$(includedir)
+
	install -d -m 755 $(DESTDIR)$(includedir)/pkg
+
	install -d -m 755 $(DESTDIR)$(pkgconfigdir)
+
	install -m 644 lib$(LIB)$(LIBSOEXT) $(DESTDIR)$(libdir)/
+
	ln -sf lib$(LIB)$(LIBSOEXT) $(DESTDIR)$(libdir)/lib$(LIB)$(SH_SOEXT)
+
	install -m 644 lib$(LIB)_flat.a $(DESTDIR)$(libdir)/lib$(LIB).a
+
	install -m 644 pkg.h $(DESTDIR)$(includedir)/
+
	install -m 644 $(top_srcdir)/libpkg/pkg/vec.h $(DESTDIR)$(includedir)/pkg
+
	install -m 644 $(top_srcdir)/libpkg/pkg/audit.h $(DESTDIR)$(includedir)/pkg
+
	install -m 644 pkg.pc $(DESTDIR)$(pkgconfigdir)/
deleted libpkg/Makefile.in
@@ -1,211 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	pkg
-
SRCS=	backup_lib.c \
-
	merge3.c \
-
	pkg_audit.c \
-
	pkg_deps.c \
-
	pkg_repo_meta.c \
-
	pkg.c \
-
	pkg_key.c \
-
	pkgsign.c \
-
	pkgsign_ecc.c \
-
	pkgsign_ossl.c \
-
	clean_cache.c \
-
	metalog.c \
-
	pkg_checksum.c \
-
	pkg_manifest.c \
-
	pkg_repo_update.c \
-
	pkgdb_iterator.c \
-
	lua.c \
-
	lua_scripts.c \
-
	scripts.c \
-
	diff.c \
-
	packing.c \
-
	pkg_config.c \
-
	pkg_event.c \
-
	pkg_object.c \
-
	pkg_osvf.c \
-
	pkg_repo.c \
-
	pkgdb_query.c \
-
	sha256.c dns_utils.c \
-
	pkg_add.c \
-
	pkg_create.c \
-
	pkg_jobs_conflicts.c pkg_ports.c \
-
	pkg_solve.c \
-
	pkgdb.c \
-
	pkg_abi.c \
-
	pkg_elf.c \
-
	pkg_abi_macho.c \
-
	binfmt_macho.c \
-
	ssh.c \
-
	pkgbase.c \
-
	pkg_arch.c \
-
	pkg_cudf.c \
-
	pkg_cpe.c \
-
	pkg_jobs_universe.c  pkg_printf.c \
-
	pkg_status.c \
-
	plugins.c \
-
	utils.c fetch.c \
-
	pkg_sandbox.c \
-
	pkg_attributes.c \
-
	pkg_delete.c \
-
	pkg_jobs.c \
-
	pkg_jobs_schedule.c \
-
	pkg_repo_create.c \
-
	pkg_version.c \
-
	rcscripts.c \
-
	flags.c \
-
	fetch_ssh.c \
-
	fetch_libfetch.c \
-
	fetch_file.c \
-
	triggers.c \
-
	pkghash.c \
-
	yuarel.c \
-
	json.c
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
-
		-I$(top_srcdir)/external/blake2 \
-
		-I$(top_srcdir)/external/sqlite \
-
		-I$(top_srcdir)/external/uthash \
-
		-I$(top_srcdir)/external/picosat \
-
		-I$(top_srcdir)/external/yxml \
-
		-I$(top_srcdir)/external/uthash \
-
		-I$(top_srcdir)/external/include \
-
		-I$(top_srcdir)/external/libucl/include \
-
		-I$(top_srcdir)/external/lua/src \
-
		-I$(top_srcdir)/external/liblua/ \
-
		-I$(top_srcdir)/external/libder/libder \
-
		-I$(top_srcdir)/external/libecc/include \
-
		-I$(top_srcdir)/external/fetch \
-
		-I$(top_srcdir)/libpkg/repo \
-
		-I$(top_builddir)/libpkg/repo \
-
		-I$(top_srcdir)/libpkg \
-
		-I$(top_builddir)/libpkg \
-
		-I$(top_srcdir) \
-
		-I$(top_builddir) \
-
		-Wl,--as-needed \
-
		-Wno-pointer-sign \
-
		-Wno-missing-field-initializers \
-
		-Wno-sign-compare \
-
		-DPREFIX=\"$(PREFIX)\" \
-
		-DHAVE_CONFIG_H
-

-
LOCAL_LDFLAGS=	@waflags@ \
-
		@REPOS_LDFLAGS@ \
-
		-L$(top_builddir)/external/libsqlite -lsqlite_pic \
-
		-L$(top_builddir)/external/libucl -lucl_pic \
-
		-L$(top_builddir)/external/libpicosat -lpicosat_pic \
-
		-L$(top_builddir)/external/liblinenoise -llinenoise_pic \
-
		-L$(top_builddir)/external/libyxml -lyxml_pic \
-
		-L$(top_builddir)/external/libblake2 -lblake2_pic \
-
		-L$(top_builddir)/compat -lbsd_compat_pic \
-
		-L$(top_builddir)/external/liblua -llua_pic \
-
		-L$(top_builddir)/external/libder -lder_pic \
-
		-L$(top_builddir)/external/libecc -lecc_pic \
-
		-L$(top_builddir)/external/libfetch -lfetch_pic \
-
		@nowaflags@ \
-
		-lm
-

-
STATIC_LIBS=	@REPOS_STATIC_LIBS@ \
-
		$(top_builddir)/external/libsqlite/libsqlite.a \
-
		$(top_builddir)/external/libucl/libucl.a \
-
		$(top_builddir)/external/libpicosat/libpicosat.a \
-
		$(top_builddir)/external/liblinenoise/liblinenoise.a \
-
		$(top_builddir)/external/libyxml/libyxml.a \
-
		$(top_builddir)/external/libblake2/libblake2.a \
-
		$(top_builddir)/external/liblua/liblua.a \
-
		$(top_builddir)/compat/libbsd_compat.a \
-
		$(top_builddir)/external/libder/libder.a \
-
		$(top_builddir)/external/libecc/libecc.a \
-
		$(top_builddir)/external/libfetch/libfetch.a \
-
		lib$(LIB).a
-

-
@if HAVE_LIBUTIL
-
LOCAL_LDFLAGS+=	-lutil
-
@endif
-
@if HAVE_LIBFTS
-
LOCAL_LDFLAGS+=	-lfts
-
@endif
-
@if HAVE_LIBDL
-
LOCAL_LDFLAGS+= -ldl
-
@endif
-

-
@if pkgos_darwin
-
LOCAL_LDFLAGS+=	-lresolv
-
@else
-
@if pkgos_freebsd
-
LOCAL_LDFLAGS+=	-Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver,--undefined-version
-
@else
-
### --undefined-version is a FreeBSD ld option
-
LOCAL_LDFLAGS+=	-Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver
-
@endif
-
@endif
-

-
@if libelf-internal
-
LOCAL_CFLAGS+= -I$(top_srcdir)/external/elf
-
STATIC_LIBS+=	$(top_builddir)/external/libelf/libelf.a
-
LOCAL_LDFLAGS+=	-L$(top_builddir)/external/libelf -lelf
-
@endif
-

-
@if libelf-external
-
LOCAL_LDFLAGS+=	-lelf
-
@endif
-

-
@if PKG_LIBARCHIVE_LIBS
-
LOCAL_CFLAGS+=	@PKG_LIBARCHIVE_CFLAGS@
-
LOCAL_LDFLAGS+=	@PKG_LIBARCHIVE_LDFLAGS@ @PKG_LIBARCHIVE_LIBS@
-
@else
-
LOCAL_LDFLAGS+=	-larchive
-
@endif
-

-
@if PKG_OPENSSL_LIBS
-
LOCAL_CFLAGS+=	@PKG_OPENSSL_CFLAGS@
-
LOCAL_LDFLAGS+=	@PKG_OPENSSL_LDFLAGS@ @PKG_OPENSSL_LIBS@
-
@else
-
LOCAL_LDFLAGS+=	-lssl -lcrypto
-
@endif
-

-
@if PKG_LIBLDNS_LIBS
-
LOCAL_CFLAGS+=	@PKG_LIBLDNS_CFLAGS@
-
LOCAL_LDFLAGS+=	@PKG_LIBLDNS_LDFLAGS@ @PKG_LIBLDNS_LIBS@
-
@endif
-

-
VPATH=	$(top_srcdir)/libpkg
-
.PATH:	$(top_srcdir)/libpkg
-

-
include $(MK)/lib.mk
-

-
$(OBJS) $(SHOBJS): $(top_builddir)/pkg_config.h
-

-
all: lib$(LIB)_flat.a
-

-
lib$(LIB)$(LIBSOEXT): $(STATIC_LIBS)
-

-
@if pkgos_darwin
-
lib$(LIB)_flat.a: $(STATIC_LIBS)
-
	libtool -static -o lib$(LIB)_flat.a $(STATIC_LIBS)
-
@else
-
lib$(LIB)_flat.a: ${STATIC_LIBS} mergelib_script
-
	$(AR) -M < mergelib_script
-
@endif
-

-
mergelib_script: $(STATIC_LIBS)
-
	@echo "CREATE lib$(LIB)_flat.a" > $@
-
	@for l in $(STATIC_LIBS); do \
-
		echo "ADDLIB $$l"; \
-
	done >> $@
-
	@echo "SAVE" >> $@
-
	@echo "END" >> $@
-

-
install: all pkg.h lib$(LIB)$(LIBSOEXT) lib$(LIB)_flat.a
-
	install -d -m 755 $(DESTDIR)$(libdir)
-
	install -d -m 755 $(DESTDIR)$(includedir)
-
	install -d -m 755 $(DESTDIR)$(includedir)/pkg
-
	install -d -m 755 $(DESTDIR)$(pkgconfigdir)
-
	install -m 644 lib$(LIB)$(LIBSOEXT) $(DESTDIR)$(libdir)/
-
	ln -sf lib$(LIB)$(LIBSOEXT) $(DESTDIR)$(libdir)/lib$(LIB)$(SH_SOEXT)
-
	install -m 644 lib$(LIB)_flat.a $(DESTDIR)$(libdir)/lib$(LIB).a
-
	install -m 644 pkg.h $(DESTDIR)$(includedir)/
-
	install -m 644 $(top_srcdir)/libpkg/pkg/vec.h $(DESTDIR)$(includedir)/pkg
-
	install -m 644 $(top_srcdir)/libpkg/pkg/audit.h $(DESTDIR)$(includedir)/pkg
-
	install -m 644 pkg.pc $(DESTDIR)$(pkgconfigdir)/
added libpkg/repo/Makefile.autosetup
@@ -0,0 +1,21 @@
+
include @builddir@/mk/defs.mk
+
DIRS=	@REPOS@
+

+
all: pkg_repos.h
+

+
pkg_repos.h: $(DIRS)
+
	@echo "#ifndef PKG_REPOS_H" > $@
+
	@echo "#define PKG_REPOS_H" >> $@
+
	@for b in $(DIRS); do \
+
		echo "extern struct pkg_repo_ops pkg_repo_$${b}_ops;" ; \
+
	done >> $@
+
	@echo "struct pkg_repo_ops *repos_ops[] = {" >> $@
+
	@for b in $(DIRS); do \
+
		echo "&pkg_repo_$${b}_ops," ; \
+
	done >> $@
+
	@echo "NULL" >> $@
+
	@echo "};" >> $@
+
	@echo "#endif /* PKG_REPOS_H */" >> $@
+

+
include $(MK)/dir.mk
+

deleted libpkg/repo/Makefile.in
@@ -1,21 +0,0 @@
-
include @builddir@/mk/defs.mk
-
DIRS=	@REPOS@
-

-
all: pkg_repos.h
-

-
pkg_repos.h: $(DIRS)
-
	@echo "#ifndef PKG_REPOS_H" > $@
-
	@echo "#define PKG_REPOS_H" >> $@
-
	@for b in $(DIRS); do \
-
		echo "extern struct pkg_repo_ops pkg_repo_$${b}_ops;" ; \
-
	done >> $@
-
	@echo "struct pkg_repo_ops *repos_ops[] = {" >> $@
-
	@for b in $(DIRS); do \
-
		echo "&pkg_repo_$${b}_ops," ; \
-
	done >> $@
-
	@echo "NULL" >> $@
-
	@echo "};" >> $@
-
	@echo "#endif /* PKG_REPOS_H */" >> $@
-

-
include $(MK)/dir.mk
-

added libpkg/repo/binary/Makefile.autosetup
@@ -0,0 +1,26 @@
+
include @builddir@/mk/defs.mk
+
LIB=	repo-binary
+
SRCS=	binary.c \
+
	common.c \
+
	fetch.c \
+
	init.c \
+
	query.c \
+
	update.c
+
LOCAL_CFLAGS=	-I$(top_srcdir)/libpkg \
+
		-I$(top_builddir)/libpkg \
+
		-I$(top_srcdir)/external/uthash \
+
		-I$(top_srcdir)/external/sqlite \
+
		-I$(top_srcdir)/external/libucl/include \
+
		-I$(top_srcdir)/external/include \
+
		-I$(top_srcdir)/compat \
+
		-I$(top_srcdir)/ \
+
		-I$(top_builddir)/
+

+
VPATH=	$(top_srcdir)/libpkg/repo/binary
+
.PATH:	$(top_srcdir)/libpkg/repo/binary
+

+
@if HAVE_PKG_LIBARCHIVE
+
LOCAL_CFLAGS+=	@PKG_LIBARCHIVE_CFLAGS@
+
@endif
+

+
include $(MK)/static-lib.mk
deleted libpkg/repo/binary/Makefile.in
@@ -1,26 +0,0 @@
-
include @builddir@/mk/defs.mk
-
LIB=	repo-binary
-
SRCS=	binary.c \
-
	common.c \
-
	fetch.c \
-
	init.c \
-
	query.c \
-
	update.c
-
LOCAL_CFLAGS=	-I$(top_srcdir)/libpkg \
-
		-I$(top_builddir)/libpkg \
-
		-I$(top_srcdir)/external/uthash \
-
		-I$(top_srcdir)/external/sqlite \
-
		-I$(top_srcdir)/external/libucl/include \
-
		-I$(top_srcdir)/external/include \
-
		-I$(top_srcdir)/compat \
-
		-I$(top_srcdir)/ \
-
		-I$(top_builddir)/
-

-
VPATH=	$(top_srcdir)/libpkg/repo/binary
-
.PATH:	$(top_srcdir)/libpkg/repo/binary
-

-
@if HAVE_PKG_LIBARCHIVE
-
LOCAL_CFLAGS+=	@PKG_LIBARCHIVE_CFLAGS@
-
@endif
-

-
include $(MK)/static-lib.mk
added scripts/Makefile.autosetup
@@ -0,0 +1,46 @@
+
include @builddir@/mk/defs.mk
+

+
.SUFFIXES: .in
+

+
.in:
+
	sed -e 's|%prefix%|$(PREFIX)|g' $< > $@
+

+
pdailydir=		$(sysconfdir)/periodic/daily
+
psecuritydir=		$(sysconfdir)/periodic/security
+
pweeklydir=		$(sysconfdir)/periodic/weekly
+
bashcompdir=		$(sysconfdir)/bash_completion.d
+
zshcompdir=		$(PREFIX)/share/zsh/site-functions
+

+
PDAILY=	periodic/411.pkg-backup \
+
	periodic/490.status-pkg-changes
+
PSECURITY=	periodic/410.pkg-audit \
+
		periodic/405.pkg-base-audit \
+
		periodic/460.pkg-checksum
+
PWEEKLY=	periodic/400.status-pkg
+
COMPLETION=	completion/_pkg \
+
		completion/_pkg.bash
+

+
VPATH=	$(top_srcdir)/scripts
+

+
all: $(PDAILY) $(PSECURITY) $(PWEEKLY) $(COMPLETION)
+

+
clean:
+
	rm -f $(PDAILY) $(PSECURITY) $(PWEEKLY)
+

+
install: $(PDAILY) $(PSECURITY) $(PWEEKLY) $(COMPLETION)
+
	install -d -m 755 $(DESTDIR)$(pdailydir)
+
	install -d -m 755 $(DESTDIR)$(pweeklydir)
+
	install -d -m 755 $(DESTDIR)$(psecuritydir)
+
	install -d -m 755 $(DESTDIR)$(bashcompdir)
+
	install -d -m 755 $(DESTDIR)$(zshcompdir)
+
	for script in $(PDAILY); do \
+
		install -m 755 $$script $(DESTDIR)$(pdailydir)/ ; \
+
	done
+
	for script in $(PSECURITY); do \
+
		install -m 755 $$script $(DESTDIR)$(psecuritydir)/ ; \
+
	done
+
	for script in $(PWEEKLY); do \
+
		install -m 755 $$script $(DESTDIR)$(pweeklydir)/ ; \
+
	done
+
	install -m 644 completion/_pkg.bash $(DESTDIR)$(bashcompdir)/
+
	install -m 644 completion/_pkg  $(DESTDIR)$(zshcompdir)/
deleted scripts/Makefile.in
@@ -1,46 +0,0 @@
-
include @builddir@/mk/defs.mk
-

-
.SUFFIXES: .in
-

-
.in:
-
	sed -e 's|%prefix%|$(PREFIX)|g' $< > $@
-

-
pdailydir=		$(sysconfdir)/periodic/daily
-
psecuritydir=		$(sysconfdir)/periodic/security
-
pweeklydir=		$(sysconfdir)/periodic/weekly
-
bashcompdir=		$(sysconfdir)/bash_completion.d
-
zshcompdir=		$(PREFIX)/share/zsh/site-functions
-

-
PDAILY=	periodic/411.pkg-backup \
-
	periodic/490.status-pkg-changes
-
PSECURITY=	periodic/410.pkg-audit \
-
		periodic/405.pkg-base-audit \
-
		periodic/460.pkg-checksum
-
PWEEKLY=	periodic/400.status-pkg
-
COMPLETION=	completion/_pkg \
-
		completion/_pkg.bash
-

-
VPATH=	$(top_srcdir)/scripts
-

-
all: $(PDAILY) $(PSECURITY) $(PWEEKLY) $(COMPLETION)
-

-
clean:
-
	rm -f $(PDAILY) $(PSECURITY) $(PWEEKLY)
-

-
install: $(PDAILY) $(PSECURITY) $(PWEEKLY) $(COMPLETION)
-
	install -d -m 755 $(DESTDIR)$(pdailydir)
-
	install -d -m 755 $(DESTDIR)$(pweeklydir)
-
	install -d -m 755 $(DESTDIR)$(psecuritydir)
-
	install -d -m 755 $(DESTDIR)$(bashcompdir)
-
	install -d -m 755 $(DESTDIR)$(zshcompdir)
-
	for script in $(PDAILY); do \
-
		install -m 755 $$script $(DESTDIR)$(pdailydir)/ ; \
-
	done
-
	for script in $(PSECURITY); do \
-
		install -m 755 $$script $(DESTDIR)$(psecuritydir)/ ; \
-
	done
-
	for script in $(PWEEKLY); do \
-
		install -m 755 $$script $(DESTDIR)$(pweeklydir)/ ; \
-
	done
-
	install -m 644 completion/_pkg.bash $(DESTDIR)$(bashcompdir)/
-
	install -m 644 completion/_pkg  $(DESTDIR)$(zshcompdir)/
added src/Makefile.autosetup
@@ -0,0 +1,131 @@
+
include @builddir@/mk/defs.mk
+
PROG=	pkg
+
SRCS=	add.c \
+
	alias.c \
+
	annotate.c \
+
	audit.c \
+
	autoremove.c \
+
	check.c \
+
	clean.c \
+
	config.c \
+
	create.c \
+
	delete.c \
+
	event.c \
+
	fetch.c \
+
	globals.c \
+
	info.c \
+
	install.c \
+
	key.c \
+
	lock.c \
+
	main.c \
+
	plugins.c \
+
	query.c \
+
	register.c \
+
	repo.c \
+
	repositories.c \
+
	rquery.c \
+
	search.c \
+
	set.c \
+
	shell.c \
+
	shlib.c \
+
	ssh.c \
+
	stats.c \
+
	triggers.c \
+
	unregister.c \
+
	update.c \
+
	updating.c \
+
	upgrade.c \
+
	utils.c \
+
	version.c \
+
	which.c
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
+
		-I$(top_srcdir)/external/libucl/include \
+
		-I$(top_srcdir)/external/include \
+
		-I$(top_builddir)/ \
+
		-I$(top_srcdir)/libpkg \
+
		-I$(top_builddir)/libpkg \
+
		-DGITHASH=\"@GITHASH@\" \
+
		-DHAVE_CONFIG_H \
+
		-Werror=switch
+
LIBPKGFLAT=	-L$(top_builddir)/libpkg -lpkg_flat
+
OTHER_LIBS=	@EXTRA_LIBS@ -lm -pthread
+

+
@if HAVE_PKG_LIBARCHIVE
+
OTHER_LIBS+=	@PKG_LIBARCHIVE_LDFLAGS@ @PKG_LIBARCHIVE_LIBS@
+
LOCAL_CFLAGS+=	@PKG_LIBARCHIVE_CFLAGS@
+
@else
+
OTHER_LIBS+=	-larchive
+
@endif
+

+
@if HAVE_LIBUTIL
+
OTHER_LIBS+=	-lutil
+
@endif
+

+
@if HAVE_LIBFTS
+
OTHER_LIBS+=	-lfts
+
@endif
+

+
@if HAVE_LIBDL
+
OTHER_LIBS+=	-ldl
+
@endif
+

+
@if PKG_OPENSSL_LIBS
+
LOCAL_CFLAGS+=	@PKG_OPENSSL_CFLAGS@
+
OTHER_LIBS+=	@PKG_OPENSSL_LDFLAGS@ @PKG_OPENSSL_LIBS@
+
@else
+
OTHER_LIBS+=	-lssl -lcrypto
+
@endif
+

+
# libmd must be linked after libssl/libcrypto.
+
@if HAVE_LIBMD
+
OTHER_LIBS+=	-lmd
+
@endif
+

+
@if pkgos_darwin
+
LOCAL_LDFLAGS=	$(LIBPKGFLAT) $(LIBS) $(OTHER_LIBS) -lresolv
+
STATIC_LDFLAGS=	$(LIBPKGFLAT) $(LIBS) $(OTHER_LIBS) -lresolv
+
# OSX doesn't support static binaries, sigh
+
STATIC_ARG=
+
@else
+
LOCAL_LDFLAGS=	-Wl,-Bstatic \
+
		@waflags@ $(LIBPKGFLAT) @nowaflags@ \
+
		$(LIBS) \
+
		-Wl,-Bdynamic -Wl,--as-needed $(OTHER_LIBS) \
+
		-Wl,--export-dynamic
+
STATIC_ARG=	-static
+
STATIC_LDFLAGS=	$(LIBPKGFLAT) $(LIBS) $(OTHER_LIBS)
+
@endif
+

+
# For libarchive
+
STATIC_LDFLAGS+=	-lbz2 -lz -llzma @ZSTDLIB@
+

+
VPATH=	$(top_srcdir)/src
+

+
include $(MK)/prog.mk
+

+
@if HAVE_STATIC
+
all: pkg-static
+
install: install-static
+

+
pkg-static: $(OBJS) $(top_builddir)/libpkg/libpkg_flat.a
+
	$(CC) -o $@ $(OBJS) $(STATIC_ARG) $(LDFLAGS) $(STATIC_LDFLAGS)
+

+
install-static: pkg-static
+
	install -d -m 755 $(DESTDIR)$(sbindir)
+
	install -m 755 pkg-static $(DESTDIR)$(sbindir)/pkg-static
+
@endif
+

+
${OBJS}: $(top_builddir)/pkg_config.h
+

+
$(PROG): $(top_builddir)/libpkg/libpkg_flat.a
+

+
install: $(PROG)
+
	install -d -m 755 $(DESTDIR)$(sbindir)
+
	install -m 755 pkg $(DESTDIR)$(sbindir)/pkg
+
	install -d -m 755 $(DESTDIR)$(etcdir)
+
	install -m 644 $(top_srcdir)/src/pkg.conf.sample $(DESTDIR)$(etcdir)/
+

+
clean: clean-pkg-static
+
clean-pkg-static:
+
	rm -f pkg-static
deleted src/Makefile.in
@@ -1,131 +0,0 @@
-
include @builddir@/mk/defs.mk
-
PROG=	pkg
-
SRCS=	add.c \
-
	alias.c \
-
	annotate.c \
-
	audit.c \
-
	autoremove.c \
-
	check.c \
-
	clean.c \
-
	config.c \
-
	create.c \
-
	delete.c \
-
	event.c \
-
	fetch.c \
-
	globals.c \
-
	info.c \
-
	install.c \
-
	key.c \
-
	lock.c \
-
	main.c \
-
	plugins.c \
-
	query.c \
-
	register.c \
-
	repo.c \
-
	repositories.c \
-
	rquery.c \
-
	search.c \
-
	set.c \
-
	shell.c \
-
	shlib.c \
-
	ssh.c \
-
	stats.c \
-
	triggers.c \
-
	unregister.c \
-
	update.c \
-
	updating.c \
-
	upgrade.c \
-
	utils.c \
-
	version.c \
-
	which.c
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
-
		-I$(top_srcdir)/external/libucl/include \
-
		-I$(top_srcdir)/external/include \
-
		-I$(top_builddir)/ \
-
		-I$(top_srcdir)/libpkg \
-
		-I$(top_builddir)/libpkg \
-
		-DGITHASH=\"@GITHASH@\" \
-
		-DHAVE_CONFIG_H \
-
		-Werror=switch
-
LIBPKGFLAT=	-L$(top_builddir)/libpkg -lpkg_flat
-
OTHER_LIBS=	@EXTRA_LIBS@ -lm -pthread
-

-
@if HAVE_PKG_LIBARCHIVE
-
OTHER_LIBS+=	@PKG_LIBARCHIVE_LDFLAGS@ @PKG_LIBARCHIVE_LIBS@
-
LOCAL_CFLAGS+=	@PKG_LIBARCHIVE_CFLAGS@
-
@else
-
OTHER_LIBS+=	-larchive
-
@endif
-

-
@if HAVE_LIBUTIL
-
OTHER_LIBS+=	-lutil
-
@endif
-

-
@if HAVE_LIBFTS
-
OTHER_LIBS+=	-lfts
-
@endif
-

-
@if HAVE_LIBDL
-
OTHER_LIBS+=	-ldl
-
@endif
-

-
@if PKG_OPENSSL_LIBS
-
LOCAL_CFLAGS+=	@PKG_OPENSSL_CFLAGS@
-
OTHER_LIBS+=	@PKG_OPENSSL_LDFLAGS@ @PKG_OPENSSL_LIBS@
-
@else
-
OTHER_LIBS+=	-lssl -lcrypto
-
@endif
-

-
# libmd must be linked after libssl/libcrypto.
-
@if HAVE_LIBMD
-
OTHER_LIBS+=	-lmd
-
@endif
-

-
@if pkgos_darwin
-
LOCAL_LDFLAGS=	$(LIBPKGFLAT) $(LIBS) $(OTHER_LIBS) -lresolv
-
STATIC_LDFLAGS=	$(LIBPKGFLAT) $(LIBS) $(OTHER_LIBS) -lresolv
-
# OSX doesn't support static binaries, sigh
-
STATIC_ARG=
-
@else
-
LOCAL_LDFLAGS=	-Wl,-Bstatic \
-
		@waflags@ $(LIBPKGFLAT) @nowaflags@ \
-
		$(LIBS) \
-
		-Wl,-Bdynamic -Wl,--as-needed $(OTHER_LIBS) \
-
		-Wl,--export-dynamic
-
STATIC_ARG=	-static
-
STATIC_LDFLAGS=	$(LIBPKGFLAT) $(LIBS) $(OTHER_LIBS)
-
@endif
-

-
# For libarchive
-
STATIC_LDFLAGS+=	-lbz2 -lz -llzma @ZSTDLIB@
-

-
VPATH=	$(top_srcdir)/src
-

-
include $(MK)/prog.mk
-

-
@if HAVE_STATIC
-
all: pkg-static
-
install: install-static
-

-
pkg-static: $(OBJS) $(top_builddir)/libpkg/libpkg_flat.a
-
	$(CC) -o $@ $(OBJS) $(STATIC_ARG) $(LDFLAGS) $(STATIC_LDFLAGS)
-

-
install-static: pkg-static
-
	install -d -m 755 $(DESTDIR)$(sbindir)
-
	install -m 755 pkg-static $(DESTDIR)$(sbindir)/pkg-static
-
@endif
-

-
${OBJS}: $(top_builddir)/pkg_config.h
-

-
$(PROG): $(top_builddir)/libpkg/libpkg_flat.a
-

-
install: $(PROG)
-
	install -d -m 755 $(DESTDIR)$(sbindir)
-
	install -m 755 pkg $(DESTDIR)$(sbindir)/pkg
-
	install -d -m 755 $(DESTDIR)$(etcdir)
-
	install -m 644 $(top_srcdir)/src/pkg.conf.sample $(DESTDIR)$(etcdir)/
-

-
clean: clean-pkg-static
-
clean-pkg-static:
-
	rm -f pkg-static
added tests/Makefile.autosetup
@@ -0,0 +1,242 @@
+
include @builddir@/mk/defs.mk
+

+
TESTS=	\
+
	checksum \
+
	deps_formula \
+
	merge \
+
	packing \
+
	pkg_add_dir_to_del \
+
	pkg_cpe \
+
	pkg_printf \
+
	pkg_validation \
+
	pkg_osvf \
+
	pkg \
+
	plist \
+
	lua \
+
	ssh \
+
	utils \
+
	metalog \
+
	vec \
+
	pkg_elf \
+
	hash \
+
	shlibs \
+
	kv
+

+
TESTS_SH= \
+
	frontend/audit.sh \
+
	frontend/pkg.sh \
+
	frontend/add.sh \
+
	frontend/alias.sh \
+
	frontend/annotate.sh \
+
	frontend/autoremove.sh \
+
	frontend/autoupgrade.sh \
+
	frontend/check.sh \
+
	frontend/config.sh \
+
	frontend/configmerge.sh \
+
	frontend/conflicts.sh \
+
	frontend/conflicts-multirepo.sh \
+
	frontend/create.sh \
+
	frontend/create-parsebin.sh \
+
	frontend/delete.sh \
+
	frontend/extract.sh \
+
	frontend/fetch.sh \
+
	frontend/install.sh \
+
	frontend/jpeg.sh \
+
	frontend/key.sh \
+
	frontend/lock.sh \
+
	frontend/messages.sh \
+
	frontend/multipleprovider.sh \
+
	frontend/packagesplit.sh \
+
	frontend/packagemerge.sh \
+
	frontend/php-pr.sh \
+
	frontend/pubkey.sh \
+
	frontend/query.sh \
+
	frontend/register.sh \
+
	frontend/repo.sh \
+
	frontend/rquery.sh \
+
	frontend/requires.sh \
+
	frontend/rootdir.sh \
+
	frontend/rubypuppet.sh \
+
	frontend/search.sh \
+
	frontend/set.sh \
+
	frontend/version.sh \
+
	frontend/vital.sh \
+
	frontend/which.sh \
+
	frontend/unregister.sh \
+
	frontend/update.sh \
+
	frontend/updating.sh \
+
	frontend/upgrade.sh \
+
	frontend/issue1374.sh \
+
	frontend/issue1425.sh \
+
	frontend/issue1440.sh \
+
	frontend/issue1445.sh \
+
	frontend/fingerprint.sh \
+
	frontend/lua.sh \
+
	frontend/shellscript.sh \
+
	frontend/clean.sh \
+
	frontend/backup_lib.sh \
+
	frontend/abi.sh \
+
	frontend/http.sh \
+
	frontend/triggers.sh \
+
	frontend/info.sh \
+
	frontend/force_reinstall_shlib.sh
+

+
#
+
# These files are mostly simple binaries obtained from
+
# int main(void) { return 0; }
+
#
+
# The freebsd-*.bin files are copies of /usr/bin/uname from official
+
# 14.1 release artifacts for the given architecture.
+

+

+
TESTS_SHELL_BINS= \
+
	frontend/dfly.bin \
+
	frontend/freebsd-aarch64.bin \
+
	frontend/freebsd-amd64.bin \
+
	frontend/freebsd-armv6.bin \
+
	frontend/freebsd-armv7.bin \
+
	frontend/freebsd-i386.bin \
+
	frontend/freebsd-powerpc.bin \
+
	frontend/freebsd-powerpc64.bin \
+
	frontend/freebsd-powerpc64le.bin \
+
	frontend/freebsd-riscv64.bin \
+
	frontend/linux.bin \
+
	frontend/macos.bin \
+
	frontend/macos106.bin \
+
	frontend/macos150.bin \
+
	frontend/macosfat.bin \
+
	frontend/macosfatlib.bin \
+
	frontend/libtestfbsd.so.1 \
+
	frontend/libtest2fbsd.so.1 \
+
	frontend/libfoo.so.1
+

+
lua_OBJS=	lib/lua.o
+
merge_OBJS=	lib/merge.o
+
plist_OBJS=	lib/plist.o
+
checksum_OBJS=	lib/checksum.o
+
pkg_printf_OBJS=	lib/pkg_printf_test.o \
+
			lib/pkg_printf.o
+
deps_formula_OBJS=	lib/deps_formula.o
+
pkg_add_dir_to_del_OBJS=	lib/pkg_add_dir_to_del.o
+
pkg_cpe_OBJS=	lib/pkg_cpe.o
+
pkg_validation_OBJS=	lib/pkg_validation.o
+
packing_OBJS=	lib/packing.o
+
ssh_OBJS=	lib/ssh.o
+
utils_OBJS=	lib/utils.o
+
metalog_OBJS=	lib/metalog.o
+
vec_OBJS=	lib/vec.o
+
pkg_elf_OBJS=	lib/pkg_elf.o
+
hash_OBJS=	lib/hash.o
+
shlibs_OBJS=	lib/shlibs.o
+
kv_OBJS=	lib/kv.o
+
pkg_OBJS=	lib/pkg.o
+
pkg_osvf_OBJS=	lib/pkg_osvf.o
+

+
SRCS=	\
+
	$(packing_OBJS:.o=.c) \
+
	$(merge_OBJS:.o=.c) \
+
	$(plist_OBJS:.o=.c) \
+
	$(lua_OBJS:.o=.c) \
+
	$(checksum_OBJS:.o=.c) \
+
	$(pkg_printf_OBJS:.o=.c) \
+
	$(deps_formula_OBJS:.o=.c) \
+
	$(pkg_add_dir_to_del_OBJS:.o=.c) \
+
	$(pkg_cpe_OBJS:.o=.c) \
+
	$(pkg_validation_OBJS:.o=.c) \
+
	$(pkg_osvf_OBJS:.o=.c) \
+
	$(ssh_OBJS:.o=.c) \
+
	$(utils_OBJS:.o=.c) \
+
	$(metalog_OBJS:.o=.c) \
+
	$(vec_OBJS:.o=.c) \
+
	$(pkg_elf_OBJS:.o=.c) \
+
	$(hash_OBJS:.o=.c) \
+
	$(shlibs_OBJS:.o=.c) \
+
	$(kv_OBJS:.o=.c) \
+
	$(pkg_OBJS:.o=.c)
+

+
include $(MK)/common.mk
+

+
TESTS_SHELL=	$(TESTS_SH:.sh=)
+

+
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
+
		-I$(top_srcdir)/external/libucl/include \
+
		-I$(top_srcdir)/external/uthash \
+
		-I$(top_srcdir)/external/include \
+
		-I$(top_srcdir)/external/sqlite \
+
		-I$(top_srcdir)/external/lua/src \
+
		-I$(top_srcdir)/libpkg \
+
		-I$(top_builddir)/ \
+
		-I$(top_builddir)/libpkg \
+
		@PKG_ATF_C_CFLAGS@ \
+
		-DTESTING \
+
		-DTESTING_TOP_DIR="\"@abs_top_srcdir@/tests\""
+

+
LIBS=	\
+
	-L$(top_builddir)/libpkg -lpkg_flat \
+
	-lm \
+
	@EXTRA_LIBS@
+

+
@if HAVE_PKG_LIBARCHIVE
+
CFLAGS+=	@PKG_LIBARCHIVE_CFLAGS@
+
LIBS+=	@PKG_LIBARCHIVE_LDFLAGS@ @PKG_LIBARCHIVE_LIBS@
+
@else
+
LIBS+=	-L/usr/lib -larchive -lbz2 -lz -llzma
+
@endif
+
OTHER_LIBS=	-pthread
+
@if HAVE_LIBUTIL
+
OTHER_LIBS+=	-lutil
+
@endif
+
@if HAVE_LIBFTS
+
OTHER_LIBS+=	-lfts
+
@endif
+
@if HAVE_LIBDL
+
OTHER_LIBS+=	-ldl
+
@endif
+
@if PKG_OPENSSL_LIBS
+
CFLAGS+=	@PKG_OPENSSL_CFLAGS@
+
LIBS+=	@PKG_OPENSSL_LDFLAGS@ @PKG_OPENSSL_LIBS@
+
@else
+
OTHER_LIBS+=	-lssl -lcrypto
+
@endif
+

+

+
# Hack to determine we are on osx
+
@if pkgos_darwin
+
OTHER_LIBS+=	-lresolv
+
@endif
+

+
LOCAL_LDFLAGS=	$(LIBS) $(OTHER_LIBS)
+
LOCAL_LDFLAGS+=	@PKG_ATF_C_LDFLAGS@ @PKG_ATF_C_LIBS@
+

+
VPATH=	$(top_srcdir)/tests
+

+
all: $(TESTS) Kyuafile ${TESTS_SHELL} $(TESTS_SHELL_BINS) frontend/Kyuafile
+

+
$(TESTS): $(OBJS) $(top_builddir)/libpkg/libpkg_flat.a
+
	$(CC) -o $@ $($@_OBJS) $(LDFLAGS) $(LOCAL_LDFLAGS)
+

+
lib/pkg_printf.c: $(top_srcdir)/libpkg/pkg_printf.c
+
	cp $(top_srcdir)/libpkg/pkg_printf.c $@
+

+
.sh:
+
	install -m 755 $< $@
+

+
clean:
+
	rm -f lib/pkg_printf.c $(OBJS) $(TESTS) $(TESTS_SHELL) $(TESTS_SHELL_BINS) Kyuafile frontend/Kyuafile
+

+
Kyuafile: $(TESTS)
+
	@echo "Generating $@"
+
	@echo 'syntax(2)' > $@
+
	@echo 'test_suite("pkg")' >> $@
+
	@for p in $(TESTS); do \
+
		echo "atf_test_program{name='$$p'}" >> $@ ; \
+
	done
+
	@echo 'include("frontend/Kyuafile")' >> $@
+

+
frontend/Kyuafile: $(TESTS_SHELL) $(TESTS_SHELL_BINS)
+
	@echo "Generating $@"
+
	@echo 'syntax(2)' > $@
+
	@echo 'test_suite("pkg")' >> $@
+
	@for p in $(TESTS_SHELL); do \
+
		echo "atf_test_program{name='$${p##*/}'}" >> $@ ; \
+
	done
deleted tests/Makefile.in
@@ -1,242 +0,0 @@
-
include @builddir@/mk/defs.mk
-

-
TESTS=	\
-
	checksum \
-
	deps_formula \
-
	merge \
-
	packing \
-
	pkg_add_dir_to_del \
-
	pkg_cpe \
-
	pkg_printf \
-
	pkg_validation \
-
	pkg_osvf \
-
	pkg \
-
	plist \
-
	lua \
-
	ssh \
-
	utils \
-
	metalog \
-
	vec \
-
	pkg_elf \
-
	hash \
-
	shlibs \
-
	kv
-

-
TESTS_SH= \
-
	frontend/audit.sh \
-
	frontend/pkg.sh \
-
	frontend/add.sh \
-
	frontend/alias.sh \
-
	frontend/annotate.sh \
-
	frontend/autoremove.sh \
-
	frontend/autoupgrade.sh \
-
	frontend/check.sh \
-
	frontend/config.sh \
-
	frontend/configmerge.sh \
-
	frontend/conflicts.sh \
-
	frontend/conflicts-multirepo.sh \
-
	frontend/create.sh \
-
	frontend/create-parsebin.sh \
-
	frontend/delete.sh \
-
	frontend/extract.sh \
-
	frontend/fetch.sh \
-
	frontend/install.sh \
-
	frontend/jpeg.sh \
-
	frontend/key.sh \
-
	frontend/lock.sh \
-
	frontend/messages.sh \
-
	frontend/multipleprovider.sh \
-
	frontend/packagesplit.sh \
-
	frontend/packagemerge.sh \
-
	frontend/php-pr.sh \
-
	frontend/pubkey.sh \
-
	frontend/query.sh \
-
	frontend/register.sh \
-
	frontend/repo.sh \
-
	frontend/rquery.sh \
-
	frontend/requires.sh \
-
	frontend/rootdir.sh \
-
	frontend/rubypuppet.sh \
-
	frontend/search.sh \
-
	frontend/set.sh \
-
	frontend/version.sh \
-
	frontend/vital.sh \
-
	frontend/which.sh \
-
	frontend/unregister.sh \
-
	frontend/update.sh \
-
	frontend/updating.sh \
-
	frontend/upgrade.sh \
-
	frontend/issue1374.sh \
-
	frontend/issue1425.sh \
-
	frontend/issue1440.sh \
-
	frontend/issue1445.sh \
-
	frontend/fingerprint.sh \
-
	frontend/lua.sh \
-
	frontend/shellscript.sh \
-
	frontend/clean.sh \
-
	frontend/backup_lib.sh \
-
	frontend/abi.sh \
-
	frontend/http.sh \
-
	frontend/triggers.sh \
-
	frontend/info.sh \
-
	frontend/force_reinstall_shlib.sh
-

-
#
-
# These files are mostly simple binaries obtained from
-
# int main(void) { return 0; }
-
#
-
# The freebsd-*.bin files are copies of /usr/bin/uname from official
-
# 14.1 release artifacts for the given architecture.
-

-

-
TESTS_SHELL_BINS= \
-
	frontend/dfly.bin \
-
	frontend/freebsd-aarch64.bin \
-
	frontend/freebsd-amd64.bin \
-
	frontend/freebsd-armv6.bin \
-
	frontend/freebsd-armv7.bin \
-
	frontend/freebsd-i386.bin \
-
	frontend/freebsd-powerpc.bin \
-
	frontend/freebsd-powerpc64.bin \
-
	frontend/freebsd-powerpc64le.bin \
-
	frontend/freebsd-riscv64.bin \
-
	frontend/linux.bin \
-
	frontend/macos.bin \
-
	frontend/macos106.bin \
-
	frontend/macos150.bin \
-
	frontend/macosfat.bin \
-
	frontend/macosfatlib.bin \
-
	frontend/libtestfbsd.so.1 \
-
	frontend/libtest2fbsd.so.1 \
-
	frontend/libfoo.so.1
-

-
lua_OBJS=	lib/lua.o
-
merge_OBJS=	lib/merge.o
-
plist_OBJS=	lib/plist.o
-
checksum_OBJS=	lib/checksum.o
-
pkg_printf_OBJS=	lib/pkg_printf_test.o \
-
			lib/pkg_printf.o
-
deps_formula_OBJS=	lib/deps_formula.o
-
pkg_add_dir_to_del_OBJS=	lib/pkg_add_dir_to_del.o
-
pkg_cpe_OBJS=	lib/pkg_cpe.o
-
pkg_validation_OBJS=	lib/pkg_validation.o
-
packing_OBJS=	lib/packing.o
-
ssh_OBJS=	lib/ssh.o
-
utils_OBJS=	lib/utils.o
-
metalog_OBJS=	lib/metalog.o
-
vec_OBJS=	lib/vec.o
-
pkg_elf_OBJS=	lib/pkg_elf.o
-
hash_OBJS=	lib/hash.o
-
shlibs_OBJS=	lib/shlibs.o
-
kv_OBJS=	lib/kv.o
-
pkg_OBJS=	lib/pkg.o
-
pkg_osvf_OBJS=	lib/pkg_osvf.o
-

-
SRCS=	\
-
	$(packing_OBJS:.o=.c) \
-
	$(merge_OBJS:.o=.c) \
-
	$(plist_OBJS:.o=.c) \
-
	$(lua_OBJS:.o=.c) \
-
	$(checksum_OBJS:.o=.c) \
-
	$(pkg_printf_OBJS:.o=.c) \
-
	$(deps_formula_OBJS:.o=.c) \
-
	$(pkg_add_dir_to_del_OBJS:.o=.c) \
-
	$(pkg_cpe_OBJS:.o=.c) \
-
	$(pkg_validation_OBJS:.o=.c) \
-
	$(pkg_osvf_OBJS:.o=.c) \
-
	$(ssh_OBJS:.o=.c) \
-
	$(utils_OBJS:.o=.c) \
-
	$(metalog_OBJS:.o=.c) \
-
	$(vec_OBJS:.o=.c) \
-
	$(pkg_elf_OBJS:.o=.c) \
-
	$(hash_OBJS:.o=.c) \
-
	$(shlibs_OBJS:.o=.c) \
-
	$(kv_OBJS:.o=.c) \
-
	$(pkg_OBJS:.o=.c)
-

-
include $(MK)/common.mk
-

-
TESTS_SHELL=	$(TESTS_SH:.sh=)
-

-
LOCAL_CFLAGS=	-I$(top_srcdir)/compat \
-
		-I$(top_srcdir)/external/libucl/include \
-
		-I$(top_srcdir)/external/uthash \
-
		-I$(top_srcdir)/external/include \
-
		-I$(top_srcdir)/external/sqlite \
-
		-I$(top_srcdir)/external/lua/src \
-
		-I$(top_srcdir)/libpkg \
-
		-I$(top_builddir)/ \
-
		-I$(top_builddir)/libpkg \
-
		@PKG_ATF_C_CFLAGS@ \
-
		-DTESTING \
-
		-DTESTING_TOP_DIR="\"@abs_top_srcdir@/tests\""
-

-
LIBS=	\
-
	-L$(top_builddir)/libpkg -lpkg_flat \
-
	-lm \
-
	@EXTRA_LIBS@
-

-
@if HAVE_PKG_LIBARCHIVE
-
CFLAGS+=	@PKG_LIBARCHIVE_CFLAGS@
-
LIBS+=	@PKG_LIBARCHIVE_LDFLAGS@ @PKG_LIBARCHIVE_LIBS@
-
@else
-
LIBS+=	-L/usr/lib -larchive -lbz2 -lz -llzma
-
@endif
-
OTHER_LIBS=	-pthread
-
@if HAVE_LIBUTIL
-
OTHER_LIBS+=	-lutil
-
@endif
-
@if HAVE_LIBFTS
-
OTHER_LIBS+=	-lfts
-
@endif
-
@if HAVE_LIBDL
-
OTHER_LIBS+=	-ldl
-
@endif
-
@if PKG_OPENSSL_LIBS
-
CFLAGS+=	@PKG_OPENSSL_CFLAGS@
-
LIBS+=	@PKG_OPENSSL_LDFLAGS@ @PKG_OPENSSL_LIBS@
-
@else
-
OTHER_LIBS+=	-lssl -lcrypto
-
@endif
-

-

-
# Hack to determine we are on osx
-
@if pkgos_darwin
-
OTHER_LIBS+=	-lresolv
-
@endif
-

-
LOCAL_LDFLAGS=	$(LIBS) $(OTHER_LIBS)
-
LOCAL_LDFLAGS+=	@PKG_ATF_C_LDFLAGS@ @PKG_ATF_C_LIBS@
-

-
VPATH=	$(top_srcdir)/tests
-

-
all: $(TESTS) Kyuafile ${TESTS_SHELL} $(TESTS_SHELL_BINS) frontend/Kyuafile
-

-
$(TESTS): $(OBJS) $(top_builddir)/libpkg/libpkg_flat.a
-
	$(CC) -o $@ $($@_OBJS) $(LDFLAGS) $(LOCAL_LDFLAGS)
-

-
lib/pkg_printf.c: $(top_srcdir)/libpkg/pkg_printf.c
-
	cp $(top_srcdir)/libpkg/pkg_printf.c $@
-

-
.sh:
-
	install -m 755 $< $@
-

-
clean:
-
	rm -f lib/pkg_printf.c $(OBJS) $(TESTS) $(TESTS_SHELL) $(TESTS_SHELL_BINS) Kyuafile frontend/Kyuafile
-

-
Kyuafile: $(TESTS)
-
	@echo "Generating $@"
-
	@echo 'syntax(2)' > $@
-
	@echo 'test_suite("pkg")' >> $@
-
	@for p in $(TESTS); do \
-
		echo "atf_test_program{name='$$p'}" >> $@ ; \
-
	done
-
	@echo 'include("frontend/Kyuafile")' >> $@
-

-
frontend/Kyuafile: $(TESTS_SHELL) $(TESTS_SHELL_BINS)
-
	@echo "Generating $@"
-
	@echo 'syntax(2)' > $@
-
	@echo 'test_suite("pkg")' >> $@
-
	@for p in $(TESTS_SHELL); do \
-
		echo "atf_test_program{name='$${p##*/}'}" >> $@ ; \
-
	done