aboutsummaryrefslogtreecommitdiffstats
path: root/ext/etc/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/etc/extconf.rb')
-rw-r--r--ext/etc/extconf.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/etc/extconf.rb b/ext/etc/extconf.rb
index 1e679b5d0b..20a7dd00d6 100644
--- a/ext/etc/extconf.rb
+++ b/ext/etc/extconf.rb
@@ -12,8 +12,10 @@ have_func("uname((struct utsname *)NULL)", headers)
have_func("getlogin")
have_func("getpwent")
have_func("getgrent")
-sysconfdir = RbConfig.expand(RbConfig::CONFIG["sysconfdir"].dup, "prefix"=>"", "DESTDIR"=>"")
-$defs.push("-DSYSCONFDIR=#{Shellwords.escape(sysconfdir.dump)}")
+if (sysconfdir = RbConfig::CONFIG["sysconfdir"] and
+ !RbConfig.expand(sysconfdir.dup, "prefix"=>"", "DESTDIR"=>"").empty?)
+ $defs.push("-DSYSCONFDIR=#{Shellwords.escape(sysconfdir.dump)}")
+end
have_func("sysconf")
have_func("confstr")