mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* configure.in: add new configure option `--with-winsock2' for mingw.
* win32/Makefile.sub (config.h): define USE_WINSOCK2 in config.h instead of in CPPFLAGS. * ext/socket/extconf.rb: determine whether to use winsock2 or not by using with_config. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4e19b0e00f
commit
ae229456fb
4 changed files with 29 additions and 6 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,7 +1,17 @@
|
|||
Wed Jun 7 11:34:38 2006 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* configure.in: add new configure option `--with-winsock2' for mingw.
|
||||
|
||||
* win32/Makefile.sub (config.h): define USE_WINSOCK2 in config.h
|
||||
instead of in CPPFLAGS.
|
||||
|
||||
* ext/socket/extconf.rb: determine whether to use winsock2 or not
|
||||
by using with_config.
|
||||
|
||||
Wed Jun 7 10:45:10 2006 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* win32/{configure.bat, setup.mak, Makefile.sub, win32.h}: add
|
||||
support new configure option `--with-winsock2'.
|
||||
new configure option `--with-winsock2'.
|
||||
|
||||
* win32/win32.c (StartSockets): ditto.
|
||||
|
||||
|
|
15
configure.in
15
configure.in
|
@ -187,6 +187,15 @@ cygwin*|mingw*)
|
|||
sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
|
||||
[rb_cv_msvcrt=msvcrt])])
|
||||
test "$rb_cv_msvcrt" = "" && AC_MSG_ERROR([must be linked to DLL])
|
||||
AC_ARG_WITH(winsock2,
|
||||
[ --with-winsock2 link winsock2 (MinGW only)], [
|
||||
case $withval in
|
||||
yes) with_winsock2=yes;;
|
||||
*) with_winsock2=no;;
|
||||
esac], [with_winsock2=no])
|
||||
if test "$with_winsock2" = yes; then
|
||||
AC_DEFINE(USE_WINSOCK2)
|
||||
fi
|
||||
esac
|
||||
: ${enable_shared=yes}
|
||||
;;
|
||||
|
@ -328,7 +337,11 @@ cygwin*) rb_cv_have_daylight=no
|
|||
ac_cv_func__setjmp=no
|
||||
ac_cv_func_setitimer=no
|
||||
;;
|
||||
mingw*) LIBS="-lwsock32 $LIBS"
|
||||
mingw*) if test "$with_winsock2" = yes; then
|
||||
LIBS="-lws2_32 $LIBS"
|
||||
else
|
||||
LIBS="-lwsock32 $LIBS"
|
||||
fi
|
||||
ac_cv_header_a_out_h=no
|
||||
ac_cv_header_pwd_h=no
|
||||
ac_cv_header_utime_h=no
|
||||
|
|
|
@ -6,7 +6,7 @@ when /bccwin32/
|
|||
have_library("ws2_32", "WSACleanup")
|
||||
when /mswin32|mingw/
|
||||
test_func = "WSACleanup"
|
||||
if /USE_WINSOCK2/ =~ $CPPFLAGS
|
||||
if with_config("winsock2")
|
||||
have_library("ws2_32", "WSACleanup")
|
||||
else
|
||||
have_library("wsock32", "WSACleanup")
|
||||
|
|
|
@ -142,9 +142,6 @@ CC = $(CC) -nologo
|
|||
LD = $(CC)
|
||||
LDSHARED = $(LD) -LD
|
||||
XCFLAGS = -DRUBY_EXPORT -I. -I$(srcdir) -I$(srcdir)/missing
|
||||
!if defined(USE_WINSOCK2)
|
||||
CPPFLAGS = $(CPPFLAGS) -DUSE_WINSOCK2
|
||||
!endif
|
||||
!if $(MSC_VER) >= 1400
|
||||
# Prevents VC++ 2005 (cl ver 14) warnings
|
||||
CPPFLAGS = $(CPPFLAGS) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
|
||||
|
@ -208,6 +205,9 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
|
|||
#if _MSC_VER != $(MSC_VER)
|
||||
#error MSC version unmatch
|
||||
#endif
|
||||
!if defined(USE_WINSOCK2)
|
||||
#define USE_WINSOCK2 1
|
||||
!endif
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
|
Loading…
Add table
Reference in a new issue