summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes2
-rw-r--r--Makefile.config.in1
-rw-r--r--config/Makefile.mingw237
-rw-r--r--config/Makefile.mingw64239
-rw-r--r--config/Makefile.msvc245
-rw-r--r--config/Makefile.msvc64247
-rw-r--r--config/m-nt.h23
-rw-r--r--config/s-nt.h47
8 files changed, 508 insertions, 533 deletions
diff --git a/.gitattributes b/.gitattributes
index 214412f107..bc4401f281 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -74,6 +74,8 @@ asmcomp/*/emit.mlp typo.tab=may typo.long-line=may
# The build-aux directory contains bundled files so do not check it
build-aux typo.prune
+# For comparison with autoconf, some overlong lines are now permitted.
+config/Makefile.m* typo.long-line
/config/gnu typo.prune
/config/gnu/** typo.prune
diff --git a/Makefile.config.in b/Makefile.config.in
index db2872beae..93bf847056 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -253,7 +253,6 @@ endif # ifeq "$(TOOLCHAIN)" "msvc"
# in the future their definition may be moved to a more private part of
# the compiler's build system
ifeq "$(UNIX_OR_WIN32)" "win32"
- DISTRIB=$(prefix)
OTOPDIR=$(WINTOPDIR)
CTOPDIR=$(WINTOPDIR)
CYGPATH=cygpath -m
diff --git a/config/Makefile.mingw b/config/Makefile.mingw
index f2a3fb0b11..074052cfa3 100644
--- a/config/Makefile.mingw
+++ b/config/Makefile.mingw
@@ -15,117 +15,114 @@
# Configuration for Windows, Mingw compiler
+EMPTY=
######### General configuration
-PREFIX=C:/ocamlmgw
-
-### Remove this to disable compiling ocamldebug
-WITH_DEBUGGER=ocamldebugger
-
-### Remove this to disable compiling ocamldoc
-WITH_OCAMLDOC=ocamldoc
+prefix=C:/ocamlmgw
+exec_prefix=${prefix}
### Where to install the binaries
-BINDIR=$(PREFIX)/bin
+BINDIR=${exec_prefix}/bin
### Where to install the standard library
-LIBDIR=$(PREFIX)/lib/ocaml
+LIBDIR=${exec_prefix}/lib/ocaml
### Where to install the stub DLLs
-STUBLIBDIR=$(LIBDIR)/stublibs
-
-### Where to install the info files
-DISTRIB=$(PREFIX)
+STUBLIBDIR=${exec_prefix}/lib/ocaml/stublibs
### Where to install the man pages
-MANDIR=$(PREFIX)/man
+MANDIR=${prefix}/man
########## Toolchain and OS dependencies
-TOOLCHAIN=mingw
+PROGRAMS_MAN_SECTION=1
+LIBRARIES_MAN_SECTION=3
+HASHBANGSCRIPTS=false
-### Toolchain prefix
-TARGET=i686-w64-mingw32
-HOST=i686-w64-mingw32
+### Which C compiler to use for the bytecode interpreter.
+CC=i686-w64-mingw32-gcc
+CC_HAS_DEBUG_PREFIX_MAP=false
+AS_HAS_DEBUG_PREFIX_MAP=false
+OC_LDFLAGS=-municode
+### How to invoke the C preprocessor
+CPP=i686-w64-mingw32-gcc -E
+
+### The ranlib command
+RANLIB=i686-w64-mingw32-ranlib
+RANLIBCMD=i686-w64-mingw32-ranlib
-TOOLPREF=$(TARGET)-
+### The ar command
+ARCMD=i686-w64-mingw32-ar
-CCOMPTYPE=cc
O=o
+EXT_OBJ=.o
+OUTPUTOBJ=-o $(EMPTY)
A=a
+EXT_LIB=.a
S=s
-SO=s.o
-EXE=.exe
-EMPTY=
-OUTPUTEXE=-o $(EMPTY)
+EXT_ASM=.s
+SO=dll
EXT_DLL=.dll
-EXT_OBJ=.$(O)
-OUTPUTOBJ=-o $(EMPTY)
-EXT_LIB=.$(A)
-EXT_ASM=.$(S)
-PROGRAMS_MAN_SECTION=1
-LIBRARIES_MAN_SECTION=3
-HASHBANGSCRIPTS=false
-PTHREAD_LINK=
-PTHREAD_CAML_LINK=
-X11_INCLUDES=
-X11_LINK=
-RPATH=
-SUPPORTS_SHARED_LIBRARIES=true
SHAREDLIB_CFLAGS=
-MKSHAREDLIBRPATH=
-ASM=$(TOOLPREF)as
-ASPP=$(TOOLPREF)gcc -c
-DYNLINKOPTS=
-SYSTHREAD_SUPPORT=true
-EXTRALIBS=
-NATDYNLINK=true
-NATDYNLINKOPTS=
-CMXS=cmxs
-RUNTIMED=false
-ASM_CFI_SUPPORTED=false
-WITH_FRAME_POINTERS=false
+RPATH=
+
+### Name of architecture for the native-code compiler
+ARCH=i386
+ARCH64=false
+
+### Name of architecture model for the native-code compiler.
+MODEL=default
+
+### Name of operating system family for the native-code compiler.
+SYSTEM=mingw
+ASM=i686-w64-mingw32-as
+ASPP=i686-w64-mingw32-gcc -c
+
+### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
+INSTALL_BYTECODE_PROGRAMS=true
+
+############# Configuration for the contributed libraries
+
+OTHERLIBRARIES=win32unix str dynlink bigarray systhreads
+PTHREAD_LINK=
+PTHREAD_CAML_LINK=$(addprefix -cclib ,$(PTHREAD_LINK))
UNIX_OR_WIN32=win32
UNIXLIB=win32unix
-FLAMBDA=false
-WITH_FLAMBDA_INVARIANTS=false
-WITH_SPACETIME=false
-ENABLE_CALL_COUNTS=false
-WITH_PROFINFO=false
-LIBUNWIND_AVAILABLE=false
-LIBUNWIND_LINK_FLAGS=
-PROFINFO_WIDTH=0
-FORCE_SAFE_STRING=false
-DEFAULT_SAFE_STRING=true
-WINDOWS_UNICODE=1
-AFL_INSTRUMENT=false
-AWK=gawk
-CC_HAS_DEBUG_PREFIX_MAP=false
-AS_HAS_DEBUG_PREFIX_MAP=false
########## Configuration for the bytecode compiler
-
-### Which C compiler to use for the bytecode interpreter.
-CC=$(TOOLPREF)gcc
-OC_CFLAGS=-O -mms-bitfields -Wall -Wno-unused -fno-tree-vrp
+OC_CFLAGS=-O -mms-bitfields -Wno-unused -Wall -fno-tree-vrp
# -fno-tree-vrp is here to try to work around the Skylake/Kaby lake bug,
# and only works on GCC 4.2 and later.
-OC_CPPFLAGS=-DCAML_NAME_SPACE -DUNICODE -D_UNICODE \
- -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
+OC_CPPFLAGS=-DCAML_NAME_SPACE -DUNICODE -D_UNICODE -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
OCAMLC_CFLAGS=-O -mms-bitfields
-OC_LDFLAGS=-municode
-
### Libraries needed
BYTECCLIBS=-lws2_32 -lversion
+EXE=.exe
+OUTPUTEXE=-o $(EMPTY)
+SUPPORTS_SHARED_LIBRARIES=true
+MKSHAREDLIBRPATH=
+DYNLINKOPTS=
+NATDYNLINK=true
+NATDYNLINKOPTS=
+
+### Canonicalize the name of a system library
+SYSLIB=-l$(1)
+
+### How to build a static library
+MKLIB=rm -f $(1) && i686-w64-mingw32-ar rc $(1) $(2) && i686-w64-mingw32-ranlib $(1)
+
+############# Configuration for the native-code compiler
+
+OCAMLOPT_CFLAGS=-O -mms-bitfields
NATIVECCLIBS=-lws2_32 -lversion
+SYSTHREAD_SUPPORT=true
-### How to invoke the C preprocessor
-CPP=cpp
+### Build partially-linked object file
+PACKLD=i686-w64-mingw32-ld -r -o $(EMPTY)
### Flexlink
FLEXLINK_CMD=flexlink
-FLEXDLL_CHAIN=mingw
# FLEXLINK_FLAGS must be safe to insert in an OCaml string
# (see ocamlmklibconfig.ml in tools/Makefile)
FLEXLINK_FLAGS=-chain $(FLEXDLL_CHAIN) -stack 16777216
@@ -136,62 +133,58 @@ IFLEXDIR=-I"../flexdll"
else
IFLEXDIR=-I"$(FLEXDIR)"
endif
+EXTRALIBS=
+CCOMPTYPE=cc
+TOOLCHAIN=mingw
+CMXS=cmxs
+
# MKDLL, MKEXE and MKMAINDLL must ultimately be equivalent to
# $(FLEXLINK_CMD) $(FLEXLINK_FLAGS) [-exe|-maindll]
# or OCAML_FLEXLINK overriding will not work (see utils/config.mlp)
-MKDLL=$(FLEXLINK)
MKEXE=$(MKEXE_ANSI) $(if $(OC_LDFLAGS),-link "$(OC_LDFLAGS)")
-MKEXEDEBUGFLAG=-g
+MKDLL=$(FLEXLINK)
MKMAINDLL=$(FLEXLINK) -maindll
+MKEXEDEBUGFLAG=-link -g
+RUNTIMED=true
-### Native command to build ocamlrun.exe without flexlink
-MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OC_LDFLAGS) $(OUTPUTEXE)$(1) $(2)
-
-### Native command to build an ANSI executable
-MKEXE_ANSI=$(FLEXLINK) -exe
-
-### How to build a static library
-MKLIB=rm -f $(1) && $(TOOLPREF)ar rcs $(1) $(2)
-
-### Canonicalize the name of a system library
-SYSLIB=-l$(1)
-
-### The ranlib command
-RANLIB=$(TOOLPREF)ranlib
-RANLIBCMD=$(TOOLPREF)ranlib
-
-### The ar command
-ARCMD=$(TOOLPREF)ar
-
-############# Configuration for the native-code compiler
-
-### Name of architecture for the native-code compiler
-ARCH=i386
-ARCH64=false
-
-### Name of architecture model for the native-code compiler.
-MODEL=default
-
-### Name of operating system family for the native-code compiler.
-SYSTEM=mingw
+### Remove this to disable compiling ocamldebug
+WITH_DEBUGGER=ocamldebugger
-OCAMLOPT_CFLAGS=-O -mms-bitfields
+### Remove this to disable compiling ocamldoc
+WITH_OCAMLDOC=ocamldoc
-### Build partially-linked object file
-PACKLD=$(TOOLPREF)ld -r -o # must have a space after '-o'
+ASM_CFI_SUPPORTED=false
+WITH_FRAME_POINTERS=false
+WITH_SPACETIME=false
+ENABLE_CALL_COUNTS=true
+WITH_PROFINFO=false
+PROFINFO_WIDTH=0
+LIBUNWIND_AVAILABLE=false
+LIBUNWIND_LINK_FLAGS=
+### Toolchain prefix
+TARGET=i686-w64-mingw32
+HOST=i686-w64-mingw32
-### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
-INSTALL_BYTECODE_PROGRAMS=true
+FLAMBDA=false
+WITH_FLAMBDA_INVARIANTS=false
+FORCE_SAFE_STRING=false
+DEFAULT_SAFE_STRING=true
+WINDOWS_UNICODE=1
+AFL_INSTRUMENT=false
+MAX_TESTSUITE_DIR_RETRIES=1
+FLAT_FLOAT_ARRAY=true
+AWK=gawk
-############# Configuration for the contributed libraries
+### Native command to build ocamlrun.exe without flexlink
+ MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OC_LDFLAGS) $(OUTPUTEXE)$(1) $(2)
+############# for the testsuite makefiles
+ OTOPDIR=$(WINTOPDIR)
+ CTOPDIR=$(TOPDIR)
+ CYGPATH=cygpath -m
+ DIFF=/usr/bin/diff -q --strip-trailing-cr
+ SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
-OTHERLIBRARIES=win32unix str dynlink bigarray systhreads
+### Native command to build an ANSI executable
+ MKEXE_ANSI=$(FLEXLINK) -exe
-############# for the testsuite makefiles
-OTOPDIR=$(WINTOPDIR)
-CTOPDIR=$(TOPDIR)
-CYGPATH=cygpath -m
-DIFF=/usr/bin/diff -q --strip-trailing-cr
-SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
-MAX_TESTSUITE_DIR_RETRIES=1
-FLAT_FLOAT_ARRAY=true
+ FLEXDLL_CHAIN=mingw
diff --git a/config/Makefile.mingw64 b/config/Makefile.mingw64
index 03c1e4ad21..adfe0cff58 100644
--- a/config/Makefile.mingw64
+++ b/config/Makefile.mingw64
@@ -15,117 +15,114 @@
# Configuration for Windows, Mingw compiler
+EMPTY=
######### General configuration
-PREFIX=C:/ocamlmgw64
-
-### Remove this to disable compiling ocamldebug
-WITH_DEBUGGER=ocamldebugger
+prefix=C:/ocamlmgw64
+exec_prefix=${prefix}
-### Remove this to disable compiling ocamldoc
-WITH_OCAMLDOC=ocamldoc
-
-### Where to install the binaries
-BINDIR=$(PREFIX)/bin
+### Where to install the binaries.
+BINDIR=${exec_prefix}/bin
### Where to install the standard library
-LIBDIR=$(PREFIX)/lib/ocaml
+LIBDIR=${exec_prefix}/lib/ocaml
### Where to install the stub DLLs
-STUBLIBDIR=$(LIBDIR)/stublibs
-
-### Where to install the info files
-DISTRIB=$(PREFIX)
+STUBLIBDIR=${exec_prefix}/lib/ocaml/stublibs
### Where to install the man pages
-MANDIR=$(PREFIX)/man
+MANDIR=${prefix}/man
########## Toolchain and OS dependencies
-TOOLCHAIN=mingw
+PROGRAMS_MAN_SECTION=1
+LIBRARIES_MAN_SECTION=3
+HASHBANGSCRIPTS=false
-### Toolchain prefix
-TARGET=x86_64-w64-mingw32
-HOST=$(TARGET)
+### Which C compiler to use for the bytecode interpreter.
+CC=x86_64-w64-mingw32-gcc
+CC_HAS_DEBUG_PREFIX_MAP=false
+AS_HAS_DEBUG_PREFIX_MAP=false
+OC_LDFLAGS=-municode
+### How to invoke the C preprocessor
+CPP=x86_64-w64-mingw32-gcc -E
-TOOLPREF=$(TARGET)-
+### The ranlib command
+RANLIB=x86_64-w64-mingw32-ranlib
+RANLIBCMD=x86_64-w64-mingw32-ranlib
+
+### The ar command
+ARCMD=x86_64-w64-mingw32-ar
-CCOMPTYPE=cc
O=o
+EXT_OBJ=.o
+OUTPUTOBJ=-o $(EMPTY)
A=a
+EXT_LIB=.a
S=s
-SO=s.o
-EXE=.exe
-EMPTY=
-OUTPUTEXE=-o $(EMPTY)
+EXT_ASM=.s
+SO=dll
EXT_DLL=.dll
-EXT_OBJ=.$(O)
-OUTPUTOBJ=-o $(EMPTY)
-EXT_LIB=.$(A)
-EXT_ASM=.$(S)
-PROGRAMS_MAN_SECTION=1
-LIBRARIES_MAN_SECTION=3
-HASHBANGSCRIPTS=false
-PTHREAD_LINK=
-PTHREAD_CAML_LINK=
-X11_INCLUDES=
-X11_LINK=
-RPATH=
-SUPPORTS_SHARED_LIBRARIES=true
SHAREDLIB_CFLAGS=
-MKSHAREDLIBRPATH=
-ASM=$(TOOLPREF)as
-ASPP=$(TOOLPREF)gcc -c
-DYNLINKOPTS=
-SYSTHREAD_SUPPORT=true
-EXTRALIBS=
-NATDYNLINK=true
-NATDYNLINKOPTS=
-CMXS=cmxs
-RUNTIMED=false
-ASM_CFI_SUPPORTED=false
-WITH_FRAME_POINTERS=false
+RPATH=
+
+### Name of architecture for the native-code compiler
+ARCH=amd64
+ARCH64=true
+
+### Name of architecture model for the native-code compiler.
+MODEL=default
+
+### Name of operating system family for the native-code compiler.
+SYSTEM=mingw64
+ASM=x86_64-w64-mingw32-as
+ASPP=x86_64-w64-mingw32-gcc -c
+
+### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
+INSTALL_BYTECODE_PROGRAMS=true
+
+############# Configuration for the contributed libraries
+
+OTHERLIBRARIES=win32unix str dynlink bigarray raw_spacetime_lib systhreads
+PTHREAD_LINK=
+PTHREAD_CAML_LINK=$(addprefix -cclib ,$(PTHREAD_LINK))
UNIX_OR_WIN32=win32
UNIXLIB=win32unix
-FLAMBDA=false
-WITH_FLAMBDA_INVARIANTS=false
-WITH_PROFINFO=false
-WITH_SPACETIME=false
-ENABLE_CALL_COUNTS=false
-LIBUNWIND_AVAILABLE=false
-LIBUNWIND_LINK_FLAGS=
-PROFINFO_WIDTH=0
-FORCE_SAFE_STRING=false
-DEFAULT_SAFE_STRING=true
-WINDOWS_UNICODE=1
-AFL_INSTRUMENT=false
-AWK=gawk
-CC_HAS_DEBUG_PREFIX_MAP=false
-AS_HAS_DEBUG_PREFIX_MAP=false
########## Configuration for the bytecode compiler
-
-### Which C compiler to use for the bytecode interpreter.
-CC=$(TOOLPREF)gcc
-OC_CFLAGS=-O -mms-bitfields -Wall -Wno-unused -fno-tree-vrp
+OC_CFLAGS=-O -mms-bitfields -Wno-unused -Wall -fno-tree-vrp
# -fno-tree-vrp is here to try to work around the Skylake/Kaby lake bug,
# and only works on GCC 4.2 and later.
-OC_CPPFLAGS=-DCAML_NAME_SPACE -DUNICODE -D_UNICODE \
- -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
+OC_CPPFLAGS=-DCAML_NAME_SPACE -DUNICODE -D_UNICODE -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
OCAMLC_CFLAGS=-O -mms-bitfields
-OC_LDFLAGS=-municode
-
### Libraries needed
BYTECCLIBS=-lws2_32 -lversion
+EXE=.exe
+OUTPUTEXE=-o $(EMPTY)
+SUPPORTS_SHARED_LIBRARIES=true
+MKSHAREDLIBRPATH=
+DYNLINKOPTS=
+NATDYNLINK=true
+NATDYNLINKOPTS=
+
+### Canonicalize the name of a system library
+SYSLIB=-l$(1)
+
+### How to build a static library
+MKLIB=rm -f $(1) && x86_64-w64-mingw32-ar rc $(1) $(2) && x86_64-w64-mingw32-ranlib $(1)
+
+############# Configuration for the native-code compiler
+
+OCAMLOPT_CFLAGS=-O -mms-bitfields
NATIVECCLIBS=-lws2_32 -lversion
+SYSTHREAD_SUPPORT=true
-### How to invoke the C preprocessor
-CPP=cpp
+### Build partially-linked object file
+PACKLD=x86_64-w64-mingw32-ld -r -o $(EMPTY)
### Flexlink
FLEXLINK_CMD=flexlink
-FLEXDLL_CHAIN=mingw64
# FLEXLINK_FLAGS must be safe to insert in an OCaml string
# (see ocamlmklibconfig.ml in tools/Makefile)
FLEXLINK_FLAGS=-chain $(FLEXDLL_CHAIN) -stack 33554432
@@ -136,62 +133,58 @@ IFLEXDIR=-I"../flexdll"
else
IFLEXDIR=-I"$(FLEXDIR)"
endif
+EXTRALIBS=
+CCOMPTYPE=cc
+TOOLCHAIN=mingw
+CMXS=cmxs
+
# MKDLL, MKEXE and MKMAINDLL must ultimately be equivalent to
# $(FLEXLINK_CMD) $(FLEXLINK_FLAGS) [-exe|-maindll]
# or OCAML_FLEXLINK overriding will not work (see utils/config.mlp)
-MKDLL=$(FLEXLINK)
MKEXE=$(MKEXE_ANSI) $(if $(OC_LDFLAGS),-link "$(OC_LDFLAGS)")
-MKEXEDEBUGFLAG=-g
+MKDLL=$(FLEXLINK)
MKMAINDLL=$(FLEXLINK) -maindll
+MKEXEDEBUGFLAG=-link -g
+RUNTIMED=true
-### Native command to build ocamlrun.exe without flexlink
-MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OC_LDFLAGS) $(OUTPUTEXE)$(1) $(2)
-
-### Native command to build an ANSI executable
-MKEXE_ANSI=$(FLEXLINK) -exe
-
-### How to build a static library
-MKLIB=rm -f $(1) && $(TOOLPREF)ar rcs $(1) $(2)
-
-### Canonicalize the name of a system library
-SYSLIB=-l$(1)
-
-### The ranlib command
-RANLIB=$(TOOLPREF)ranlib
-RANLIBCMD=$(TOOLPREF)ranlib
-
-### The ar command
-ARCMD=$(TOOLPREF)ar
-
-############# Configuration for the native-code compiler
-
-### Name of architecture for the native-code compiler
-ARCH=amd64
-ARCH64=true
-
-### Name of architecture model for the native-code compiler.
-MODEL=default
-
-### Name of operating system family for the native-code compiler.
-SYSTEM=mingw64
+### Remove this to disable compiling ocamldebug
+WITH_DEBUGGER=ocamldebugger
-OCAMLOPT_CFLAGS=-O -mms-bitfields
+### Remove this to disable compiling ocamldoc
+WITH_OCAMLDOC=ocamldoc
-### Build partially-linked object file
-PACKLD=$(TOOLPREF)ld -r -o # must have a space after '-o'
+ASM_CFI_SUPPORTED=false
+WITH_FRAME_POINTERS=false
+WITH_SPACETIME=false
+ENABLE_CALL_COUNTS=true
+WITH_PROFINFO=false
+PROFINFO_WIDTH=0
+LIBUNWIND_AVAILABLE=false
+LIBUNWIND_LINK_FLAGS=
+### Toolchain prefix
+TARGET=x86_64-w64-mingw32
+HOST=x86_64-w64-mingw32
-### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
-INSTALL_BYTECODE_PROGRAMS=true
+FLAMBDA=false
+WITH_FLAMBDA_INVARIANTS=false
+FORCE_SAFE_STRING=false
+DEFAULT_SAFE_STRING=true
+WINDOWS_UNICODE=1
+AFL_INSTRUMENT=false
+MAX_TESTSUITE_DIR_RETRIES=1
+FLAT_FLOAT_ARRAY=true
+AWK=gawk
-############# Configuration for the contributed libraries
+### Native command to build ocamlrun.exe without flexlink
+ MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OC_LDFLAGS) $(OUTPUTEXE)$(1) $(2)
+############# for the testsuite makefiles
+ OTOPDIR=$(WINTOPDIR)
+ CTOPDIR=$(TOPDIR)
+ CYGPATH=cygpath -m
+ DIFF=/usr/bin/diff -q --strip-trailing-cr
+ SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
-OTHERLIBRARIES=win32unix str dynlink bigarray systhreads
+### Native command to build an ANSI executable
+ MKEXE_ANSI=$(FLEXLINK) -exe
-############# for the testsuite makefiles
-OTOPDIR=$(WINTOPDIR)
-CTOPDIR=$(TOPDIR)
-CYGPATH=cygpath -m
-DIFF=/usr/bin/diff -q --strip-trailing-cr
-SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
-MAX_TESTSUITE_DIR_RETRIES=1
-FLAT_FLOAT_ARRAY=true
+ FLEXDLL_CHAIN=mingw64
diff --git a/config/Makefile.msvc b/config/Makefile.msvc
index f4b33574b9..25fb7afff3 100644
--- a/config/Makefile.msvc
+++ b/config/Makefile.msvc
@@ -17,107 +17,111 @@
######### General configuration
-PREFIX=C:/ocamlms
+prefix=C:/ocamlms
+exec_prefix=${prefix}
### Where to install the binaries.
-BINDIR=$(PREFIX)/bin
+BINDIR=${exec_prefix}/bin
### Where to install the standard library
-LIBDIR=$(PREFIX)/lib/ocaml
+LIBDIR=${exec_prefix}/lib/ocaml
### Where to install the stub DLLs
-STUBLIBDIR=$(LIBDIR)/stublibs
-
-### Where to install the info files
-DISTRIB=$(PREFIX)
+STUBLIBDIR=${exec_prefix}/lib/ocaml/stublibs
### Where to install the man pages
-MANDIR=$(PREFIX)/man
+MANDIR=${prefix}/man
########## Toolchain and OS dependencies
-TOOLCHAIN=msvc
+PROGRAMS_MAN_SECTION=1
+LIBRARIES_MAN_SECTION=3
+HASHBANGSCRIPTS=false
-# It doesn't make much sense to set "TARGET" and "HOST" for msvc but it's needed
-# for the myocamlbuild config.
-# The only case these will be used currently is to check whether we're
-# cross-compiling or not so setting them to the same value is what matters.
-HOST=msvc
-TARGET=$(HOST)
+### Which C compiler to use for the bytecode interpreter.
+CC=cl
+CC_HAS_DEBUG_PREFIX_MAP=false
+AS_HAS_DEBUG_PREFIX_MAP=false
+OC_LDFLAGS=/ENTRY:wmainCRTStartup
+### How to invoke the C preprocessor
+CPP=cl -nologo -EP
+
+### The ranlib command
+RANLIB=echo
+RANLIBCMD=
+
+### The ar command
+ARCMD=
-CCOMPTYPE=msvc
O=obj
+EXT_OBJ=.obj
+OUTPUTOBJ=-Fo
A=lib
+EXT_LIB=.lib
S=asm
-SO=s.obj
-EXE=.exe
-OUTPUTEXE=-Fe
+EXT_ASM=.asm
+SO=dll
EXT_DLL=.dll
-EXT_OBJ=.$(O)
-OUTPUTOBJ=-Fo
-EXT_LIB=.$(A)
-EXT_ASM=.$(S)
-PROGRAMS_MAN_SECTION=1
-LIBRARIES_MAN_SECTION=3
-HASHBANGSCRIPTS=false
-PTHREAD_LINK=
-PTHREAD_CAML_LINK=
-X11_INCLUDES=
-X11_LINK=
-RPATH=
-SUPPORTS_SHARED_LIBRARIES=true
SHAREDLIB_CFLAGS=
+RPATH=
+
+### Name of architecture for the native-code compiler
+ARCH=i386
+ARCH64=false
+
+### Name of architecture model for the native-code compiler.
+MODEL=default
+
+### Name of operating system family for the native-code compiler.
+SYSTEM=win32
ASM=ml -nologo -coff -Cp -c -Fo
ASPP=
-DYNLINKOPTS=
-SYSTHREAD_SUPPORT=true
-EXTRALIBS=
-CMXS=cmxs
-NATDYNLINK=true
-NATDYNLINKOPTS=
-RUNTIMED=false
-ASM_CFI_SUPPORTED=false
-WITH_FRAME_POINTERS=false
+
+### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
+INSTALL_BYTECODE_PROGRAMS=true
+
+############# Configuration for the contributed libraries
+
+OTHERLIBRARIES=win32unix str dynlink bigarray systhreads
+PTHREAD_LINK=
+PTHREAD_CAML_LINK=$(addprefix -cclib ,$(PTHREAD_LINK))
UNIX_OR_WIN32=win32
UNIXLIB=win32unix
-FLAMBDA=false
-WITH_FLAMBDA_INVARIANTS=false
-WITH_PROFINFO=false
-WITH_SPACETIME=false
-ENABLE_CALL_COUNTS=false
-LIBUNWIND_AVAILABLE=false
-LIBUNWIND_LINK_FLAGS=
-PROFINFO_WIDTH=0
-FORCE_SAFE_STRING=false
-DEFAULT_SAFE_STRING=true
-WINDOWS_UNICODE=1
-AFL_INSTRUMENT=false
-AWK=gawk
-CC_HAS_DEBUG_PREFIX_MAP=false
-AS_HAS_DEBUG_PREFIX_MAP=false
########## Configuration for the bytecode compiler
-
-### Which C compiler to use for the bytecode interpreter.
-CC=cl
OC_CFLAGS=-nologo -O2 -Gy- -MD
-OC_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE -DCAML_NAME_SPACE -DUNICODE -D_UNICODE \
- -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
+OC_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE -DCAML_NAME_SPACE -DUNICODE -D_UNICODE -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
OCAMLC_CFLAGS=-nologo -O2 -Gy- -MD
-OCAMLC_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE
-
-OC_LDFLAGS=/ENTRY:wmainCRTStartup
+OCAMLC_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE
### Libraries needed
BYTECCLIBS=advapi32.lib ws2_32.lib version.lib
+EXE=.exe
+OUTPUTEXE=-Fe
+SUPPORTS_SHARED_LIBRARIES=true
+MKSHAREDLIBRPATH=
+DYNLINKOPTS=
+NATDYNLINK=true
+NATDYNLINKOPTS=
+
+### Canonicalize the name of a system library
+SYSLIB=$(1).lib
+
+### How to build a static library
+MKLIB=link -lib -nologo /out:$(1) $(2)
+
+############# Configuration for the native-code compiler
+
+OCAMLOPT_CFLAGS=-nologo -O2 -Gy- -MD
+OCAMLOPT_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE
NATIVECCLIBS=advapi32.lib ws2_32.lib version.lib
+SYSTHREAD_SUPPORT=true
-### How to invoke the C preprocessor
-CPP=cl -nologo -EP
+### Build partially-linked object file
+PACKLD=link -lib -nologo -out:
### Flexlink
FLEXLINK_CMD=flexlink
-FLEXDLL_CHAIN=msvc
# FLEXLINK_FLAGS must be safe to insert in an OCaml string
# (see ocamlmklibconfig.ml in tools/Makefile)
FLEXLINK_FLAGS=-merge-manifest -stack 16777216
@@ -128,58 +132,19 @@ IFLEXDIR=-I"../flexdll"
else
IFLEXDIR=-I"$(FLEXDIR)"
endif
+EXTRALIBS=
+CCOMPTYPE=msvc
+TOOLCHAIN=msvc
+CMXS=cmxs
+
# MKDLL, MKEXE and MKMAINDLL must ultimately be equivalent to
# $(FLEXLINK_CMD) $(FLEXLINK_FLAGS) [-exe|-maindll]
# or OCAML_FLEXLINK overriding will not work (see utils/config.mlp)
-MKDLL=$(FLEXLINK)
MKEXE=$(MKEXE_ANSI) $(if $(OC_LDFLAGS),-link "$(OC_LDFLAGS)")
-MKEXEDEBUGFLAG=
+MKDLL=$(FLEXLINK)
MKMAINDLL=$(FLEXLINK) -maindll
-
-### Native command to build ocamlrun.exe without flexlink
-MERGEMANIFESTEXE=test ! -f $(1).manifest \
- || mt -nologo -outputresource:$(1) -manifest $(1).manifest \
- && rm -f $(1).manifest
-MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OUTPUTEXE)$(1) $(2) \
- /link /subsystem:console $(OC_LDFLAGS) && ($(MERGEMANIFESTEXE))
-
-### Native command to build an ANSI executable
-MKEXE_ANSI=$(FLEXLINK) -exe
-
-### How to build a static library
-MKLIB=link -lib -nologo -out:$(1) $(2)
-MKSHAREDLIBRPATH=
-
-### Canonicalize the name of a system library
-SYSLIB=$(1).lib
-
-### The ranlib command
-RANLIB=echo
-RANLIBCMD=
-
-### The ar command
-ARCMD=
-
-############# Configuration for the native-code compiler
-
-### Name of architecture for the native-code compiler
-ARCH=i386
-ARCH64=false
-
-### Name of architecture model for the native-code compiler.
-MODEL=default
-
-### Name of operating system family for the native-code compiler.
-SYSTEM=win32
-
-OCAMLOPT_CFLAGS=-nologo -O2 -Gy- -MD
-OCAMLOPT_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE
-
-### Build partially-linked object file
-PACKLD=link -lib -nologo -out:# there must be no space after this '-out:'
-
-### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
-INSTALL_BYTECODE_PROGRAMS=true
+MKEXEDEBUGFLAG=
+RUNTIMED=true
### Clear this to disable compiling ocamldebug
WITH_DEBUGGER=ocamldebugger
@@ -187,17 +152,47 @@ WITH_DEBUGGER=ocamldebugger
### Clear this to disable compiling ocamldoc
WITH_OCAMLDOC=ocamldoc
-############# Configuration for the contributed libraries
-
-OTHERLIBRARIES=win32unix systhreads str dynlink bigarray
+ASM_CFI_SUPPORTED=false
+WITH_FRAME_POINTERS=false
+WITH_SPACETIME=false
+ENABLE_CALL_COUNTS=true
+WITH_PROFINFO=false
+PROFINFO_WIDTH=0
+LIBUNWIND_AVAILABLE=false
+LIBUNWIND_LINK_FLAGS=
+# It doesn't make much sense to set "TARGET" and "HOST" for msvc but it's needed
+# for the myocamlbuild config.
+# The only case these will be used currently is to check whether we're
+# cross-compiling or not so setting them to the same value is what matters.
+TARGET=$(HOST)
+HOST=msvc
-############# for the testsuite makefiles
-OTOPDIR=$(WINTOPDIR)
-CTOPDIR=$(WINTOPDIR)
-CYGPATH=cygpath -m
-DIFF=/usr/bin/diff -q --strip-trailing-cr
-FIND=/usr/bin/find
-SORT=/usr/bin/sort
-SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
+FLAMBDA=false
+WITH_FLAMBDA_INVARIANTS=false
+FORCE_SAFE_STRING=false
+DEFAULT_SAFE_STRING=true
+WINDOWS_UNICODE=1
+AFL_INSTRUMENT=false
MAX_TESTSUITE_DIR_RETRIES=1
FLAT_FLOAT_ARRAY=true
+AWK=gawk
+
+### Native command to build ocamlrun.exe without flexlink
+ MERGEMANIFESTEXE=test ! -f $(1).manifest \
+ || mt -nologo -outputresource:$(1) -manifest $(1).manifest \
+ && rm -f $(1).manifest
+ MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OUTPUTEXE)$(1) $(2) \
+ /link /subsystem:console $(OC_LDFLAGS) && ($(MERGEMANIFESTEXE))
+############# for the testsuite makefiles
+
+ OTOPDIR=$(WINTOPDIR)
+ CTOPDIR=$(WINTOPDIR)
+ CYGPATH=cygpath -m
+ DIFF=/usr/bin/diff -q --strip-trailing-cr
+ FIND=/usr/bin/find
+ SORT=/usr/bin/sort
+ SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
+
+### Native command to build an ANSI executable
+ MKEXE_ANSI=$(FLEXLINK) -exe
+ FLEXDLL_CHAIN=msvc
diff --git a/config/Makefile.msvc64 b/config/Makefile.msvc64
index 017bbafcbb..4931ea4b4a 100644
--- a/config/Makefile.msvc64
+++ b/config/Makefile.msvc64
@@ -17,108 +17,111 @@
######### General configuration
-PREFIX=C:/ocamlms64
+prefix=C:/ocamlms64
+exec_prefix=${prefix}
### Where to install the binaries.
-BINDIR=$(PREFIX)/bin
+BINDIR=${exec_prefix}/bin
### Where to install the standard library
-LIBDIR=$(PREFIX)/lib/ocaml
+LIBDIR=${exec_prefix}/lib/ocaml
### Where to install the stub DLLs
-STUBLIBDIR=$(LIBDIR)/stublibs
-
-### Where to install the info files
-DISTRIB=$(PREFIX)
+STUBLIBDIR=${exec_prefix}/lib/ocaml/stublibs
### Where to install the man pages
-MANDIR=$(PREFIX)/man
+MANDIR=${prefix}/man
########## Toolchain and OS dependencies
-TOOLCHAIN=msvc
+PROGRAMS_MAN_SECTION=1
+LIBRARIES_MAN_SECTION=3
+HASHBANGSCRIPTS=false
-# It doesn't make much sense to set "TARGET" and "HOST" for msvc but it's needed
-# for the myocamlbuild config.
-# The only case these will be used currently is to check whether we're
-# cross-compiling or not so setting them to the same value is what matters.
-HOST=msvc64
-TARGET=$(HOST)
+### Which C compiler to use for the bytecode interpreter.
+CC=cl
+CC_HAS_DEBUG_PREFIX_MAP=false
+AS_HAS_DEBUG_PREFIX_MAP=false
+OC_LDFLAGS=/ENTRY:wmainCRTStartup
+### How to invoke the C preprocessor
+CPP=cl -nologo -EP
+
+### The ranlib command
+RANLIB=echo
+RANLIBCMD=
+
+### The ar command
+ARCMD=
-CCOMPTYPE=msvc
O=obj
+EXT_OBJ=.obj
+OUTPUTOBJ=-Fo
A=lib
+EXT_LIB=.lib
S=asm
-SO=s.obj
-EXE=.exe
-OUTPUTEXE=-Fe
+EXT_ASM=.asm
+SO=dll
EXT_DLL=.dll
-EXT_OBJ=.$(O)
-OUTPUTOBJ=-Fo
-EXT_LIB=.$(A)
-EXT_ASM=.$(S)
-PROGRAMS_MAN_SECTION=1
-LIBRARIES_MAN_SECTION=3
-HASHBANGSCRIPTS=false
-PTHREAD_LINK=
-PTHREAD_CAML_LINK=
-X11_INCLUDES=
-X11_LINK=
-RPATH=
-SUPPORTS_SHARED_LIBRARIES=true
SHAREDLIB_CFLAGS=
+RPATH=
+
+### Name of architecture for the native-code compiler
+ARCH=amd64
+ARCH64=true
+
+### Name of architecture model for the native-code compiler.
+MODEL=default
+
+### Name of operating system family for the native-code compiler.
+SYSTEM=win64
ASM=ml64 -nologo -Cp -c -Fo
ASPP=
-DYNLINKOPTS=
-SYSTHREAD_SUPPORT=true
-CMXS=cmxs
-NATDYNLINK=true
-NATDYNLINKOPTS=
-RUNTIMED=false
-ASM_CFI_SUPPORTED=false
-WITH_FRAME_POINTERS=false
+
+### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
+INSTALL_BYTECODE_PROGRAMS=true
+
+############# Configuration for the contributed libraries
+
+OTHERLIBRARIES=win32unix str dynlink bigarray raw_spacetime_lib systhreads
+PTHREAD_LINK=
+PTHREAD_CAML_LINK=$(addprefix -cclib ,$(PTHREAD_LINK))
UNIX_OR_WIN32=win32
UNIXLIB=win32unix
-FLAMBDA=false
-WITH_FLAMBDA_INVARIANTS=false
-WITH_PROFINFO=false
-WITH_SPACETIME=false
-ENABLE_CALL_COUNTS=false
-LIBUNWIND_AVAILABLE=false
-LIBUNWIND_LINK_FLAGS=
-PROFINFO_WIDTH=0
-FORCE_SAFE_STRING=false
-DEFAULT_SAFE_STRING=true
-WINDOWS_UNICODE=1
-AFL_INSTRUMENT=false
-AWK=gawk
-CC_HAS_DEBUG_PREFIX_MAP=false
-AS_HAS_DEBUG_PREFIX_MAP=false
########## Configuration for the bytecode compiler
-
-### Which C compiler to use for the bytecode interpreter.
-CC=cl
OC_CFLAGS=-nologo -O2 -Gy- -MD
-OC_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE -DCAML_NAME_SPACE -DUNICODE -D_UNICODE \
- -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
+OC_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE -DCAML_NAME_SPACE -DUNICODE -D_UNICODE -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
OCAMLC_CFLAGS=-nologo -O2 -Gy- -MD
-OCAMLC_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE
-
-OC_LDFLAGS=/ENTRY:wmainCRTStartup
+OCAMLC_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE
### Libraries needed
-#EXTRALIBS=bufferoverflowu.lib # for the old PSDK compiler only
-EXTRALIBS=
BYTECCLIBS=advapi32.lib ws2_32.lib version.lib
+EXE=.exe
+OUTPUTEXE=-Fe
+SUPPORTS_SHARED_LIBRARIES=true
+MKSHAREDLIBRPATH=
+DYNLINKOPTS=
+NATDYNLINK=true
+NATDYNLINKOPTS=
+
+### Canonicalize the name of a system library
+SYSLIB=$(1).lib
+
+### How to build a static library
+MKLIB=link -lib -nologo -machine:AMD64 /out:$(1) $(2)
+
+############# Configuration for the native-code compiler
+
+OCAMLOPT_CFLAGS=-nologo -O2 -Gy- -MD
+OCAMLOPT_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE
NATIVECCLIBS=advapi32.lib ws2_32.lib version.lib
+SYSTHREAD_SUPPORT=true
-### How to invoke the C preprocessor
-CPP=$(CC) -nologo -EP
+### Build partially-linked object file
+PACKLD=link -lib -nologo -machine:AMD64 -out:
### Flexlink
FLEXLINK_CMD=flexlink
-FLEXDLL_CHAIN=msvc64
# FLEXLINK_FLAGS must be safe to insert in an OCaml string
# (see ocamlmklibconfig.ml in tools/Makefile)
FLEXLINK_FLAGS=-x64 -merge-manifest -stack 33554432
@@ -129,58 +132,20 @@ IFLEXDIR=-I"../flexdll"
else
IFLEXDIR=-I"$(FLEXDIR)"
endif
+#EXTRALIBS=bufferoverflowu.lib # for the old PSDK compiler only
+EXTRALIBS=
+CCOMPTYPE=msvc
+TOOLCHAIN=msvc
+CMXS=cmxs
+
# MKDLL, MKEXE and MKMAINDLL must ultimately be equivalent to
# $(FLEXLINK_CMD) $(FLEXLINK_FLAGS) [-exe|-maindll]
# or OCAML_FLEXLINK overriding will not work (see utils/config.mlp)
-MKDLL=$(FLEXLINK)
MKEXE=$(MKEXE_ANSI) $(if $(OC_LDFLAGS),-link "$(OC_LDFLAGS)")
-MKEXEDEBUGFLAG=
+MKDLL=$(FLEXLINK)
MKMAINDLL=$(FLEXLINK) -maindll
-
-### Native command to build ocamlrun.exe without flexlink
-MERGEMANIFESTEXE=test ! -f $(1).manifest \
- || mt -nologo -outputresource:$(1) -manifest $(1).manifest \
- && rm -f $(1).manifest
-MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OUTPUTEXE)$(1) $(2) \
- /link /subsystem:console $(OC_LDFLAGS) && ($(MERGEMANIFESTEXE))
-
-### Native command to build an ANSI executable
-MKEXE_ANSI=$(FLEXLINK) -exe
-
-### How to build a static library
-MKLIB=link -lib -nologo -machine:AMD64 /out:$(1) $(2)
-MKSHAREDLIBRPATH=
-
-### Canonicalize the name of a system library
-SYSLIB=$(1).lib
-
-### The ranlib command
-RANLIB=echo
-RANLIBCMD=
-
-### The ar command
-ARCMD=
-
-############# Configuration for the native-code compiler
-
-### Name of architecture for the native-code compiler
-ARCH=amd64
-ARCH64=true
-
-### Name of architecture model for the native-code compiler.
-MODEL=default
-
-### Name of operating system family for the native-code compiler.
-SYSTEM=win64
-
-OCAMLOPT_CFLAGS=-nologo -O2 -Gy- -MD
-OCAMLOPT_CPPFLAGS=-D_CRT_SECURE_NO_DEPRECATE
-
-### Build partially-linked object file
-PACKLD=link -lib -nologo -machine:AMD64 -out:# must have no space after '-out:'
-
-### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
-INSTALL_BYTECODE_PROGRAMS=true
+MKEXEDEBUGFLAG=
+RUNTIMED=true
### Clear this to disable compiling ocamldebug
WITH_DEBUGGER=ocamldebugger
@@ -188,17 +153,47 @@ WITH_DEBUGGER=ocamldebugger
### Clear this to disable compiling ocamldoc
WITH_OCAMLDOC=ocamldoc
-############# Configuration for the contributed libraries
-
-OTHERLIBRARIES=win32unix systhreads str dynlink bigarray
+ASM_CFI_SUPPORTED=false
+WITH_FRAME_POINTERS=false
+WITH_SPACETIME=false
+ENABLE_CALL_COUNTS=true
+WITH_PROFINFO=false
+PROFINFO_WIDTH=0
+LIBUNWIND_AVAILABLE=false
+LIBUNWIND_LINK_FLAGS=
+# It doesn't make much sense to set "TARGET" and "HOST" for msvc but it's needed
+# for the myocamlbuild config.
+# The only case these will be used currently is to check whether we're
+# cross-compiling or not so setting them to the same value is what matters.
+TARGET=$(HOST)
+HOST=msvc64
-############# for the testsuite makefiles
-OTOPDIR=$(WINTOPDIR)
-CTOPDIR=$(WINTOPDIR)
-CYGPATH=cygpath -m
-DIFF=/usr/bin/diff -q --strip-trailing-cr
-FIND=/usr/bin/find
-SORT=/usr/bin/sort
-SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
+FLAMBDA=false
+WITH_FLAMBDA_INVARIANTS=false
+FORCE_SAFE_STRING=false
+DEFAULT_SAFE_STRING=true
+WINDOWS_UNICODE=1
+AFL_INSTRUMENT=false
MAX_TESTSUITE_DIR_RETRIES=1
FLAT_FLOAT_ARRAY=true
+AWK=gawk
+
+### Native command to build ocamlrun.exe without flexlink
+ MERGEMANIFESTEXE=test ! -f $(1).manifest \
+ || mt -nologo -outputresource:$(1) -manifest $(1).manifest \
+ && rm -f $(1).manifest
+ MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OUTPUTEXE)$(1) $(2) \
+ /link /subsystem:console $(OC_LDFLAGS) && ($(MERGEMANIFESTEXE))
+
+############# for the testsuite makefiles
+ OTOPDIR=$(WINTOPDIR)
+ CTOPDIR=$(WINTOPDIR)
+ CYGPATH=cygpath -m
+ DIFF=/usr/bin/diff -q --strip-trailing-cr
+ FIND=/usr/bin/find
+ SORT=/usr/bin/sort
+ SET_LD_PATH=PATH="$(PATH):$(LD_PATH)"
+
+### Native command to build an ANSI executable
+ MKEXE_ANSI=$(FLEXLINK) -exe
+ FLEXDLL_CHAIN=msvc64
diff --git a/config/m-nt.h b/config/m-nt.h
index eae64b6693..c2de968749 100644
--- a/config/m-nt.h
+++ b/config/m-nt.h
@@ -17,7 +17,7 @@
Visual C++ or Mingw compiler */
#ifdef _WIN64
-#define ARCH_SIXTYFOUR
+#define ARCH_SIXTYFOUR 1
#else
#undef ARCH_SIXTYFOUR
#endif
@@ -32,27 +32,10 @@
#define SIZEOF_PTR 4
#endif
#define SIZEOF_SHORT 2
-
-#ifdef __MINGW32__
-#define ARCH_INT64_TYPE long long
-#define ARCH_UINT64_TYPE unsigned long long
-#else
-#define ARCH_INT64_TYPE __int64
-#define ARCH_UINT64_TYPE unsigned __int64
-#endif
-#define ARCH_INT64_PRINTF_FORMAT "I64"
-#if _MSC_VER >= 1800
-#define ARCH_SIZET_PRINTF_FORMAT "z"
-#else
-#define ARCH_SIZET_PRINTF_FORMAT "I"
-#endif
-
-#if defined(_MSC_VER) && !defined(__cplusplus)
-#define inline __inline
-#endif
+#define SIZEOF_LONGLONG 8
#undef NONSTANDARD_DIV_MOD
#define PROFINFO_WIDTH 0
-#define FLAT_FLOAT_ARRAY
+#define FLAT_FLOAT_ARRAY 1
diff --git a/config/s-nt.h b/config/s-nt.h
index b259a44830..57f5dc53e4 100644
--- a/config/s-nt.h
+++ b/config/s-nt.h
@@ -17,23 +17,38 @@
#define OCAML_OS_TYPE "Win32"
+#undef BSD_SIGNALS
+#define SUPPORT_DYNAMIC_LINKING 1
+#define HAS_SOCKETS 1
+#define HAS_IPV6 1
#if defined(__MINGW32__) || _MSC_VER >= 1600
-#define HAS_STDINT_H
+#define HAS_STDINT_H 1
#endif
-#undef BSD_SIGNALS
-#define HAS_STRERROR
-#define HAS_SOCKETS
-#define HAS_GETCWD
-#define HAS_UTIME
-#define HAS_GETHOSTNAME
-#define HAS_MKTIME
-#define HAS_PUTENV
+#ifdef __MINGW32__
+#define HAS_UNISTD 1
+#define HAS_DIRENT 1
+#define HAS_REWINDDIR 1
+#endif
+#define HAS_GETCWD 1
+#define HAS_UTIME 1
+#ifdef __MINGW32__
+#define HAS_TRUNCATE 1
+#define HAS_NANOSLEEP 1
+#endif
+#define HAS_GETHOSTNAME 1
+#ifdef __MINGW32__
+#define HAS_GETTIMEOFDAY 1
+#endif
+#define HAS_MKTIME 1
+#define HAS_PUTENV 1
#ifndef __MINGW32__
-#define HAS_LOCALE_H
-#define HAS_STRTOD_L
+#define HAS_LOCALE_H 1
+#define HAS_STRTOD_L 1
+#endif
+#ifdef __MINGW32__
+#define HAS_MKSTEMP 1
#endif
-#define HAS_BROKEN_PRINTF
-#define HAS_IPV6
-#define HAS_NICE
-#define SUPPORT_DYNAMIC_LINKING
-#define HAS_EXECVPE
+#define HAS_NICE 1
+#define HAS_EXECVPE 1
+#define HAS_BROKEN_PRINTF 1
+#define HAS_STRERROR 1