Added a configure script to emulate GNU autoconf and related changes.
Changes included in this set: * Added strlcat() and strlcpy() from OpenBSD, always use them if the system does not have them built in. * Changed an array of PATH_MAX size allocated in the stack, to a dynamically allocated buffer from heap. This should reduce memory usage a bit. * Simplify code that implemented a homegrown realpath(3) implementation, simply use realpath(3). * If compiler supports -fstack-protector, build all code with -D_FORTIFY_SOURCE=2 and --param ssp-buffer-size=1 so that all buffers are protected.
This commit is contained in:
6
prog.mk
6
prog.mk
@@ -1,5 +1,7 @@
|
||||
-include $(TOPDIR)/config.mk
|
||||
|
||||
OBJS ?= main.o
|
||||
CFLAGS += -fPIE
|
||||
CFLAGS += $(PROG_CFLAGS)
|
||||
LDFLAGS += -lxbps
|
||||
|
||||
.PHONY: all
|
||||
@@ -39,5 +41,5 @@ $(BIN).static: $(OBJS)
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
@printf " [CCLD]\t\t$@\n"
|
||||
@$(CC) $^ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -pie -o $@
|
||||
@$(CC) $^ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(PROG_LDFLAGS) -o $@
|
||||
|
||||
|
Reference in New Issue
Block a user