allow for building against libbsd for glibc systems

This commit is contained in:
Ariadne Conill 2020-07-25 01:16:01 -06:00
parent 492e9e7038
commit cbcd8e8326
2 changed files with 14 additions and 2 deletions

View file

@ -1,4 +1,6 @@
SCDOC := scdoc SCDOC := scdoc
LIBBSD_CFLAGS =
LIBBSD_LIBS =
PACKAGE_NAME := ifupdown-ng PACKAGE_NAME := ifupdown-ng
PACKAGE_VERSION := 0.2.1 PACKAGE_VERSION := 0.2.1
@ -7,7 +9,9 @@ PACKAGE_BUGREPORT := https://github.com/kaniini/ifupdown-ng/issues/new
INTERFACES_FILE := /etc/network/interfaces INTERFACES_FILE := /etc/network/interfaces
STATE_FILE := /run/ifstate 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}\" 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 CMDS = ifup ifdown ifquery
LIBS = ${LIBIFUPDOWN_LIB} LIBS = ${LIBIFUPDOWN_LIB}
LIBS += ${LIBBSD_LIBS}
all: libifupdown.a ${MULTICALL} ${CMDS} all: libifupdown.a ${MULTICALL} ${CMDS}

View file

@ -26,7 +26,14 @@ For compatibility with some legacy ifupdown executors, we also provide the
## Building ## 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`. To run the tests, do `make check`.