| diff --git a/Makefile b/Makefile |
| index 4b80a18..3577119 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 |
| @@ -10,9 +10,10 @@ BUILDFLAGS = \ |
| -Werror \ |
| $(NULL) |
| |
| -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,21 +34,21 @@ 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 |
| +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 util.o validation.o error.o |
| - $(CC) -shared -Wl,-soname,libnetplan.so.$(NETPLAN_SOVER) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ `pkg-config --libs yaml-0.1` |
| + $(CC) -shared -Wl,-soname,libnetplan.so.$(NETPLAN_SOVER) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ `$(HOSTPKGCONFIG) --libs yaml-0.1` |
| ln -snf libnetplan.so.$(NETPLAN_SOVER) libnetplan.so |
| |
| #generate: src/generate.[hc] src/parse.[hc] src/util.[hc] src/networkd.[hc] src/nm.[hc] src/validation.[hc] src/error.[hc] |
| 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 |
| - $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ `pkg-config --cflags --libs libsystemd glib-2.0` |
| + $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< `$(HOSTPKGCONFIG) --cflags --libs libsystemd glib-2.0` |
| |
| src/_features.h: src/[^_]*.[hc] |
| printf "#include <stddef.h>\nstatic const char *feature_flags[] __attribute__((__unused__)) = {\n" > $@ |
| @@ -117,12 +118,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/ |
| @@ -133,13 +134,6 @@ install: default |
| 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 |