Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix out-of-tree libelf, libmachista and tests builds
Jessica Clarke committed 3 years ago
commit 724e6cc0fe4718c6ad92af7bddaa5d12cb6079c2
parent 87ab7de
13 files changed +41 -11
modified .gitignore
@@ -45,6 +45,7 @@ scripts/sbin/pkg2ng
# Generated files:

/autosetup/jimsh0
+
/Kyuafile
/Makefile
/compat/Makefile
/docs/Makefile
@@ -78,10 +79,11 @@ scripts/sbin/pkg2ng
/tests/Kyuafile
/tests/checksum
/tests/deps_formula
-
# Almost everything in tests/frontend is generated aside from .sh and .in files.
+
# Almost everything in tests/frontend is generated aside from .sh, .in and .binin files.
/tests/frontend/*
!/tests/frontend/*.sh
!/tests/frontend/*.in
+
!/tests/frontend/*.binin
/tests/frontend/test_environment.sh
/tests/lua
/tests/metalog
deleted Kyuafile
@@ -1,4 +0,0 @@
-
syntax(2)
-
test_suite("pkg")
-

-
include("tests/Kyuafile")
added Kyuafile.in
@@ -0,0 +1,4 @@
+
syntax(2)
+
test_suite("pkg")
+

+
include("tests/Kyuafile")
modified Makefile.autosetup
@@ -5,6 +5,9 @@ DIRS+= tests
@endif

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

+
VPATH=	$(top_srcdir)

@if coverage
check: clean-profiles
@@ -14,7 +17,11 @@ clean-profiles:
@endif

check: all
+

@if TESTS
+
all: Kyuafile
+

+
check:
	export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1; \
	export LLVM_PROFILE_FILE=/tmp/pkg.%p.profraw; \
	if [ "$(HTML)" != "" ]; then \
modified auto.def
@@ -359,4 +359,4 @@ foreach dir [list external/blake2 external/picosat \
	make-template $dir/Makefile.autosetup $dir/Makefile
}

-
file mkdir external/libucl/src scripts/periodic scripts/completion
+
file mkdir external/libucl/src scripts/periodic scripts/completion tests/lib tests/frontend
modified external/libelf/Makefile.autosetup
@@ -61,6 +61,8 @@ SRCS= elf_begin.c \

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

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

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

modified external/libmachista/Makefile.autosetup
@@ -3,4 +3,6 @@ LIB= machista
SRCS=	libmachista.c \
	hashmap.c

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

include $(MK)/static-lib.mk
modified mk/common.mk
@@ -6,9 +6,16 @@ CFLAGS+= $(CPPFLAGS)
CFLAGS+=	-Werror=implicit-function-declaration
CFLAGS+=	-Werror=return-type

-
-include $(DEPFILES)
+
# bmake's traditional include support treats empty strings in the expanded
+
# result (whether because the variable is empty or there are consecutive
+
# whitespace characters) as file names, and thus tries to read the containing
+
# directory as a Makefile, which fails, and isn't ignored since it exists.
+
# Work around this quirky behaviour by adding an extra entry that should never
+
# exist and then normalize its whitespace during substitution with :=.
+
DEPFILES_NONEMPTY=	$(DEPFILES) /nonexistent
+
-include $(DEPFILES_NONEMPTY:=)

-
.SUFFIXES: .pico .in
+
.SUFFIXES: .pico .in .bin .binin

.c.o:
	$(CC) -Wall -Wextra -std=gnu99 -D_GNU_SOURCE=1 -MT $@ -MD -MP -MF $*.Tpo -o $@ -c $(CFLAGS) $(LOCAL_CFLAGS) $<
@@ -21,3 +28,6 @@ CFLAGS+= -Werror=return-type
.in:
	sed -e 's|@prefix@|$(PREFIX)|g; s|@abs_top_srcdir@|$(top_srcdir)|g' \
		-e 's|@VERSION@|$(version)|g' $< > $@
+

+
.binin.bin:
+
	cp $< $@
modified tests/Makefile.autosetup
@@ -64,6 +64,10 @@ TESTS_SH= \
	frontend/http.sh \
	frontend/triggers.sh

+
TESTS_SHELL_BINS= \
+
	frontend/dfly.bin \
+
	frontend/fbsd.bin
+

lua_OBJS=	lib/lua.o
merge_OBJS=	lib/merge.o
plist_OBJS=	lib/plist.o
@@ -102,6 +106,7 @@ LOCAL_CFLAGS= -I$(top_srcdir)/compat \
		-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@ \
@@ -139,7 +144,9 @@ OTHER_LIBS+= -lresolv
LOCAL_LDFLAGS=	$(LIBS) $(OTHER_LIBS)
LOCAL_LDFLAGS+=	@PKG_ATF_C_LDFLAGS@ @PKG_ATF_C_LIBS@

-
all: $(TESTS) Kyuafile ${TESTS_SHELL} frontend/Kyuafile
+
VPATH=	$(top_srcdir)/tests
+

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

$(TESTS): $(OBJS)
	$(CC) -o $@ $($@_OBJS) $(LDFLAGS) $(LOCAL_LDFLAGS)
@@ -151,7 +158,7 @@ lib/pkg_printf.c: $(top_srcdir)/libpkg/pkg_printf.c
	install -m 755 $< $@

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

Kyuafile: $(TESTS)
	@echo "Generating $@"
@@ -162,7 +169,7 @@ Kyuafile: $(TESTS)
	done
	@echo 'include("frontend/Kyuafile")' >> $@

-
frontend/Kyuafile: $(TESTS_SHELL)
+
frontend/Kyuafile: $(TESTS_SHELL) $(TESTS_SHELL_BINS)
	@echo "Generating $@"
	@echo 'syntax(2)' > $@
	@echo 'test_suite("pkg")' >> $@
deleted tests/frontend/dfly.bin
added tests/frontend/dfly.binin
deleted tests/frontend/fbsd.bin
added tests/frontend/fbsd.binin