summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-25 09:42:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-25 09:42:47 +0000
commit8b1e7e34403977058d412931e31577df719fd2e4 (patch)
tree7743656749f91b601f3d025ea357e8a8043424d8 /ext
parent45c61f40b23b14e97428206e1b813eb813526e6f (diff)
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/curses/curses.c19
-rw-r--r--ext/extmk.rb.in21
2 files changed, 33 insertions, 7 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index ec7c6c6002..a2fbe182fa 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -333,7 +333,11 @@ curses_addstr(obj, str)
VALUE obj;
VALUE str;
{
- addstr(STR2CSTR(str));
+ char *s = STR2CSTR(str);
+
+ if (s) {
+ addstr(s);
+ }
return Qnil;
}
@@ -681,11 +685,14 @@ window_addstr(obj, str)
VALUE obj;
VALUE str;
{
- struct windata *winp;
-
- GetWINDOW(obj, winp);
- waddstr(winp->window, STR2CSTR(str));
-
+ char *s = STR2CSTR(str);
+
+ if (s) {
+ struct windata *winp;
+
+ GetWINDOW(obj, winp);
+ waddstr(winp->window, s);
+ }
return Qnil;
}
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 77f42d7072..14374c2249 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -225,6 +225,17 @@ def create_makefile(target)
$defs.push(format("-DEXTLIB='%s'", libs.join(",")))
end
+ $DLDFLAGS = '@DLDFLAGS@'
+
+ if PLATFORM =~ /beos/
+ if $libs
+ $libs = $libs + " -lruby"
+ else
+ $libs = "-lruby"
+ end
+ $DLDFLAGS = $DLDFLAGS + " -L" + $topdir
+ end
+
$srcdir = $topdir + "/ext/" + target
mfile = open("Makefile", "w")
mfile.printf "\
@@ -241,7 +252,7 @@ CC = @CC@
prefix = @prefix@
CFLAGS = %s -I#{$topdir} -I@includedir@ %s #$CFLAGS %s
-DLDFLAGS = @DLDFLAGS@ #$LDFLAGS
+DLDFLAGS = #$DLDFLAGS #$LDFLAGS
LDSHARED = @LDSHARED@
", if $static then "" else "@CCDLFLAGS@" end, CFLAGS, $defs.join(" ")
@@ -343,6 +354,14 @@ $(TARGET): $(OBJS)
dfile.close
end
mfile.close
+
+ if PLATFORM =~ /beos/
+ print "creating ruby.def\n"
+ open("ruby.def", "w") do |file|
+ file.print("EXPORTS\n") if PLATFORM =~ /^i/
+ file.print("Init_#{target}\n")
+ end
+ end
end
def extmake(target)