Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,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
Expand Down
73 changes: 33 additions & 40 deletions config/Makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

######### General configuration

PREFIX=C:/ocamlmgw
prefix=C:/ocamlmgw
exec_prefix=${prefix}

### Remove this to disable compiling ocamldebug
WITH_DEBUGGER=ocamldebugger
Expand All @@ -26,19 +27,16 @@ WITH_DEBUGGER=ocamldebugger
WITH_OCAMLDOC=ocamldoc

### 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

Expand All @@ -48,49 +46,45 @@ TOOLCHAIN=mingw
TARGET=i686-w64-mingw32
HOST=i686-w64-mingw32

TOOLPREF=$(TARGET)-

CCOMPTYPE=cc
O=o
A=a
S=s
SO=s.o
SO=dll
EXE=.exe
EMPTY=
OUTPUTEXE=-o $(EMPTY)
EXT_DLL=.dll
EXT_OBJ=.$(O)
EXT_OBJ=.o
OUTPUTOBJ=-o $(EMPTY)
EXT_LIB=.$(A)
EXT_ASM=.$(S)
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=
PTHREAD_CAML_LINK=$(addprefix -cclib ,$(PTHREAD_LINK))
RPATH=
SUPPORTS_SHARED_LIBRARIES=true
SHAREDLIB_CFLAGS=
MKSHAREDLIBRPATH=
ASM=$(TOOLPREF)as
ASPP=$(TOOLPREF)gcc -c
ASM=i686-w64-mingw32-as
ASPP=i686-w64-mingw32-gcc -c
DYNLINKOPTS=
SYSTHREAD_SUPPORT=true
EXTRALIBS=
NATDYNLINK=true
NATDYNLINKOPTS=
CMXS=cmxs
RUNTIMED=false
RUNTIMED=true
ASM_CFI_SUPPORTED=false
WITH_FRAME_POINTERS=false
UNIX_OR_WIN32=win32
UNIXLIB=win32unix
FLAMBDA=false
WITH_FLAMBDA_INVARIANTS=false
WITH_SPACETIME=false
ENABLE_CALL_COUNTS=false
ENABLE_CALL_COUNTS=true
WITH_PROFINFO=false
LIBUNWIND_AVAILABLE=false
LIBUNWIND_LINK_FLAGS=
Expand All @@ -106,12 +100,11 @@ 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
CC=i686-w64-mingw32-gcc
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
Expand All @@ -121,11 +114,11 @@ BYTECCLIBS=-lws2_32 -lversion
NATIVECCLIBS=-lws2_32 -lversion

### How to invoke the C preprocessor
CPP=cpp
CPP=i686-w64-mingw32-gcc -E

### Flexlink
FLEXLINK_CMD=flexlink
FLEXDLL_CHAIN=mingw
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
Expand All @@ -141,27 +134,27 @@ endif
# or OCAML_FLEXLINK overriding will not work (see utils/config.mlp)
MKDLL=$(FLEXLINK)
MKEXE=$(MKEXE_ANSI) $(if $(OC_LDFLAGS),-link "$(OC_LDFLAGS)")
MKEXEDEBUGFLAG=-g
MKEXEDEBUGFLAG=-link -g
MKMAINDLL=$(FLEXLINK) -maindll

### Native command to build ocamlrun.exe without flexlink
MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OC_LDFLAGS) $(OUTPUTEXE)$(1) $(2)
MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OC_LDFLAGS) $(OUTPUTEXE)$(1) $(2)

### Native command to build an ANSI executable
MKEXE_ANSI=$(FLEXLINK) -exe
MKEXE_ANSI=$(FLEXLINK) -exe

### How to build a static library
MKLIB=rm -f $(1) && $(TOOLPREF)ar rcs $(1) $(2)
MKLIB=rm -f $(1) && i686-w64-mingw32-ar rc $(1) $(2) && i686-w64-mingw32-ranlib $(1)

### Canonicalize the name of a system library
SYSLIB=-l$(1)

### The ranlib command
RANLIB=$(TOOLPREF)ranlib
RANLIBCMD=$(TOOLPREF)ranlib
RANLIB=i686-w64-mingw32-ranlib
RANLIBCMD=i686-w64-mingw32-ranlib

### The ar command
ARCMD=$(TOOLPREF)ar
ARCMD=i686-w64-mingw32-ar

############# Configuration for the native-code compiler

Expand All @@ -178,7 +171,7 @@ SYSTEM=mingw
OCAMLOPT_CFLAGS=-O -mms-bitfields

### Build partially-linked object file
PACKLD=$(TOOLPREF)ld -r -o # must have a space after '-o'
PACKLD=i686-w64-mingw32-ld -r -o $(EMPTY)

### Set to "true" to install ".byte" executables (ocamlc.byte, etc.)
INSTALL_BYTECODE_PROGRAMS=true
Expand All @@ -188,10 +181,10 @@ INSTALL_BYTECODE_PROGRAMS=true
OTHERLIBRARIES=win32unix str dynlink bigarray systhreads

