Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
be08993a
Commit
be08993a
authored
11 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
Avoid globals when ivars will do
parent
ce5f4ad4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/ENV/4.3/cc
+11
-7
11 additions, 7 deletions
Library/ENV/4.3/cc
Library/ENV/libsuperenv.rb
+0
-3
0 additions, 3 deletions
Library/ENV/libsuperenv.rb
with
11 additions
and
10 deletions
Library/ENV/4.3/cc
+
11
−
7
View file @
be08993a
...
...
@@ -25,9 +25,13 @@ end
LOGGER
=
Logger
.
new
class
Cmd
attr_reader
:brewfix
,
:sdkroot
def
initialize
path
,
args
@arg0
=
File
.
basename
(
path
).
freeze
@args
=
args
.
freeze
@brewfix
=
ENV
[
'HOMEBREW_PREFIX'
]
@sdkroot
=
ENV
[
'HOMEBREW_SDKROOT'
]
end
def
mode
if
@arg0
==
'cpp'
or
@arg0
==
'ld'
...
...
@@ -74,9 +78,9 @@ class Cmd
refurbished_args
end
if
tool
!=
'ld'
args
<<
"--sysroot=
#
$
sdkroot
"
args
<<
"--sysroot=
#
{
sdkroot
}
"
else
args
<<
"-syslibroot"
<<
$
sdkroot
args
<<
"-syslibroot"
<<
sdkroot
end
if
nclt?
allflags
=
case
mode
when
:ccld
...
...
@@ -133,7 +137,7 @@ class Cmd
when
/^-L(.+)/
path
=
$1
.
chuzzle
||
whittler
.
next
doit
=
case
path
.
cleanpath
when
%r{^
#
$
brewfix
}
when
%r{^
#
{
brewfix
}
}
# maybe homebrew is installed to /sw or /opt/brew
true
when
%r{^/opt}
,
%r{^/sw}
,
%r{/usr/X11}
...
...
@@ -180,7 +184,7 @@ class Cmd
end
def
syspath
if
nclt?
%W{
#
$
sdkroot
/usr
#
$
sdkroot
/usr/local}
%W{
#
{
sdkroot
}
/usr
#
{
sdkroot
}
/usr/local}
else
%W{/usr /usr/local}
end
...
...
@@ -189,7 +193,7 @@ class Cmd
# 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.
# NOTE this only counts if Homebrew is installed at /usr/local
syspath
.
map
{
|
d
|
"
#{
d
}
/lib"
}.
reject
{
|
d
|
d
==
"
#
$
brewfix
/lib"
}
syspath
.
map
{
|
d
|
"
#{
d
}
/lib"
}.
reject
{
|
d
|
d
==
"
#
{
brewfix
}
/lib"
}
end
def
syscpath
isystem
,
_
=
cpath
...
...
@@ -197,7 +201,7 @@ class Cmd
end
def
cpath
cpath
=
ENV
[
'CMAKE_PREFIX_PATH'
].
split
(
':'
).
map
{
|
d
|
"
#{
d
}
/include"
}
+
ENV
[
'CMAKE_INCLUDE_PATH'
].
split
(
':'
)
opt
=
cpath
.
grep
(
%r{^
#
$
brewfix
/opt}
)
opt
=
cpath
.
grep
(
%r{^
#
{
brewfix
}
/opt}
)
sys
=
cpath
-
opt
[
sys
,
opt
]
end
...
...
@@ -243,7 +247,7 @@ class Cmd
ENV
.
key?
'as_nl'
end
def
nclt?
$
sdkroot
!=
nil
sdkroot
!=
nil
end
def
cccfg?
flags
flags
.
split
(
''
).
all?
{
|
c
|
ENV
[
'HOMEBREW_CCCFG'
].
include?
c
}
if
ENV
[
'HOMEBREW_CCCFG'
]
...
...
This diff is collapsed.
Click to expand it.
Library/ENV/libsuperenv.rb
+
0
−
3
View file @
be08993a
...
...
@@ -20,6 +20,3 @@ class Array
select
{
|
path
|
File
.
directory?
path
}.
uniq
.
map
{
|
path
|
prefix
+
path
}
end
end
$brewfix
=
ENV
[
'HOMEBREW_PREFIX'
]
$sdkroot
=
ENV
[
'HOMEBREW_SDKROOT'
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment