allow for building against libbsd for glibc systems
This commit is contained in:
parent
492e9e7038
commit
cbcd8e8326
2 changed files with 14 additions and 2 deletions
7
Makefile
7
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}
|
||||
|
||||
|
|
|
@ -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`.
|
||||
|
||||
|
|
Loading…
Reference in a new issue