Skip to content

Commit

Permalink
better AIX support
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Apr 27, 1999
1 parent e67e5ad commit e975828
Show file tree
Hide file tree
Showing 11 changed files with 1,260 additions and 15 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,5 +1,11 @@
Mon Apr 26 16:46:59 1999 Yukihiro Matsumoto <matz@netlab.co.jp>

* ext/extmk.rb.in: AIX shared library support modified.

* ext/aix_mksym.rb: ditto.

* configure.in: ditto.

* sprintf.c (rb_f_sprintf): should allocate proper sized buffer
for float numbers.

Expand Down
8 changes: 4 additions & 4 deletions Makefile.in
Expand Up @@ -13,8 +13,7 @@ AUTOCONF = autoconf

prefix = @prefix@
CFLAGS = @CFLAGS@ -I. -I@srcdir@ -I@includedir@
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
XLDFLAGS = @XLDFLAGS@
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ @XLDFLAGS@
EXTLIBS =
LIBS = @LIBS@ $(EXTLIBS)
MISSING = @LIBOBJS@ @ALLOCA@
Expand Down Expand Up @@ -86,7 +85,7 @@ all: miniruby$(binsuffix) rbconfig.rb

miniruby$(binsuffix): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.o
@rm -f $@
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) dmyext.o $(LIBRUBY_A) $(LIBS) -o $@
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.o $(LIBRUBY_A) $(LIBS) -o $@

$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS)
@rm -f $@
Expand All @@ -112,10 +111,11 @@ clean:; @rm -f $(OBJS) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY_ALIASES) $(MAINOBJ)
distclean: clean
@rm -f Makefile ext/extmk.rb config.h
@rm -f ext/config.cache config.cache config.log config.status
@rm -f parse.c *~ core *.core gmon.out y.tab.c y.output
@rm -f *~ core *.core gmon.out y.tab.c y.output ruby.imp
@rm -f $(PROGRAM) miniruby$(binsuffix)

realclean: distclean
@rm -f parse.c
@rm -f lex.c

test: miniruby$(binsuffix)
Expand Down
4 changes: 2 additions & 2 deletions configure
Expand Up @@ -4008,8 +4008,8 @@ echo "configure:3935: checking whether OS depend dynamic link works" >&5
DLDFLAGS="$ARCH_FLAG"
rb_cv_dlopen=yes ;;
aix*) LDSHARED='/usr/ccs/bin/ld'
XLDFLAGS="-Wl,-bE:ruby.imp"
DLDFLAGS="-eInit_$(TARGET) -bI:$(ruby_inc)/ruby.imp -bM:SRE -T512 -H512 -lc"
XLDFLAGS='-Wl,-bE:ruby.imp'
DLDFLAGS='-eInit_$(TARGET) -bI:$(ruby_inc)/ruby.imp -bM:SRE -T512 -H512 -lc'
rb_cv_dlopen=yes ;;

human*) DLDFLAGS=''
Expand Down
4 changes: 2 additions & 2 deletions configure.in
Expand Up @@ -449,8 +449,8 @@ if test "$with_dln_a_out" != yes; then
DLDFLAGS="$ARCH_FLAG"
rb_cv_dlopen=yes ;;
aix*) LDSHARED='/usr/ccs/bin/ld'
XLDFLAGS="-Wl,-bE:ruby.imp"
DLDFLAGS="-eInit_$(TARGET) -bI:$(ruby_inc)/ruby.imp -bM:SRE -T512 -H512 -lc"
XLDFLAGS='-Wl,-bE:ruby.imp'
DLDFLAGS='-eInit_$(TARGET) -bI:$(ruby_inc)/ruby.imp -bM:SRE -T512 -H512 -lc'
rb_cv_dlopen=yes ;;

human*) DLDFLAGS=''
Expand Down
4 changes: 1 addition & 3 deletions ext/aix_mksym.rb
Expand Up @@ -30,6 +30,4 @@ def extract(nm, out)
exp.close
nm.close
end
if older("../ruby.imp", "../miniruby")
extract(open("|/usr/ccs/bin/nm -p ../*.o"), "../ruby.imp")
end
extract(open("|/usr/ccs/bin/nm -p ../*.o"), "../ruby.imp")
8 changes: 4 additions & 4 deletions ext/extmk.rb.in
Expand Up @@ -30,9 +30,9 @@ if $topdir !~ "^/"
# get absolute path
$topdir = File.expand_path($topdir)
end
$ruby_inc = "@top_srcdir@"
$ruby_inc = $top_srcdir

load '@top_srcdir@/lib/find.rb'
load "#{$top_srcdir}/lib/find.rb"

## drive letter
if PLATFORM == "i386-os2_emx" then
Expand Down Expand Up @@ -497,8 +497,8 @@ for d in Dir["#{$top_srcdir}/ext/*"]
print "cleaning ", d, "\n"
else
print "compiling ", d, "\n"
if PLATFORM =~ /ibm-aix/
load './aix_mksym.rb'
if PLATFORM =~ /-aix/ and older("../ruby.imp", "../miniruby")
load "#{$top_srcdir}/ext/aix_mksym.rb"
end
end
extmake(d)
Expand Down
6 changes: 6 additions & 0 deletions missing/finite.c
@@ -0,0 +1,6 @@
int
finite(n)
double n;
{
return !isnan(n) && !isinf(n);
}
18 changes: 18 additions & 0 deletions missing/isinf.c
@@ -0,0 +1,18 @@
static double zero() { return 0.0; }
static double one() { return 1.0; }
static double inf() { return one() / zero(); }

int
isinf(n)
double n;
{
static double pinf = 0.0;
static double ninf = 0.0;

if (pinf == 0.0) {
pinf = inf();
ninf = -pinf;
}
return memcmp(&n, &pinf, sizeof n) == 0
|| memcmp(&n, &ninf, sizeof n) == 0;
}
18 changes: 18 additions & 0 deletions missing/isnan.c
@@ -0,0 +1,18 @@
static int double_ne();

int
isnan(n)
double n;
{
return double_ne(n, n);
}

static
int
double_ne(n1, n2)
double n1, n2;
{
return n1 != n2;
}


0 comments on commit e975828

Please sign in to comment.