Skip to content

Commit 2a36dbc

Browse files
committed
Fix Rakefile
1 parent 85af160 commit 2a36dbc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Rakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jemalloc_lib = File.expand_path('jemalloc/lib/libjemalloc.a', __dir__)
2020
file jemalloc_lib do
2121
Dir.chdir('jemalloc') do
2222
sh './autogen.sh'
23-
sh './configure --disable-initial-exec-tls --with-pic'
23+
sh './configure --disable-initial-exec-tls --with-pic', env: { 'CFLAGS' => '-fPIC' }
2424
sh "make -j #{Etc.nprocessors}"
2525
end
2626
end
@@ -44,7 +44,7 @@ def patch_cmake_static_jemalloc
4444
return unless File.file?(file)
4545

4646
orig = "#{file}.orig"
47-
return if File.exist?(orig)
47+
orig = nil if File.exist?(orig)
4848

4949
content = File.read(file)
5050

@@ -56,7 +56,7 @@ def patch_cmake_static_jemalloc
5656
return if content.include?('add_library(jemalloc STATIC IMPORTED)')
5757

5858
content = jemalloc_declaration + "\n" + content
59-
File.write(orig, File.read(file))
59+
File.write(orig, File.read(file)) if orig
6060
File.write(file, content)
6161
puts "Inserted static jemalloc declaration into: #{file}"
6262
end

0 commit comments

Comments
 (0)