summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 02:45:15 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 02:45:15 +0000
commit6536fb84b35a5ef03fcc0b22cd34f1122d53d976 (patch)
treef6dc9277400077a0cc7c102fef65e72d11153938 /ext
parent9d04ee7eddb098f0450f3e6b1c1ab5f6e81b3c48 (diff)
1.1c6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/aix_ld.rb2
-rw-r--r--ext/etc/etc.c5
-rw-r--r--ext/etc/extconf.rb23
-rw-r--r--ext/extmk.rb.in31
-rw-r--r--ext/tcltklib/extconf.rb11
5 files changed, 45 insertions, 27 deletions
diff --git a/ext/aix_ld.rb b/ext/aix_ld.rb
index 1058977b88..42b2087a46 100644
--- a/ext/aix_ld.rb
+++ b/ext/aix_ld.rb
@@ -43,7 +43,7 @@ def extract(nm, out)
else
next
end
- }.sort!
+ }.compact!.sort!
uniq(data)
exp = open(out, "w")
for line in data
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 7bb7796663..1cf06768c8 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -239,7 +239,10 @@ Init_etc()
sPasswd = struct_define("Passwd",
"name", "passwd", "uid", "gid",
- "gecos", "dir", "shell",
+#ifdef PW_GECOS
+ "gecos",
+#endif
+ "dir", "shell",
#ifdef PW_CHANGE
"change",
#endif
diff --git a/ext/etc/extconf.rb b/ext/etc/extconf.rb
index a02ff8c091..4cf04a3ec3 100644
--- a/ext/etc/extconf.rb
+++ b/ext/etc/extconf.rb
@@ -1,8 +1,31 @@
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"
+ end
+end
+
have_library("sun", "getpwnam") # NIS (== YP) interface for IRIX 4
a = have_func("getlogin")
b = have_func("getpwent")
c = have_func("getgrent")
if a or b or c
+ etc_grep_header("pw_gecos")
+ etc_grep_header("pw_change")
+ etc_grep_header("pw_quota")
+ etc_grep_header("pw_age")
+ etc_grep_header("pw_class")
+ etc_grep_header("pw_comment")
+ etc_grep_header("pw_expire")
create_makefile("etc")
end
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index e0e4569870..e8dc56604f 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -1,7 +1,7 @@
#! /usr/local/bin/ruby
$".push 'mkmf.rb' #"
-require 'find'
+load '../lib/find.rb'
if ARGV[0] == 'static'
$force_static = TRUE
@@ -319,7 +319,7 @@ clean:; @rm -f *.o *.so *.sl
realclean: clean
", target,
- if $static then "o" else "@DLEXT@" end, $dots, $dots
+ if $static then "a" else "@DLEXT@" end, $dots, $dots
mfile.printf "\
@@ -335,7 +335,13 @@ install:
install_rb(mfile)
mfile.printf "\n"
- if !$static && "@DLEXT@" != "o"
+ if $static
+ mfile.printf "\
+$(TARGET): $(OBJS)
+ @AR@ cru $(TARGET) $(OBJS)
+ @-@RANLIB@ $(LIBRUBY) 2> /dev/null || true
+"
+ elsif "@DLEXT@" != "o"
mfile.printf "\
$(TARGET): $(OBJS)
$(LDSHARED) $(DLDFLAGS) -o $(TARGET) $(OBJS) $(LOCAL_LIBS) $(LIBS)
@@ -346,26 +352,11 @@ $(TARGET): $(OBJS)
$(TARGET): $(OBJS)
ar cru $(TARGET) $(OBJS)
"
- elsif PLATFORM =~ "-nextstep"
- mfile.printf "\
-$(TARGET): $(OBJS)
- cc -r $(CFLAGS) -o $(TARGET) $(OBJS)
-"
- elsif PLATFORM =~ "-openstep"
+ elsif PLATFORM =~ "-nextstep" || PLATFORM =~ "-openstep" || PLATFORM =~ "-rhapsody"
mfile.printf "\
$(TARGET): $(OBJS)
cc -r $(CFLAGS) -o $(TARGET) $(OBJS)
"
- elsif PLATFORM =~ "-rhapsody"
- mfile.printf "\
-$(TARGET): $(OBJS)
- cc -r $(CFLAGS) -o $(TARGET) $(OBJS)
-"
- elsif $static
- mfile.printf "\
-$(TARGET): $(OBJS)
- ld -r -o $(TARGET) $(OBJS)
-"
else
mfile.printf "\
$(TARGET): $(OBJS)
@@ -505,7 +496,7 @@ exit if $install or $clean
$extinit = "" unless $extinit
if $extlist.size > 0
for s,t in $extlist
- f = format("%s/%s.o", s, t)
+ f = format("%s/%s.a", s, t)
if File.exist?(f)
$extinit += format("\
\tInit_%s();\n\
diff --git a/ext/tcltklib/extconf.rb b/ext/tcltklib/extconf.rb
index 55cdc498c4..14c8e45ae5 100644
--- a/ext/tcltklib/extconf.rb
+++ b/ext/tcltklib/extconf.rb
@@ -11,9 +11,10 @@ $includes = []
def search_header(include, *path)
pwd = Dir.getwd
begin
- for i in path.reverse!
+ for i in path.sort!.reverse!
dir = Dir[i]
for path in dir
+ next unless File.directory? path
Dir.chdir path
files = Dir[include]
if files.size > 0
@@ -30,14 +31,14 @@ def search_header(include, *path)
end
search_header("tcl.h",
- "/usr/include/tcl*",
+ "/usr/include/tcl{,8*,7*}",
"/usr/include",
- "/usr/local/include/tcl*",
+ "/usr/local/include/tcl{,8*,7*}",
"/usr/local/include")
search_header("tk.h",
- "/usr/include/tk*",
+ "/usr/include/tk{,8*,4*}",
"/usr/include",
- "/usr/local/include/tk*",
+ "/usr/local/include/tk{,8*,4*}",
"/usr/local/include")
search_header("X11/Xlib.h",
"/usr/include/X11*",