    Subject: [ruby-dev:9048] [PATCH] OS/2 patch improved for 1.5.0
    From: kenn@hma.att.ne.jp
    Date: Tue, 1 Feb 2000 04:00:17 +0900
    --Multipart_Sun_Jan_30_08:01:57_2000-1
    Content-Type: text/plain; charset=ISO-2022-JP

    長沢です。

    某ML での「OMF Object format 対応」の成果をフィードバックします。

    # あ、OS/2 上での話です。

    まだちょっと system() 周りが怪しいため make test が完遂しないんですが、
    それは今後の課題、ということで。

    #多分それは、私が切った貼ったででっちあげた missing/os2.c のコードのせい(^^;;

    あと、ext/pty.c への差分は「seteuid も setreuid も setresuid も無い環
    境ではmake が通らない」点の修正です。

    1.5.0 への差分になってます。

    --Multipart_Sun_Jan_30_08:01:57_2000-1
    Content-Type: text/plain; type=patch; charset=US-ASCII
    Content-Disposition: attachment; filename="rubyos2.patch"
    Content-Transfer-Encoding: 7bit

    diff -ru2p ruby/Makefile.in ruby-1.5/Makefile.in
    --- ruby/Makefile.in	Sun Jan 30 07:33:25 2000
    +++ ruby-1.5/Makefile.in	Sun Jan 30 06:38:50 2000
    @@ -12,4 +12,6 @@ AUTOCONF = autoconf
     @SET_MAKE@

    +.SUFFIXES: .obj
    +
     prefix = @prefix@
     CFLAGS = @CFLAGS@
    diff -ru2p ruby/configure.in ruby-1.5/configure.in
    --- ruby/configure.in	Sun Jan 30 07:33:28 2000
    +++ ruby-1.5/configure.in	Sun Jan 30 06:37:50 2000
    @@ -145,4 +145,7 @@ human*)		ac_cv_func_getpgrp_void=yes;;
     beos*)		;;
     cygwin*)	;;
    +os2_emx*)	LIBS="-lm $LIBS"
    +		ac_cv_lib_xpg4_setlocale=no
    +		ac_cv_lib_dir_opendir=no;;
     *) LIBS="-lm $LIBS";;
     esac
    @@ -526,6 +529,6 @@ else
         cygwin*)	DLEXT=dll
     	 	AC_DEFINE(DLEXT, ".dll");;
    -    os2_emx)	DLEXT=o
    -	 	AC_DEFINE(DLEXT, ".so");;
    +    os2_emx*)	DLEXT=dll
    +	 	AC_DEFINE(DLEXT, ".dll");;
         *)		DLEXT=so
         		AC_DEFINE(DLEXT, ".so");;
    @@ -611,5 +614,5 @@ rb_cv_missing_fconvert=yes, rb_cv_missin
       dnl OS/2 environment w/ Autoconf 2.1x for EMX
       os2_emx)
    -    LIBOBJS="$LIBOBJS os2.o"
    +    LIBOBJS="$LIBOBJS os2.$OBJEXT"
         setup=Setup.emx
         ;;
    diff -ru2p ruby/ext/etc/extconf.rb ruby-1.5/ext/etc/extconf.rb
    --- ruby/ext/etc/extconf.rb	Sun Jan 30 07:33:30 2000
    +++ ruby-1.5/ext/etc/extconf.rb	Sun Jan 30 06:48:02 2000
    @@ -16,5 +16,7 @@ EOF
     end

    -have_library("sun", "getpwnam")	# NIS (== YP) interface for IRIX 4
    +if /i386-os2/ !~ RUBY_PLATFORM
    +  have_library("sun", "getpwnam")	# NIS (== YP) interface for IRIX 4
    +end
     a = have_func("getlogin")
     b = have_func("getpwent")
    diff -ru2p ruby/ext/extmk.rb.in ruby-1.5/ext/extmk.rb.in
    --- ruby/ext/extmk.rb.in	Sun Jan 30 07:33:30 2000
    +++ ruby-1.5/ext/extmk.rb.in	Sun Jan 30 06:43:30 2000
    @@ -461,8 +461,18 @@ $(DLLIB): $(OBJS)
       end

    +  if /i386-os2_emx/ =~ RUBY_PLATFORM
    +    if  $OBJEXT != "o"
    +    mfile.printf "\
    +$(OBJS):
    +	$(CC) $(CFLAGS) -c $<
    +"
    +    end
    +  end
    +
       if File.exist?("#{$srcdir}/depend")
         dfile = open("#{$srcdir}/depend", "r")
         mfile.printf "###\n"
         while line = dfile.gets()
    +      line = line.gsub(/\.o/, ".#{$OBJEXT}")
           mfile.printf "%s", line.gsub('\$\(hdrdir\)/config.h', '$(topdir)/config.h')
         end
    @@ -501,5 +511,5 @@ def extmake(target)
       $local_flags = ""
       case RUBY_PLATFORM
    -  when /cygwin|beos|openstep|nextstep|rhapsody/
    +  when /cygwin|beos|openstep|nextstep|rhapsody|i386-os2_emx/
         $libs = ""
       when /mswin32/
    diff -ru2p ruby/ext/pty/pty.c ruby-1.5/ext/pty/pty.c
    --- ruby/ext/pty/pty.c	Sun Jan 30 07:33:32 2000
    +++ ruby-1.5/ext/pty/pty.c	Sun Jan 30 06:54:24 2000
    @@ -283,5 +283,7 @@ establishShell(shellname, info)
     	close(slave);

    +#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRESUID)
     	seteuid(getuid());
    +#endif

     	argc = 0;

    --Multipart_Sun_Jan_30_08:01:57_2000-1
    Content-Type: text/plain; charset=ISO-2022-JP

    --
                               長沢　研二         - HGF01572@nifty.ne.jp -
                                                  -   kenn@hma.att.ne.jp -
                                          /// Team OS/2 J at HAMAMATSU ///

    --Multipart_Sun_Jan_30_08:01:57_2000-1--