summaryrefslogtreecommitdiff
path: root/ext/etc
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-05 04:43:17 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-05 04:43:17 +0000
commitac376af4f42ca83fc178a0f8911f542e1bc5e8f1 (patch)
treeabee653bfd09ab04a700fffe88b8383f326aaac3 /ext/etc
parent9307e0402b62bdb1bede1960bb21662d6fd8771d (diff)
* ext/etc/extconf.rb: use egrep_cpp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/etc')
-rw-r--r--ext/etc/extconf.rb13
1 files changed, 2 insertions, 11 deletions
diff --git a/ext/etc/extconf.rb b/ext/etc/extconf.rb
index 6fe8810..b920d91 100644
--- a/ext/etc/extconf.rb
+++ b/ext/etc/extconf.rb
@@ -1,17 +1,8 @@
require 'mkmf'
def etc_grep_header(field)
- f = open("conftest.c", "w")
- f.print <<EOF
-#include <pwd.h>
-EOF
- f.close
- begin
- if xsystem("#{CPP} | egrep #{field}")
- $defs.push(format("-D%s", field.upcase))
- end
- ensure
- system "rm -f conftest.c"
+ if egrep_cpp(field, "#include <pwd.h>\n")
+ $defs.push(format("-D%s", field.upcase))
end
end