summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--win32/Makefile.sub11
-rw-r--r--win32/setup.mak5
-rw-r--r--win32/win32.c11
4 files changed, 22 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 32a7f16cff..ee289e5c85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Oct 2 13:53:48 2009 NAKAMURA Usaku <[email protected]>
+
+ * win32/{setup.mak,Makefile.sub,win32.c} (RT_VER): split compiler
+ specification and runtime library specification.
+
+ * win32/Makefile.sub (LD_SHARED*, config.status): no need to embbed
+ manifest if not exist.
+
Fri Oct 2 13:38:52 2009 NAKAMURA Usaku <[email protected]>
* win32/win32.c (rb_w32_getpid): simply call GetCurrentProcessId()
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index db9152b679..c9719b8f41 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -179,8 +179,8 @@ XCFLAGS = -DRUBY_EXPORT -I. -I$(srcdir) -I$(srcdir)/missing $(XCFLAGS)
# Prevents VC++ 2005 (cl ver 14) warnings
CRTDEFFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
MANIFESTTOOL = mt -nologo
-LDSHARED_1 = $(MANIFESTTOOL) -manifest $(@).manifest -outputresource:$(@);2
-LDSHARED_2 = @$(RM) $(@:/=\).manifest
+LDSHARED_1 = @if exist $(@).manifest $(MANIFESTTOOL) -manifest $(@).manifest -outputresource:$(@);2
+LDSHARED_2 = @$if exist $(@).manifest (RM) $(@:/=\).manifest
!endif
CPPFLAGS = $(CRTDEFFLAGS) $(DEFS) $(ARCHDEFS) $(CPPFLAGS)
@@ -297,6 +297,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
!if defined(USE_WINSOCK2)
#define USE_WINSOCK2 $(USE_WINSOCK2)
!endif
+#define RT_VER $(RT_VER)
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
@@ -320,7 +321,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
#define SIZEOF_VOIDP 4
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
-!if $(MSC_VER) >= 1400
+!if $(RT_VER) >= 80
#define SIZEOF_TIME_T 8
!else
#define SIZEOF_TIME_T 4
@@ -549,8 +550,8 @@ s,@RPATHFLAG@,,;t t
s,@LIBARG@,%s.lib,;t t
s,@LINK_SO@,$$(LDSHARED) -Fe$$(@) $$(OBJS) $$(LIBS) $$(LOCAL_LIBS) $$(DLDFLAGS) -implib:$$(*F:.so=)-$$(arch).lib -pdb:$$(*F:.so=)-$$(arch).pdb -def:$$(DEFFILE),;t t
!if $(MSC_VER) >= 1400
-s,@LINK_SO@,$(MANIFESTTOOL) -manifest $$(@).manifest -outputresource:$$(@);2,;t t
-s,@LINK_SO@,@$$(RM) $$(@:/=\).manifest,;t t
+s,@LINK_SO@,@if exist $$(@).manifest $(MANIFESTTOOL) -manifest $$(@).manifest -outputresource:$$(@);2,;t t
+s,@LINK_SO@,@if exist $$(@).manifest $$(RM) $$(@:/=\).manifest,;t t
!endif
s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;t t
s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -c -Tp$$(<:\=/),;t t
diff --git a/win32/setup.mak b/win32/setup.mak
index 18a0ef7596..5772f3f2a7 100644
--- a/win32/setup.mak
+++ b/win32/setup.mak
@@ -58,12 +58,13 @@ EXTOUT = $(EXTOUT)
@echo OS = mswin32 >>$(MAKEFILE)
-runtime-: nul
- @$(CC) -MD <<rtname.c user32.lib > nul
+ @$(CC) -MD <<rtname.c user32.lib -link > nul
#include <windows.h>
#include <memory.h>
#include <string.h>
#include <stddef.h>
#include <stdio.h>
+#include <stdlib.h>
#ifndef MAXPATHLEN
# define MAXPATHLEN 1024
#endif
@@ -101,7 +102,9 @@ runtime_name()
}
}
if (ver) printf("OS = $$(OS)_%s\n", ver);
+ else ver = "60";
printf("RT = %s\n", base);
+ printf("RT_VER = %s\n", ver);
return 1;
}
diff --git a/win32/win32.c b/win32/win32.c
index d7d72c332d..83d1964467 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -368,7 +368,7 @@ flock(int fd, int oper)
static void init_stdhandle(void);
-#if _MSC_VER >= 1400
+#if RT_VER >= 80
static void
invalid_parameter(const wchar_t *expr, const wchar_t *func, const wchar_t *file, unsigned int line, uintptr_t dummy)
{
@@ -476,7 +476,7 @@ init_env(void)
void
NtInitialize(int *argc, char ***argv)
{
-#if _MSC_VER >= 1400
+#if RT_VER >= 80
static void set_pioinfo_extra(void);
_CrtSetReportMode(_CRT_ASSERT, 0);
@@ -1754,7 +1754,7 @@ typedef struct {
#ifdef MSVCRT_THREADS
int lockinitflag;
CRITICAL_SECTION lock;
-#if _MSC_VER >= 1400
+#if RT_VER >= 80
char textmode;
char pipech2[2];
#endif
@@ -1776,7 +1776,7 @@ EXTERN_C _CRTIMP ioinfo * __pioinfo[];
#define _osfile(i) (_pioinfo(i)->osfile)
#define _pipech(i) (_pioinfo(i)->pipech)
-#if _MSC_VER >= 1400
+#if RT_VER >= 80
static size_t pioinfo_extra = 0; /* workaround for VC++8 SP1 */
static void
@@ -1929,9 +1929,6 @@ char *
rb_w32_strerror(int e)
{
static char buffer[512];
-#if !defined __MINGW32__
- extern int sys_nerr;
-#endif
DWORD source = 0;
char *p;