sysconfdir on Windows

* ext/etc/etc.c (etc_sysconfdir): mentioned special case on
  Windows.  [ruby-core:43110] [Bug #6121]

* ext/etc/extconf.rb: define SYSCONFDIR only if sysconfdir is set
  in RbConfig::CONFIG and not empty.

* win32/Makefile.sub (config.status): sysconfdir is not used on
  Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-10-24 13:48:08 +00:00
parent 9885c1c79f
commit 8fc8587e05
4 changed files with 10 additions and 6 deletions

View File

@ -512,6 +512,7 @@ AS_CASE(["$target_os"],
RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]` RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
test "$RT_VER" = "" && RT_VER=60 test "$RT_VER" = "" && RT_VER=60
AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER) AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
sysconfdir=
]) ])
: ${enable_shared=yes} : ${enable_shared=yes}
], ],

View File

@ -628,7 +628,8 @@ VALUE rb_w32_conv_from_wchar(const WCHAR *wstr, rb_encoding *enc);
* *
* This is typically "/etc", but is modified by the prefix used when Ruby was * This is typically "/etc", but is modified by the prefix used when Ruby was
* compiled. For example, if Ruby is built and installed in /usr/local, returns * compiled. For example, if Ruby is built and installed in /usr/local, returns
* "/usr/local/etc". * "/usr/local/etc" on other than Windows. On Windows, this returns system
* provided directory always.
*/ */
static VALUE static VALUE
etc_sysconfdir(VALUE obj) etc_sysconfdir(VALUE obj)

View File

@ -12,8 +12,10 @@ have_func("uname((struct utsname *)NULL)", headers)
have_func("getlogin") have_func("getlogin")
have_func("getpwent") have_func("getpwent")
have_func("getgrent") have_func("getgrent")
sysconfdir = RbConfig.expand(RbConfig::CONFIG["sysconfdir"].dup, "prefix"=>"", "DESTDIR"=>"") if (sysconfdir = RbConfig::CONFIG["sysconfdir"] and
$defs.push("-DSYSCONFDIR=#{Shellwords.escape(sysconfdir.dump)}") !RbConfig.expand(sysconfdir.dup, "prefix"=>"", "DESTDIR"=>"").empty?)
$defs.push("-DSYSCONFDIR=#{Shellwords.escape(sysconfdir.dump)}")
end
have_func("sysconf") have_func("sysconf")
have_func("confstr") have_func("confstr")

View File

@ -829,9 +829,9 @@ s,@bindir@,$${exec_prefix}/bin,;t t
s,@sbindir@,$${exec_prefix}/sbin,;t t s,@sbindir@,$${exec_prefix}/sbin,;t t
s,@libexecdir@,$${exec_prefix}/libexec,;t t s,@libexecdir@,$${exec_prefix}/libexec,;t t
s,@datadir@,$${prefix}/share,;t t s,@datadir@,$${prefix}/share,;t t
s,@sysconfdir@,$${prefix}/etc,;t t s,@sysconfdir@,,;t t
s,@sharedstatedir@,/etc,;t t s,@sharedstatedir@,$${prefix}/com,;t t
s,@localstatedir@,/var,;t t s,@localstatedir@,$${prefix}/var,;t t
s,@libdir@,$${exec_prefix}/$(libdir_basename),;t t s,@libdir@,$${exec_prefix}/$(libdir_basename),;t t
s,@includedir@,$${prefix}/include,;t t s,@includedir@,$${prefix}/include,;t t
s,@oldincludedir@,/usr/include,;t t s,@oldincludedir@,/usr/include,;t t