mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
support mingw32.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9da4f78db4
commit
6d53b692ab
25 changed files with 327 additions and 228 deletions
|
@ -2,7 +2,7 @@
|
|||
Win32API - Ruby Win32 API Import Facility
|
||||
*/
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#if !defined _MSC_VER && !defined NT
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
case PLATFORM
|
||||
case RUBY_PLATFORM
|
||||
when /cygwin/,/mingw/
|
||||
$CFLAGS = "-fno-defer-pop"
|
||||
create_makefile("Win32API")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'mkmf'
|
||||
|
||||
make=false
|
||||
have_library("mytinfo", "tgetent") if /bow/ =~ PLATFORM
|
||||
have_library("mytinfo", "tgetent") if /bow/ =~ RUBY_PLATFORM
|
||||
if have_header("ncurses.h") and have_library("ncurses", "initscr")
|
||||
make=true
|
||||
elsif have_header("ncurses/curses.h") and have_library("ncurses", "initscr")
|
||||
|
|
|
@ -53,7 +53,7 @@ end
|
|||
LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s conftest.c %s %s @LIBS@"
|
||||
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s conftest.c"
|
||||
|
||||
if /cygwin|mswin32|djgpp|mingw32|m68k-human|i386-os2_emx/i =~ RUBY_PLATFORM
|
||||
if /cygwin|mswin32|djgpp|mingw|m68k-human|i386-os2_emx/i =~ RUBY_PLATFORM
|
||||
$null = open("nul", "w")
|
||||
else
|
||||
$null = open("/dev/null", "w")
|
||||
|
@ -158,7 +158,7 @@ end
|
|||
def have_library(lib, func="main")
|
||||
if func && func != ""
|
||||
libs = append_library($libs, lib)
|
||||
if /mswin32/ =~ RUBY_PLATFORM
|
||||
if /mswin32|mingw/ =~ RUBY_PLATFORM
|
||||
r = try_link(<<"SRC", libs)
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
|
@ -210,7 +210,7 @@ end
|
|||
def have_func(func)
|
||||
libs = $libs
|
||||
|
||||
if /mswin32/ =~ RUBY_PLATFORM
|
||||
if /mswin32|mingw/ =~ RUBY_PLATFORM
|
||||
r = try_link(<<"SRC", libs)
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
|
@ -253,7 +253,7 @@ def arg_config(config, default=nil)
|
|||
unless defined? $configure_args
|
||||
$configure_args = {}
|
||||
args = "@configure_args@"
|
||||
if /mswin32/ =~ RUBY_PLATFORM and ENV["CONFIGURE_ARGS"]
|
||||
if /mswin32|mingw/ =~ RUBY_PLATFORM and ENV["CONFIGURE_ARGS"]
|
||||
args = args + " " + ENV["CONFIGURE_ARGS"]
|
||||
end
|
||||
for arg in args.split
|
||||
|
@ -340,7 +340,7 @@ def create_makefile(target)
|
|||
end
|
||||
|
||||
defflag = ''
|
||||
if RUBY_PLATFORM =~ /cygwin/ and not $static
|
||||
if RUBY_PLATFORM =~ /cygwin|mingw/ and not $static
|
||||
if File.exist? target + ".def"
|
||||
defflag = "--def=" + target + ".def"
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'mkmf'
|
|||
|
||||
have_header("sys/stropts.h")
|
||||
have_func("setresuid")
|
||||
$CFLAGS << "-DHAVE_DEV_PTMX" if /cygwin/ === PLATFORM
|
||||
$CFLAGS << "-DHAVE_DEV_PTMX" if /cygwin/ === RUBY_PLATFORM
|
||||
if have_func("openpty") or
|
||||
have_func("_getpty") or
|
||||
have_func("ioctl")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require "mkmf"
|
||||
|
||||
dir_config("readline")
|
||||
have_library("user32", nil) if /cygwin/ === PLATFORM
|
||||
have_library("user32", nil) if /cygwin/ === RUBY_PLATFORM
|
||||
have_library("termcap", "tgetnum") or
|
||||
have_library("curses", "tgetnum") or
|
||||
have_library("ncurses", "tgetnum")
|
||||
|
|
|
@ -2,8 +2,8 @@ require 'mkmf'
|
|||
$LDFLAGS += " -L/usr/local/lib" if File.directory?("/usr/local/lib")
|
||||
$CFLAGS += " -Dss_family=__ss_family -Dss_len=__ss_len"
|
||||
|
||||
case PLATFORM
|
||||
when /mswin32/
|
||||
case RUBY_PLATFORM
|
||||
when /mswin32|mingw/
|
||||
test_func = "WSACleanup"
|
||||
have_library("wsock32", "WSACleanup")
|
||||
have_func("closesocket")
|
||||
|
|
|
@ -40,4 +40,9 @@
|
|||
# define SET_SIN_LEN(si,len)
|
||||
#endif
|
||||
|
||||
#ifndef IN_MULTICAST
|
||||
# define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
|
||||
# define IN_MULTICAST(i) IN_CLASSD(i)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
require 'mkmf'
|
||||
|
||||
have_library("nsl", "t_open")
|
||||
have_library("socket", "socket")
|
||||
have_library("dl", "dlopen")
|
||||
have_library("m", "log")
|
||||
if RUBY_PLATFORM !~ /mswin32|mingw/
|
||||
have_library("nsl", "t_open")
|
||||
have_library("socket", "socket")
|
||||
have_library("dl", "dlopen")
|
||||
have_library("m", "log")
|
||||
end
|
||||
|
||||
dir_config("tk")
|
||||
dir_config("tcl")
|
||||
|
@ -41,7 +43,7 @@ def find_tk(tklib)
|
|||
end
|
||||
|
||||
if have_header("tcl.h") && have_header("tk.h") &&
|
||||
(/mswin32/ =~ RUBY_PLATFORM || find_library("X11", "XOpenDisplay",
|
||||
(/mswin32|mingw|cygwin/ =~ RUBY_PLATFORM || find_library("X11", "XOpenDisplay",
|
||||
"/usr/X11/lib", "/usr/X11R6/lib", "/usr/openwin/lib")) &&
|
||||
find_tcl(tcllib) &&
|
||||
find_tk(tklib)
|
||||
|
|
|
@ -34,6 +34,7 @@ static VALUE ip_invoke_real _((int, VALUE*, VALUE));
|
|||
|
||||
/* from tkAppInit.c */
|
||||
|
||||
#if !defined __MINGW32__
|
||||
/*
|
||||
* The following variable is a special hack that is needed in order for
|
||||
* Sun shared libraries to be used for Tcl.
|
||||
|
@ -41,6 +42,7 @@ static VALUE ip_invoke_real _((int, VALUE*, VALUE));
|
|||
|
||||
extern int matherr();
|
||||
int *tclDummyMathPtr = (int *) matherr;
|
||||
#endif
|
||||
|
||||
/*---- module TclTkLib ----*/
|
||||
|
||||
|
@ -487,8 +489,6 @@ _macinit()
|
|||
void
|
||||
Init_tcltklib()
|
||||
{
|
||||
extern VALUE rb_argv0; /* the argv[0] */
|
||||
|
||||
VALUE lib = rb_define_module("TclTkLib");
|
||||
VALUE ip = rb_define_class("TclTkIp", rb_cObject);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue