File: extconf.rb

package info (click to toggle)
ruby-prof 1.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,048 kB
  • sloc: ruby: 9,805; ansic: 2,968; makefile: 7
file content (22 lines) | stat: -rw-r--r-- 699 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require "mkmf"

# Let's go with a modern version of C! want to intermix declarations and code (ie, don't define
# all variables at the top of the method). If using Visual Studio, you'll need 2019 version
# 16.8 or higher
if RUBY_PLATFORM =~ /mswin/
  $CFLAGS += ' /std:c11'
else
  $CFLAGS += ' -std=c11'
end

# For gcc add -s to strip symbols, reducing library size from 17MB to 78KB (at least on Windows with mingw64)
if RUBY_PLATFORM !~ /mswin/
  $LDFLAGS += ' -s'
end

# And since we are using C99 we want to disable Ruby sending these warnings to gcc
if CONFIG['warnflags']
  CONFIG['warnflags'].gsub!('-Wdeclaration-after-statement', '')
end

create_makefile("ruby_prof")