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
5dc15272
Commit
5dc15272
authored
13 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
ENV: reset LD when switching compilers
Signed-off-by:
Jack Nagel
<
jacknagel@gmail.com
>
parent
01c14f87
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/Homebrew/extend/ENV.rb
+9
-3
9 additions, 3 deletions
Library/Homebrew/extend/ENV.rb
Library/Homebrew/test/test_ENV.rb
+7
-0
7 additions, 0 deletions
Library/Homebrew/test/test_ENV.rb
with
16 additions
and
3 deletions
Library/Homebrew/extend/ENV.rb
+
9
−
3
View file @
5dc15272
...
...
@@ -87,7 +87,8 @@ module HomebrewEnvExtension
def
gcc_4_0_1
# we don't use xcrun because gcc 4.0 has not been provided since Xcode 4
self
[
'CC'
]
=
"
#{
MacOS
.
dev_tools_path
}
/gcc-4.0"
self
[
'CC'
]
=
"
#{
MacOS
.
dev_tools_path
}
/gcc-4.0"
self
[
'LD'
]
=
self
[
'CC'
]
self
[
'CXX'
]
=
"
#{
MacOS
.
dev_tools_path
}
/g++-4.0"
self
[
'OBJC'
]
=
self
[
'CC'
]
replace_in_cflags
'-O4'
,
'-O3'
...
...
@@ -129,6 +130,7 @@ module HomebrewEnvExtension
self
[
'CC'
]
=
`/usr/bin/xcrun -find
#{
$1
}
`
.
chomp
if
$1
self
[
'CXX'
]
=~
%r{/usr/bin/xcrun (.*)}
self
[
'CXX'
]
=
`/usr/bin/xcrun -find
#{
$1
}
`
.
chomp
if
$1
self
[
'LD'
]
=
self
[
'CC'
]
self
[
'OBJC'
]
=
self
[
'CC'
]
end
...
...
@@ -138,11 +140,13 @@ module HomebrewEnvExtension
# But we don't want LLVM of course.
self
[
'CC'
]
=
xcrun
"gcc-4.2"
self
[
'LD'
]
=
self
[
'CC'
]
self
[
'CXX'
]
=
xcrun
"g++-4.2"
self
[
'OBJC'
]
=
self
[
'CC'
]
unless
self
[
'CC'
]
self
[
'CC'
]
=
"
#{
HOMEBREW_PREFIX
}
/bin/gcc-4.2"
self
[
'LD'
]
=
self
[
'CC'
]
self
[
'CXX'
]
=
"
#{
HOMEBREW_PREFIX
}
/bin/g++-4.2"
self
[
'OBJC'
]
=
self
[
'CC'
]
raise
"GCC could not be found"
if
not
File
.
exist?
self
[
'CC'
]
...
...
@@ -159,7 +163,8 @@ module HomebrewEnvExtension
alias_method
:gcc_4_2
,
:gcc
def
llvm
self
[
'CC'
]
=
xcrun
"llvm-gcc"
self
[
'CC'
]
=
xcrun
"llvm-gcc"
self
[
'LD'
]
=
self
[
'CC'
]
self
[
'CXX'
]
=
xcrun
"llvm-g++"
self
[
'OBJC'
]
=
self
[
'CC'
]
set_cpu_cflags
'core2 -msse4'
,
:penryn
=>
'core2 -msse4.1'
,
:core2
=>
'core2'
,
:core
=>
'prescott'
...
...
@@ -167,7 +172,8 @@ module HomebrewEnvExtension
end
def
clang
self
[
'CC'
]
=
xcrun
"clang"
self
[
'CC'
]
=
xcrun
"clang"
self
[
'LD'
]
=
self
[
'CC'
]
self
[
'CXX'
]
=
xcrun
"clang++"
self
[
'OBJC'
]
=
self
[
'CC'
]
replace_in_cflags
(
/-Xarch_i386 (-march=\S*)/
,
'\1'
)
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/test_ENV.rb
+
7
−
0
View file @
5dc15272
...
...
@@ -25,4 +25,11 @@ class EnvironmentTests < Test::Unit::TestCase
assert
!
ENV
.
cc
.
empty?
assert
!
ENV
.
cxx
.
empty?
end
def
test_switching_compilers
ENV
.
llvm
ENV
.
clang
assert_equal
ENV
[
'LD'
],
ENV
[
'CC'
]
assert_equal
ENV
[
'OBJC'
],
ENV
[
'CC'
]
end
end
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