diff --git a/Makefile b/Makefile index db9bb05..e58ec5d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ SCDOC := scdoc +LIBBSD_CFLAGS = +LIBBSD_LIBS = PACKAGE_NAME := ifupdown-ng PACKAGE_VERSION := 0.2.1 @@ -7,7 +9,9 @@ PACKAGE_BUGREPORT := https://github.com/kaniini/ifupdown-ng/issues/new INTERFACES_FILE := /etc/network/interfaces STATE_FILE := /run/ifstate -CFLAGS = -ggdb3 -Os -Wall -Wextra +CFLAGS ?= -ggdb3 -Os +CFLAGS += -Wall -Wextra +CFLAGS += ${LIBBSD_CFLAGS} CPPFLAGS = -I. -DINTERFACES_FILE=\"${INTERFACES_FILE}\" -DSTATE_FILE=\"${STATE_FILE}\" -DPACKAGE_NAME=\"${PACKAGE_NAME}\" -DPACKAGE_VERSION=\"${PACKAGE_VERSION}\" -DPACKAGE_BUGREPORT=\"${PACKAGE_BUGREPORT}\" @@ -41,6 +45,7 @@ CMD_OBJ = ${MULTICALL_OBJ} ${IFQUERY_OBJ} ${IFUPDOWN_OBJ} CMDS = ifup ifdown ifquery LIBS = ${LIBIFUPDOWN_LIB} +LIBS += ${LIBBSD_LIBS} all: libifupdown.a ${MULTICALL} ${CMDS} diff --git a/README.md b/README.md index 7bc19dc..ed81193 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,14 @@ For compatibility with some legacy ifupdown executors, we also provide the ## Building -Simply do `make` and `make install` to build and install. +On musl systems, simply do `make` and `make install` to build and install. + +On glibc systems, you must additionally define LIBBSD_CFLAGS and LIBBSD_LIBS: + + export LIBBSD_CFLAGS=$(pkg-config --cflags libbsd-overlay) + export LIBBSD_LIBS=$(pkg-config --libs libbsd-overlay) + make + make install To run the tests, do `make check`.