| 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 |
| @@ -27,9 +27,10 @@ SRCS = \ |
| src/validation.c \ |
| $(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 ?= |
| @@ -50,20 +51,20 @@ PYFLAKES3 ?= $(shell command -v pyflakes-3 || command -v pyflakes3 || echo true) |
| PYCODESTYLE3 ?= $(shell command -v pycodestyle-3 || command -v pycodestyle || command -v pep8 || echo true) |
| NOSETESTS3 ?= $(shell command -v nosetests-3 || command -v 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): $(SRCS) abicompat.lds |
| - $(CC) -shared -Wl,-soname,libnetplan.so.$(NETPLAN_SOVER) $(BUILDFLAGS) $(CFLAGS) -fvisibility=hidden $(LDFLAGS) -o $@ $(SRCS) -T abicompat.lds `pkg-config --cflags --libs glib-2.0 gio-2.0 yaml-0.1 uuid` |
| + $(CC) -shared -Wl,-soname,libnetplan.so.$(NETPLAN_SOVER) $(BUILDFLAGS) $(CFLAGS) -fvisibility=hidden $(LDFLAGS) -o $@ $(SRCS) -T abicompat.lds `${HOSTPKGCONFIG} --cflags --libs glib-2.0 gio-2.0 yaml-0.1 uuid` |
| ln -snf libnetplan.so.$(NETPLAN_SOVER) libnetplan.so |
| |
| generate: libnetplan.so.$(NETPLAN_SOVER) generate.o |
| - $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(filter-out $<,$^) -L. -lnetplan `pkg-config --cflags --libs glib-2.0 gio-2.0 yaml-0.1 uuid` |
| + $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(filter-out $<,$^) -L. -lnetplan `${HOSTPKGCONFIG} --cflags --libs glib-2.0 gio-2.0 yaml-0.1 uuid` |
| |
| netplan-dbus: libnetplan.so.$(NETPLAN_SOVER) src/_features.h dbus.o |
| - $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(filter-out $<,$(patsubst %.h,,$^)) -L. -lnetplan `pkg-config --cflags --libs libsystemd glib-2.0 gio-2.0 yaml-0.1 uuid` |
| + $(CC) $(BUILDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(filter-out $<,$(patsubst %.h,,$^)) -L. -lnetplan `${HOSTPKGCONFIG} --cflags --libs libsystemd glib-2.0 gio-2.0 yaml-0.1 uuid` |
| |
| src/_features.h: src/[^_]*.[hc] |
| printf "#include <stddef.h>\nstatic const char *feature_flags[] __attribute__((__unused__)) = {\n" > $@ |
| @@ -133,12 +134,6 @@ install: default |
| # headers, dev data |
| install -m 644 include/*.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/ |
| @@ -149,13 +144,4 @@ install: default |
| sed -e "s#@ROOTLIBEXECDIR@#$(ROOTLIBEXECDIR)#" $< > $@ |
| |
| |
| -%.html: %.md |
| - pandoc -s --metadata title="Netplan reference" --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 |