1 |
commit: 3e4df184a9626123cf7c0678fc757e399a2af2a1 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 27 22:50:22 2012 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 27 22:50:22 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/crossdev.git;a=commit;h=3e4df184 |
7 |
|
8 |
crossdev: add --show-target-cfg for external toolers |
9 |
|
10 |
This is meant for other scripts that will be calling crossdev to get |
11 |
info out of crossdev so they don't have to duplicate tuple maps. |
12 |
|
13 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
14 |
|
15 |
--- |
16 |
crossdev | 33 +++++++++++++++++++++++++++++++++ |
17 |
1 files changed, 33 insertions(+), 0 deletions(-) |
18 |
|
19 |
diff --git a/crossdev b/crossdev |
20 |
index 45debb9..27f0a1c 100755 |
21 |
--- a/crossdev |
22 |
+++ b/crossdev |
23 |
@@ -69,6 +69,9 @@ Stage Options: |
24 |
${GOOD}-s4, --stage4${NORMAL} Also build a full compiler [default] |
25 |
(shared libs GCC/various lang frontends/etc...) |
26 |
|
27 |
+External Tooling Options: |
28 |
+ ${GOOD}--show-target-cfg${NORMAL} Display target settings that crossdev will use |
29 |
+ |
30 |
Extra Fun (must be run after above stages): |
31 |
${GOOD}--ex-only${NORMAL} Skip the stage steps above |
32 |
${GOOD}--ex-gcc${NORMAL} Build extra gcc targets (gcj/ada/etc...) |
33 |
@@ -474,6 +477,7 @@ EX_GDB="no" |
34 |
FORCE="no" |
35 |
SET_X="no" |
36 |
SHOW_FAIL_LOG="no" |
37 |
+SHOW_TARGET_CFG="no" |
38 |
|
39 |
while [[ $# -gt 0 ]] ; do |
40 |
case $1 in |
41 |
@@ -508,6 +512,7 @@ while [[ $# -gt 0 ]] ; do |
42 |
--without-*) eval $(set_withval $1);; |
43 |
-f|--force) FORCE="yes";; |
44 |
-x) SET_X="yes";; |
45 |
+ --show-target-cfg) SHOW_TARGET_CFG="yes";; |
46 |
--show-fail-log) SHOW_FAIL_LOG="yes";; |
47 |
-P|--portage) UOPTS="${UOPTS} $2"; shift;; |
48 |
-b|-d|-p|-v|-q) UOPTS="${UOPTS} $1";; |
49 |
@@ -531,6 +536,34 @@ for with in HEADERS ; do |
50 |
[[ ${!var} == "COW" ]] && eval ${var}=${!defvar} |
51 |
done |
52 |
|
53 |
+show_target_cfg() { |
54 |
+ local pkgs |
55 |
+ |
56 |
+ pkgs=( |
57 |
+ binutils B |
58 |
+ gcc G |
59 |
+ headers K |
60 |
+ libc L |
61 |
+ ) |
62 |
+ ex_gdb && pkgs+=( gdb D ) |
63 |
+ |
64 |
+ echo "arch ${TARCH}" |
65 |
+ echo "target ${CTARGET}" |
66 |
+ echo "category cross-${CTARGET}" |
67 |
+ while [[ ${#pkgs[@]} -gt 0 ]] ; do |
68 |
+ local vcat="${pkgs[1]}CAT" |
69 |
+ local vpkg="${pkgs[1]}PKG" |
70 |
+ |
71 |
+ if [[ ${!vpkg} != "[none]" ]] ; then |
72 |
+ echo "${pkgs[0]} ${!vcat} ${!vpkg}" |
73 |
+ fi |
74 |
+ pkgs=( ${pkgs[@]:2} ) |
75 |
+ done |
76 |
+ |
77 |
+ exit 0 |
78 |
+} |
79 |
+[[ ${SHOW_TARGET_CFG} == "yes" ]] && show_target_cfg |
80 |
+ |
81 |
setup_portage_vars |
82 |
if [[ -z ${CROSSDEV_OVERLAY} ]] ; then |
83 |
eerror "You need to specify an output overlay. Please use --ov-output or set" |