############# 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)"
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
79 changes: 36 additions & 43 deletions config/Makefile.mingw64
Original file line number Diff line number Diff line change
Expand Up @@ -17,72 +17,66 @@

######### General configuration

PREFIX=C:/ocamlmgw64
prefix=C:/ocamlmgw64
exec_prefix=${prefix}

### Remove this to disable compiling ocamldebug
WITH_DEBUGGER=ocamldebugger

### 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

### Toolchain prefix
TARGET=x86_64-w64-mingw32
HOST=$(TARGET)

TOOLPREF=$(TARGET)-
HOST=x86_64-w64-mingw32

CCOMPTYPE=cc
O=o
A=a
S=s
SO=s.o
SO=dll
EXE=.exe
EMPTY=
OUTPUTEXE=-o $(EMPTY)
EXT_DLL=.dll
EXT_OBJ=.$(O)
EXT_OBJ=.o
OUTPUTOBJ=-o $(EMPTY)
EXT_LIB=.$(A)
EXT_ASM=.$(S)
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=
PTHREAD_CAML_LINK=$(addprefix -cclib ,$(PTHREAD_LINK))
RPATH=
SUPPORTS_SHARED_LIBRARIES=true
SHAREDLIB_CFLAGS=
MKSHAREDLIBRPATH=
ASM=$(TOOLPREF)as
ASPP=$(TOOLPREF)gcc -c
ASM=x86_64-w64-mingw32-as
ASPP=x86_64-w64-mingw32-gcc -c
DYNLINKOPTS=
SYSTHREAD_SUPPORT=true
EXTRALIBS=
NATDYNLINK=true
NATDYNLINKOPTS=
CMXS=cmxs
RUNTIMED=false
RUNTIMED=true
ASM_CFI_SUPPORTED=false
WITH_FRAME_POINTERS=false
UNIX_OR_WIN32=win32
Expand All @@ -91,7 +85,7 @@ FLAMBDA=false
WITH_FLAMBDA_INVARIANTS=false
WITH_PROFINFO=false
WITH_SPACETIME=false
ENABLE_CALL_COUNTS=false
ENABLE_CALL_COUNTS=true
LIBUNWIND_AVAILABLE=false
LIBUNWIND_LINK_FLAGS=
PROFINFO_WIDTH=0
Expand All @@ -106,12 +100,11 @@ 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
CC=x86_64-w64-mingw32-gcc
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
Expand All @@ -121,11 +114,11 @@ BYTECCLIBS=-lws2_32 -lversion
NATIVECCLIBS=-lws2_32 -lversion

### How to invoke the C preprocessor
CPP=cpp
CPP=x86_64-w64-mingw32-gcc -E

### Flexlink
FLEXLINK_CMD=flexlink
FLEXDLL_CHAIN=mingw64
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
Expand All @@ -141,27 +134,27 @@ endif
# or OCAML_FLEXLINK overriding will not work (see utils/config.mlp)
MKDLL=$(FLEXLINK)
MKEXE=$(MKEXE_ANSI) $(if $(OC_LDFLAGS),-link "$(OC_LDFLAGS)")
MKEXEDEBUGFLAG=-g
MKEXEDEBUGFLAG=-link -g
MKMAINDLL=$(FLEXLINK) -maindll

### Native command to build ocamlrun.exe without flexlink
MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OC_LDFLAGS) $(OUTPUTEXE)$(1) $(2)
MKEXE_BOOT=$(CC) $(OC_CFLAGS) $(OC_LDFLAGS) $(OUTPUTEXE)$(1) $(2)

### Native command to build an ANSI executable
MKEXE_ANSI=$(FLEXLINK) -exe
MKEXE_ANSI=$(FLEXLINK) -exe

### How to build a static library
MKLIB=rm -f $(1) && $(TOOLPREF)ar rcs $(1) $(2)
MKLIB=rm -f $(1) && x86_64-w64-mingw32-ar rc $(1) $(2) && x86_64-w64-mingw32-ranlib $(1)

### Canonicalize the name of a system library
SYSLIB=-l$(1)

### The ranlib command
RANLIB=$(TOOLPREF)ranlib
RANLIBCMD=$(TOOLPREF)ranlib
RANLIB=x86_64-w64-mingw32-ranlib
RANLIBCMD=x86_64-w64-mingw32-ranlib

### The ar command
ARCMD=$(TOOLPREF)ar
ARCMD=x86_64-w64-mingw32-ar

############# Configuration for the native-code compiler

Expand All @@ -178,20 +171,20 @@ SYSTEM=mingw64
OCAMLOPT_CFLAGS=-O -mms-bitfields

### Build partially-linked object file
PACKLD=$(TOOLPREF)ld -r -o # must have a space after '-o'
PACKLD=x86_64-w64-mingw32-ld -r -o $(EMPTY)

### 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
OTHERLIBRARIES=win32unix str dynlink bigarray raw_spacetime_lib systhreads

############# 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)"
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
Loading