mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/mkmf.rb: Documented MakeMakefile constants. Hid implementation
details from RDoc git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5e3ebde7c8
commit
c8a4d4b071
2 changed files with 68 additions and 2 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Jan 25 10:36:31 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* lib/mkmf.rb: Documented MakeMakefile constants. Hid implementation
|
||||||
|
details from RDoc
|
||||||
|
|
||||||
Fri Jan 25 10:04:07 2013 Eric Hodel <drbrain@segment7.net>
|
Fri Jan 25 10:04:07 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/rubygems/compatibility.rb: Hide compatibility shims from RDoc
|
* lib/rubygems/compatibility.rb: Hide compatibility shims from RDoc
|
||||||
|
|
|
||||||
65
lib/mkmf.rb
65
lib/mkmf.rb
|
|
@ -46,15 +46,33 @@ end
|
||||||
# library.
|
# library.
|
||||||
module MakeMakefile
|
module MakeMakefile
|
||||||
|
|
||||||
|
##
|
||||||
|
# The makefile configuration using the defaults from when ruby was built.
|
||||||
|
|
||||||
CONFIG = RbConfig::MAKEFILE_CONFIG
|
CONFIG = RbConfig::MAKEFILE_CONFIG
|
||||||
ORIG_LIBPATH = ENV['LIB']
|
ORIG_LIBPATH = ENV['LIB']
|
||||||
|
|
||||||
|
##
|
||||||
|
# Extensions for files compiled with a C compiler
|
||||||
|
|
||||||
C_EXT = %w[c m]
|
C_EXT = %w[c m]
|
||||||
|
|
||||||
|
##
|
||||||
|
# Extensions for files complied with a C++ compiler
|
||||||
|
|
||||||
CXX_EXT = %w[cc mm cxx cpp]
|
CXX_EXT = %w[cc mm cxx cpp]
|
||||||
if File::FNM_SYSCASE.zero?
|
if File::FNM_SYSCASE.zero?
|
||||||
CXX_EXT.concat(%w[C])
|
CXX_EXT.concat(%w[C])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Extensions for source files
|
||||||
|
|
||||||
SRC_EXT = C_EXT + CXX_EXT
|
SRC_EXT = C_EXT + CXX_EXT
|
||||||
|
|
||||||
|
##
|
||||||
|
# Extensions for header files
|
||||||
|
|
||||||
HDR_EXT = %w[h hpp]
|
HDR_EXT = %w[h hpp]
|
||||||
$static = nil
|
$static = nil
|
||||||
$config_h = '$(arch_hdrdir)/ruby/config.h'
|
$config_h = '$(arch_hdrdir)/ruby/config.h'
|
||||||
|
|
@ -1216,7 +1234,7 @@ SRC
|
||||||
|
|
||||||
# :stopdoc:
|
# :stopdoc:
|
||||||
STRING_OR_FAILED_FORMAT = "%s"
|
STRING_OR_FAILED_FORMAT = "%s"
|
||||||
def STRING_OR_FAILED_FORMAT.%(x)
|
def STRING_OR_FAILED_FORMAT.%(x) # :nodoc:
|
||||||
x ? super : "failed"
|
x ? super : "failed"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -1894,7 +1912,7 @@ all install static install-so install-rb: Makefile
|
||||||
RULES
|
RULES
|
||||||
end
|
end
|
||||||
|
|
||||||
def each_compile_rules
|
def each_compile_rules # :nodoc:
|
||||||
vpath_splat = /\$\(\*VPATH\*\)/
|
vpath_splat = /\$\(\*VPATH\*\)/
|
||||||
COMPILE_RULES.each do |rule|
|
COMPILE_RULES.each do |rule|
|
||||||
if vpath_splat =~ rule
|
if vpath_splat =~ rule
|
||||||
|
|
@ -2417,16 +2435,43 @@ MESSAGE
|
||||||
config_string('COMMON_HEADERS') do |s|
|
config_string('COMMON_HEADERS') do |s|
|
||||||
Shellwords.shellwords(s).each {|w| hdr << "#include <#{w}>"}
|
Shellwords.shellwords(s).each {|w| hdr << "#include <#{w}>"}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Common headers for ruby C extensions
|
||||||
|
|
||||||
COMMON_HEADERS = hdr.join("\n")
|
COMMON_HEADERS = hdr.join("\n")
|
||||||
|
|
||||||
|
##
|
||||||
|
# Common libraries for ruby C extensions
|
||||||
|
|
||||||
COMMON_LIBS = config_string('COMMON_LIBS', &split) || []
|
COMMON_LIBS = config_string('COMMON_LIBS', &split) || []
|
||||||
|
|
||||||
|
##
|
||||||
|
# make compile rules
|
||||||
|
|
||||||
COMPILE_RULES = config_string('COMPILE_RULES', &split) || %w[.%s.%s:]
|
COMPILE_RULES = config_string('COMPILE_RULES', &split) || %w[.%s.%s:]
|
||||||
RULE_SUBST = config_string('RULE_SUBST')
|
RULE_SUBST = config_string('RULE_SUBST')
|
||||||
|
|
||||||
|
##
|
||||||
|
# Command which will compile C files in the generated Makefile
|
||||||
|
|
||||||
COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<'
|
COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<'
|
||||||
|
|
||||||
|
##
|
||||||
|
# Command which will compile C++ files in the generated Makefile
|
||||||
|
|
||||||
COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<'
|
COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<'
|
||||||
|
|
||||||
|
##
|
||||||
|
# Command which will compile a program in order to test linking a library
|
||||||
|
|
||||||
TRY_LINK = config_string('TRY_LINK') ||
|
TRY_LINK = config_string('TRY_LINK') ||
|
||||||
"$(CC) #{OUTFLAG}conftest#{$EXEEXT} $(INCFLAGS) $(CPPFLAGS) " \
|
"$(CC) #{OUTFLAG}conftest#{$EXEEXT} $(INCFLAGS) $(CPPFLAGS) " \
|
||||||
"$(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
|
"$(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
|
||||||
|
|
||||||
|
##
|
||||||
|
# Command which will link a shared library
|
||||||
|
|
||||||
LINK_SO = (config_string('LINK_SO') || "").sub(/^$/) do
|
LINK_SO = (config_string('LINK_SO') || "").sub(/^$/) do
|
||||||
if CONFIG["DLEXT"] == $OBJEXT
|
if CONFIG["DLEXT"] == $OBJEXT
|
||||||
"ld $(DLDFLAGS) -r -o $@ $(OBJS)\n"
|
"ld $(DLDFLAGS) -r -o $@ $(OBJS)\n"
|
||||||
|
|
@ -2435,14 +2480,30 @@ MESSAGE
|
||||||
"$(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)"
|
"$(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Argument which will add a library path to the linker
|
||||||
|
|
||||||
LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L%s'
|
LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L%s'
|
||||||
RPATHFLAG = config_string('RPATHFLAG') || ''
|
RPATHFLAG = config_string('RPATHFLAG') || ''
|
||||||
|
|
||||||
|
##
|
||||||
|
# Argument which will add a library to the linker
|
||||||
|
|
||||||
LIBARG = config_string('LIBARG') || '-l%s'
|
LIBARG = config_string('LIBARG') || '-l%s'
|
||||||
|
|
||||||
|
##
|
||||||
|
# A C main function which does no work
|
||||||
|
|
||||||
MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main(void) {return 0;}'
|
MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main(void) {return 0;}'
|
||||||
UNIVERSAL_INTS = config_string('UNIVERSAL_INTS') {|s| Shellwords.shellwords(s)} ||
|
UNIVERSAL_INTS = config_string('UNIVERSAL_INTS') {|s| Shellwords.shellwords(s)} ||
|
||||||
%w[int short long long\ long]
|
%w[int short long long\ long]
|
||||||
|
|
||||||
sep = config_string('BUILD_FILE_SEPARATOR') {|s| ":/=#{s}" if s != "/"} || ""
|
sep = config_string('BUILD_FILE_SEPARATOR') {|s| ":/=#{s}" if s != "/"} || ""
|
||||||
|
|
||||||
|
##
|
||||||
|
# Makefile rules that will clean the extension build directory
|
||||||
|
|
||||||
CLEANINGS = "
|
CLEANINGS = "
|
||||||
clean-static::
|
clean-static::
|
||||||
clean-rb-default::
|
clean-rb-default::
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue