From ce5f4ad4dfc99f5f058ec724136c226ecabaf7d8 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 21 Nov 2013 14:50:35 -0600 Subject: Move some global methods into the context in which they used --- Library/ENV/4.3/cc | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 7a40d2e38..b29acb64d 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -24,20 +24,6 @@ end LOGGER = Logger.new -def cccfg? flags - flags.split('').all?{|c| ENV['HOMEBREW_CCCFG'].include? c } if ENV['HOMEBREW_CCCFG'] -end -def nclt? - $sdkroot != nil -end -def syspath - if nclt? - %W{#$sdkroot/usr #$sdkroot/usr/local} - else - %W{/usr /usr/local} - end -end - class Cmd def initialize path, args @arg0 = File.basename(path).freeze @@ -192,6 +178,13 @@ class Cmd args.concat ENV['HOMEBREW_ARCHFLAGS'].split(' ') if cccfg? 'u' args end + def syspath + if nclt? + %W{#$sdkroot/usr #$sdkroot/usr/local} + else + %W{/usr /usr/local} + end + end def syslibpath # We reject brew's lib as we explicitly add this as a -L flag, thus it # is given higher priority by cc, so it surpasses the system libpath. @@ -249,6 +242,12 @@ class Cmd # configure scripts generated with autoconf 2.61 or later export as_nl ENV.key? 'as_nl' end + def nclt? + $sdkroot != nil + end + def cccfg? flags + flags.split('').all?{|c| ENV['HOMEBREW_CCCFG'].include? c } if ENV['HOMEBREW_CCCFG'] + end end if __FILE__ == $PROGRAM_NAME -- cgit v1.2.3