Module: Superenv
- Includes:
- SharedEnvExtension
- Defined in:
- Library/Homebrew/extend/ENV/super.rb,
Library/Homebrew/extend/os/mac/extend/ENV/super.rb,
Library/Homebrew/extend/os/linux/extend/ENV/super.rb
Overview
typed: false
frozen_string_literal: true
Instance Method Summary
collapse
#append, #append_path, #append_to_cccfg, #append_to_cflags, #cc, #cflags, #compiler, #cppflags, #cxx, #cxxflags, #fc, #fcflags, #fflags, #fortran, #ldflags, #ncurses_define, #no_weak_imports_support?, #permit_weak_imports, #prepend, #prepend_create_path, #prepend_path, #remove, #remove_cc_etc, #remove_from_cflags
Instance Method Details
#cxx11 ⇒ Object
272
273
274
275
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 272
def cxx11
append_to_cccfg "x"
append_to_cccfg "g" if homebrew_cc == "clang"
end
|
#deparallelize ⇒ Object
Removes the MAKEFLAGS environment variable, causing make to use a single job.
This is useful for makefiles with race conditions.
When passed a block, MAKEFLAGS is removed only for the duration of the block and is restored after its completion.
236
237
238
239
240
241
242
243
244
245
246
247
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 236
def deparallelize
old = delete("MAKEFLAGS")
if block_given?
begin
yield
ensure
self["MAKEFLAGS"] = old
end
end
old
end
|
#determine_cccfg ⇒ Object
227
228
229
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 227
def determine_cccfg
""
end
|
#determine_dynamic_linker_path ⇒ Object
37
38
39
40
41
42
|
# File 'Library/Homebrew/extend/os/linux/extend/ENV/super.rb', line 37
def determine_dynamic_linker_path
path = "#{HOMEBREW_PREFIX}/lib/ld.so"
return unless File.readable? path
path
end
|
#determine_rpath_paths(formula) ⇒ Object
29
30
31
32
33
34
35
|
# File 'Library/Homebrew/extend/os/linux/extend/ENV/super.rb', line 29
def determine_rpath_paths(formula)
PATH.new(
*formula&.lib,
"#{HOMEBREW_PREFIX}/lib",
PATH.new(run_time_deps.map { |dep| dep.opt_lib.to_s }).existing,
)
end
|
141
142
143
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 141
def
[]
end
|
208
209
210
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 208
def
[]
end
|
192
193
194
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 192
def
[]
end
|
200
201
202
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 200
def
[]
end
|
153
154
155
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 153
def
[]
end
|
168
169
170
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 168
def
[]
end
|
102
103
104
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 102
def
[]
end
|
#libcxx ⇒ Object
277
278
279
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 277
def libcxx
append_to_cccfg "g" if compiler == :clang
end
|
#libstdcxx ⇒ Object
281
282
283
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 281
def libstdcxx
append_to_cccfg "h" if compiler == :clang
end
|
#m32 ⇒ Object
264
265
266
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 264
def m32
append "HOMEBREW_ARCHFLAGS", "-m32"
end
|
#m64 ⇒ Object
268
269
270
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 268
def m64
append "HOMEBREW_ARCHFLAGS", "-m64"
end
|
#make_jobs ⇒ Object
249
250
251
252
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 249
def make_jobs
self["MAKEFLAGS"] =~ /-\w*j(\d+)/
[Regexp.last_match(1).to_i, 1].max
end
|
#no_weak_imports ⇒ Object
151
152
153
|
# File 'Library/Homebrew/extend/os/mac/extend/ENV/super.rb', line 151
def no_weak_imports
append_to_cccfg "w" if no_weak_imports_support?
end
|
#permit_arch_flags ⇒ Object
260
261
262
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 260
def permit_arch_flags
append_to_cccfg "K"
end
|
#reset ⇒ Object
32
33
34
35
36
37
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 32
def reset
super
delete("as_nl")
end
|
#set_cpu_flags(_arg0, _arg1 = "", _arg2 = {}) ⇒ Object
298
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 298
def set_cpu_flags(_arg0, _arg1 = "", _arg2 = {}); end
|
#set_x11_env_if_installed ⇒ Object
296
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 296
def set_x11_env_if_installed; end
|
#universal_binary ⇒ Object
254
255
256
257
258
|
# File 'Library/Homebrew/extend/ENV/super.rb', line 254
def universal_binary
check_for_compiler_universal_support
self["HOMEBREW_ARCHFLAGS"] = Hardware::CPU.universal_archs.as_arch_flags
end
|