2009-09-10 10:00:47 -04:00
|
|
|
# -*- indent-tabs-mode: t -*-
|
1999-01-19 23:59:39 -05:00
|
|
|
# module to create Makefile for extension modules
|
1998-01-16 07:19:09 -05:00
|
|
|
# invoke like: ruby -r mkmf extconf.rb
|
|
|
|
|
|
|
|
require 'rbconfig'
|
2003-07-18 04:34:45 -04:00
|
|
|
require 'fileutils'
|
2002-03-29 02:42:20 -05:00
|
|
|
require 'shellwords'
|
1998-01-16 07:19:09 -05:00
|
|
|
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
CONFIG = RbConfig::MAKEFILE_CONFIG
|
2000-12-21 22:22:25 -05:00
|
|
|
ORIG_LIBPATH = ENV['LIB']
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2005-04-07 10:59:24 -04:00
|
|
|
CXX_EXT = %w[cc cxx cpp]
|
2009-03-13 21:39:15 -04:00
|
|
|
if File::FNM_SYSCASE.zero?
|
2005-04-07 10:59:24 -04:00
|
|
|
CXX_EXT.concat(%w[C])
|
2005-03-31 08:24:27 -05:00
|
|
|
end
|
2009-05-17 10:23:17 -04:00
|
|
|
SRC_EXT = %w[c m].concat(CXX_EXT)
|
2008-10-05 10:34:37 -04:00
|
|
|
$static = nil
|
|
|
|
$config_h = '$(arch_hdrdir)/ruby/config.h'
|
2006-05-25 19:44:08 -04:00
|
|
|
$default_static = $static
|
1999-08-13 01:45:20 -04:00
|
|
|
|
2002-03-29 02:42:20 -05:00
|
|
|
unless defined? $configure_args
|
|
|
|
$configure_args = {}
|
2002-09-03 04:40:47 -04:00
|
|
|
args = CONFIG["configure_args"]
|
2002-09-15 08:57:21 -04:00
|
|
|
if ENV["CONFIGURE_ARGS"]
|
2002-09-03 04:40:47 -04:00
|
|
|
args << " " << ENV["CONFIGURE_ARGS"]
|
|
|
|
end
|
|
|
|
for arg in Shellwords::shellwords(args)
|
2002-03-29 02:42:20 -05:00
|
|
|
arg, val = arg.split('=', 2)
|
2003-06-25 01:28:24 -04:00
|
|
|
next unless arg
|
2004-08-20 17:42:21 -04:00
|
|
|
arg.tr!('_', '-')
|
2002-03-29 02:42:20 -05:00
|
|
|
if arg.sub!(/^(?!--)/, '--')
|
|
|
|
val or next
|
|
|
|
arg.downcase!
|
|
|
|
end
|
|
|
|
next if /^--(?:top|topsrc|src|cur)dir$/ =~ arg
|
|
|
|
$configure_args[arg] = val || true
|
|
|
|
end
|
|
|
|
for arg in ARGV
|
|
|
|
arg, val = arg.split('=', 2)
|
2003-06-25 01:28:24 -04:00
|
|
|
next unless arg
|
2004-08-20 17:42:21 -04:00
|
|
|
arg.tr!('_', '-')
|
2002-03-29 02:42:20 -05:00
|
|
|
if arg.sub!(/^(?!--)/, '--')
|
|
|
|
val or next
|
|
|
|
arg.downcase!
|
|
|
|
end
|
|
|
|
$configure_args[arg] = val || true
|
|
|
|
end
|
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2001-05-07 05:26:29 -04:00
|
|
|
$libdir = CONFIG["libdir"]
|
|
|
|
$rubylibdir = CONFIG["rubylibdir"]
|
|
|
|
$archdir = CONFIG["archdir"]
|
2001-05-11 01:24:59 -04:00
|
|
|
$sitedir = CONFIG["sitedir"]
|
2001-05-07 05:26:29 -04:00
|
|
|
$sitelibdir = CONFIG["sitelibdir"]
|
|
|
|
$sitearchdir = CONFIG["sitearchdir"]
|
2007-11-03 09:30:59 -04:00
|
|
|
$vendordir = CONFIG["vendordir"]
|
|
|
|
$vendorlibdir = CONFIG["vendorlibdir"]
|
|
|
|
$vendorarchdir = CONFIG["vendorarchdir"]
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2002-09-23 07:01:49 -04:00
|
|
|
$mswin = /mswin/ =~ RUBY_PLATFORM
|
|
|
|
$bccwin = /bccwin/ =~ RUBY_PLATFORM
|
|
|
|
$mingw = /mingw/ =~ RUBY_PLATFORM
|
|
|
|
$cygwin = /cygwin/ =~ RUBY_PLATFORM
|
|
|
|
$netbsd = /netbsd/ =~ RUBY_PLATFORM
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$os2 = /os2/ =~ RUBY_PLATFORM
|
2004-03-18 21:35:27 -05:00
|
|
|
$beos = /beos/ =~ RUBY_PLATFORM
|
2008-08-06 16:52:44 -04:00
|
|
|
$haiku = /haiku/ =~ RUBY_PLATFORM
|
2004-03-18 21:35:27 -05:00
|
|
|
$solaris = /solaris/ =~ RUBY_PLATFORM
|
2009-03-19 05:49:51 -04:00
|
|
|
$universal = /universal/ =~ RUBY_PLATFORM
|
2006-07-20 23:12:45 -04:00
|
|
|
$dest_prefix_pattern = (File::PATH_SEPARATOR == ';' ? /\A([[:alpha:]]:)?/ : /\A/)
|
2002-09-10 05:53:04 -04:00
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# :stopdoc:
|
|
|
|
|
2002-10-28 12:01:23 -05:00
|
|
|
def config_string(key, config = CONFIG)
|
|
|
|
s = config[key] and !s.empty? and block_given? ? yield(s) : s
|
|
|
|
end
|
|
|
|
|
2002-04-01 10:01:56 -05:00
|
|
|
def dir_re(dir)
|
2006-09-20 10:18:19 -04:00
|
|
|
Regexp.new('\$(?:\('+dir+'\)|\{'+dir+'\})(?:\$(?:\(target_prefix\)|\{target_prefix\}))?')
|
2002-04-01 10:01:56 -05:00
|
|
|
end
|
|
|
|
|
2007-12-17 03:47:28 -05:00
|
|
|
def relative_from(path, base)
|
|
|
|
dir = File.join(path, "")
|
|
|
|
if File.expand_path(dir) == File.expand_path(dir, base)
|
|
|
|
path
|
|
|
|
else
|
|
|
|
File.join(base, path)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2002-04-01 10:01:56 -05:00
|
|
|
INSTALL_DIRS = [
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
[dir_re('commondir'), "$(RUBYCOMMONDIR)"],
|
2007-06-09 23:06:15 -04:00
|
|
|
[dir_re('sitedir'), "$(RUBYCOMMONDIR)"],
|
2007-11-03 09:30:59 -04:00
|
|
|
[dir_re('vendordir'), "$(RUBYCOMMONDIR)"],
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
[dir_re('rubylibdir'), "$(RUBYLIBDIR)"],
|
|
|
|
[dir_re('archdir'), "$(RUBYARCHDIR)"],
|
|
|
|
[dir_re('sitelibdir'), "$(RUBYLIBDIR)"],
|
2007-11-03 09:30:59 -04:00
|
|
|
[dir_re('vendorlibdir'), "$(RUBYLIBDIR)"],
|
2007-06-09 23:06:15 -04:00
|
|
|
[dir_re('sitearchdir'), "$(RUBYARCHDIR)"],
|
2007-11-03 09:30:59 -04:00
|
|
|
[dir_re('vendorarchdir'), "$(RUBYARCHDIR)"],
|
2007-06-09 23:06:15 -04:00
|
|
|
[dir_re('rubyhdrdir'), "$(RUBYHDRDIR)"],
|
|
|
|
[dir_re('sitehdrdir'), "$(SITEHDRDIR)"],
|
2007-11-03 09:30:59 -04:00
|
|
|
[dir_re('vendorhdrdir'), "$(VENDORHDRDIR)"],
|
2008-02-04 21:14:17 -05:00
|
|
|
[dir_re('bindir'), "$(BINDIR)"],
|
2002-04-01 10:01:56 -05:00
|
|
|
]
|
|
|
|
|
2005-02-18 20:43:58 -05:00
|
|
|
def install_dirs(target_prefix = nil)
|
|
|
|
if $extout
|
|
|
|
dirs = [
|
2008-02-04 21:14:17 -05:00
|
|
|
['BINDIR', '$(extout)/bin'],
|
2006-09-16 03:06:57 -04:00
|
|
|
['RUBYCOMMONDIR', '$(extout)/common'],
|
2006-09-20 10:18:19 -04:00
|
|
|
['RUBYLIBDIR', '$(RUBYCOMMONDIR)$(target_prefix)'],
|
2005-02-18 20:43:58 -05:00
|
|
|
['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'],
|
2007-06-09 23:06:15 -04:00
|
|
|
['HDRDIR', '$(extout)/include/ruby$(target_prefix)'],
|
|
|
|
['ARCHHDRDIR', '$(extout)/include/$(arch)/ruby$(target_prefix)'],
|
2005-02-18 20:43:58 -05:00
|
|
|
['extout', "#$extout"],
|
|
|
|
['extout_prefix', "#$extout_prefix"],
|
|
|
|
]
|
|
|
|
elsif $extmk
|
|
|
|
dirs = [
|
2008-02-04 21:14:17 -05:00
|
|
|
['BINDIR', '$(bindir)'],
|
2005-02-18 20:43:58 -05:00
|
|
|
['RUBYCOMMONDIR', '$(rubylibdir)'],
|
|
|
|
['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'],
|
|
|
|
['RUBYARCHDIR', '$(archdir)$(target_prefix)'],
|
2007-06-09 23:06:15 -04:00
|
|
|
['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
|
|
|
|
['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
|
2005-02-18 20:43:58 -05:00
|
|
|
]
|
2007-11-03 09:30:59 -04:00
|
|
|
elsif $configure_args.has_key?('--vendor')
|
|
|
|
dirs = [
|
2008-02-04 21:14:17 -05:00
|
|
|
['BINDIR', '$(bindir)'],
|
2007-11-03 09:30:59 -04:00
|
|
|
['RUBYCOMMONDIR', '$(vendordir)$(target_prefix)'],
|
|
|
|
['RUBYLIBDIR', '$(vendorlibdir)$(target_prefix)'],
|
|
|
|
['RUBYARCHDIR', '$(vendorarchdir)$(target_prefix)'],
|
|
|
|
['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
|
|
|
|
['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
|
|
|
|
]
|
2005-02-18 20:43:58 -05:00
|
|
|
else
|
2007-06-16 09:30:58 -04:00
|
|
|
dirs = [
|
2008-02-04 21:14:17 -05:00
|
|
|
['BINDIR', '$(bindir)'],
|
2005-02-18 20:43:58 -05:00
|
|
|
['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'],
|
|
|
|
['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'],
|
|
|
|
['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'],
|
2007-06-09 23:06:15 -04:00
|
|
|
['HDRDIR', '$(rubyhdrdir)/ruby$(target_prefix)'],
|
|
|
|
['ARCHHDRDIR', '$(rubyhdrdir)/$(arch)/ruby$(target_prefix)'],
|
2005-02-18 20:43:58 -05:00
|
|
|
]
|
|
|
|
end
|
|
|
|
dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")]
|
|
|
|
dirs
|
|
|
|
end
|
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def map_dir(dir, map = nil)
|
|
|
|
map ||= INSTALL_DIRS
|
2006-10-09 10:41:24 -04:00
|
|
|
map.inject(dir) {|d, (orig, new)| d.gsub(orig, new)}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2002-04-01 10:01:56 -05:00
|
|
|
|
2010-06-23 01:32:46 -04:00
|
|
|
topdir = File.dirname(File.dirname(__FILE__))
|
2007-12-22 01:19:11 -05:00
|
|
|
path = File.expand_path($0)
|
2009-08-06 00:00:38 -04:00
|
|
|
$extmk = path[0, topdir.size+1] == topdir+"/"
|
2010-10-23 01:40:11 -04:00
|
|
|
$extmk &&= %r"\A(?:ext|enc|tool|test(?:/.+)?)\z" =~ File.dirname(path[topdir.size+1..-1])
|
2009-08-06 00:00:38 -04:00
|
|
|
$extmk &&= true
|
2007-06-09 23:06:15 -04:00
|
|
|
if not $extmk and File.exist?(($hdrdir = RbConfig::CONFIG["rubyhdrdir"]) + "/ruby/ruby.h")
|
|
|
|
$topdir = $hdrdir
|
2007-08-30 00:49:27 -04:00
|
|
|
$top_srcdir = $hdrdir
|
2007-06-09 23:06:15 -04:00
|
|
|
$arch_hdrdir = $hdrdir + "/$(arch)"
|
2008-08-17 02:58:41 -04:00
|
|
|
elsif File.exist?(($hdrdir = ($top_srcdir ||= topdir) + "/include") + "/ruby.h")
|
2007-06-09 23:06:15 -04:00
|
|
|
$topdir ||= RbConfig::CONFIG["topdir"]
|
|
|
|
$arch_hdrdir = "$(extout)/include/$(arch)"
|
2004-02-09 03:48:55 -05:00
|
|
|
else
|
2007-08-02 17:17:37 -04:00
|
|
|
abort "mkmf.rb can't find header files for ruby at #{$hdrdir}/ruby.h"
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
|
2002-09-15 08:57:21 -04:00
|
|
|
OUTFLAG = CONFIG['OUTFLAG']
|
2007-12-23 22:49:56 -05:00
|
|
|
COUTFLAG = CONFIG['COUTFLAG']
|
2002-09-15 08:57:21 -04:00
|
|
|
CPPOUTFILE = CONFIG['CPPOUTFILE']
|
2002-09-08 05:08:15 -04:00
|
|
|
|
2007-06-09 23:06:15 -04:00
|
|
|
CONFTEST_C = "conftest.c".freeze
|
1999-01-19 23:59:39 -05:00
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
class String
|
2008-03-07 05:56:13 -05:00
|
|
|
# Wraps a string in escaped quotes if it contains whitespace.
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def quote
|
2007-06-09 23:06:15 -04:00
|
|
|
/\s/ =~ self ? "\"#{self}\"" : "#{self}"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2008-03-07 05:56:13 -05:00
|
|
|
|
|
|
|
# Generates a string used as cpp macro name.
|
2007-11-17 19:09:50 -05:00
|
|
|
def tr_cpp
|
|
|
|
strip.upcase.tr_s("^A-Z0-9_", "_")
|
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
|
|
|
class Array
|
2008-03-07 05:56:13 -05:00
|
|
|
# Wraps all strings in escaped quotes if they contain whitespace.
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def quote
|
|
|
|
map {|s| s.quote}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2000-05-28 22:10:22 -04:00
|
|
|
def rm_f(*files)
|
2009-09-17 17:36:53 -04:00
|
|
|
opt = (Hash === files.last ? [files.pop] : [])
|
|
|
|
FileUtils.rm_f(Dir[*files.flatten], *opt)
|
2000-05-28 22:10:22 -04:00
|
|
|
end
|
|
|
|
|
2008-12-23 23:45:34 -05:00
|
|
|
def rm_rf(*files)
|
2009-09-17 17:36:53 -04:00
|
|
|
opt = (Hash === files.last ? [files.pop] : [])
|
|
|
|
FileUtils.rm_rf(Dir[*files.flatten], *opt)
|
2008-12-23 23:45:34 -05:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# Returns time stamp of the +target+ file if it exists and is newer
|
|
|
|
# than or equal to all of +times+.
|
2003-07-18 04:34:45 -04:00
|
|
|
def modified?(target, times)
|
|
|
|
(t = File.mtime(target)) rescue return nil
|
|
|
|
Array === times or times = [times]
|
|
|
|
t if times.all? {|n| n <= t}
|
2002-09-03 04:40:47 -04:00
|
|
|
end
|
|
|
|
|
2004-01-08 21:20:28 -05:00
|
|
|
def merge_libs(*libs)
|
|
|
|
libs.inject([]) do |x, y|
|
|
|
|
xy = x & y
|
|
|
|
xn = yn = 0
|
2004-01-21 02:44:24 -05:00
|
|
|
y = y.inject([]) {|ary, e| ary.last == e ? ary : ary << e}
|
2004-01-08 21:20:28 -05:00
|
|
|
y.each_with_index do |v, yi|
|
|
|
|
if xy.include?(v)
|
|
|
|
xi = [x.index(v), xn].max()
|
|
|
|
x[xi, 1] = y[yn..yi]
|
|
|
|
xn, yn = xi + (yi - yn + 1), yi + 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
x.concat(y[yn..-1] || [])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# This is a custom logging module. It generates an mkmf.log file when you
|
|
|
|
# run your extconf.rb script. This can be useful for debugging unexpected
|
|
|
|
# failures.
|
|
|
|
#
|
|
|
|
# This module and its associated methods are meant for internal use only.
|
|
|
|
#
|
2002-09-08 05:08:15 -04:00
|
|
|
module Logging
|
|
|
|
@log = nil
|
|
|
|
@logfile = 'mkmf.log'
|
|
|
|
@orgerr = $stderr.dup
|
|
|
|
@orgout = $stdout.dup
|
2005-02-06 09:51:44 -05:00
|
|
|
@postpone = 0
|
2007-06-12 01:52:19 -04:00
|
|
|
@quiet = $extmk
|
2002-06-19 01:54:24 -04:00
|
|
|
|
2008-08-31 04:59:09 -04:00
|
|
|
def self::log_open
|
|
|
|
@log ||= File::open(@logfile, 'wb')
|
2002-10-27 04:04:55 -05:00
|
|
|
@log.sync = true
|
2008-08-31 04:59:09 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def self::open
|
|
|
|
log_open
|
2002-09-08 05:08:15 -04:00
|
|
|
$stderr.reopen(@log)
|
|
|
|
$stdout.reopen(@log)
|
|
|
|
yield
|
|
|
|
ensure
|
|
|
|
$stderr.reopen(@orgerr)
|
|
|
|
$stdout.reopen(@orgout)
|
|
|
|
end
|
|
|
|
|
2002-09-15 08:57:21 -04:00
|
|
|
def self::message(*s)
|
2008-08-31 04:59:09 -04:00
|
|
|
log_open
|
2002-09-15 08:57:21 -04:00
|
|
|
@log.printf(*s)
|
|
|
|
end
|
|
|
|
|
2002-09-08 05:08:15 -04:00
|
|
|
def self::logfile file
|
|
|
|
@logfile = file
|
|
|
|
if @log and not @log.closed?
|
2002-10-27 04:04:55 -05:00
|
|
|
@log.flush
|
2002-09-08 05:08:15 -04:00
|
|
|
@log.close
|
|
|
|
@log = nil
|
|
|
|
end
|
1999-01-19 23:59:39 -05:00
|
|
|
end
|
2009-03-05 22:56:38 -05:00
|
|
|
|
2003-08-05 23:11:14 -04:00
|
|
|
def self::postpone
|
2005-02-06 09:51:44 -05:00
|
|
|
tmplog = "mkmftmp#{@postpone += 1}.log"
|
2003-08-05 23:11:14 -04:00
|
|
|
open do
|
|
|
|
log, *save = @log, @logfile, @orgout, @orgerr
|
|
|
|
@log, @logfile, @orgout, @orgerr = nil, tmplog, log, log
|
|
|
|
begin
|
|
|
|
log.print(open {yield})
|
2009-04-08 00:57:59 -04:00
|
|
|
ensure
|
2010-08-15 03:22:57 -04:00
|
|
|
@log.close if @log
|
2003-08-05 23:11:14 -04:00
|
|
|
File::open(tmplog) {|t| FileUtils.copy_stream(t, log)}
|
|
|
|
@log, @logfile, @orgout, @orgerr = log, *save
|
2005-02-06 09:51:44 -05:00
|
|
|
@postpone -= 1
|
2003-08-05 23:11:14 -04:00
|
|
|
rm_f tmplog
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2007-06-12 01:52:19 -04:00
|
|
|
|
|
|
|
class << self
|
|
|
|
attr_accessor :quiet
|
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
|
2002-09-06 07:23:14 -04:00
|
|
|
def xsystem command
|
2008-02-08 01:09:23 -05:00
|
|
|
varpat = /\$\((\w+)\)|\$\{(\w+)\}/
|
|
|
|
if varpat =~ command
|
|
|
|
vars = Hash.new {|h, k| h[k] = ''; ENV[k]}
|
|
|
|
command = command.dup
|
|
|
|
nil while command.gsub!(varpat) {vars[$1||$2]}
|
|
|
|
end
|
2002-09-08 05:08:15 -04:00
|
|
|
Logging::open do
|
2003-09-25 20:52:49 -04:00
|
|
|
puts command.quote
|
|
|
|
system(command)
|
2002-09-06 07:23:14 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def xpopen command, *mode, &block
|
2002-09-08 05:08:15 -04:00
|
|
|
Logging::open do
|
2002-09-06 07:23:14 -04:00
|
|
|
case mode[0]
|
|
|
|
when nil, /^r/
|
|
|
|
puts "#{command} |"
|
|
|
|
else
|
|
|
|
puts "| #{command}"
|
|
|
|
end
|
|
|
|
IO.popen(command, *mode, &block)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2002-09-23 07:01:49 -04:00
|
|
|
def log_src(src)
|
2006-07-09 05:05:47 -04:00
|
|
|
src = src.split(/^/)
|
|
|
|
fmt = "%#{src.size.to_s.size}d: %s"
|
|
|
|
Logging::message <<"EOM"
|
2002-09-15 08:57:21 -04:00
|
|
|
checked program was:
|
2002-09-23 07:01:49 -04:00
|
|
|
/* begin */
|
2006-07-09 05:05:47 -04:00
|
|
|
EOM
|
|
|
|
src.each_with_index {|line, no| Logging::message fmt, no+1, line}
|
|
|
|
Logging::message <<"EOM"
|
|
|
|
/* end */
|
2002-09-23 07:01:49 -04:00
|
|
|
|
2002-09-15 08:57:21 -04:00
|
|
|
EOM
|
2002-09-23 07:01:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def create_tmpsrc(src)
|
2008-10-22 12:24:58 -04:00
|
|
|
src = "#{COMMON_HEADERS}\n#{src}"
|
2003-08-26 07:03:53 -04:00
|
|
|
src = yield(src) if block_given?
|
2008-10-22 12:24:58 -04:00
|
|
|
src.gsub!(/[ \t]+$/, '')
|
|
|
|
src.gsub!(/\A\n+|^\n+$/, '')
|
|
|
|
src.sub!(/[^\n]\z/, "\\&\n")
|
2007-12-26 12:32:22 -05:00
|
|
|
count = 0
|
|
|
|
begin
|
|
|
|
open(CONFTEST_C, "wb") do |cfile|
|
|
|
|
cfile.print src
|
|
|
|
end
|
|
|
|
rescue Errno::EACCES
|
|
|
|
if (count += 1) < 5
|
|
|
|
sleep 0.2
|
|
|
|
retry
|
|
|
|
end
|
2000-12-21 22:22:25 -05:00
|
|
|
end
|
2003-08-26 07:03:53 -04:00
|
|
|
src
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
|
2008-08-31 05:22:06 -04:00
|
|
|
def have_devel?
|
|
|
|
unless defined? $have_devel
|
|
|
|
$have_devel = true
|
|
|
|
$have_devel = try_link(MAIN_DOES_NOTHING)
|
|
|
|
end
|
|
|
|
$have_devel
|
|
|
|
end
|
|
|
|
|
2003-08-26 07:03:53 -04:00
|
|
|
def try_do(src, command, &b)
|
2008-08-31 05:22:06 -04:00
|
|
|
unless have_devel?
|
|
|
|
raise <<MSG
|
2010-09-13 05:11:58 -04:00
|
|
|
The compiler failed to generate an executable file.
|
2008-08-31 05:22:06 -04:00
|
|
|
You have to install development tools first.
|
|
|
|
MSG
|
|
|
|
end
|
2010-01-28 21:09:51 -05:00
|
|
|
begin
|
|
|
|
src = create_tmpsrc(src, &b)
|
|
|
|
xsystem(command)
|
|
|
|
ensure
|
|
|
|
log_src(src)
|
|
|
|
rm_rf 'conftest.dSYM'
|
|
|
|
end
|
2002-09-23 07:01:49 -04:00
|
|
|
end
|
|
|
|
|
2007-02-28 04:26:07 -05:00
|
|
|
def link_command(ldflags, opt="", libpath=$DEFLIBPATH|$LIBPATH)
|
2007-07-12 21:10:48 -04:00
|
|
|
conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote,
|
2009-06-04 18:15:03 -04:00
|
|
|
'src' => "#{CONFTEST_C}",
|
2007-06-09 23:06:15 -04:00
|
|
|
'arch_hdrdir' => "#$arch_hdrdir",
|
|
|
|
'top_srcdir' => $top_srcdir.quote,
|
|
|
|
'INCFLAGS' => "#$INCFLAGS",
|
|
|
|
'CPPFLAGS' => "#$CPPFLAGS",
|
2007-04-23 09:08:29 -04:00
|
|
|
'CFLAGS' => "#$CFLAGS",
|
|
|
|
'ARCH_FLAG' => "#$ARCH_FLAG",
|
|
|
|
'LDFLAGS' => "#$LDFLAGS #{ldflags}",
|
|
|
|
'LIBPATH' => libpathflag(libpath),
|
|
|
|
'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
|
2007-07-12 21:10:48 -04:00
|
|
|
'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")
|
|
|
|
RbConfig::expand(TRY_LINK.dup, conf)
|
2002-09-23 07:01:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def cc_command(opt="")
|
2007-07-12 21:10:48 -04:00
|
|
|
conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
|
2007-06-09 23:06:15 -04:00
|
|
|
'arch_hdrdir' => "#$arch_hdrdir",
|
2007-07-12 21:10:48 -04:00
|
|
|
'top_srcdir' => $top_srcdir.quote)
|
|
|
|
RbConfig::expand("$(CC) #$INCFLAGS #$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} -c #{CONFTEST_C}",
|
|
|
|
conf)
|
2002-09-23 07:01:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def cpp_command(outfile, opt="")
|
2007-07-12 21:10:48 -04:00
|
|
|
conf = RbConfig::CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote,
|
2007-06-09 23:06:15 -04:00
|
|
|
'arch_hdrdir' => "#$arch_hdrdir",
|
2007-07-12 21:10:48 -04:00
|
|
|
'top_srcdir' => $top_srcdir.quote)
|
|
|
|
RbConfig::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}",
|
|
|
|
conf)
|
2002-09-23 07:01:49 -04:00
|
|
|
end
|
|
|
|
|
2007-02-28 04:26:07 -05:00
|
|
|
def libpathflag(libpath=$DEFLIBPATH|$LIBPATH)
|
2003-10-30 22:58:21 -05:00
|
|
|
libpath.map{|x|
|
2007-04-23 09:08:29 -04:00
|
|
|
case x
|
|
|
|
when "$(topdir)", /\A\./
|
|
|
|
LIBPATHFLAG
|
|
|
|
else
|
|
|
|
LIBPATHFLAG+RPATHFLAG
|
|
|
|
end % x.quote
|
2004-06-25 23:43:26 -04:00
|
|
|
}.join
|
1999-01-19 23:59:39 -05:00
|
|
|
end
|
|
|
|
|
2010-09-19 09:10:31 -04:00
|
|
|
# :nodoc:
|
2003-08-26 07:03:53 -04:00
|
|
|
def try_link0(src, opt="", &b)
|
2009-05-08 06:38:55 -04:00
|
|
|
cmd = link_command("", opt)
|
|
|
|
if $universal
|
|
|
|
require 'tmpdir'
|
|
|
|
Dir.mktmpdir("mkmf_", oldtmpdir = ENV["TMPDIR"]) do |tmpdir|
|
|
|
|
begin
|
|
|
|
ENV["TMPDIR"] = tmpdir
|
|
|
|
try_do(src, cmd, &b)
|
|
|
|
ensure
|
|
|
|
ENV["TMPDIR"] = oldtmpdir
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
try_do(src, cmd, &b)
|
|
|
|
end
|
2002-09-06 07:23:14 -04:00
|
|
|
end
|
|
|
|
|
2010-09-19 09:10:31 -04:00
|
|
|
# Returns whether or not the +src+ can be compiled as a C source and
|
|
|
|
# linked with its depending libraries successfully.
|
|
|
|
# +opt+ is passed to the linker as options. Note that +$CFLAGS+ and +$LDFLAGS+
|
|
|
|
# are also passed to the linker.
|
|
|
|
#
|
|
|
|
# If a block given, it is called with the source before compilation. You can
|
|
|
|
# modify the source in the block.
|
|
|
|
#
|
|
|
|
# [+src+] a String which contains a C source
|
|
|
|
# [+opt+] a String which contains linker options
|
2003-08-26 07:03:53 -04:00
|
|
|
def try_link(src, opt="", &b)
|
|
|
|
try_link0(src, opt, &b)
|
2002-09-23 07:01:49 -04:00
|
|
|
ensure
|
|
|
|
rm_f "conftest*", "c0x32*"
|
|
|
|
end
|
|
|
|
|
2010-09-19 09:10:31 -04:00
|
|
|
# Returns whether or not the +src+ can be compiled as a C source.
|
|
|
|
# +opt+ is passed to the C compiler as options. Note that +$CFLAGS+ is
|
|
|
|
# also passed to the compiler.
|
|
|
|
#
|
|
|
|
# If a block given, it is called with the source before compilation. You can
|
|
|
|
# modify the source in the block.
|
|
|
|
#
|
|
|
|
# [+src+] a String which contains a C source
|
|
|
|
# [+opt+] a String which contains compiler options
|
2003-08-26 07:03:53 -04:00
|
|
|
def try_compile(src, opt="", &b)
|
|
|
|
try_do(src, cc_command(opt), &b)
|
2002-09-23 07:01:49 -04:00
|
|
|
ensure
|
|
|
|
rm_f "conftest*"
|
|
|
|
end
|
|
|
|
|
2010-09-19 09:10:31 -04:00
|
|
|
# Returns whether or not the +src+ can be preprocessed with the C preprocessor.
|
|
|
|
# +opt+ is passed to the preprocessor as options. Note that +$CFLAGS+ is
|
|
|
|
# also passed to the preprocessor.
|
|
|
|
#
|
|
|
|
# If a block given, it is called with the source before preprocessing. You can
|
|
|
|
# modify the source in the block.
|
|
|
|
#
|
|
|
|
# [+src+] a String which contains a C source
|
|
|
|
# [+opt+] a String which contains preprocessor options
|
2003-08-26 07:03:53 -04:00
|
|
|
def try_cpp(src, opt="", &b)
|
|
|
|
try_do(src, cpp_command(CPPOUTFILE, opt), &b)
|
2002-09-23 07:01:49 -04:00
|
|
|
ensure
|
|
|
|
rm_f "conftest*"
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
2009-01-26 21:09:47 -05:00
|
|
|
class Object
|
|
|
|
alias_method :try_header, (config_string('try_header') || :try_cpp)
|
|
|
|
end
|
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def cpp_include(header)
|
|
|
|
if header
|
|
|
|
header = [header] unless header.kind_of? Array
|
2009-03-19 05:49:51 -04:00
|
|
|
header.map {|h| String === h ? "#include <#{h}>\n" : h}.join
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
else
|
|
|
|
""
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2005-02-06 09:51:44 -05:00
|
|
|
def with_cppflags(flags)
|
|
|
|
cppflags = $CPPFLAGS
|
|
|
|
$CPPFLAGS = flags
|
2005-02-06 11:23:03 -05:00
|
|
|
ret = yield
|
2005-02-06 09:51:44 -05:00
|
|
|
ensure
|
2005-02-06 11:23:03 -05:00
|
|
|
$CPPFLAGS = cppflags unless ret
|
2005-02-06 09:51:44 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def with_cflags(flags)
|
|
|
|
cflags = $CFLAGS
|
|
|
|
$CFLAGS = flags
|
2005-02-06 11:23:03 -05:00
|
|
|
ret = yield
|
2005-02-06 09:51:44 -05:00
|
|
|
ensure
|
2005-02-06 11:23:03 -05:00
|
|
|
$CFLAGS = cflags unless ret
|
2005-02-06 09:51:44 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def with_ldflags(flags)
|
|
|
|
ldflags = $LDFLAGS
|
|
|
|
$LDFLAGS = flags
|
2005-02-06 11:23:03 -05:00
|
|
|
ret = yield
|
2005-02-06 09:51:44 -05:00
|
|
|
ensure
|
2005-02-06 11:23:03 -05:00
|
|
|
$LDFLAGS = ldflags unless ret
|
2005-02-06 09:51:44 -05:00
|
|
|
end
|
|
|
|
|
2003-08-26 07:03:53 -04:00
|
|
|
def try_static_assert(expr, headers = nil, opt = "", &b)
|
2003-07-24 03:41:36 -04:00
|
|
|
headers = cpp_include(headers)
|
2003-08-26 07:03:53 -04:00
|
|
|
try_compile(<<SRC, opt, &b)
|
2003-07-24 03:41:36 -04:00
|
|
|
#{headers}
|
2003-08-26 07:03:53 -04:00
|
|
|
/*top*/
|
2005-02-06 09:51:44 -05:00
|
|
|
int conftest_const[(#{expr}) ? 1 : -1];
|
2003-07-24 03:41:36 -04:00
|
|
|
SRC
|
|
|
|
end
|
|
|
|
|
2003-08-26 07:03:53 -04:00
|
|
|
def try_constant(const, headers = nil, opt = "", &b)
|
2005-02-06 09:51:44 -05:00
|
|
|
includes = cpp_include(headers)
|
2003-07-30 02:39:06 -04:00
|
|
|
if CROSS_COMPILING
|
2005-02-06 09:51:44 -05:00
|
|
|
if try_static_assert("#{const} > 0", headers, opt)
|
|
|
|
# positive constant
|
|
|
|
elsif try_static_assert("#{const} < 0", headers, opt)
|
2003-07-24 03:41:36 -04:00
|
|
|
neg = true
|
|
|
|
const = "-(#{const})"
|
|
|
|
elsif try_static_assert("#{const} == 0", headers, opt)
|
|
|
|
return 0
|
2005-02-06 09:51:44 -05:00
|
|
|
else
|
|
|
|
# not a constant
|
|
|
|
return nil
|
2003-07-24 03:41:36 -04:00
|
|
|
end
|
|
|
|
upper = 1
|
2006-07-09 05:05:47 -04:00
|
|
|
lower = 0
|
2005-02-06 09:51:44 -05:00
|
|
|
until try_static_assert("#{const} <= #{upper}", headers, opt)
|
2003-07-24 03:41:36 -04:00
|
|
|
lower = upper
|
|
|
|
upper <<= 1
|
|
|
|
end
|
|
|
|
return nil unless lower
|
2005-02-06 09:51:44 -05:00
|
|
|
while upper > lower + 1
|
|
|
|
mid = (upper + lower) / 2
|
|
|
|
if try_static_assert("#{const} > #{mid}", headers, opt)
|
|
|
|
lower = mid
|
2003-07-24 03:41:36 -04:00
|
|
|
else
|
2005-02-06 09:51:44 -05:00
|
|
|
upper = mid
|
|
|
|
end
|
|
|
|
end
|
2003-07-24 03:41:36 -04:00
|
|
|
upper = -upper if neg
|
|
|
|
return upper
|
|
|
|
else
|
2008-08-31 05:22:06 -04:00
|
|
|
src = %{#{includes}
|
2003-07-24 03:41:36 -04:00
|
|
|
#include <stdio.h>
|
2003-08-26 07:03:53 -04:00
|
|
|
/*top*/
|
2005-02-06 09:51:44 -05:00
|
|
|
int conftest_const = (int)(#{const});
|
|
|
|
int main() {printf("%d\\n", conftest_const); return 0;}
|
2003-07-24 03:41:36 -04:00
|
|
|
}
|
2003-08-26 07:03:53 -04:00
|
|
|
if try_link0(src, opt, &b)
|
2003-07-24 03:41:36 -04:00
|
|
|
xpopen("./conftest") do |f|
|
|
|
|
return Integer(f.gets)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
2010-09-19 09:10:31 -04:00
|
|
|
# You should use +have_func+ rather than +try_func+.
|
|
|
|
#
|
|
|
|
# [+func+] a String which contains a symbol name
|
|
|
|
# [+libs+] a String which contains library names.
|
|
|
|
# [+headers+] a String or an Array of strings which contains
|
|
|
|
# names of header files.
|
2003-08-26 07:03:53 -04:00
|
|
|
def try_func(func, libs, headers = nil, &b)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
headers = cpp_include(headers)
|
2009-01-23 00:34:49 -05:00
|
|
|
try_link(<<"SRC", libs, &b) or
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
#{headers}
|
2003-08-26 07:03:53 -04:00
|
|
|
/*top*/
|
2008-08-31 04:52:56 -04:00
|
|
|
#{MAIN_DOES_NOTHING}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
int t() { void ((*volatile p)()); p = (void ((*)()))#{func}; return 0; }
|
|
|
|
SRC
|
2009-01-23 00:34:49 -05:00
|
|
|
try_link(<<"SRC", libs, &b)
|
2006-09-28 22:44:37 -04:00
|
|
|
#{headers}
|
|
|
|
/*top*/
|
2008-08-31 04:52:56 -04:00
|
|
|
#{MAIN_DOES_NOTHING}
|
2006-09-28 22:44:37 -04:00
|
|
|
int t() { #{func}(); return 0; }
|
|
|
|
SRC
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
|
|
|
|
2010-09-19 09:10:31 -04:00
|
|
|
# You should use +have_var+ rather than +try_var+.
|
2005-02-06 09:51:44 -05:00
|
|
|
def try_var(var, headers = nil, &b)
|
|
|
|
headers = cpp_include(headers)
|
|
|
|
try_compile(<<"SRC", &b)
|
|
|
|
#{headers}
|
|
|
|
/*top*/
|
2008-08-31 04:52:56 -04:00
|
|
|
#{MAIN_DOES_NOTHING}
|
2007-12-13 21:54:08 -05:00
|
|
|
int t() { const volatile void *volatile p; p = &(&#{var})[0]; return 0; }
|
2005-02-06 09:51:44 -05:00
|
|
|
SRC
|
|
|
|
end
|
|
|
|
|
2010-09-19 09:10:31 -04:00
|
|
|
# Returns whether or not the +src+ can be preprocessed with the C preprocessor and
|
|
|
|
# matches with +pat+.
|
|
|
|
#
|
|
|
|
# If a block given, it is called with the source before compilation. You can
|
|
|
|
# modify the source in the block.
|
|
|
|
#
|
|
|
|
# [+pat+] a Regexp or a String
|
|
|
|
# [+src+] a String which contains a C source
|
|
|
|
# [+opt+] a String which contains preprocessor options
|
|
|
|
#
|
|
|
|
# Note:
|
|
|
|
# When pat is a Regexp the matching will be checked in process,
|
|
|
|
# otherwise egrep(1) will be invoked to check it.
|
2003-08-26 07:03:53 -04:00
|
|
|
def egrep_cpp(pat, src, opt = "", &b)
|
|
|
|
src = create_tmpsrc(src, &b)
|
2002-09-23 07:01:49 -04:00
|
|
|
xpopen(cpp_command('', opt)) do |f|
|
|
|
|
if Regexp === pat
|
2003-01-19 14:14:22 -05:00
|
|
|
puts(" ruby -ne 'print if #{pat.inspect}'")
|
2002-09-23 07:01:49 -04:00
|
|
|
f.grep(pat) {|l|
|
|
|
|
puts "#{f.lineno}: #{l}"
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
false
|
|
|
|
else
|
|
|
|
puts(" egrep '#{pat}'")
|
|
|
|
begin
|
|
|
|
stdin = $stdin.dup
|
|
|
|
$stdin.reopen(f)
|
|
|
|
system("egrep", pat)
|
|
|
|
ensure
|
|
|
|
$stdin.reopen(stdin)
|
2002-09-06 07:23:14 -04:00
|
|
|
end
|
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
2002-09-23 07:01:49 -04:00
|
|
|
ensure
|
|
|
|
rm_f "conftest*"
|
|
|
|
log_src(src)
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# This is used internally by the have_macro? method.
|
2003-08-26 07:03:53 -04:00
|
|
|
def macro_defined?(macro, src, opt = "", &b)
|
2003-08-05 23:11:14 -04:00
|
|
|
src = src.sub(/[^\n]\z/, "\\&\n")
|
2005-03-24 09:11:27 -05:00
|
|
|
try_compile(src + <<"SRC", opt, &b)
|
2003-08-26 07:03:53 -04:00
|
|
|
/*top*/
|
2002-09-08 06:00:43 -04:00
|
|
|
#ifndef #{macro}
|
|
|
|
# error
|
2005-03-24 09:11:27 -05:00
|
|
|
>>>>>> #{macro} undefined <<<<<<
|
2002-09-08 06:00:43 -04:00
|
|
|
#endif
|
2002-09-15 08:57:21 -04:00
|
|
|
SRC
|
2002-09-08 06:00:43 -04:00
|
|
|
end
|
|
|
|
|
2010-09-19 09:10:31 -04:00
|
|
|
# Returns whether or not
|
|
|
|
# * the +src+ can be compiled as a C source,
|
|
|
|
# * the result object can be linked with its depending libraries successfully,
|
|
|
|
# * the linked file can be invoked as an executable
|
|
|
|
# * and the executable exits successfully
|
|
|
|
# +opt+ is passed to the linker as options. Note that +$CFLAGS+ and +$LDFLAGS+
|
|
|
|
# are also passed to the linker.
|
|
|
|
#
|
|
|
|
# If a block given, it is called with the source before compilation. You can
|
|
|
|
# modify the source in the block.
|
|
|
|
#
|
|
|
|
# [+src+] a String which contains a C source
|
|
|
|
# [+opt+] a String which contains linker options
|
|
|
|
#
|
|
|
|
# @return true when the executable exits successfully, false when it fails, or
|
|
|
|
# nil when preprocessing, compilation or link fails.
|
2003-08-26 07:03:53 -04:00
|
|
|
def try_run(src, opt = "", &b)
|
|
|
|
if try_link0(src, opt, &b)
|
2002-09-23 07:01:49 -04:00
|
|
|
xsystem("./conftest")
|
|
|
|
else
|
|
|
|
nil
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
2002-09-23 07:01:49 -04:00
|
|
|
ensure
|
|
|
|
rm_f "conftest*"
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def install_files(mfile, ifiles, map = nil, srcprefix = nil)
|
2002-04-01 10:01:56 -05:00
|
|
|
ifiles or return
|
2008-02-04 21:14:17 -05:00
|
|
|
ifiles.empty? and return
|
2010-02-21 07:20:21 -05:00
|
|
|
srcprefix ||= "$(srcdir)/#{srcprefix}".chomp('/')
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
RbConfig::expand(srcdir = srcprefix.dup)
|
2002-04-01 10:01:56 -05:00
|
|
|
dirs = []
|
|
|
|
path = Hash.new {|h, i| h[i] = dirs.push([i])[-1]}
|
|
|
|
ifiles.each do |files, dir, prefix|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
dir = map_dir(dir, map)
|
2008-02-04 21:14:17 -05:00
|
|
|
prefix &&= %r|\A#{Regexp.quote(prefix)}/?|
|
2004-02-09 03:48:55 -05:00
|
|
|
if /\A\.\// =~ files
|
2002-04-01 10:01:56 -05:00
|
|
|
# install files which are in current working directory.
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
files = files[2..-1]
|
|
|
|
len = nil
|
2001-07-24 06:29:17 -04:00
|
|
|
else
|
2002-04-01 10:01:56 -05:00
|
|
|
# install files which are under the $(srcdir).
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
files = File.join(srcdir, files)
|
|
|
|
len = srcdir.size
|
2001-07-24 06:29:17 -04:00
|
|
|
end
|
2003-07-18 04:34:45 -04:00
|
|
|
f = nil
|
2006-10-09 10:41:24 -04:00
|
|
|
Dir.glob(files) do |fx|
|
|
|
|
f = fx
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
f[0..len] = "" if len
|
2008-02-04 21:14:17 -05:00
|
|
|
case File.basename(f)
|
|
|
|
when *$NONINSTALLFILES
|
|
|
|
next
|
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
d = File.dirname(f)
|
|
|
|
d.sub!(prefix, "") if prefix
|
|
|
|
d = (d.empty? || d == ".") ? dir : File.join(dir, d)
|
|
|
|
f = File.join(srcprefix, f) if len
|
|
|
|
path[d] << f
|
2002-04-01 10:01:56 -05:00
|
|
|
end
|
2003-07-18 04:34:45 -04:00
|
|
|
unless len or f
|
|
|
|
d = File.dirname(files)
|
|
|
|
d.sub!(prefix, "") if prefix
|
|
|
|
d = (d.empty? || d == ".") ? dir : File.join(dir, d)
|
|
|
|
path[d] << files
|
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
dirs
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
2002-04-01 10:01:56 -05:00
|
|
|
def install_rb(mfile, dest, srcdir = nil)
|
2002-06-24 03:34:30 -04:00
|
|
|
install_files(mfile, [["lib/**/*.rb", dest, "lib"]], nil, srcdir)
|
2002-04-01 10:01:56 -05:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
def append_library(libs, lib) # :no-doc:
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
format(LIBARG, lib) + " " + libs
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
|
2002-09-03 04:40:47 -04:00
|
|
|
def message(*s)
|
2007-06-12 01:52:19 -04:00
|
|
|
unless Logging.quiet and not $VERBOSE
|
2002-09-15 08:57:21 -04:00
|
|
|
printf(*s)
|
|
|
|
$stdout.flush
|
2002-09-04 12:52:53 -04:00
|
|
|
end
|
2002-09-03 04:40:47 -04:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# This emits a string to stdout that allows users to see the results of the
|
|
|
|
# various have* and find* methods as they are tested.
|
|
|
|
#
|
|
|
|
# Internal use only.
|
|
|
|
#
|
2005-02-06 09:51:44 -05:00
|
|
|
def checking_for(m, fmt = nil)
|
2010-05-27 21:40:39 -04:00
|
|
|
f = caller[0][/in `([^<].*)'$/, 1] and f << ": " #` for vim #'
|
2006-09-03 02:34:13 -04:00
|
|
|
m = "checking #{/\Acheck/ =~ f ? '' : 'for '}#{m}... "
|
2003-07-23 01:19:22 -04:00
|
|
|
message "%s", m
|
2003-08-05 23:11:14 -04:00
|
|
|
a = r = nil
|
|
|
|
Logging::postpone do
|
|
|
|
r = yield
|
2005-02-06 09:51:44 -05:00
|
|
|
a = (fmt ? fmt % r : r ? "yes" : "no") << "\n"
|
2003-08-05 23:11:14 -04:00
|
|
|
"#{f}#{m}-------------------- #{a}\n"
|
|
|
|
end
|
|
|
|
message(a)
|
|
|
|
Logging::message "--------------------\n\n"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
r
|
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2006-09-16 03:22:49 -04:00
|
|
|
def checking_message(target, place = nil, opt = nil)
|
|
|
|
[["in", place], ["with", opt]].inject("#{target}") do |msg, (pre, noun)|
|
|
|
|
if noun
|
|
|
|
[[:to_str], [:join, ","], [:to_s]].each do |meth, *args|
|
|
|
|
if noun.respond_to?(meth)
|
|
|
|
break noun = noun.send(meth, *args)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
msg << " #{pre} #{noun}" unless noun.empty?
|
|
|
|
end
|
|
|
|
msg
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# :startdoc:
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Returns whether or not +macro+ is defined either in the common header
|
|
|
|
# files or within any +headers+ you provide.
|
|
|
|
#
|
|
|
|
# Any options you pass to +opt+ are passed along to the compiler.
|
|
|
|
#
|
2005-02-06 09:51:44 -05:00
|
|
|
def have_macro(macro, headers = nil, opt = "", &b)
|
2006-09-16 03:22:49 -04:00
|
|
|
checking_for checking_message(macro, headers, opt) do
|
2005-02-06 09:51:44 -05:00
|
|
|
macro_defined?(macro, cpp_include(headers), opt, &b)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Returns whether or not the given entry point +func+ can be found within
|
|
|
|
# +lib+. If +func+ is nil, the 'main()' entry point is used by default.
|
|
|
|
# If found, it adds the library to list of libraries to be used when linking
|
|
|
|
# your extension.
|
|
|
|
#
|
|
|
|
# If +headers+ are provided, it will include those header files as the
|
|
|
|
# header files it looks in when searching for +func+.
|
|
|
|
#
|
2008-03-07 05:56:13 -05:00
|
|
|
# The real name of the library to be linked can be altered by
|
2006-08-17 01:47:50 -04:00
|
|
|
# '--with-FOOlib' configuration option.
|
|
|
|
#
|
2006-07-09 05:05:47 -04:00
|
|
|
def have_library(lib, func = nil, headers = nil, &b)
|
2003-08-06 04:28:52 -04:00
|
|
|
func = "main" if !func or func.empty?
|
2003-09-05 11:00:33 -04:00
|
|
|
lib = with_config(lib+'lib', lib)
|
2006-09-16 03:22:49 -04:00
|
|
|
checking_for checking_message("#{func}()", LIBARG%lib) do
|
2003-08-05 23:11:14 -04:00
|
|
|
if COMMON_LIBS.include?(lib)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
true
|
1998-01-16 07:19:09 -05:00
|
|
|
else
|
2003-08-05 23:11:14 -04:00
|
|
|
libs = append_library($libs, lib)
|
2006-07-09 05:05:47 -04:00
|
|
|
if try_func(func, libs, headers, &b)
|
2003-08-05 23:11:14 -04:00
|
|
|
$libs = libs
|
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Returns whether or not the entry point +func+ can be found within the library
|
|
|
|
# +lib+ in one of the +paths+ specified, where +paths+ is an array of strings.
|
|
|
|
# If +func+ is nil , then the main() function is used as the entry point.
|
|
|
|
#
|
|
|
|
# If +lib+ is found, then the path it was found on is added to the list of
|
|
|
|
# library paths searched and linked against.
|
|
|
|
#
|
2003-08-26 07:03:53 -04:00
|
|
|
def find_library(lib, func, *paths, &b)
|
2003-09-05 11:00:33 -04:00
|
|
|
func = "main" if !func or func.empty?
|
|
|
|
lib = with_config(lib+'lib', lib)
|
2005-02-06 09:51:44 -05:00
|
|
|
paths = paths.collect {|path| path.split(File::PATH_SEPARATOR)}.flatten
|
2003-09-05 11:00:33 -04:00
|
|
|
checking_for "#{func}() in #{LIBARG%lib}" do
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
libpath = $LIBPATH
|
|
|
|
libs = append_library($libs, lib)
|
|
|
|
begin
|
2003-08-26 07:03:53 -04:00
|
|
|
until r = try_func(func, libs, &b) or paths.empty?
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$LIBPATH = libpath | [paths.shift]
|
|
|
|
end
|
|
|
|
if r
|
|
|
|
$libs = libs
|
|
|
|
libpath = nil
|
|
|
|
end
|
|
|
|
ensure
|
|
|
|
$LIBPATH = libpath if libpath
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
r
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Returns whether or not the function +func+ can be found in the common
|
|
|
|
# header files, or within any +headers+ that you provide. If found, a
|
|
|
|
# macro is passed as a preprocessor constant to the compiler using the
|
|
|
|
# function name, in uppercase, prepended with 'HAVE_'.
|
|
|
|
#
|
|
|
|
# For example, if have_func('foo') returned true, then the HAVE_FOO
|
|
|
|
# preprocessor macro would be passed to the compiler.
|
|
|
|
#
|
2003-08-26 07:03:53 -04:00
|
|
|
def have_func(func, headers = nil, &b)
|
2006-09-16 03:22:49 -04:00
|
|
|
checking_for checking_message("#{func}()", headers) do
|
2003-08-26 07:03:53 -04:00
|
|
|
if try_func(func, $libs, headers, &b)
|
2007-11-17 19:09:50 -05:00
|
|
|
$defs.push(format("-DHAVE_%s", func.tr_cpp))
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
true
|
2000-06-22 04:29:58 -04:00
|
|
|
else
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
false
|
2000-06-22 04:29:58 -04:00
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Returns whether or not the variable +var+ can be found in the common
|
|
|
|
# header files, or within any +headers+ that you provide. If found, a
|
|
|
|
# macro is passed as a preprocessor constant to the compiler using the
|
|
|
|
# variable name, in uppercase, prepended with 'HAVE_'.
|
|
|
|
#
|
|
|
|
# For example, if have_var('foo') returned true, then the HAVE_FOO
|
|
|
|
# preprocessor macro would be passed to the compiler.
|
|
|
|
#
|
2005-02-06 09:51:44 -05:00
|
|
|
def have_var(var, headers = nil, &b)
|
2006-09-16 03:22:49 -04:00
|
|
|
checking_for checking_message(var, headers) do
|
2005-02-06 09:51:44 -05:00
|
|
|
if try_var(var, headers, &b)
|
2007-11-17 19:09:50 -05:00
|
|
|
$defs.push(format("-DHAVE_%s", var.tr_cpp))
|
2005-02-06 09:51:44 -05:00
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Returns whether or not the given +header+ file can be found on your system.
|
|
|
|
# If found, a macro is passed as a preprocessor constant to the compiler using
|
|
|
|
# the header file name, in uppercase, prepended with 'HAVE_'.
|
|
|
|
#
|
|
|
|
# For example, if have_header('foo.h') returned true, then the HAVE_FOO_H
|
|
|
|
# preprocessor macro would be passed to the compiler.
|
|
|
|
#
|
2009-02-06 21:44:07 -05:00
|
|
|
def have_header(header, preheaders = nil, &b)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
checking_for header do
|
2009-02-06 21:44:07 -05:00
|
|
|
if try_header(cpp_include(preheaders)+cpp_include(header), &b)
|
2010-01-17 00:18:03 -05:00
|
|
|
$defs.push(format("-DHAVE_%s", header.tr_cpp))
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
2010-07-27 05:59:29 -04:00
|
|
|
# Returns whether or not the given +framework+ can be found on your system.
|
|
|
|
# If found, a macro is passed as a preprocessor constant to the compiler using
|
|
|
|
# the framework name, in uppercase, prepended with 'HAVE_FRAMEWORK_'.
|
|
|
|
#
|
|
|
|
# For example, if have_framework('Ruby') returned true, then the HAVE_FRAMEWORK_RUBY
|
|
|
|
# preprocessor macro would be passed to the compiler.
|
|
|
|
#
|
|
|
|
def have_framework(fw, &b)
|
|
|
|
checking_for fw do
|
|
|
|
src = cpp_include("#{fw}/#{fw}.h") << "\n" "int main(void){return 0;}"
|
|
|
|
if try_link(src, opt = "-framework #{fw}", &b)
|
|
|
|
$defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp))
|
|
|
|
$LDFLAGS << " " << opt
|
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Instructs mkmf to search for the given +header+ in any of the +paths+
|
|
|
|
# provided, and returns whether or not it was found in those paths.
|
|
|
|
#
|
|
|
|
# If the header is found then the path it was found on is added to the list
|
|
|
|
# of included directories that are sent to the compiler (via the -I switch).
|
|
|
|
#
|
2004-02-13 11:03:15 -05:00
|
|
|
def find_header(header, *paths)
|
2007-06-12 01:43:06 -04:00
|
|
|
message = checking_message(header, paths)
|
2006-07-09 05:05:47 -04:00
|
|
|
header = cpp_include(header)
|
2007-06-12 01:43:06 -04:00
|
|
|
checking_for message do
|
2009-01-26 21:09:47 -05:00
|
|
|
if try_header(header)
|
2004-02-13 11:03:15 -05:00
|
|
|
true
|
|
|
|
else
|
|
|
|
found = false
|
|
|
|
paths.each do |dir|
|
2004-06-25 22:07:30 -04:00
|
|
|
opt = "-I#{dir}".quote
|
2009-01-26 21:09:47 -05:00
|
|
|
if try_header(header, opt)
|
2004-06-25 22:07:30 -04:00
|
|
|
$INCFLAGS << " " << opt
|
2004-02-13 11:03:15 -05:00
|
|
|
found = true
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
found
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Returns whether or not the struct of type +type+ contains +member+. If
|
|
|
|
# it does not, or the struct type can't be found, then false is returned. You
|
|
|
|
# may optionally specify additional +headers+ in which to look for the struct
|
|
|
|
# (in addition to the common header files).
|
|
|
|
#
|
|
|
|
# If found, a macro is passed as a preprocessor constant to the compiler using
|
2007-11-17 15:20:44 -05:00
|
|
|
# the type name and the member name, in uppercase, prepended with 'HAVE_'.
|
2006-08-17 01:47:50 -04:00
|
|
|
#
|
2007-11-17 15:20:44 -05:00
|
|
|
# For example, if have_struct_member('struct foo', 'bar') returned true, then the
|
|
|
|
# HAVE_STRUCT_FOO_BAR preprocessor macro would be passed to the compiler.
|
|
|
|
#
|
|
|
|
# HAVE_ST_BAR is also defined for backward compatibility.
|
2009-03-05 22:56:38 -05:00
|
|
|
#
|
2006-08-17 01:47:50 -04:00
|
|
|
def have_struct_member(type, member, headers = nil, &b)
|
2006-09-16 03:22:49 -04:00
|
|
|
checking_for checking_message("#{type}.#{member}", headers) do
|
2003-08-26 07:03:53 -04:00
|
|
|
if try_compile(<<"SRC", &b)
|
2006-08-17 01:47:50 -04:00
|
|
|
#{cpp_include(headers)}
|
2003-08-26 07:03:53 -04:00
|
|
|
/*top*/
|
2008-08-31 04:52:56 -04:00
|
|
|
#{MAIN_DOES_NOTHING}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
int s = (char *)&((#{type}*)0)->#{member} - (char *)0;
|
2002-09-08 06:00:43 -04:00
|
|
|
SRC
|
2007-11-17 19:09:50 -05:00
|
|
|
$defs.push(format("-DHAVE_%s_%s", type.tr_cpp, member.tr_cpp))
|
|
|
|
$defs.push(format("-DHAVE_ST_%s", member.tr_cpp)) # backward compatibility
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
true
|
2002-09-08 06:00:43 -04:00
|
|
|
else
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
false
|
2002-09-08 06:00:43 -04:00
|
|
|
end
|
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
|
|
|
|
2007-08-02 18:09:08 -04:00
|
|
|
def try_type(type, headers = nil, opt = "", &b)
|
|
|
|
if try_compile(<<"SRC", opt, &b)
|
|
|
|
#{cpp_include(headers)}
|
|
|
|
/*top*/
|
|
|
|
typedef #{type} conftest_type;
|
|
|
|
int conftestval[sizeof(conftest_type)?1:-1];
|
|
|
|
SRC
|
2007-11-17 19:09:50 -05:00
|
|
|
$defs.push(format("-DHAVE_TYPE_%s", type.tr_cpp))
|
2007-08-02 18:09:08 -04:00
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Returns whether or not the static type +type+ is defined. You may
|
|
|
|
# optionally pass additional +headers+ to check against in addition to the
|
|
|
|
# common header files.
|
|
|
|
#
|
|
|
|
# You may also pass additional flags to +opt+ which are then passed along to
|
|
|
|
# the compiler.
|
|
|
|
#
|
|
|
|
# If found, a macro is passed as a preprocessor constant to the compiler using
|
|
|
|
# the type name, in uppercase, prepended with 'HAVE_TYPE_'.
|
|
|
|
#
|
|
|
|
# For example, if have_type('foo') returned true, then the HAVE_TYPE_FOO
|
|
|
|
# preprocessor macro would be passed to the compiler.
|
|
|
|
#
|
2006-07-09 05:05:47 -04:00
|
|
|
def have_type(type, headers = nil, opt = "", &b)
|
2006-09-16 03:22:49 -04:00
|
|
|
checking_for checking_message(type, headers, opt) do
|
2007-08-02 18:09:08 -04:00
|
|
|
try_type(type, headers, opt, &b)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Returns where the static type +type+ is defined.
|
|
|
|
#
|
|
|
|
# You may also pass additional flags to +opt+ which are then passed along to
|
|
|
|
# the compiler.
|
|
|
|
#
|
|
|
|
# See also +have_type+.
|
|
|
|
#
|
|
|
|
def find_type(type, opt, *headers, &b)
|
|
|
|
opt ||= ""
|
|
|
|
fmt = "not found"
|
|
|
|
def fmt.%(x)
|
|
|
|
x ? x.respond_to?(:join) ? x.join(",") : x : self
|
|
|
|
end
|
|
|
|
checking_for checking_message(type, nil, opt), fmt do
|
|
|
|
headers.find do |h|
|
|
|
|
try_type(type, h, opt, &b)
|
2003-07-24 03:41:36 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2007-08-30 00:13:16 -04:00
|
|
|
def try_const(const, headers = nil, opt = "", &b)
|
|
|
|
const, type = *const
|
|
|
|
if try_compile(<<"SRC", opt, &b)
|
|
|
|
#{cpp_include(headers)}
|
|
|
|
/*top*/
|
|
|
|
typedef #{type || 'int'} conftest_type;
|
|
|
|
conftest_type conftestval = #{type ? '' : '(int)'}#{const};
|
|
|
|
SRC
|
2007-11-17 19:09:50 -05:00
|
|
|
$defs.push(format("-DHAVE_CONST_%s", const.tr_cpp))
|
2007-08-30 00:13:16 -04:00
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Returns whether or not the constant +const+ is defined. You may
|
|
|
|
# optionally pass the +type+ of +const+ as <code>[const, type]</code>,
|
|
|
|
# like as:
|
|
|
|
#
|
|
|
|
# have_const(%w[PTHREAD_MUTEX_INITIALIZER pthread_mutex_t], "pthread.h")
|
|
|
|
#
|
|
|
|
# You may also pass additional +headers+ to check against in addition
|
|
|
|
# to the common header files, and additional flags to +opt+ which are
|
|
|
|
# then passed along to the compiler.
|
|
|
|
#
|
|
|
|
# If found, a macro is passed as a preprocessor constant to the compiler using
|
|
|
|
# the type name, in uppercase, prepended with 'HAVE_CONST_'.
|
|
|
|
#
|
|
|
|
# For example, if have_const('foo') returned true, then the HAVE_CONST_FOO
|
|
|
|
# preprocessor macro would be passed to the compiler.
|
|
|
|
#
|
|
|
|
def have_const(const, headers = nil, opt = "", &b)
|
|
|
|
checking_for checking_message([*const].compact.join(' '), headers, opt) do
|
|
|
|
try_const(const, headers, opt, &b)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-01-17 00:23:25 -05:00
|
|
|
STRING_OR_FAILED_FORMAT = "%s"
|
2010-05-28 20:43:09 -04:00
|
|
|
# :stopdoc:
|
2010-01-17 00:23:25 -05:00
|
|
|
def STRING_OR_FAILED_FORMAT.%(x)
|
|
|
|
x ? super : "failed"
|
|
|
|
end
|
2010-05-28 20:43:09 -04:00
|
|
|
# :startdoc:
|
2010-01-17 00:23:25 -05:00
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Returns the size of the given +type+. You may optionally specify additional
|
|
|
|
# +headers+ to search in for the +type+.
|
|
|
|
#
|
|
|
|
# If found, a macro is passed as a preprocessor constant to the compiler using
|
|
|
|
# the type name, in uppercase, prepended with 'SIZEOF_', followed by the type
|
|
|
|
# name, followed by '=X' where 'X' is the actual size.
|
|
|
|
#
|
|
|
|
# For example, if check_sizeof('mystruct') returned 12, then the
|
|
|
|
# SIZEOF_MYSTRUCT=12 preprocessor macro would be passed to the compiler.
|
|
|
|
#
|
2009-08-06 00:00:38 -04:00
|
|
|
def check_sizeof(type, headers = nil, opts = "", &b)
|
2009-03-19 05:49:51 -04:00
|
|
|
typename, member = type.split('.', 2)
|
|
|
|
prelude = cpp_include(headers).split(/$/)
|
|
|
|
prelude << "typedef #{typename} rbcv_typedef_;\n"
|
|
|
|
prelude << "static rbcv_typedef_ *rbcv_ptr_;\n"
|
|
|
|
prelude = [prelude]
|
2009-03-26 23:56:46 -04:00
|
|
|
expr = "sizeof((*rbcv_ptr_)#{"." << member if member})"
|
2010-01-17 00:23:25 -05:00
|
|
|
fmt = STRING_OR_FAILED_FORMAT
|
2006-09-16 03:22:49 -04:00
|
|
|
checking_for checking_message("size of #{type}", headers), fmt do
|
2009-05-08 06:17:04 -04:00
|
|
|
if UNIVERSAL_INTS.include?(type)
|
|
|
|
type
|
|
|
|
elsif size = UNIVERSAL_INTS.find {|t|
|
|
|
|
try_static_assert("#{expr} == sizeof(#{t})", prelude, opts, &b)
|
|
|
|
}
|
|
|
|
$defs.push(format("-DSIZEOF_%s=SIZEOF_%s", type.tr_cpp, size.tr_cpp))
|
|
|
|
size
|
|
|
|
elsif size = try_constant(expr, prelude, opts, &b)
|
2009-03-19 05:49:51 -04:00
|
|
|
$defs.push(format("-DSIZEOF_%s=%s", type.tr_cpp, size))
|
2006-07-09 05:05:47 -04:00
|
|
|
size
|
2005-03-24 09:11:27 -05:00
|
|
|
end
|
2003-07-24 03:41:36 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-01-17 00:23:25 -05:00
|
|
|
# Returns the signedness of the given +type+. You may optionally
|
|
|
|
# specify additional +headers+ to search in for the +type+.
|
|
|
|
#
|
|
|
|
# If the +type+ is found and is a numeric type, a macro is passed as a
|
|
|
|
# preprocessor constant to the compiler using the +type+ name, in
|
|
|
|
# uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+
|
|
|
|
# name, followed by '=X' where 'X' is positive integer if the +type+ is
|
|
|
|
# unsigned, or negative integer if the +type+ is signed.
|
|
|
|
#
|
|
|
|
# For example, if size_t is defined as unsigned, then
|
|
|
|
# check_signedness('size_t') would returned +1 and the
|
|
|
|
# SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the
|
|
|
|
# compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
|
|
|
|
# done.
|
|
|
|
#
|
|
|
|
def check_signedness(type, headers = nil)
|
|
|
|
signed = nil
|
|
|
|
checking_for("signedness of #{type}", STRING_OR_FAILED_FORMAT) do
|
|
|
|
if try_static_assert("(#{type})-1 < 0")
|
|
|
|
signed = -1
|
|
|
|
elsif try_static_assert("(#{type})-1 > 0")
|
|
|
|
signed = +1
|
|
|
|
else
|
|
|
|
next nil
|
|
|
|
end
|
|
|
|
$defs.push("-DSIGNEDNESS_OF_%s=%+d" % [type.tr_cpp, signed])
|
|
|
|
signed < 0 ? "signed" : "unsigned"
|
|
|
|
end
|
|
|
|
signed
|
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# :stopdoc:
|
|
|
|
|
|
|
|
# Used internally by the what_type? method to determine if +type+ is a scalar
|
|
|
|
# pointer.
|
2005-09-06 19:35:31 -04:00
|
|
|
def scalar_ptr_type?(type, member = nil, headers = nil, &b)
|
|
|
|
try_compile(<<"SRC", &b) # pointer
|
|
|
|
#{cpp_include(headers)}
|
|
|
|
/*top*/
|
|
|
|
volatile #{type} conftestval;
|
2008-08-31 04:52:56 -04:00
|
|
|
#{MAIN_DOES_NOTHING}
|
2005-09-06 19:35:31 -04:00
|
|
|
int t() {return (int)(1-*(conftestval#{member ? ".#{member}" : ""}));}
|
|
|
|
SRC
|
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# Used internally by the what_type? method to determine if +type+ is a scalar
|
|
|
|
# pointer.
|
2005-09-06 19:35:31 -04:00
|
|
|
def scalar_type?(type, member = nil, headers = nil, &b)
|
|
|
|
try_compile(<<"SRC", &b) # pointer
|
|
|
|
#{cpp_include(headers)}
|
|
|
|
/*top*/
|
|
|
|
volatile #{type} conftestval;
|
2008-08-31 04:52:56 -04:00
|
|
|
#{MAIN_DOES_NOTHING}
|
2005-09-06 19:35:31 -04:00
|
|
|
int t() {return (int)(1-(conftestval#{member ? ".#{member}" : ""}));}
|
|
|
|
SRC
|
|
|
|
end
|
|
|
|
|
2009-04-08 01:00:07 -04:00
|
|
|
# Used internally by the what_type? method to check if _typeof_ GCC
|
|
|
|
# extension is available.
|
|
|
|
def have_typeof?
|
|
|
|
return $typeof if defined?($typeof)
|
|
|
|
$typeof = %w[__typeof__ typeof].find do |t|
|
|
|
|
try_compile(<<SRC)
|
|
|
|
int rbcv_foo;
|
|
|
|
#{t}(rbcv_foo) rbcv_bar;
|
|
|
|
SRC
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2005-09-06 19:35:31 -04:00
|
|
|
def what_type?(type, member = nil, headers = nil, &b)
|
|
|
|
m = "#{type}"
|
2009-04-08 01:00:07 -04:00
|
|
|
var = val = "*rbcv_var_"
|
2009-03-26 23:56:46 -04:00
|
|
|
func = "rbcv_func_(void)"
|
2005-09-06 19:35:31 -04:00
|
|
|
if member
|
|
|
|
m << "." << member
|
2009-03-26 23:56:46 -04:00
|
|
|
else
|
|
|
|
type, member = type.split('.', 2)
|
|
|
|
end
|
|
|
|
if member
|
2009-04-08 01:00:07 -04:00
|
|
|
val = "(#{var}).#{member}"
|
|
|
|
end
|
|
|
|
prelude = [cpp_include(headers).split(/^/)]
|
|
|
|
prelude << ["typedef #{type} rbcv_typedef_;\n",
|
|
|
|
"extern rbcv_typedef_ *#{func};\n",
|
|
|
|
"static rbcv_typedef_ #{var};\n",
|
|
|
|
]
|
|
|
|
type = "rbcv_typedef_"
|
|
|
|
fmt = member && !(typeof = have_typeof?) ? "seems %s" : "%s"
|
|
|
|
if typeof
|
|
|
|
var = "*rbcv_member_"
|
|
|
|
func = "rbcv_mem_func_(void)"
|
|
|
|
member = nil
|
|
|
|
type = "rbcv_mem_typedef_"
|
|
|
|
prelude[-1] << "typedef #{typeof}(#{val}) #{type};\n"
|
|
|
|
prelude[-1] << "extern #{type} *#{func};\n"
|
|
|
|
prelude[-1] << "static #{type} #{var};\n"
|
|
|
|
val = var
|
2005-09-06 19:35:31 -04:00
|
|
|
end
|
|
|
|
def fmt.%(x)
|
|
|
|
x ? super : "unknown"
|
|
|
|
end
|
2006-09-16 03:22:49 -04:00
|
|
|
checking_for checking_message(m, headers), fmt do
|
2009-04-08 01:00:07 -04:00
|
|
|
if scalar_ptr_type?(type, member, prelude, &b)
|
|
|
|
if try_static_assert("sizeof(*#{var}) == 1", prelude)
|
2009-03-26 23:56:46 -04:00
|
|
|
return "string"
|
2005-09-06 19:35:31 -04:00
|
|
|
end
|
2009-03-26 23:56:46 -04:00
|
|
|
ptr = "*"
|
2009-04-08 01:00:07 -04:00
|
|
|
elsif scalar_type?(type, member, prelude, &b)
|
|
|
|
unless member and !typeof or try_static_assert("(#{type})-1 < 0", prelude)
|
|
|
|
unsigned = "unsigned"
|
|
|
|
end
|
2009-03-26 23:56:46 -04:00
|
|
|
ptr = ""
|
|
|
|
else
|
2009-04-08 01:00:07 -04:00
|
|
|
next
|
|
|
|
end
|
|
|
|
type = UNIVERSAL_INTS.find do |t|
|
|
|
|
pre = prelude
|
|
|
|
unless member
|
|
|
|
pre += [["static #{unsigned} #{t} #{ptr}#{var};\n",
|
|
|
|
"extern #{unsigned} #{t} #{ptr}*#{func};\n"]]
|
|
|
|
end
|
|
|
|
try_static_assert("sizeof(#{ptr}#{val}) == sizeof(#{unsigned} #{t})", pre)
|
2005-09-06 19:35:31 -04:00
|
|
|
end
|
2009-04-08 01:00:07 -04:00
|
|
|
type or next
|
|
|
|
[unsigned, type, ptr].join(" ").strip
|
2005-09-06 19:35:31 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# This method is used internally by the find_executable method.
|
|
|
|
#
|
|
|
|
# Internal use only.
|
|
|
|
#
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def find_executable0(bin, path = nil)
|
2009-11-30 02:54:26 -05:00
|
|
|
exts = config_string('EXECUTABLE_EXTS') {|s| s.split} || config_string('EXEEXT') {|s| [s]}
|
2005-09-22 10:37:02 -04:00
|
|
|
if File.expand_path(bin) == bin
|
|
|
|
return bin if File.executable?(bin)
|
2009-11-30 02:54:26 -05:00
|
|
|
if exts
|
|
|
|
exts.each {|ext| File.executable?(file = bin + ext) and return file}
|
|
|
|
end
|
2005-09-22 10:37:02 -04:00
|
|
|
return nil
|
|
|
|
end
|
|
|
|
if path ||= ENV['PATH']
|
|
|
|
path = path.split(File::PATH_SEPARATOR)
|
|
|
|
else
|
|
|
|
path = %w[/usr/local/bin /usr/ucb /usr/bin /bin]
|
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
file = nil
|
|
|
|
path.each do |dir|
|
|
|
|
return file if File.executable?(file = File.join(dir, bin))
|
2009-11-30 02:54:26 -05:00
|
|
|
if exts
|
|
|
|
exts.each {|ext| File.executable?(ext = file + ext) and return ext}
|
|
|
|
end
|
2002-09-08 06:00:43 -04:00
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
nil
|
2002-09-08 06:00:43 -04:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# :startdoc:
|
|
|
|
|
|
|
|
# Searches for the executable +bin+ on +path+. The default path is your
|
|
|
|
# PATH environment variable. If that isn't defined, it will resort to
|
|
|
|
# searching /usr/local/bin, /usr/ucb, /usr/bin and /bin.
|
|
|
|
#
|
|
|
|
# If found, it will return the full path, including the executable name,
|
|
|
|
# of where it was found.
|
|
|
|
#
|
|
|
|
# Note that this method does not actually affect the generated Makefile.
|
|
|
|
#
|
2002-08-21 04:30:09 -04:00
|
|
|
def find_executable(bin, path = nil)
|
2006-09-16 03:22:49 -04:00
|
|
|
checking_for checking_message(bin, path) do
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
find_executable0(bin, path)
|
2002-08-21 04:30:09 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# :stopdoc:
|
|
|
|
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
def arg_config(config, default=nil, &block)
|
|
|
|
$arg_config << [config, default]
|
|
|
|
defaults = []
|
|
|
|
if default
|
|
|
|
defaults << default
|
|
|
|
elsif !block
|
|
|
|
defaults << nil
|
|
|
|
end
|
2005-02-06 09:51:44 -05:00
|
|
|
$configure_args.fetch(config.tr('_', '-'), *defaults, &block)
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# :startdoc:
|
|
|
|
|
|
|
|
# Tests for the presence of a --with-<tt>config</tt> or --without-<tt>config</tt>
|
|
|
|
# option. Returns true if the with option is given, false if the without
|
|
|
|
# option is given, and the default value otherwise.
|
|
|
|
#
|
|
|
|
# This can be useful for adding custom definitions, such as debug information.
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# if with_config("debug")
|
|
|
|
# $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
|
|
|
|
# end
|
|
|
|
#
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
def with_config(config, default=nil)
|
2005-10-22 10:55:07 -04:00
|
|
|
config = config.sub(/^--with[-_]/, '')
|
|
|
|
val = arg_config("--with-"+config) do
|
|
|
|
if arg_config("--without-"+config)
|
|
|
|
false
|
|
|
|
elsif block_given?
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
yield(config, default)
|
2005-10-22 10:55:07 -04:00
|
|
|
else
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
break default
|
2005-10-22 10:55:07 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
case val
|
|
|
|
when "yes"
|
|
|
|
true
|
|
|
|
when "no"
|
|
|
|
false
|
|
|
|
else
|
|
|
|
val
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# Tests for the presence of an --enable-<tt>config</tt> or
|
|
|
|
# --disable-<tt>config</tt> option. Returns true if the enable option is given,
|
|
|
|
# false if the disable option is given, and the default value otherwise.
|
|
|
|
#
|
|
|
|
# This can be useful for adding custom definitions, such as debug information.
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# if enable_config("debug")
|
|
|
|
# $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
|
|
|
|
# end
|
|
|
|
#
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
def enable_config(config, default=nil)
|
2002-03-29 02:42:20 -05:00
|
|
|
if arg_config("--enable-"+config)
|
1999-08-13 01:45:20 -04:00
|
|
|
true
|
2002-03-29 02:42:20 -05:00
|
|
|
elsif arg_config("--disable-"+config)
|
1999-08-13 01:45:20 -04:00
|
|
|
false
|
2005-02-06 09:51:44 -05:00
|
|
|
elsif block_given?
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
yield(config, default)
|
1999-08-13 01:45:20 -04:00
|
|
|
else
|
* sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).
* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
basename and pid. [ruby-talk:196272]
* parse.y (do_block): remove -> style block.
* parse.y (parser_yylex): remove tLAMBDA_ARG.
* eval.c (rb_call0): binding for the return event hook should have
consistent scope. [ruby-core:07928]
* eval.c (proc_invoke): return behavior should depend whether it
is surrounded by a lambda or a mere block.
* eval.c (formal_assign): handles post splat arguments.
* eval.c (rb_call0): ditto.
* st.c (strhash): use FNV-1a hash.
* parse.y (parser_yylex): removed experimental ';;' terminator.
* eval.c (rb_node_arity): should be aware of post splat arguments.
* eval.c (rb_proc_arity): ditto.
* parse.y (f_args): syntax rule enhanced to support arguments
after the splat.
* parse.y (block_param): ditto for block parameters.
* parse.y (f_post_arg): mandatory formal arguments after the splat
argument.
* parse.y (new_args_gen): generate nodes for mandatory formal
arguments after the splat argument.
* eval.c (rb_eval): dispatch mandatory formal arguments after the
splat argument.
* parse.y (args): allow more than one splat in the argument list.
* parse.y (method_call): allow aref [] to accept all kind of
method argument, including assocs, splat, and block argument.
* eval.c (SETUP_ARGS0): prepare block argument as well.
* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]
* eval.c (error_line): print receivers true/false/nil specially.
* eval.c (rb_proc_yield): handles parameters in yield semantics.
* eval.c (nil_yield): gives LocalJumpError to denote no block
error.
* io.c (rb_io_getc): now takes one-character string.
* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
hashing algorithm.
* string.c (rb_str_aref): str[0] now returns 1 character string,
instead of a fixnum. [Ruby2]
* parse.y (parser_yylex): ?c now returns 1 character string,
instead of a fixnum. [Ruby2]
* string.c (rb_str_aset): no longer support fixnum insertion.
* eval.c (umethod_bind): should not update original class.
[ruby-dev:28636]
* eval.c (ev_const_get): should support constant access from
within instance_eval(). [ruby-dev:28327]
* time.c (time_timeval): should round for usec floating
number. [ruby-core:07896]
* time.c (time_add): ditto.
* dir.c (sys_warning): should not call a vararg function
rb_sys_warning() indirectly. [ruby-core:07886]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* re.c (rb_reg_initialize): should not allow modifying literal
regexps. frozen check moved from rb_reg_initialize_m as well.
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
* dir.c (dir_close): should not close untainted dir stream.
* dir.c (GetDIR): add tainted/frozen check for each dir operation.
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
typo fixed. a patch from Florian Gross <florg at florg.net>.
* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
event_hooks. no guarantee for arbitrary hook deletion.
[ruby-dev:28632]
* util.c (ruby_strtod): differ addition to minimize error.
[ruby-dev:28619]
* util.c (ruby_strtod): should not raise ERANGE when the input
string does not have any digits. [ruby-dev:28629]
* eval.c (proc_invoke): should restore old ruby_frame->block.
thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833]
also fix [ruby-dev:28614] as well.
* signal.c (trap): sig should be less then NSIG. Coverity found
this bug. a patch from Kevin Tew <tewk at tewk.com>.
[ruby-core:07823]
* math.c (math_log2): add new method inspired by
[ruby-talk:191237].
* math.c (math_log): add optional base argument to Math::log().
[ruby-talk:191308]
* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
uninitialized array element. a patch from Pat Eyler
<rubypate at gmail.com>. [ruby-core:07809]
* array.c (rb_ary_fill): initialize local variables first. a
patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810]
* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
type_tag. a patch from Pat Eyler <rubypate at gmail.com>.
[ruby-core:07808]
* ext/socket/socket.c (make_hostent_internal): accept ai_family
check from Sam Roberts <sroberts at uniserve.com>.
[ruby-core:07691]
* util.c (ruby_strtod): should not cut off 18 digits for no
reason. [ruby-core:07796]
* array.c (rb_ary_fill): internalize local variable "beg" to
pacify Coverity. [ruby-core:07770]
* pack.c (pack_unpack): now supports CRLF newlines. a patch from
<tommy at tmtm.org>. [ruby-dev:28601]
* applied code clean-up patch from Stefan Huehner
<stefan at huehner.org>. [ruby-core:07764]
* lib/jcode.rb (String::tr_s): should have translated non
squeezing character sequence (i.e. a character) as well. thanks
to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]
* ext/socket/socket.c: document update patch from Sam Roberts
<sroberts at uniserve.com>. [ruby-core:07701]
* lib/mathn.rb (Integer): need not to remove gcd2. a patch from
NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570]
* parse.y (arg): too much NEW_LIST()
* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.
* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
[ruby-dev:28585]
* parse.y (arg): use NODE_ARGSCAT for placeholder.
* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
mathew <meta at pobox.com>. [ruby-core:07738]
* variable.c (rb_const_set): raise error when no target klass is
supplied. [ruby-dev:28582]
* prec.c (prec_prec_f): documentation patch from
<gerardo.santana at gmail.com>. [ruby-core:07689]
* bignum.c (rb_big_pow): second operand may be too big even if
it's a Fixnum. [ruby-talk:187984]
* README.EXT: update symbol description. [ruby-talk:188104]
* COPYING: explicitly note GPLv2. [ruby-talk:187922]
* parse.y: remove some obsolete syntax rules (unparenthesized
method calls in argument list).
* eval.c (rb_call0): insecure calling should be checked for non
NODE_SCOPE method invocations too.
* eval.c (rb_alias): should preserve the current safe level as
well as method definition.
* process.c (rb_f_sleep): remove RDoc description about SIGALRM
which is not valid on the current implementation. [ruby-dev:28464]
Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>
* eval.c (method_missing): should support argument splat in
super. a bug in combination of super, splat and
method_missing. [ruby-talk:185438]
* configure.in: Solaris SunPro compiler -rapth patch from
<kuwa at labs.fujitsu.com>. [ruby-dev:28443]
* configure.in: remove enable_rpath=no for Solaris.
[ruby-dev:28440]
* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
String object.
* ruby.1: a clarification patch from David Lutterkort
<dlutter at redhat.com>. [ruby-core:7508]
* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
directories. a patch from Eric Hodel <drbrain at segment7.net>.
[ruby-core:07423]
* eval.c (rb_clear_cache_by_class): clearing wrong cache.
* ext/extmk.rb: use :remove_destination to install extension libraries
to avoid SEGV. [ruby-dev:28417]
* eval.c (rb_thread_fd_writable): should not re-schedule output
from KILLED thread (must be error printing).
* array.c (rb_ary_flatten_bang): allow specifying recursion
level. [ruby-talk:182170]
* array.c (rb_ary_flatten): ditto.
* gc.c (add_heap): a heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.
* eval.c (rb_call): use separate cache for fcall/vcall
invocation.
* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
functions.
* eval.c (rb_mod_local): a new method to specify newly added
visibility "local".
* eval.c (search_method): search for local methods which are
visible only from the current class.
* class.c (rb_class_local_methods): a method to list local methods.
* object.c (Init_Object): add BasicObject class as a top level
BlankSlate class.
* ruby.h (SYM2ID): should not cast to signed long.
[ruby-core:07414]
* class.c (rb_include_module): allow module duplication.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 17:20:17 -04:00
|
|
|
return default
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# Generates a header file consisting of the various macro definitions generated
|
|
|
|
# by other methods such as have_func and have_header. These are then wrapped in
|
|
|
|
# a custom #ifndef based on the +header+ file name, which defaults to
|
|
|
|
# 'extconf.h'.
|
|
|
|
#
|
|
|
|
# For example:
|
2009-03-05 22:56:38 -05:00
|
|
|
#
|
2008-03-07 05:56:13 -05:00
|
|
|
# # extconf.rb
|
|
|
|
# require 'mkmf'
|
|
|
|
# have_func('realpath')
|
|
|
|
# have_header('sys/utime.h')
|
|
|
|
# create_header
|
|
|
|
# create_makefile('foo')
|
|
|
|
#
|
|
|
|
# The above script would generate the following extconf.h file:
|
|
|
|
#
|
|
|
|
# #ifndef EXTCONF_H
|
|
|
|
# #define EXTCONF_H
|
|
|
|
# #define HAVE_REALPATH 1
|
|
|
|
# #define HAVE_SYS_UTIME_H 1
|
|
|
|
# #endif
|
|
|
|
#
|
|
|
|
# Given that the create_header method generates a file based on definitions
|
|
|
|
# set earlier in your extconf.rb file, you will probably want to make this
|
|
|
|
# one of the last methods you call in your script.
|
|
|
|
#
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def create_header(header = "extconf.h")
|
2003-07-23 01:19:22 -04:00
|
|
|
message "creating %s\n", header
|
2010-01-17 00:18:03 -05:00
|
|
|
sym = header.tr_cpp
|
2006-05-25 19:44:08 -04:00
|
|
|
hdr = ["#ifndef #{sym}\n#define #{sym}\n"]
|
2009-03-13 21:39:15 -04:00
|
|
|
for line in $defs
|
|
|
|
case line
|
|
|
|
when /^-D([^=]+)(?:=(.*))?/
|
2009-11-06 03:13:47 -05:00
|
|
|
hdr << "#define #$1 #{$2 ? Shellwords.shellwords($2)[0].gsub(/(?=\t+)/, "\\\n") : 1}\n"
|
2009-03-13 21:39:15 -04:00
|
|
|
when /^-U(.*)/
|
2006-05-25 19:44:08 -04:00
|
|
|
hdr << "#undef #$1\n"
|
2009-03-13 21:39:15 -04:00
|
|
|
end
|
|
|
|
end
|
2006-05-25 19:44:08 -04:00
|
|
|
hdr << "#endif\n"
|
|
|
|
hdr = hdr.join
|
|
|
|
unless (IO.read(header) == hdr rescue false)
|
2009-09-17 17:34:24 -04:00
|
|
|
open(header, "wb") do |hfile|
|
2006-05-25 19:44:08 -04:00
|
|
|
hfile.write(hdr)
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
end
|
2006-05-25 19:44:08 -04:00
|
|
|
$extconf_h = header
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Sets a +target+ name that the user can then use to configure various 'with'
|
|
|
|
# options with on the command line by using that name. For example, if the
|
|
|
|
# target is set to "foo", then the user could use the --with-foo-dir command
|
|
|
|
# line option.
|
|
|
|
#
|
|
|
|
# You may pass along additional 'include' or 'lib' defaults via the +idefault+
|
|
|
|
# and +ldefault+ parameters, respectively.
|
|
|
|
#
|
|
|
|
# Note that dir_config only adds to the list of places to search for libraries
|
|
|
|
# and include files. It does not link the libraries into your application.
|
|
|
|
#
|
2000-08-24 02:21:43 -04:00
|
|
|
def dir_config(target, idefault=nil, ldefault=nil)
|
2002-01-31 07:03:08 -05:00
|
|
|
if dir = with_config(target + "-dir", (idefault unless ldefault))
|
2005-02-06 09:51:44 -05:00
|
|
|
defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
|
2003-07-30 09:35:23 -04:00
|
|
|
idefault = ldefault = nil
|
2000-08-24 02:21:43 -04:00
|
|
|
end
|
2001-04-24 02:21:58 -04:00
|
|
|
|
2002-01-31 07:03:08 -05:00
|
|
|
idir = with_config(target + "-include", idefault)
|
2005-02-06 09:51:44 -05:00
|
|
|
$arg_config.last[1] ||= "${#{target}-dir}/include"
|
2002-01-31 07:03:08 -05:00
|
|
|
ldir = with_config(target + "-lib", ldefault)
|
2005-02-06 09:51:44 -05:00
|
|
|
$arg_config.last[1] ||= "${#{target}-dir}/lib"
|
2001-04-24 02:21:58 -04:00
|
|
|
|
2010-05-01 18:38:45 -04:00
|
|
|
idirs = idir ? Array === idir ? idir.dup : idir.split(File::PATH_SEPARATOR) : []
|
2003-07-30 09:35:23 -04:00
|
|
|
if defaults
|
2006-10-09 10:41:24 -04:00
|
|
|
idirs.concat(defaults.collect {|d| d + "/include"})
|
2003-07-30 09:35:23 -04:00
|
|
|
idir = ([idir] + idirs).compact.join(File::PATH_SEPARATOR)
|
|
|
|
end
|
|
|
|
unless idirs.empty?
|
2006-10-09 10:41:24 -04:00
|
|
|
idirs.collect! {|d| "-I" + d}
|
2003-07-30 09:35:23 -04:00
|
|
|
idirs -= Shellwords.shellwords($CPPFLAGS)
|
|
|
|
unless idirs.empty?
|
2004-06-25 22:07:30 -04:00
|
|
|
$CPPFLAGS = (idirs.quote << $CPPFLAGS).join(" ")
|
2003-01-19 14:14:22 -05:00
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
2001-04-24 02:21:58 -04:00
|
|
|
|
2010-05-01 18:38:45 -04:00
|
|
|
ldirs = ldir ? Array === ldir ? ldir.dup : ldir.split(File::PATH_SEPARATOR) : []
|
2003-07-30 09:35:23 -04:00
|
|
|
if defaults
|
2006-10-09 10:41:24 -04:00
|
|
|
ldirs.concat(defaults.collect {|d| d + "/lib"})
|
2003-07-30 09:35:23 -04:00
|
|
|
ldir = ([ldir] + ldirs).compact.join(File::PATH_SEPARATOR)
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
2004-07-13 02:54:01 -04:00
|
|
|
$LIBPATH = ldirs | $LIBPATH
|
1999-08-13 01:45:20 -04:00
|
|
|
|
2001-04-24 02:21:58 -04:00
|
|
|
[idir, ldir]
|
1999-08-13 01:45:20 -04:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# :stopdoc:
|
|
|
|
|
|
|
|
# Handles meta information about installed libraries. Uses your platform's
|
|
|
|
# pkg-config program if it has one.
|
2003-08-02 01:54:00 -04:00
|
|
|
def pkg_config(pkg)
|
2006-05-24 11:51:03 -04:00
|
|
|
if pkgconfig = with_config("#{pkg}-config") and find_executable0(pkgconfig)
|
|
|
|
# iff package specific config command is given
|
|
|
|
get = proc {|opt| `#{pkgconfig} --#{opt}`.chomp}
|
2009-03-05 22:56:38 -05:00
|
|
|
elsif ($PKGCONFIG ||=
|
2006-05-24 11:51:03 -04:00
|
|
|
(pkgconfig = with_config("pkg-config", ("pkg-config" unless CROSS_COMPILING))) &&
|
|
|
|
find_executable0(pkgconfig) && pkgconfig) and
|
|
|
|
system("#{$PKGCONFIG} --exists #{pkg}")
|
|
|
|
# default to pkg-config command
|
|
|
|
get = proc {|opt| `#{$PKGCONFIG} --#{opt} #{pkg}`.chomp}
|
|
|
|
elsif find_executable0(pkgconfig = "#{pkg}-config")
|
|
|
|
# default to package specific config command, as a last resort.
|
|
|
|
get = proc {|opt| `#{pkgconfig} --#{opt}`.chomp}
|
|
|
|
end
|
|
|
|
if get
|
|
|
|
cflags = get['cflags']
|
|
|
|
ldflags = get['libs']
|
|
|
|
libs = get['libs-only-l']
|
2003-08-16 10:58:34 -04:00
|
|
|
ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
|
2003-08-02 01:54:00 -04:00
|
|
|
$CFLAGS += " " << cflags
|
|
|
|
$LDFLAGS += " " << ldflags
|
2003-08-05 23:11:14 -04:00
|
|
|
$libs += " " << libs
|
2003-08-02 01:54:00 -04:00
|
|
|
Logging::message "package configuration for %s\n", pkg
|
|
|
|
Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",
|
|
|
|
cflags, ldflags, libs
|
|
|
|
[cflags, ldflags, libs]
|
2006-05-24 11:51:03 -04:00
|
|
|
else
|
|
|
|
Logging::message "package configuration for %s is not found\n", pkg
|
|
|
|
nil
|
2003-08-02 01:54:00 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2001-12-20 11:23:27 -05:00
|
|
|
def with_destdir(dir)
|
2006-07-20 23:12:45 -04:00
|
|
|
dir = dir.sub($dest_prefix_pattern, '')
|
|
|
|
/\A\$[\(\{]/ =~ dir ? dir : "$(DESTDIR)"+dir
|
2001-12-20 11:23:27 -05:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# Converts forward slashes to backslashes. Aimed at MS Windows.
|
|
|
|
#
|
|
|
|
# Internal use only.
|
|
|
|
#
|
2002-06-10 21:27:48 -04:00
|
|
|
def winsep(s)
|
|
|
|
s.tr('/', '\\')
|
|
|
|
end
|
|
|
|
|
2009-01-23 00:56:01 -05:00
|
|
|
# Converts native path to format acceptable in Makefile
|
|
|
|
#
|
|
|
|
# Internal use only.
|
|
|
|
#
|
|
|
|
if !CROSS_COMPILING
|
|
|
|
case CONFIG['build_os']
|
|
|
|
when 'mingw32'
|
|
|
|
def mkintpath(path)
|
|
|
|
# mingw uses make from msys and it needs special care
|
|
|
|
# converts from C:\some\path to /C/some/path
|
|
|
|
path = path.dup
|
|
|
|
path.tr!('\\', '/')
|
|
|
|
path.sub!(/\A([A-Za-z]):(?=\/)/, '/\1')
|
|
|
|
path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
unless defined?(mkintpath)
|
|
|
|
def mkintpath(path)
|
|
|
|
path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def configuration(srcdir)
|
|
|
|
mk = []
|
2007-06-09 23:06:15 -04:00
|
|
|
vpath = $VPATH.dup
|
2005-05-27 03:49:06 -04:00
|
|
|
if !CROSS_COMPILING
|
|
|
|
case CONFIG['build_os']
|
|
|
|
when 'cygwin'
|
|
|
|
if CONFIG['target_os'] != 'cygwin'
|
2007-06-09 23:06:15 -04:00
|
|
|
vpath = vpath.map {|p| p.sub(/.*/, '$(shell cygpath -u \&)')}
|
2005-05-27 03:49:06 -04:00
|
|
|
end
|
|
|
|
end
|
2004-12-08 06:14:53 -05:00
|
|
|
end
|
2006-10-12 05:28:28 -04:00
|
|
|
CONFIG["hdrdir"] ||= $hdrdir
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
mk << %{
|
1998-01-16 07:19:09 -05:00
|
|
|
SHELL = /bin/sh
|
|
|
|
|
|
|
|
#### Start of system configuration section. ####
|
2009-01-23 00:34:49 -05:00
|
|
|
#{"top_srcdir = " + $top_srcdir.sub(%r"\A#{Regexp.quote($topdir)}/", "$(topdir)/") if $extmk}
|
2009-01-23 00:56:01 -05:00
|
|
|
srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {mkintpath(CONFIG[$1||$2])}.quote}
|
|
|
|
topdir = #{mkintpath($extmk ? CONFIG["topdir"] : $topdir).quote}
|
|
|
|
hdrdir = #{mkintpath(CONFIG["hdrdir"]).quote}
|
2007-06-09 23:06:15 -04:00
|
|
|
arch_hdrdir = #{$arch_hdrdir}
|
2004-03-18 04:50:14 -05:00
|
|
|
VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
|
2002-06-10 21:27:48 -04:00
|
|
|
}
|
2007-05-22 16:48:34 -04:00
|
|
|
if $extmk
|
2010-08-02 18:52:25 -04:00
|
|
|
mk << "RUBYLIB =\n""RUBYOPT = -\n"
|
2007-05-22 16:48:34 -04:00
|
|
|
end
|
2006-07-25 01:50:45 -04:00
|
|
|
if destdir = CONFIG["prefix"][$dest_prefix_pattern, 1]
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
mk << "\nDESTDIR = #{destdir}\n"
|
2002-04-01 10:01:56 -05:00
|
|
|
end
|
2002-05-04 17:57:32 -04:00
|
|
|
CONFIG.each do |key, var|
|
|
|
|
next unless /prefix$/ =~ key
|
2006-07-20 23:12:45 -04:00
|
|
|
mk << "#{key} = #{with_destdir(var)}\n"
|
2002-04-01 10:01:56 -05:00
|
|
|
end
|
2002-05-04 17:57:32 -04:00
|
|
|
CONFIG.each do |key, var|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
next if /^abs_/ =~ key
|
2007-06-09 23:06:15 -04:00
|
|
|
next if /^(?:src|top|hdr)dir$/ =~ key
|
|
|
|
next unless /dir$/ =~ key
|
2006-07-20 23:12:45 -04:00
|
|
|
mk << "#{key} = #{with_destdir(var)}\n"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2005-09-21 10:31:20 -04:00
|
|
|
if !$extmk and !$configure_args.has_key?('--ruby') and
|
|
|
|
sep = config_string('BUILD_FILE_SEPARATOR')
|
|
|
|
sep = ":/=#{sep}"
|
|
|
|
else
|
|
|
|
sep = ""
|
|
|
|
end
|
2009-01-23 18:21:16 -05:00
|
|
|
possible_command = (proc {|s| s if /top_srcdir/ !~ s} unless $extmk)
|
2008-10-10 21:20:20 -04:00
|
|
|
extconf_h = $extconf_h ? "-DRUBY_EXTCONF_H=\\\"$(RUBY_EXTCONF_H)\\\" " : $defs.join(" ") << " "
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
mk << %{
|
|
|
|
CC = #{CONFIG['CC']}
|
2005-04-20 17:45:43 -04:00
|
|
|
CXX = #{CONFIG['CXX']}
|
2002-11-14 08:51:19 -05:00
|
|
|
LIBRUBY = #{CONFIG['LIBRUBY']}
|
|
|
|
LIBRUBY_A = #{CONFIG['LIBRUBY_A']}
|
|
|
|
LIBRUBYARG_SHARED = #$LIBRUBYARG_SHARED
|
|
|
|
LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC
|
2007-12-23 22:49:56 -05:00
|
|
|
OUTFLAG = #{OUTFLAG}
|
|
|
|
COUTFLAG = #{COUTFLAG}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
|
2006-05-25 19:44:08 -04:00
|
|
|
RUBY_EXTCONF_H = #{$extconf_h}
|
2008-06-09 08:14:39 -04:00
|
|
|
cflags = #{CONFIG['cflags']}
|
|
|
|
optflags = #{CONFIG['optflags']}
|
|
|
|
debugflags = #{CONFIG['debugflags']}
|
|
|
|
warnflags = #{CONFIG['warnflags']}
|
2006-08-31 10:59:43 -04:00
|
|
|
CFLAGS = #{$static ? '' : CONFIG['CCDLFLAGS']} #$CFLAGS #$ARCH_FLAG
|
2006-05-25 19:44:08 -04:00
|
|
|
INCFLAGS = -I. #$INCFLAGS
|
2007-10-13 15:08:37 -04:00
|
|
|
DEFS = #{CONFIG['DEFS']}
|
2006-05-25 19:44:08 -04:00
|
|
|
CPPFLAGS = #{extconf_h}#{$CPPFLAGS}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
CXXFLAGS = $(CFLAGS) #{CONFIG['CXXFLAGS']}
|
2007-11-28 00:43:17 -05:00
|
|
|
ldflags = #{$LDFLAGS}
|
|
|
|
dldflags = #{$DLDFLAGS}
|
2010-01-09 14:41:22 -05:00
|
|
|
ARCH_FLAG = #{$ARCH_FLAG}
|
|
|
|
DLDFLAGS = $(ldflags) $(dldflags)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
LDSHARED = #{CONFIG['LDSHARED']}
|
2005-04-20 17:45:43 -04:00
|
|
|
LDSHAREDXX = #{config_string('LDSHAREDXX') || '$(LDSHARED)'}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
AR = #{CONFIG['AR']}
|
|
|
|
EXEEXT = #{CONFIG['EXEEXT']}
|
|
|
|
|
2009-05-07 21:14:14 -04:00
|
|
|
RUBY_BASE_NAME = #{CONFIG['RUBY_BASE_NAME']}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
RUBY_INSTALL_NAME = #{CONFIG['RUBY_INSTALL_NAME']}
|
|
|
|
RUBY_SO_NAME = #{CONFIG['RUBY_SO_NAME']}
|
|
|
|
arch = #{CONFIG['arch']}
|
|
|
|
sitearch = #{CONFIG['sitearch']}
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
ruby_version = #{RbConfig::CONFIG['ruby_version']}
|
2004-03-18 21:35:27 -05:00
|
|
|
ruby = #{$ruby}
|
2005-09-21 10:31:20 -04:00
|
|
|
RUBY = $(ruby#{sep})
|
2009-01-23 18:21:16 -05:00
|
|
|
RM = #{config_string('RM', &possible_command) || '$(RUBY) -run -e rm -- -f'}
|
2008-09-01 09:44:54 -04:00
|
|
|
RM_RF = #{'$(RUBY) -run -e rm -- -rf'}
|
2009-01-24 21:06:29 -05:00
|
|
|
RMDIRS = #{config_string('RMDIRS', &possible_command) || '$(RUBY) -run -e rmdir -- -p'}
|
2009-01-23 18:21:16 -05:00
|
|
|
MAKEDIRS = #{config_string('MAKEDIRS', &possible_command) || '@$(RUBY) -run -e mkdir -- -p'}
|
|
|
|
INSTALL = #{config_string('INSTALL', &possible_command) || '@$(RUBY) -run -e install -- -vp'}
|
2005-05-13 10:44:59 -04:00
|
|
|
INSTALL_PROG = #{config_string('INSTALL_PROG') || '$(INSTALL) -m 0755'}
|
|
|
|
INSTALL_DATA = #{config_string('INSTALL_DATA') || '$(INSTALL) -m 0644'}
|
2009-01-23 18:21:16 -05:00
|
|
|
COPY = #{config_string('CP', &possible_command) || '@$(RUBY) -run -e cp -- -v'}
|
1998-01-16 07:19:09 -05:00
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
#### End of system configuration section. ####
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2006-10-12 05:28:28 -04:00
|
|
|
preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
}
|
2002-12-31 07:31:12 -05:00
|
|
|
if $nmake == ?b
|
|
|
|
mk.each do |x|
|
|
|
|
x.gsub!(/^(MAKEDIRS|INSTALL_(?:PROG|DATA))+\s*=.*\n/) do
|
|
|
|
"!ifndef " + $1 + "\n" +
|
|
|
|
$& +
|
|
|
|
"!endif\n"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
mk
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2008-03-07 05:56:13 -05:00
|
|
|
# :startdoc:
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
|
2002-10-28 12:01:23 -05:00
|
|
|
def dummy_makefile(srcdir)
|
2004-03-24 04:48:09 -05:00
|
|
|
configuration(srcdir) << <<RULES << CLEANINGS
|
|
|
|
CLEANFILES = #{$cleanfiles.join(' ')}
|
|
|
|
DISTCLEANFILES = #{$distcleanfiles.join(' ')}
|
|
|
|
|
2004-04-02 04:00:12 -05:00
|
|
|
all install static install-so install-rb: Makefile
|
2009-02-19 00:22:04 -05:00
|
|
|
.PHONY: all install static install-so install-rb
|
|
|
|
.PHONY: clean clean-so clean-rb
|
2004-03-24 04:48:09 -05:00
|
|
|
|
|
|
|
RULES
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2007-12-17 03:47:28 -05:00
|
|
|
def depend_rules(depend)
|
|
|
|
suffixes = []
|
|
|
|
depout = []
|
2007-12-17 11:15:46 -05:00
|
|
|
cont = implicit = nil
|
|
|
|
impconv = proc do
|
|
|
|
COMPILE_RULES.each {|rule| depout << (rule % implicit[0]) << implicit[1]}
|
|
|
|
implicit = nil
|
|
|
|
end
|
|
|
|
ruleconv = proc do |line|
|
|
|
|
if implicit
|
|
|
|
if /\A\t/ =~ line
|
|
|
|
implicit[1] << line
|
2007-12-17 03:47:28 -05:00
|
|
|
next
|
2007-12-17 11:15:46 -05:00
|
|
|
else
|
|
|
|
impconv[]
|
2007-12-17 03:47:28 -05:00
|
|
|
end
|
|
|
|
end
|
2007-12-17 11:15:46 -05:00
|
|
|
if m = /\A\.(\w+)\.(\w+)(?:\s*:)/.match(line)
|
|
|
|
suffixes << m[1] << m[2]
|
|
|
|
implicit = [[m[1], m[2]], [m.post_match]]
|
|
|
|
next
|
|
|
|
elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
|
2008-02-26 13:56:00 -05:00
|
|
|
line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
|
2007-12-17 03:47:28 -05:00
|
|
|
end
|
2007-12-17 11:15:46 -05:00
|
|
|
depout << line
|
|
|
|
end
|
|
|
|
depend.each_line do |line|
|
|
|
|
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
|
2008-10-05 10:34:37 -04:00
|
|
|
line.gsub!(/\$\((?:hdr|top)dir\)\/config.h/, $config_h)
|
2007-12-17 11:40:22 -05:00
|
|
|
line.gsub!(%r"\$\(hdrdir\)/(?!ruby(?![^:;/\s]))(?=[-\w]+\.h)", '\&ruby/')
|
2007-12-29 16:28:53 -05:00
|
|
|
if $nmake && /\A\s*\$\(RM|COPY\)/ =~ line
|
|
|
|
line.gsub!(%r"[-\w\./]{2,}"){$&.tr("/", "\\")}
|
|
|
|
line.gsub!(/(\$\((?!RM|COPY)[^:)]+)(?=\))/, '\1:/=\\')
|
|
|
|
end
|
2007-12-17 11:15:46 -05:00
|
|
|
if /(?:^|[^\\])(?:\\\\)*\\$/ =~ line
|
|
|
|
(cont ||= []) << line
|
|
|
|
next
|
|
|
|
elsif cont
|
|
|
|
line = (cont << line).join
|
|
|
|
cont = nil
|
2007-12-17 03:47:28 -05:00
|
|
|
end
|
2007-12-17 11:15:46 -05:00
|
|
|
ruleconv.call(line)
|
|
|
|
end
|
|
|
|
if cont
|
|
|
|
ruleconv.call(cont.join)
|
|
|
|
elsif implicit
|
|
|
|
impconv.call
|
2007-12-17 03:47:28 -05:00
|
|
|
end
|
2007-12-21 09:49:56 -05:00
|
|
|
unless suffixes.empty?
|
|
|
|
depout.unshift(".SUFFIXES: ." + suffixes.uniq.join(" .") + "\n\n")
|
|
|
|
end
|
|
|
|
depout.unshift("$(OBJS): $(RUBY_EXTCONF_H)\n\n") if $extconf_h
|
2007-12-17 03:47:28 -05:00
|
|
|
depout.flatten!
|
|
|
|
depout
|
|
|
|
end
|
|
|
|
|
2006-08-17 01:47:50 -04:00
|
|
|
# Generates the Makefile for your extension, passing along any options and
|
|
|
|
# preprocessor constants that you may have generated through other methods.
|
|
|
|
#
|
|
|
|
# The +target+ name should correspond the name of the global function name
|
|
|
|
# defined within your C extension, minus the 'Init_'. For example, if your
|
|
|
|
# C extension is defined as 'Init_foo', then your target would simply be 'foo'.
|
|
|
|
#
|
|
|
|
# If any '/' characters are present in the target name, only the last name
|
|
|
|
# is interpreted as the target name, and the rest are considered toplevel
|
|
|
|
# directory names, and the generated Makefile will be altered accordingly to
|
|
|
|
# follow that directory structure.
|
|
|
|
#
|
|
|
|
# For example, if you pass 'test/foo' as a target name, your extension will
|
|
|
|
# be installed under the 'test' directory. This means that in order to
|
|
|
|
# load the file within a Ruby program later, that directory structure will
|
|
|
|
# have to be followed, e.g. "require 'test/foo'".
|
|
|
|
#
|
2007-11-12 02:52:31 -05:00
|
|
|
# The +srcprefix+ should be used when your source files are not in the same
|
|
|
|
# directory as your build script. This will not only eliminate the need for
|
|
|
|
# you to manually copy the source files into the same directory as your build
|
|
|
|
# script, but it also sets the proper +target_prefix+ in the generated
|
|
|
|
# Makefile.
|
|
|
|
#
|
|
|
|
# Setting the +target_prefix+ will, in turn, install the generated binary in
|
2009-03-13 21:39:15 -04:00
|
|
|
# a directory under your RbConfig::CONFIG['sitearchdir'] that mimics your local
|
2007-11-12 02:52:31 -05:00
|
|
|
# filesystem when you run 'make install'.
|
|
|
|
#
|
|
|
|
# For example, given the following file tree:
|
|
|
|
#
|
|
|
|
# ext/
|
|
|
|
# extconf.rb
|
|
|
|
# test/
|
|
|
|
# foo.c
|
|
|
|
#
|
|
|
|
# And given the following code:
|
|
|
|
#
|
|
|
|
# create_makefile('test/foo', 'test')
|
|
|
|
#
|
|
|
|
# That will set the +target_prefix+ in the generated Makefile to 'test'. That,
|
|
|
|
# in turn, will create the following file tree when installed via the
|
|
|
|
# 'make install' command:
|
|
|
|
#
|
|
|
|
# /path/to/ruby/sitearchdir/test/foo.so
|
|
|
|
#
|
|
|
|
# It is recommended that you use this approach to generate your makefiles,
|
|
|
|
# instead of copying files around manually, because some third party
|
|
|
|
# libraries may depend on the +target_prefix+ being set properly.
|
|
|
|
#
|
2008-03-07 05:56:13 -05:00
|
|
|
# The +srcprefix+ argument can be used to override the default source
|
|
|
|
# directory, i.e. the current directory . It is included as part of the VPATH
|
|
|
|
# and added to the list of INCFLAGS.
|
|
|
|
#
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def create_makefile(target, srcprefix = nil)
|
|
|
|
$target = target
|
2007-02-28 04:26:07 -05:00
|
|
|
libpath = $DEFLIBPATH|$LIBPATH
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
message "creating Makefile\n"
|
|
|
|
rm_f "conftest*"
|
|
|
|
if CONFIG["DLEXT"] == $OBJEXT
|
2002-10-28 12:01:23 -05:00
|
|
|
for lib in libs = $libs.split
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
lib.sub!(/-l(.*)/, %%"lib\\1.#{$LIBEXT}"%)
|
|
|
|
end
|
2002-10-28 12:01:23 -05:00
|
|
|
$defs.push(format("-DEXTLIB='%s'", libs.join(",")))
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2000-04-12 01:06:23 -04:00
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
if target.include?('/')
|
|
|
|
target_prefix, target = File.split(target)
|
2005-02-18 23:31:36 -05:00
|
|
|
target_prefix[0,0] = '/'
|
|
|
|
else
|
|
|
|
target_prefix = ""
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2000-04-12 01:06:23 -04:00
|
|
|
|
2010-02-21 07:20:21 -05:00
|
|
|
srcprefix ||= "$(srcdir)/#{srcprefix}".chomp('/')
|
2010-01-28 21:09:51 -05:00
|
|
|
RbConfig.expand(srcdir = srcprefix.dup)
|
2002-04-01 10:01:56 -05:00
|
|
|
|
2009-05-31 10:28:04 -04:00
|
|
|
ext = ".#{$OBJEXT}"
|
2005-02-06 09:51:44 -05:00
|
|
|
if not $objs
|
2009-05-31 10:28:04 -04:00
|
|
|
srcs = $srcs || Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
|
|
|
|
objs = srcs.inject(Hash.new {[]}) {|h, f| h[File.basename(f, ".*") << ext] <<= f; h}
|
|
|
|
$objs = objs.keys
|
|
|
|
unless objs.delete_if {|b, f| f.size == 1}.empty?
|
|
|
|
dups = objs.sort.map {|b, f|
|
|
|
|
"#{b[/.*\./]}{#{f.collect {|n| n[/([^.]+)\z/]}.join(',')}}"
|
|
|
|
}
|
|
|
|
abort "source files duplication - #{dups.join(", ")}"
|
2002-12-21 10:42:10 -05:00
|
|
|
end
|
2009-05-31 10:28:04 -04:00
|
|
|
else
|
|
|
|
$objs.collect! {|o| File.basename(o, ".*") << ext} unless $OBJEXT == "o"
|
|
|
|
srcs = $srcs || $objs.collect {|o| o.chomp(ext) << ".c"}
|
2005-02-06 09:51:44 -05:00
|
|
|
end
|
2006-09-08 15:48:22 -04:00
|
|
|
$srcs = srcs
|
2002-12-21 10:42:10 -05:00
|
|
|
|
2009-03-03 02:25:50 -05:00
|
|
|
target = nil if $objs.empty?
|
2002-12-21 10:42:10 -05:00
|
|
|
|
|
|
|
if target and EXPORT_PREFIX
|
2003-12-18 07:48:43 -05:00
|
|
|
if File.exist?(File.join(srcdir, target + '.def'))
|
|
|
|
deffile = "$(srcdir)/$(TARGET).def"
|
|
|
|
unless EXPORT_PREFIX.empty?
|
2006-02-05 02:37:38 -05:00
|
|
|
makedef = %{-pe "$_.sub!(/^(?=\\w)/,'#{EXPORT_PREFIX}') unless 1../^EXPORTS$/i"}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2003-12-18 07:48:43 -05:00
|
|
|
else
|
|
|
|
makedef = %{-e "puts 'EXPORTS', '#{EXPORT_PREFIX}Init_$(TARGET)'"}
|
|
|
|
end
|
|
|
|
if makedef
|
2009-01-26 21:03:54 -05:00
|
|
|
$cleanfiles << '$(DEFFILE)'
|
2003-12-18 07:48:43 -05:00
|
|
|
origdef = deffile
|
|
|
|
deffile = "$(TARGET)-$(arch).def"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
|
|
|
end
|
2006-08-31 10:59:43 -04:00
|
|
|
origdef ||= ''
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2009-01-22 04:12:49 -05:00
|
|
|
if $extout and $INSTALLFILES
|
2009-01-24 21:06:29 -05:00
|
|
|
$cleanfiles.concat($INSTALLFILES.collect {|files, dir|File.join(dir, files.sub(/\A\.\//, ''))})
|
|
|
|
$distcleandirs.concat($INSTALLFILES.collect {|files, dir| dir})
|
2009-01-22 04:12:49 -05:00
|
|
|
end
|
|
|
|
|
2006-06-09 19:18:04 -04:00
|
|
|
if $extmk and not $extconf_h
|
|
|
|
create_header
|
|
|
|
end
|
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
libpath = libpathflag(libpath)
|
|
|
|
|
2003-08-16 10:58:34 -04:00
|
|
|
dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
|
|
|
|
staticlib = target ? "$(TARGET).#$LIBEXT" : ""
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
mfile = open("Makefile", "wb")
|
2010-01-28 21:09:51 -05:00
|
|
|
conf = configuration(srcprefix)
|
|
|
|
conf = yield(conf) if block_given?
|
2010-01-28 22:22:55 -05:00
|
|
|
mfile.puts(conf)
|
2006-09-16 03:06:57 -04:00
|
|
|
mfile.print "
|
2007-02-28 04:26:07 -05:00
|
|
|
libpath = #{($DEFLIBPATH|$LIBPATH).join(" ")}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
LIBPATH = #{libpath}
|
|
|
|
DEFFILE = #{deffile}
|
|
|
|
|
2003-01-21 14:33:19 -05:00
|
|
|
CLEANFILES = #{$cleanfiles.join(' ')}
|
|
|
|
DISTCLEANFILES = #{$distcleanfiles.join(' ')}
|
2009-01-24 21:06:29 -05:00
|
|
|
DISTCLEANDIRS = #{$distcleandirs.join(' ')}
|
2002-10-28 12:01:23 -05:00
|
|
|
|
2009-02-19 00:22:04 -05:00
|
|
|
extout = #{$extout && $extout.quote}
|
2004-02-09 04:20:52 -05:00
|
|
|
extout_prefix = #{$extout_prefix}
|
2002-10-28 12:01:23 -05:00
|
|
|
target_prefix = #{target_prefix}
|
|
|
|
LOCAL_LIBS = #{$LOCAL_LIBS}
|
|
|
|
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
|
2005-02-06 09:51:44 -05:00
|
|
|
SRCS = #{srcs.collect(&File.method(:basename)).join(' ')}
|
2009-03-03 02:25:50 -05:00
|
|
|
OBJS = #{$objs.join(" ")}
|
2002-10-28 12:01:23 -05:00
|
|
|
TARGET = #{target}
|
2002-12-21 10:42:10 -05:00
|
|
|
DLLIB = #{dllib}
|
2006-05-26 22:30:10 -04:00
|
|
|
EXTSTATIC = #{$static || ""}
|
2004-04-08 06:45:21 -04:00
|
|
|
STATIC_LIB = #{staticlib unless $static.nil?}
|
2006-09-16 03:06:57 -04:00
|
|
|
#{!$extout && defined?($installed_list) ? "INSTALLED_LIST = #{$installed_list}\n" : ""}
|
2006-12-31 10:02:22 -05:00
|
|
|
" #"
|
|
|
|
# TODO: fixme
|
|
|
|
install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
|
2008-08-07 01:16:27 -04:00
|
|
|
n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET)'
|
2006-09-16 03:06:57 -04:00
|
|
|
mfile.print "
|
2005-02-06 09:51:44 -05:00
|
|
|
TARGET_SO = #{($extout ? '$(RUBYARCHDIR)/' : '')}$(DLLIB)
|
2008-08-07 01:16:27 -04:00
|
|
|
CLEANLIBS = #{n}.#{CONFIG['DLEXT']} #{config_string('cleanlibs') {|t| t.gsub(/\$\*/) {n}}}
|
2009-01-26 21:03:54 -05:00
|
|
|
CLEANOBJS = *.#{$OBJEXT} #{config_string('cleanobjs') {|t| t.gsub(/\$\*/, "$(TARGET)#{deffile ? '-$(arch)': ''}")} if target} *.bak
|
2002-10-28 12:01:23 -05:00
|
|
|
|
2008-10-10 21:20:20 -04:00
|
|
|
all: #{$extout ? "install" : target ? "$(DLLIB)" : "Makefile"}
|
|
|
|
static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
|
2009-02-19 00:22:04 -05:00
|
|
|
.PHONY: all install static install-so install-rb
|
|
|
|
.PHONY: clean clean-so clean-rb
|
2006-09-16 03:06:57 -04:00
|
|
|
"
|
2002-10-28 12:01:23 -05:00
|
|
|
mfile.print CLEANINGS
|
2009-01-24 21:06:29 -05:00
|
|
|
fsep = config_string('BUILD_FILE_SEPARATOR') {|s| s unless s == "/"}
|
|
|
|
if fsep
|
2009-01-24 21:50:24 -05:00
|
|
|
sep = ":/=#{fsep}"
|
2009-01-24 21:06:29 -05:00
|
|
|
fseprepl = proc {|s|
|
|
|
|
s = s.gsub("/", fsep)
|
|
|
|
s = s.gsub(/(\$\(\w+)(\))/) {$1+sep+$2}
|
|
|
|
s = s.gsub(/(\$\{\w+)(\})/) {$1+sep+$2}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
fseprepl = proc {|s| s}
|
|
|
|
sep = ""
|
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
dirs = []
|
2004-02-09 03:48:55 -05:00
|
|
|
mfile.print "install: install-so install-rb\n\n"
|
2005-11-27 19:22:53 -05:00
|
|
|
sodir = (dir = "$(RUBYARCHDIR)").dup
|
2007-11-28 00:43:17 -05:00
|
|
|
mfile.print("install-so: ")
|
2004-04-02 04:00:12 -05:00
|
|
|
if target
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
f = "$(DLLIB)"
|
|
|
|
dest = "#{dir}/#{f}"
|
2007-11-28 00:43:17 -05:00
|
|
|
mfile.puts dir, "install-so: #{dest}"
|
2009-01-24 21:06:29 -05:00
|
|
|
if $extout
|
|
|
|
mfile.print "clean-so::\n"
|
|
|
|
mfile.print "\t@-$(RM) #{fseprepl[dest]}\n"
|
2010-08-07 01:19:29 -04:00
|
|
|
mfile.print "\t@-$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n"
|
2009-01-24 21:06:29 -05:00
|
|
|
else
|
2009-09-10 10:00:47 -04:00
|
|
|
mfile.print "#{dest}: #{f}\n\t@-$(MAKEDIRS) $(@D#{sep})\n"
|
|
|
|
mfile.print "\t$(INSTALL_PROG) #{fseprepl[f]} $(@D#{sep})\n"
|
2006-09-16 03:06:57 -04:00
|
|
|
if defined?($installed_list)
|
|
|
|
mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n"
|
|
|
|
end
|
2004-02-09 03:48:55 -05:00
|
|
|
end
|
2007-11-28 00:43:17 -05:00
|
|
|
else
|
|
|
|
mfile.puts "Makefile"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2005-04-02 09:39:38 -05:00
|
|
|
mfile.print("install-rb: pre-install-rb install-rb-default\n")
|
|
|
|
mfile.print("install-rb-default: pre-install-rb-default\n")
|
2005-10-19 20:42:43 -04:00
|
|
|
mfile.print("pre-install-rb: Makefile\n")
|
|
|
|
mfile.print("pre-install-rb-default: Makefile\n")
|
2005-02-06 09:51:44 -05:00
|
|
|
for sfx, i in [["-default", [["lib/**/*.rb", "$(RUBYLIBDIR)", "lib"]]], ["", $INSTALLFILES]]
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
files = install_files(mfile, i, nil, srcprefix) or next
|
|
|
|
for dir, *files in files
|
|
|
|
unless dirs.include?(dir)
|
|
|
|
dirs << dir
|
2005-04-02 09:39:38 -05:00
|
|
|
mfile.print "pre-install-rb#{sfx}: #{dir}\n"
|
2009-01-24 21:06:29 -05:00
|
|
|
end
|
2006-10-09 10:41:24 -04:00
|
|
|
for f in files
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
dest = "#{dir}/#{File.basename(f)}"
|
2010-08-04 02:52:18 -04:00
|
|
|
mfile.print("install-rb#{sfx}: #{dest} #{dir}\n")
|
|
|
|
mfile.print("#{dest}: #{f}\n")
|
2009-09-10 10:00:47 -04:00
|
|
|
mfile.print("\t$(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D#{sep})\n")
|
2006-09-16 03:06:57 -04:00
|
|
|
if defined?($installed_list) and !$extout
|
|
|
|
mfile.print("\t@echo #{dest}>>$(INSTALLED_LIST)\n")
|
|
|
|
end
|
2009-01-24 21:06:29 -05:00
|
|
|
if $extout
|
|
|
|
mfile.print("clean-rb#{sfx}::\n")
|
|
|
|
mfile.print("\t@-$(RM) #{fseprepl[dest]}\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if $extout
|
|
|
|
dirs.uniq!
|
|
|
|
unless dirs.empty?
|
|
|
|
mfile.print("clean-rb#{sfx}::\n")
|
2009-03-19 05:49:51 -04:00
|
|
|
for dir in dirs.sort_by {|d| -d.count('/')}
|
2010-08-07 01:19:29 -04:00
|
|
|
mfile.print("\t@-$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n")
|
2009-01-24 21:06:29 -05:00
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2002-06-10 21:27:48 -04:00
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2004-12-16 09:31:21 -05:00
|
|
|
dirs.unshift(sodir) if target and !dirs.include?(sodir)
|
2009-01-24 21:06:29 -05:00
|
|
|
dirs.each {|d| mfile.print "#{d}:\n\t$(MAKEDIRS) $@\n"}
|
2004-02-09 03:48:55 -05:00
|
|
|
|
|
|
|
mfile.print <<-SITEINSTALL
|
2002-10-23 14:52:29 -04:00
|
|
|
|
2004-02-09 03:48:55 -05:00
|
|
|
site-install: site-install-so site-install-rb
|
|
|
|
site-install-so: install-so
|
|
|
|
site-install-rb: install-rb
|
|
|
|
|
|
|
|
SITEINSTALL
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
|
2002-12-21 10:42:10 -05:00
|
|
|
return unless target
|
|
|
|
|
2009-08-06 00:00:38 -04:00
|
|
|
mfile.puts SRC_EXT.collect {|e| ".path.#{e} = $(VPATH)"} if $nmake == ?b
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
mfile.print ".SUFFIXES: .#{SRC_EXT.join(' .')} .#{$OBJEXT}\n"
|
|
|
|
mfile.print "\n"
|
|
|
|
|
2009-08-06 00:00:38 -04:00
|
|
|
CXX_EXT.each do |e|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
COMPILE_RULES.each do |rule|
|
2009-08-06 00:00:38 -04:00
|
|
|
mfile.printf(rule, e, $OBJEXT)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
mfile.printf("\n\t%s\n\n", COMPILE_CXX)
|
2000-08-03 05:50:41 -04:00
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2009-08-06 00:00:38 -04:00
|
|
|
%w[c].each do |e|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
COMPILE_RULES.each do |rule|
|
2009-08-06 00:00:38 -04:00
|
|
|
mfile.printf(rule, e, $OBJEXT)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
mfile.printf("\n\t%s\n\n", COMPILE_C)
|
|
|
|
end
|
|
|
|
end
|
2010-07-27 05:59:29 -04:00
|
|
|
%w[m].each do |e|
|
|
|
|
COMPILE_RULES.each do |rule|
|
|
|
|
mfile.printf(rule, e, $OBJEXT)
|
|
|
|
mfile.printf("\n\t%s\n\n", COMPILE_OBJC)
|
|
|
|
end
|
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
|
2004-02-09 04:20:52 -05:00
|
|
|
mfile.print "$(RUBYARCHDIR)/" if $extout
|
2009-01-03 21:11:33 -05:00
|
|
|
mfile.print "$(DLLIB): "
|
|
|
|
mfile.print "$(DEFFILE) " if makedef
|
2010-01-05 00:59:23 -05:00
|
|
|
mfile.print "$(OBJS) Makefile\n"
|
2006-12-14 10:20:14 -05:00
|
|
|
mfile.print "\t@-$(RM) $(@#{sep})\n"
|
2006-05-24 12:52:00 -04:00
|
|
|
mfile.print "\t@-$(MAKEDIRS) $(@D)\n" if $extout
|
|
|
|
link_so = LINK_SO.gsub(/^/, "\t")
|
2005-04-20 17:45:43 -04:00
|
|
|
if srcs.any?(&%r"\.(?:#{CXX_EXT.join('|')})\z".method(:===))
|
|
|
|
link_so = link_so.sub(/\bLDSHARED\b/, '\&XX')
|
|
|
|
end
|
|
|
|
mfile.print link_so, "\n\n"
|
2004-04-08 06:45:21 -04:00
|
|
|
unless $static.nil?
|
2010-01-05 00:59:23 -05:00
|
|
|
mfile.print "$(STATIC_LIB): $(OBJS)\n\t@-$(RM) $(@#{sep})\n\t"
|
|
|
|
mfile.print "$(AR) #{config_string('ARFLAGS') || 'cru '}$@ $(OBJS)"
|
2004-04-08 06:45:21 -04:00
|
|
|
config_string('RANLIB') do |ranlib|
|
|
|
|
mfile.print "\n\t@-#{ranlib} $(DLLIB) 2> /dev/null || true"
|
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
mfile.print "\n\n"
|
2003-12-18 07:48:43 -05:00
|
|
|
if makedef
|
2006-08-31 10:59:43 -04:00
|
|
|
mfile.print "$(DEFFILE): #{origdef}\n"
|
2003-12-18 07:48:43 -05:00
|
|
|
mfile.print "\t$(RUBY) #{makedef} #{origdef} > $@\n\n"
|
|
|
|
end
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2002-01-02 09:42:01 -05:00
|
|
|
depend = File.join(srcdir, "depend")
|
|
|
|
if File.exist?(depend)
|
2007-12-17 11:15:46 -05:00
|
|
|
mfile.print("###\n", *depend_rules(File.read(depend)))
|
2004-03-12 06:19:22 -05:00
|
|
|
else
|
2009-01-26 13:27:58 -05:00
|
|
|
headers = %w[$(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h]
|
2005-02-22 09:52:59 -05:00
|
|
|
if RULE_SUBST
|
2006-10-09 10:41:24 -04:00
|
|
|
headers.each {|h| h.sub!(/.*/, &RULE_SUBST.method(:%))}
|
2005-02-22 09:52:59 -05:00
|
|
|
end
|
2008-10-05 10:34:37 -04:00
|
|
|
headers << $config_h
|
2007-07-21 04:07:37 -04:00
|
|
|
headers << '$(RUBY_EXTCONF_H)' if $extconf_h
|
2005-02-22 09:52:59 -05:00
|
|
|
mfile.print "$(OBJS): ", headers.join(' '), "\n"
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
2005-02-06 09:51:44 -05:00
|
|
|
|
|
|
|
$makefile_created = true
|
2002-12-21 10:42:10 -05:00
|
|
|
ensure
|
2003-10-05 21:50:41 -04:00
|
|
|
mfile.close if mfile
|
1998-01-16 07:19:09 -05:00
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# :stopdoc:
|
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
def init_mkmf(config = CONFIG)
|
2005-02-06 09:51:44 -05:00
|
|
|
$makefile_created = false
|
|
|
|
$arg_config = []
|
2002-12-12 05:21:41 -05:00
|
|
|
$enable_shared = config['ENABLE_SHARED'] == 'yes'
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$defs = []
|
2006-05-25 19:44:08 -04:00
|
|
|
$extconf_h = nil
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$CFLAGS = with_config("cflags", arg_config("CFLAGS", config["CFLAGS"])).dup
|
2003-11-30 06:27:34 -05:00
|
|
|
$ARCH_FLAG = with_config("arch_flag", arg_config("ARCH_FLAG", config["ARCH_FLAG"])).dup
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$CPPFLAGS = with_config("cppflags", arg_config("CPPFLAGS", config["CPPFLAGS"])).dup
|
2006-09-25 09:26:40 -04:00
|
|
|
$LDFLAGS = with_config("ldflags", arg_config("LDFLAGS", config["LDFLAGS"])).dup
|
2008-08-17 02:58:10 -04:00
|
|
|
$INCFLAGS = "-I$(arch_hdrdir)"
|
|
|
|
$INCFLAGS << " -I$(hdrdir)/ruby/backward" unless $extmk
|
|
|
|
$INCFLAGS << " -I$(hdrdir) -I$(srcdir)"
|
2003-11-30 11:09:42 -05:00
|
|
|
$DLDFLAGS = with_config("dldflags", arg_config("DLDFLAGS", config["DLDFLAGS"])).dup
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$LIBEXT = config['LIBEXT'].dup
|
|
|
|
$OBJEXT = config["OBJEXT"].dup
|
|
|
|
$LIBS = "#{config['LIBS']} #{config['DLDLIBS']}"
|
2002-12-12 05:21:41 -05:00
|
|
|
$LIBRUBYARG = ""
|
2002-11-14 08:51:19 -05:00
|
|
|
$LIBRUBYARG_STATIC = config['LIBRUBYARG_STATIC']
|
|
|
|
$LIBRUBYARG_SHARED = config['LIBRUBYARG_SHARED']
|
2009-04-20 20:20:25 -04:00
|
|
|
$DEFLIBPATH = [$extmk ? "$(topdir)" : "$(libdir)"]
|
2007-04-23 09:08:29 -04:00
|
|
|
$DEFLIBPATH.unshift(".")
|
2007-02-28 04:26:07 -05:00
|
|
|
$LIBPATH = []
|
2008-02-04 21:14:17 -05:00
|
|
|
$INSTALLFILES = []
|
|
|
|
$NONINSTALLFILES = [/~\z/, /\A#.*#\z/, /\A\.#/, /\.bak\z/i, /\.orig\z/, /\.rej\z/, /\.l[ao]\z/, /\.o\z/]
|
2007-06-09 23:06:15 -04:00
|
|
|
$VPATH = %w[$(srcdir) $(arch_hdrdir)/ruby $(hdrdir)/ruby]
|
1999-08-13 01:45:20 -04:00
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$objs = nil
|
2005-03-31 08:24:27 -05:00
|
|
|
$srcs = nil
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$libs = ""
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
if $enable_shared or RbConfig.expand(config["LIBRUBY"].dup) != RbConfig.expand(config["LIBRUBY_A"].dup)
|
2002-12-12 05:21:41 -05:00
|
|
|
$LIBRUBYARG = config['LIBRUBYARG']
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
1999-08-13 01:45:20 -04:00
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$LOCAL_LIBS = ""
|
2004-01-08 20:05:27 -05:00
|
|
|
|
2004-03-23 00:32:01 -05:00
|
|
|
$cleanfiles = config_string('CLEANFILES') {|s| Shellwords.shellwords(s)} || []
|
2007-07-20 23:06:50 -04:00
|
|
|
$cleanfiles << "mkmf.log"
|
2004-03-23 00:32:01 -05:00
|
|
|
$distcleanfiles = config_string('DISTCLEANFILES') {|s| Shellwords.shellwords(s)} || []
|
2009-01-24 21:06:29 -05:00
|
|
|
$distcleandirs = config_string('DISTCLEANDIRS') {|s| Shellwords.shellwords(s)} || []
|
2004-01-08 20:05:27 -05:00
|
|
|
|
2004-02-09 04:20:52 -05:00
|
|
|
$extout ||= nil
|
2004-02-17 05:34:31 -05:00
|
|
|
$extout_prefix ||= nil
|
2004-02-09 03:48:55 -05:00
|
|
|
|
2005-02-06 09:51:44 -05:00
|
|
|
$arg_config.clear
|
2002-10-22 10:58:59 -04:00
|
|
|
dir_config("opt")
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2001-04-24 02:21:58 -04:00
|
|
|
|
2005-02-22 10:39:40 -05:00
|
|
|
FailedMessage = <<MESSAGE
|
2005-02-06 09:51:44 -05:00
|
|
|
Could not create Makefile due to some reason, probably lack of
|
|
|
|
necessary libraries and/or headers. Check the mkmf.log file for more
|
|
|
|
details. You may need configuration options.
|
|
|
|
|
|
|
|
Provided configuration options:
|
|
|
|
MESSAGE
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# Returns whether or not the Makefile was successfully generated. If not,
|
|
|
|
# the script will abort with an error message.
|
|
|
|
#
|
|
|
|
# Internal use only.
|
|
|
|
#
|
2005-02-06 09:51:44 -05:00
|
|
|
def mkmf_failed(path)
|
2005-03-20 08:51:48 -05:00
|
|
|
unless $makefile_created or File.exist?("Makefile")
|
2006-09-03 02:34:13 -04:00
|
|
|
opts = $arg_config.collect {|t, n| "\t#{t}#{n ? "=#{n}" : ""}\n"}
|
2005-02-22 10:39:40 -05:00
|
|
|
abort "*** #{path} failed ***\n" + FailedMessage + opts.join
|
2005-02-06 09:51:44 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2008-03-07 05:56:13 -05:00
|
|
|
# :startdoc:
|
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
init_mkmf
|
2002-03-29 02:42:20 -05:00
|
|
|
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$make = with_config("make-prog", ENV["MAKE"] || "make")
|
2003-01-19 14:14:22 -05:00
|
|
|
make, = Shellwords.shellwords($make)
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
$nmake = nil
|
|
|
|
case
|
|
|
|
when $mswin
|
2003-01-19 14:14:22 -05:00
|
|
|
$nmake = ?m if /nmake/i =~ make
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
when $bccwin
|
2003-01-19 14:14:22 -05:00
|
|
|
$nmake = ?b if /Borland/i =~ `#{make} -h`
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2010-08-08 11:18:46 -04:00
|
|
|
$ignore_error = $nmake ? '' : ' 2> /dev/null || true'
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
RbConfig::CONFIG["srcdir"] = CONFIG["srcdir"] =
|
2002-04-01 10:01:56 -05:00
|
|
|
$srcdir = arg_config("--srcdir", File.dirname($0))
|
2002-03-29 02:42:20 -05:00
|
|
|
$configure_args["--topsrcdir"] ||= $srcdir
|
2005-07-12 10:33:10 -04:00
|
|
|
if $curdir = arg_config("--curdir")
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
RbConfig.expand(curdir = $curdir.dup)
|
2005-07-12 10:33:10 -04:00
|
|
|
else
|
|
|
|
curdir = $curdir = "."
|
|
|
|
end
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
unless File.expand_path(RbConfig::CONFIG["topdir"]) == File.expand_path(curdir)
|
2005-01-31 10:19:27 -05:00
|
|
|
CONFIG["topdir"] = $curdir
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
RbConfig::CONFIG["topdir"] = curdir
|
2005-01-31 10:19:27 -05:00
|
|
|
end
|
2002-03-29 02:42:20 -05:00
|
|
|
$configure_args["--topdir"] ||= $curdir
|
* mkconfig.rb: generate RbConfig instead of Config.
* instruby.rb, rubytest.rb, runruby.rb, bcc32/Makefile.sub,
ext/extmk.rb, ext/dl/extconf.rb, ext/iconv/charset_alias.rb,
lib/mkmf.rb, lib/rdoc/ri/ri_paths.rb,
lib/webrick/httpservlet/cgihandler.rb,
test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb,
test/ruby/envutil.rb, test/soap/calc/test_calc_cgi.rb,
test/soap/header/test_authheader_cgi.rb, test/soap/ssl/test_ssl.rb,
win32/mkexports.rb, win32/resource.rb: Use RbConfig instead of
Config.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 03:34:53 -05:00
|
|
|
$ruby = arg_config("--ruby", File.join(RbConfig::CONFIG["bindir"], CONFIG["ruby_install_name"]))
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
|
2003-06-16 03:14:50 -04:00
|
|
|
split = Shellwords.method(:shellwords).to_proc
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
|
|
|
|
EXPORT_PREFIX = config_string('EXPORT_PREFIX') {|s| s.strip}
|
|
|
|
|
2008-07-01 08:13:13 -04:00
|
|
|
hdr = ['#include "ruby.h"' "\n"]
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
config_string('COMMON_MACROS') do |s|
|
2006-10-09 10:41:24 -04:00
|
|
|
Shellwords.shellwords(s).each do |w|
|
2006-10-19 22:33:49 -04:00
|
|
|
hdr << "#define " + w.split(/=/, 2).join(" ")
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
config_string('COMMON_HEADERS') do |s|
|
2006-10-09 10:41:24 -04:00
|
|
|
Shellwords.shellwords(s).each {|w| hdr << "#include <#{w}>"}
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2006-09-03 02:34:13 -04:00
|
|
|
COMMON_HEADERS = hdr.join("\n")
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
COMMON_LIBS = config_string('COMMON_LIBS', &split) || []
|
|
|
|
|
|
|
|
COMPILE_RULES = config_string('COMPILE_RULES', &split) || %w[.%s.%s:]
|
2005-02-22 09:52:59 -05:00
|
|
|
RULE_SUBST = config_string('RULE_SUBST')
|
2007-12-23 22:49:56 -05:00
|
|
|
COMPILE_C = config_string('COMPILE_C') || '$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<'
|
|
|
|
COMPILE_CXX = config_string('COMPILE_CXX') || '$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<'
|
2010-07-27 05:59:29 -04:00
|
|
|
COMPILE_OBJC = config_string('COMPILE_OBJC') || COMPILE_C
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
TRY_LINK = config_string('TRY_LINK') ||
|
2006-05-25 19:44:08 -04:00
|
|
|
"$(CC) #{OUTFLAG}conftest $(INCFLAGS) $(CPPFLAGS) " \
|
2003-12-26 10:34:33 -05:00
|
|
|
"$(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
LINK_SO = config_string('LINK_SO') ||
|
|
|
|
if CONFIG["DLEXT"] == $OBJEXT
|
2010-01-05 00:59:23 -05:00
|
|
|
"ld $(DLDFLAGS) -r -o $@ $(OBJS)\n"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
else
|
2010-01-05 00:59:23 -05:00
|
|
|
"$(LDSHARED) #{OUTFLAG}$@ $(OBJS) " \
|
2007-04-23 09:08:29 -04:00
|
|
|
"$(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)"
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
end
|
2004-06-28 01:58:13 -04:00
|
|
|
LIBPATHFLAG = config_string('LIBPATHFLAG') || ' -L"%s"'
|
2003-10-30 22:58:21 -05:00
|
|
|
RPATHFLAG = config_string('RPATHFLAG') || ''
|
* configure.in (XCFLAGS): CFLAGS to comile ruby itself.
* configure.in (LIBEXT): suffix for static libraries.
* configure.in (LIBPATHFLAG): switch template to specify library
path.
* configure.in (LINK_SO): command to link shared objects.
* configure.in (DEFFILE, ARCHFILE): miscellaneous system dependent
files.
* configure.in (EXPORT_PREFIX): prefix to exported symbols on
Windows.
* configure.in (COMMON_LIBS, COMMON_MACROS, COMMON_HEADERS):
libraries, macros and headers used in common.
* configure.in (RUBYW_INSTALL_NAME, rubyw_install_name): GUI mode
excutable name.
* Makefile.in (CFLAGS): append XCFLAGS.
* Makefile.in (PREP): miscellaneous system dependent files.
* Makefile.in (ruby.imp, ext/extinit.o): moved from ext/extmk.rb.
* Makefile.in (fake.rb): CROSS_COMPILING keeps building platform.
* Makefile.in (MAKEFILES): depend on *.in and config.status.
* Makefile.in (parse.c): replace "y.tab.c" with actual name for
byacc.
* ext/extmk.rb, lib/mkmf.rb: integrated.
* ext/extmk.rb: propagate MFLAGS.
* ext/extmk.rb (extmake): make dummy Makefile to clean even if no
Makefile is made.
* lib/mkmf.rb (older): accept multiple file names and Time
objects.
* lib/mkmf.rb (xsystem): split and qoute.
* lib/mkmf.rb (cpp_include): make include directives.
* lib/mkmf.rb (try_func): try wheather specified function is
available.
* lib/mkmf.rb (install_files): default to site-install.
* lib/mkmf.rb (checking_for): added.
* lib/mkmf.rb (find_executable0): just find executable file with
no message.
* lib/mkmf.rb (create_header): output header file is variable.
* lib/mkmf.rb (create_makefile): separate sections.
* lib/mkmf.rb (init_mkmf): initialize global variables.
* win32/Makefile.sub, bcc32/Makefile.sub (CPP, AR): added.
* bcc32/Makefile.sub (ARCH): fixed to i386.
* win32/Makefile.sub, bcc32/Makefile.sub (miniruby): should not
link EXTOBJS.
* ext/dl/extconf.rb: use try_cpp to cross compile.
* ext/dl/extconf.rb: not modify files in source directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-21 10:03:46 -04:00
|
|
|
LIBARG = config_string('LIBARG') || '-l%s'
|
2008-08-31 04:52:56 -04:00
|
|
|
MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || 'int main() {return 0;}'
|
2009-04-08 01:00:07 -04:00
|
|
|
UNIVERSAL_INTS = config_string('UNIVERSAL_INTS') {|s| Shellwords.shellwords(s)} ||
|
|
|
|
%w[int short long long\ long]
|
2002-10-28 12:01:23 -05:00
|
|
|
|
2009-03-13 21:39:15 -04:00
|
|
|
sep = config_string('BUILD_FILE_SEPARATOR') {|s| ":/=#{s}" if s != "/"} || ""
|
2002-10-28 12:01:23 -05:00
|
|
|
CLEANINGS = "
|
2009-01-24 21:06:29 -05:00
|
|
|
clean-rb-default::
|
|
|
|
clean-rb::
|
|
|
|
clean-so::
|
|
|
|
clean: clean-so clean-rb-default clean-rb
|
2008-10-10 21:20:20 -04:00
|
|
|
\t\t@-$(RM) $(CLEANLIBS#{sep}) $(CLEANOBJS#{sep}) $(CLEANFILES#{sep})
|
2002-10-28 12:01:23 -05:00
|
|
|
|
2009-01-24 21:06:29 -05:00
|
|
|
distclean-rb-default::
|
|
|
|
distclean-rb::
|
|
|
|
distclean-so::
|
|
|
|
distclean: clean distclean-so distclean-rb-default distclean-rb
|
2008-10-10 21:20:20 -04:00
|
|
|
\t\t@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
|
|
|
\t\t@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES#{sep})
|
2010-08-07 01:19:29 -04:00
|
|
|
\t\t@-$(RMDIRS) $(DISTCLEANDIRS#{sep})#{$ignore_error}
|
2002-10-28 12:01:23 -05:00
|
|
|
|
2008-10-10 21:20:20 -04:00
|
|
|
realclean: distclean
|
2002-10-28 12:01:23 -05:00
|
|
|
"
|
2005-02-06 09:51:44 -05:00
|
|
|
|
|
|
|
if not $extmk and /\A(extconf|makefile).rb\z/ =~ File.basename($0)
|
|
|
|
END {mkmf_failed($0)}
|
|
|
|
end
|