From 0d0495e818d840d89bb025415fc18e0ed9d8d4a6 Mon Sep 17 00:00:00 2001 From: George Koehler Date: Tue, 8 Nov 2016 17:13:51 -0500 Subject: [PATCH] Install only 1 copy, not 2 copies, of osx headers. Before this commit, the headers in plat/osx/include got installed twice into PLATIND/osx386/include and PLATIND/osxppc/include. This commit installs them once into PLATIND/osx/include and changes both descr files to find them. Several rules in lang/ depend on plat/osx386/include+headers or plat/osxppc/include+headers. They each become a simplerule that depends on plat/osx/include+headers. --- plat/osx/include/build.lua | 24 ++++++++++++++++++++++++ plat/osx386/build-pkg.lua | 2 +- plat/osx386/descr | 2 +- plat/osx386/include/build.lua | 27 +++++---------------------- plat/osxppc/build-pkg.lua | 2 +- plat/osxppc/descr | 2 +- plat/osxppc/include/build.lua | 27 +++++---------------------- 7 files changed, 38 insertions(+), 48 deletions(-) create mode 100644 plat/osx/include/build.lua diff --git a/plat/osx/include/build.lua b/plat/osx/include/build.lua new file mode 100644 index 000000000..7eb73f3aa --- /dev/null +++ b/plat/osx/include/build.lua @@ -0,0 +1,24 @@ +include("plat/build.lua") + +headermap = {} +packagemap = {} + +local function addheader(h) + headermap[h] = "plat/osx/include/"..h + packagemap["$(PLATIND)/osx/include/"..h] = "plat/osx/include/"..h +end + +addheader("ack/config.h") +addheader("sys/mman.h") +addheader("sys/types.h") +addheader("unistd.h") + +acklibrary { + name = "headers", + hdrs = headermap +} + +installable { + name = "pkg", + map = packagemap +} diff --git a/plat/osx386/build-pkg.lua b/plat/osx386/build-pkg.lua index 8c129c8e7..6dfe1561c 100644 --- a/plat/osx386/build-pkg.lua +++ b/plat/osx386/build-pkg.lua @@ -17,7 +17,7 @@ installable { map = { "+tools", "+libs", - "./include+pkg", + "plat/osx/include+pkg", ["$(PLATIND)/osx386/boot.o"] = "+boot", ["$(PLATIND)/osx386/libsys.a"] = "./libsys+lib", } diff --git a/plat/osx386/descr b/plat/osx386/descr index f1ba978ef..e404e7a34 100644 --- a/plat/osx386/descr +++ b/plat/osx386/descr @@ -29,7 +29,7 @@ var EGO_PLAT_FLAGS=-M{EM}/share/ack/ego/{ARCH}.descr # Override the setting in fe so that files compiled for osx386 can see # the platform-specific headers. -var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/share/ack/include/ansi +var C_INCLUDES=-I{EM}/share/ack/osx/include -I{EM}/share/ack/include/ansi name be from .m.g diff --git a/plat/osx386/include/build.lua b/plat/osx386/include/build.lua index 420518f66..164e2b44a 100644 --- a/plat/osx386/include/build.lua +++ b/plat/osx386/include/build.lua @@ -1,24 +1,7 @@ -include("plat/build.lua") - -headermap = {} -packagemap = {} - -local function addheader(h) - headermap[h] = "plat/osx/include/"..h - packagemap["$(PLATIND)/osx386/include/"..h] = "plat/osx/include/"..h -end - -addheader("ack/config.h") -addheader("sys/mman.h") -addheader("sys/types.h") -addheader("unistd.h") - -acklibrary { +simplerule { name = "headers", - hdrs = headermap -} - -installable { - name = "pkg", - map = packagemap + deps = { "plat/osx/include+headers" }, + ins = {}, + outs = {}, + commands = {}, } diff --git a/plat/osxppc/build-pkg.lua b/plat/osxppc/build-pkg.lua index d6f6d5558..c94ad6ef0 100644 --- a/plat/osxppc/build-pkg.lua +++ b/plat/osxppc/build-pkg.lua @@ -17,7 +17,7 @@ installable { map = { "+tools", "+libs", - "./include+pkg", + "plat/osx/include+pkg", ["$(PLATIND)/osxppc/boot.o"] = "+boot", ["$(PLATIND)/osxppc/libsys.a"] = "./libsys+lib", } diff --git a/plat/osxppc/descr b/plat/osxppc/descr index 3ee01752d..7e8770428 100644 --- a/plat/osxppc/descr +++ b/plat/osxppc/descr @@ -30,7 +30,7 @@ var MACHOPT_F=-m10 # Override the setting in fe so that files compiled for osxppc can see # the platform-specific headers. -var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/share/ack/include/ansi +var C_INCLUDES=-I{EM}/share/ack/osx/include -I{EM}/share/ack/include/ansi name be from .m.g diff --git a/plat/osxppc/include/build.lua b/plat/osxppc/include/build.lua index 375c99535..164e2b44a 100644 --- a/plat/osxppc/include/build.lua +++ b/plat/osxppc/include/build.lua @@ -1,24 +1,7 @@ -include("plat/build.lua") - -headermap = {} -packagemap = {} - -local function addheader(h) - headermap[h] = "plat/osx/include/"..h - packagemap["$(PLATIND)/osxppc/include/"..h] = "plat/osx/include/"..h -end - -addheader("ack/config.h") -addheader("sys/mman.h") -addheader("sys/types.h") -addheader("unistd.h") - -acklibrary { +simplerule { name = "headers", - hdrs = headermap -} - -installable { - name = "pkg", - map = packagemap + deps = { "plat/osx/include+headers" }, + ins = {}, + outs = {}, + commands = {}, }