blob: b0565f2ab4ce6c11cac66757c46a45c443109bd0 [file] [log] [blame]
diff --git a/Makefile b/Makefile
index 8645aee..c34c8c7 100644
From: Varsha Teratipally
Date: Wed, 13 Oct 2020
Subject: With crbug/985180 all unprefixed compilers have been blocked.
So pkg-config is supposed to be configured using tc-getPKG_CONFIG rather
than directly using command. Hence modifying the makefile to accept
custom pkgconfig. Also removing the docs install with pandoc because it
is not supported by cos currently
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,10 @@ BUILDFLAGS = \
SYSTEMD_GENERATOR_DIR=$(shell pkg-config --variable=systemdsystemgeneratordir systemd)
SYSTEMD_UNIT_DIR=$(shell pkg-config --variable=systemdsystemunitdir systemd)
BASH_COMPLETIONS_DIR=$(shell pkg-config --variable=completionsdir bash-completion || echo "/etc/bash_completion.d")
+HOSTPKGCONFIG ?= pkg-config
+SYSTEMD_GENERATOR_DIR=$(shell $(HOSTPKGCONFIG) --variable=systemdsystemgeneratordir systemd)
+SYSTEMD_UNIT_DIR=$(shell $(HOSTPKGCONFIG) --variable=systemdsystemunitdir systemd)
+BASH_COMPLETIONS_DIR=$(shell $(HOSTPKGCONFIG) --variable=completionsdir bash-completion || echo "/etc/bash_completion.d")
GCOV ?= gcov
ROOTPREFIX ?=
@@ -33,20 +37,20 @@ PYFLAKES3 ?= $(shell which pyflakes-3 || which pyflakes3 || echo true)
PYCODESTYLE3 ?= $(shell which pycodestyle-3 || which pycodestyle || which pep8 || echo true)
NOSETESTS3 ?= $(shell which nosetests-3 || which nosetests3 || echo true)
-default: netplan/_features.py generate netplan-dbus dbus/io.netplan.Netplan.service doc/netplan.html doc/netplan.5 doc/netplan-generate.8 doc/netplan-apply.8 doc/netplan-try.8 doc/netplan-dbus.8 doc/netplan-get.8 doc/netplan-set.8
+default: netplan/_features.py generate netplan-dbus dbus/io.netplan.Netplan.service
%.o: src/%.c
- $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -c $^ `pkg-config --cflags --libs glib-2.0 gio-2.0 yaml-0.1 uuid`
+ $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -c $^ `$(HOSTPKGCONFIG) --cflags --libs glib-2.0 gio-2.0 yaml-0.1 uuid`
libnetplan.so.$(NETPLAN_SOVER): parse.o netplan.o util.o validation.o error.o parse-nm.o
- $(CC) -shared -Wl,-soname,libnetplan.so.$(NETPLAN_SOVER) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ `pkg-config --libs glib-2.0 gio-2.0 yaml-0.1`
+ $(CC) -shared -Wl,-soname,libnetplan.so.$(NETPLAN_SOVER) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ `$(HOSTPKGCONFIG) --libs glib-2.0 gio-2.0 yaml-0.1`
ln -snf libnetplan.so.$(NETPLAN_SOVER) libnetplan.so
generate: libnetplan.so.$(NETPLAN_SOVER) nm.o networkd.o openvswitch.o generate.o sriov.o
- $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ -L. -lnetplan `pkg-config --cflags --libs glib-2.0 gio-2.0 yaml-0.1 uuid`
+ $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ -L. -lnetplan `$(HOSTPKGCONFIG) --cflags --libs glib-2.0 gio-2.0 yaml-0.1 uuid`
netplan-dbus: src/dbus.c src/_features.h parse.o util.o validation.o error.o
- $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(patsubst %.h,,$^) `pkg-config --cflags --libs libsystemd glib-2.0 gio-2.0 yaml-0.1`
+ $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(patsubst %.h,,$^) `$(HOSTPKGCONFIG) --cflags --libs libsystemd glib-2.0 gio-2.0 yaml-0.1`
src/_features.h: src/[^_]*.[hc]
printf "#include <stddef.h>\nstatic const char *feature_flags[] __attribute__((__unused__)) = {\n" > $@
@@ -116,12 +120,6 @@ install: default
# headers, dev data
install -m 644 src/*.h $(DESTDIR)/$(INCLUDEDIR)/netplan/
# TODO: install pkg-config once available
- # docs, data
- install -m 644 doc/*.html $(DESTDIR)/$(DOCDIR)/netplan/
- install -m 644 examples/*.yaml $(DESTDIR)/$(DOCDIR)/netplan/examples/
- install -m 644 doc/*.5 $(DESTDIR)/$(MANDIR)/man5/
- install -m 644 doc/*.8 $(DESTDIR)/$(MANDIR)/man8/
- install -T -D -m 644 netplan.completions $(DESTDIR)/$(BASH_COMPLETIONS_DIR)/netplan
# dbus
mkdir -p $(DESTDIR)/$(DATADIR)/dbus-1/system.d $(DESTDIR)/$(DATADIR)/dbus-1/system-services
install -m 755 netplan-dbus $(DESTDIR)/$(ROOTLIBEXECDIR)/netplan/
@@ -131,14 +129,4 @@ install: default
%.service: %.service.in
sed -e "s#@ROOTLIBEXECDIR@#$(ROOTLIBEXECDIR)#" $< > $@
-
-%.html: %.md
- pandoc -s --toc -o $@ $<
-
-doc/netplan.5: doc/manpage-header.md doc/netplan.md doc/manpage-footer.md
- pandoc -s -o $@ $^
-
-%.8: %.md
- pandoc -s -o $@ $^
-
.PHONY: clean
diff --git a/src/netplan.h b/src/netplan.h
index d2c538b..26574f8 100644
--- a/src/netplan.h
+++ b/src/netplan.h
@@ -81,7 +81,6 @@ static const char* const netplan_def_type_to_str[NETPLAN_DEF_TYPE_MAX_] = {
[NETPLAN_DEF_TYPE_ETHERNET] = "ethernets",
[NETPLAN_DEF_TYPE_WIFI] = "wifis",
[NETPLAN_DEF_TYPE_MODEM] = "modems",
- [NETPLAN_DEF_TYPE_VIRTUAL] = NULL,
[NETPLAN_DEF_TYPE_BRIDGE] = "bridges",
[NETPLAN_DEF_TYPE_BOND] = "bonds",
[NETPLAN_DEF_TYPE_VLAN] = "vlans",