Improved Windows portability release-6.29.0

2008-11-12

author
Markus Mottl <markus.mottl@gmail.com>
date
Wed Nov 12 20:31:39 2008 -0500
changeset 29
f6fdd2e312f5
parent 28
ea10d5cc12f3
child 30
6752893fa5e5

Improved Windows portability

Changes file | annotate | diff | revisions
OCamlMakefile file | annotate | diff | revisions
VERSION file | annotate | diff | revisions
     1.1 --- a/Changes
     1.2 +++ b/Changes
     1.3 @@ -1,3 +1,5 @@
     1.4 +2008-10-12: Improvements to Windows portability.
     1.5 +
     1.6  2008-10-15: Fixed portability problem on MacOS X concerning handling of
     1.7              packed libraries.
     1.8  
     2.1 --- a/OCamlMakefile
     2.2 +++ b/OCamlMakefile
     2.3 @@ -112,10 +112,30 @@
     2.4  
     2.5  ####################  variables depending on your OCaml-installation
     2.6  
     2.7 +SYSTEM := $(shell ocamlc -config 2>/dev/null | grep system | sed 's/system: //')
     2.8 +    # This may be
     2.9 +    # - mingw
    2.10 +    # - win32
    2.11 +    # - cygwin
    2.12 +    # - some other string means Unix
    2.13 +    # - empty means ocamlc does not support -config
    2.14 +
    2.15 +ifeq ($(SYSTEM),mingw)
    2.16 +  MINGW=1
    2.17 +endif
    2.18 +ifeq ($(SYSTEM),win32)
    2.19 +  MSVC=1
    2.20 +endif
    2.21 +
    2.22  ifdef MINGW
    2.23    export MINGW
    2.24    WIN32   := 1
    2.25    CFLAGS_WIN32 := -mno-cygwin
    2.26 +  # The default value 'cc' makes 'ocamlc -cc "cc"' raises the error 'The
    2.27 +  # NTVDM CPU has encountered an illegal instruction'.
    2.28 +  CC := gcc
    2.29 +  # The OCaml C header files use this flag:
    2.30 +  CFLAGS += -D__MINGW32__
    2.31  endif
    2.32  ifdef MSVC
    2.33    export MSVC
    2.34 @@ -943,15 +963,17 @@
    2.35  $(DLLSONAME):		$(OBJ_LINK)
    2.36  			$(CC) $(CFLAGS) $(CFLAGS_WIN32) $(OBJ_LINK) -shared -o $@ \
    2.37  			-Wl,--whole-archive $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \
    2.38 -			 $(OCAMLLIBPATH)/ocamlrun.a \
    2.39 +			 '$(OCAMLLIBPATH)/ocamlrun.a' \
    2.40  			-Wl,--export-all-symbols \
    2.41 -			-Wl,--no-whole-archive
    2.42 +			-Wl,--no-whole-archive \
    2.43 +			-Wl,--allow-multiple-definition \
    2.44 +			-Wl,--enable-auto-import
    2.45  else
    2.46  ifdef MSVC
    2.47  $(DLLSONAME):		$(OBJ_LINK)
    2.48  			link /NOLOGO /DLL /OUT:$@ $(OBJ_LINK) \
    2.49  			 $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/%.lib))) \
    2.50 -			 $(OCAMLLIBPATH)/ocamlrun.lib
    2.51 +			 '$(OCAMLLIBPATH)/ocamlrun.lib'
    2.52  
    2.53  else
    2.54  $(DLLSONAME):		$(OBJ_LINK)
     3.1 --- a/VERSION
     3.2 +++ b/VERSION
     3.3 @@ -1,1 +1,1 @@
     3.4 -release-6-28-2
     3.5 +release-6-29-0

mercurial