public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Changes to flag-o-matic's _filter-var
@ 2010-02-24 20:27 ChIIph
  2010-02-24 22:49 ` [gentoo-dev] " Duncan
  2010-03-07  2:27 ` [gentoo-dev] " Mike Frysinger
  0 siblings, 2 replies; 7+ messages in thread
From: ChIIph @ 2010-02-24 20:27 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 378 bytes --]

Hello everyone,

Here are some minor changes I'd like to propose to flag-o-matic's
_filter-var() to work properly with LDFLAGS.
Without this, things like "-Wl,-O1,--as-needed" won't be affected by any
kind of filter since there are no spaces to separate each flag.

I don't know of any better way to do this, but here's a patch that works
just fine.

Regards,
Tomas

[-- Attachment #1.2: filter.patch --]
[-- Type: text/plain, Size: 649 bytes --]

--- /usr/portage/eclass/flag-o-matic.eclass.old	2010-02-17 16:36:55.000000000 -0300
+++ /usr/portage/eclass/flag-o-matic.eclass	2010-02-24 17:16:30.000000000 -0300
@@ -96,14 +96,20 @@
 	VAR=$1
 	shift
 	eval VAL=\${${VAR}}
-	for f in ${VAL}; do
-		for x in "$@"; do
+	for f in ${VAL//,/ }; do
+		for x in ${@//,/ }; do
 			# Note this should work with globs like -O*
 			[[ ${f} == ${x} ]] && continue 2
 		done
 		eval new\[\${\#new\[@]}]=\${f}
 	done
+
 	eval export ${VAR}=\${new\[*]}
+	
+	if [[ "${VAR}" == "LDFLAGS" ]]; then
+		eval VAL=\${${VAR}}
+		eval export ${VAR}=${VAL// /,}
+	fi
 }
 
 # @FUNCTION: filter-flags

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-03-07 18:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24 20:27 [gentoo-dev] Changes to flag-o-matic's _filter-var ChIIph
2010-02-24 22:49 ` [gentoo-dev] " Duncan
2010-03-07  2:27 ` [gentoo-dev] " Mike Frysinger
2010-03-07 17:54   ` ChIIph
2010-03-07 17:50     ` Mike Frysinger
2010-03-07 18:59       ` ChIIph
2010-03-07 18:16         ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox