From 3a26dafbd19b86d3f36a2e48e44d130accaa2634 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Sun, 26 Nov 2017 00:34:43 +1100
Subject: add virtual toolchain package cc

---
 Makefile          |  7 +++++--
 docs/index.html   | 10 +++++-----
 src/cc.mk         |  9 +++++++++
 tools/skeleton.py |  2 +-
 4 files changed, 20 insertions(+), 8 deletions(-)
 create mode 100644 src/cc.mk

diff --git a/Makefile b/Makefile
index 5474156..80f42ab 100644
--- a/Makefile
+++ b/Makefile
@@ -418,6 +418,9 @@ $(PREFIX)/installed/print-git-oneline-$(GIT_HEAD): | $(PREFIX)/installed/.gitkee
 #   - downloads and `build-pkg` use both explicit and implicit deps
 #   - don't depend on `disabled` rules but do depend on virtual pkgs
 
+# cross libraries depend on virtual toolchain package, variable used
+# in `cleanup-deps-style` rule below
+CROSS_COMPILER := cc
 MXE_REQS_PKGS   =
 
 # distinguish between deliberately empty rules and disabled ones
@@ -884,9 +887,9 @@ cleanup-style:
 cleanup-deps-style:
 	@grep '(PKG)_DEPS.*\\' $(foreach 1,$(PKGS),$(PKG_MAKEFILES)) > $(TOP_DIR)/tmp-$@-pre
 	@$(foreach PKG,$(PKGS), \
-	    $(if $(call lne,$(sort $(filter-out gcc,$($(PKG)_DEPS))),$(filter-out gcc,$($(PKG)_DEPS))), \
+	    $(if $(call lne,$(sort $(filter-out $(CROSS_COMPILER),$($(PKG)_DEPS))),$(filter-out $(CROSS_COMPILER),$($(PKG)_DEPS))), \
 	        $(info [cleanup] $(PKG)) \
-	        $(SED) -i 's/^\([^ ]*_DEPS *:=\)[^$$]*$$/\1 '"$(strip $(filter gcc,$($(PKG)_DEPS)) $(sort $(filter-out gcc,$($(PKG)_DEPS))))"'/' '$(call PKG_MAKEFILES,$(PKG))'; \
+	        $(SED) -i 's/^\([^ ]*_DEPS *:=\)[^$$]*$$/\1 '"$(strip $(filter $(CROSS_COMPILER),$($(PKG)_DEPS)) $(sort $(filter-out $(CROSS_COMPILER),$($(PKG)_DEPS))))"'/' '$(call PKG_MAKEFILES,$(PKG))'; \
 	    ))
 	@grep '(PKG)_DEPS.*\\' $(foreach 1,$(PKGS),$(PKG_MAKEFILES)) > $(TOP_DIR)/tmp-$@-post
 	@diff -u $(TOP_DIR)/tmp-$@-pre $(TOP_DIR)/tmp-$@-post >/dev/null \
diff --git a/docs/index.html b/docs/index.html
index ec846ed..b1f0bfa 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -278,7 +278,7 @@ exit</pre>
     <p>
     If you only need the most basic tools you can also use:
     </p>
-    <pre>make gcc</pre>
+    <pre>make cc</pre>
     <p>
     and add any additional packages you need later on.
     You can also supply a host of packages on the
@@ -933,7 +933,7 @@ USE_OSGPLUGIN(&lt;plugin2&gt;)
         non-parallel
         </dd>
 
-    <dt>make gcc</dt>
+    <dt>make cc</dt>
 
         <dd>
         build a minimal useful set of packages,
@@ -1344,14 +1344,14 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre>
         The easiest way to get the dependencies right
         is to start with a minimal setup.
         That is,
-        initialize MXE with <code>make gcc</code> only,
+        initialize MXE with <code>make cc</code> only,
         then check whether your package builds successfully.
         </p>
 
         <p>
-        Always list the dependency on <code>gcc</code> explicitly:
+        Always list the dependency on <code>cc</code> explicitly:
         </p>
-        <pre>$(PKG)_DEPS     := gcc ...</pre>
+        <pre>$(PKG)_DEPS     := cc ...</pre>
 
         <p>
         Specify official name and website of a package.
diff --git a/src/cc.mk b/src/cc.mk
new file mode 100644
index 0000000..64a4d34
--- /dev/null
+++ b/src/cc.mk
@@ -0,0 +1,9 @@
+# This file is part of MXE. See LICENSE.md for licensing information.
+
+PKG             := cc
+$(PKG)_WEBSITE  := https://mxe.cc
+$(PKG)_DESCR    := Dependency package for cross libraries
+$(PKG)_VERSION  := 1
+$(PKG)_DEPS     := gcc
+$(PKG)_OO_DEPS   = pkgconf $(MXE_REQS_PKGS)
+$(PKG)_TYPE     := meta
diff --git a/tools/skeleton.py b/tools/skeleton.py
index 2dd50cf..6efc533 100755
--- a/tools/skeleton.py
+++ b/tools/skeleton.py
@@ -28,7 +28,7 @@ $(PKG)_IGNORE   :=
 $(PKG)_VERSION  := %(version)s
 $(PKG)_CHECKSUM := %(checksum)s
 %(file_specs)s
-$(PKG)_DEPS     := gcc
+$(PKG)_DEPS     := cc
 %(update)s
 define $(PKG)_BUILD
     %(build)s
-- 
cgit v0.12