summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-08-05 04:04:54 -0400
committerMike Frysinger <vapier@gentoo.org>2015-08-05 04:04:54 -0400
commitdb595876a93d194b2ac98c9e1804d0772edb1635 (patch)
tree1d0f1b5266f509f6b1ede28be0c949183f8e73f0
parentgcc-config: quote expanded paths (diff)
downloadgcc-config-1.9.0.tar.gz
gcc-config-1.9.0.tar.bz2
gcc-config-1.9.0.zip
gcc.eselect: add an eselect modulev1.9.0
This wraps gcc-config so that people can use the standard eselect interface to manage gcc profiles. URL: https://bugs.gentoo.org/507870 Reported-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--Makefile5
-rw-r--r--gcc.eselect45
2 files changed, 49 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index db14af9..e20f9f8 100644
--- a/Makefile
+++ b/Makefile
@@ -10,12 +10,14 @@ P = $(PN)-$(PV)
PREFIX = $(EPREFIX)/usr
BINDIR = $(PREFIX)/bin
+ESELECTDIR = $(PREFIX)/share/eselect/modules
SUBLIBDIR = lib
LIBDIR = $(PREFIX)/$(SUBLIBDIR)
LIBEXECDIR = $(LIBDIR)/misc
MKDIR_P = mkdir -p -m 755
INSTALL_EXE = install -m 755
+INSTALL_DATA = install -m 644
all: .gcc-config wrapper
@@ -32,9 +34,10 @@ clean:
chmod a+rx $@
install: all
- $(MKDIR_P) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBEXECDIR)
+ $(MKDIR_P) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBEXECDIR) $(DESTDIR)$(ESELECTDIR)
$(INSTALL_EXE) wrapper $(DESTDIR)$(LIBEXECDIR)/$(PN)
$(INSTALL_EXE) .gcc-config $(DESTDIR)$(BINDIR)/gcc-config
+ $(INSTALL_DATA) gcc.eselect $(DESTDIR)$(ESELECTDIR)
test check: .gcc-config
cd tests && ./run_tests
diff --git a/gcc.eselect b/gcc.eselect
new file mode 100644
index 0000000..02606dc
--- /dev/null
+++ b/gcc.eselect
@@ -0,0 +1,45 @@
+# -*-eselect-*- vim: ft=eselect
+# Copyright 2005-2015 Gentoo Foundation
+# Distributed under the terms of the GNU GPL version 2 or later
+
+DESCRIPTION="Manage installed versions of sys-devel/gcc"
+MAINTAINER="toolchain@gentoo.org"
+
+### list action
+
+describe_list() {
+ echo "List all installed version of gcc"
+}
+
+do_list() {
+ gcc-config -l
+}
+
+### set action
+
+describe_set() {
+ echo "Activate one of the installed gcc"
+}
+
+describe_set_parameters() {
+ echo "<target>"
+}
+
+describe_set_options() {
+ echo "target : Target name or number (from 'list' action)"
+}
+
+do_set() {
+ [[ $# -eq 1 ]] || die -q "Please specify exactly one version to activate!"
+ gcc-config "$1"
+}
+
+### show action
+
+describe_show() {
+ echo "Print the currently active gcc version"
+}
+
+do_show() {
+ gcc-config -c
+}