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
8484e72f
Commit
8484e72f
authored
11 years ago
by
Mike McQuaid
Browse files
Options
Downloads
Patches
Plain Diff
superenv: set cc/cxx based on actual compiler.
Closes Homebrew/homebrew#23449.
parent
f426fdd4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Library/Homebrew/extend/ENV/super.rb
+15
-19
15 additions, 19 deletions
Library/Homebrew/extend/ENV/super.rb
with
15 additions
and
19 deletions
Library/Homebrew/extend/ENV/super.rb
+
15
−
19
View file @
8484e72f
...
...
@@ -61,9 +61,8 @@ module Superenv
def
setup_build_environment
(
formula
=
nil
)
reset
self
.
cc
=
'cc'
self
.
cxx
=
'c++'
self
[
'HOMEBREW_CC'
]
=
determine_cc
self
.
cc
=
self
[
'HOMEBREW_CC'
]
=
determine_cc
self
.
cxx
=
self
[
'HOMEBREW_CXX'
]
=
determine_cxx
validate_cc!
(
formula
)
unless
formula
.
nil?
self
[
'DEVELOPER_DIR'
]
=
determine_developer_dir
self
[
'MAKEFLAGS'
]
||=
"-j
#{
determine_make_jobs
}
"
...
...
@@ -152,6 +151,10 @@ module Superenv
COMPILER_SYMBOL_MAP
.
invert
.
fetch
(
cc
,
cc
)
end
def
determine_cxx
determine_cc
.
to_s
.
gsub
(
'gcc'
,
'g++'
).
gsub
(
'clang'
,
'clang++'
)
end
def
determine_path
paths
=
[
Superenv
.
bin
]
if
MacOS
::
Xcode
.
without_clt?
...
...
@@ -292,25 +295,18 @@ module Superenv
delete
(
'MAKEFLAGS'
)
end
alias_method
:j1
,
:deparallelize
def
gcc
self
[
'HOMEBREW_CC'
]
=
"gcc-4.2"
@compiler
=
:gcc
end
def
gcc_4_0
self
[
'HOMEBREW_CC'
]
=
"gcc-4.0"
@compiler
=
:gcc_4_0
end
def
llvm
self
[
'HOMEBREW_CC'
]
=
"llvm-gcc"
@compiler
=
:llvm
end
def
clang
self
[
'HOMEBREW_CC'
]
=
"clang"
@compiler
=
:clang
COMPILER_SYMBOL_MAP
.
values
.
each
do
|
compiler
|
define_method
compiler
do
@compiler
=
compiler
self
.
cc
=
self
[
'HOMEBREW_CC'
]
=
determine_cc
self
.
cxx
=
self
[
'HOMEBREW_CXX'
]
=
determine_cxx
end
end
GNU_GCC_VERSIONS
.
each
do
|
n
|
define_method
(
:"gcc-4.
#{
n
}
"
)
do
@compiler
=
self
[
'HOMEBREW_CC'
]
=
"gcc-4.
#{
n
}
"
@compiler
=
:"gcc-4.
#{
n
}
"
self
.
cc
=
self
[
'HOMEBREW_CC'
]
=
determine_cc
self
.
cxx
=
self
[
'HOMEBREW_CXX'
]
=
determine_cxx
end
end
def
make_jobs
...
...
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