This file is part of MXE. See index.html for further information. Contains ad hoc patches for cross building. From 002715e4bdd4f2aacb6ce8b1b89bae734b6c36fc Mon Sep 17 00:00:00 2001 From: MXE Date: Wed, 13 Jun 2012 22:27:54 +0200 Subject: [PATCH] various patches to build an ocaml cross compiler diff --git a/Makefile b/Makefile index e53fd0d..0decd00 100644 --- a/Makefile +++ b/Makefile @@ -289,16 +289,17 @@ install: for i in $(OTHERLIBRARIES); do \ (cd otherlibs/$$i; $(MAKE) install) || exit $$?; \ done - cd ocamldoc; $(MAKE) install + # cd ocamldoc; $(MAKE) install if test -f ocamlopt; then $(MAKE) installopt; else :; fi if test -f debugger/ocamldebug; then (cd debugger; $(MAKE) install); \ else :; fi cp config/Makefile $(LIBDIR)/Makefile.config - BINDIR=$(BINDIR) LIBDIR=$(LIBDIR) PREFIX=$(PREFIX) \ - ./build/partial-install.sh + #BINDIR=$(BINDIR) LIBDIR=$(LIBDIR) PREFIX=$(PREFIX) \ + # ./build/partial-install.sh # Installation of the native-code compiler installopt: + if test -d $(COMPLIBDIR); then : ; else $(MKDIR) $(COMPLIBDIR); fi cd asmrun; $(MAKE) install cp ocamlopt $(BINDIR)/ocamlopt$(EXE) cd stdlib; $(MAKE) installopt @@ -737,7 +738,7 @@ ocamlbuild.native: ocamlopt ocamlbuild-mixed-boot ocamlbuildlib.native: ocamlopt ocamlbuild-mixed-boot ./build/ocamlbuildlib-native-only.sh -ocamlbuild-mixed-boot: ocamlc +ocamlbuild-mixed-boot: ocamlc otherlibraries ./build/mixed-boot.sh touch ocamlbuild-mixed-boot diff --git a/Makefile-mingw.in b/Makefile-mingw.in new file mode 100644 index 0000000..c3dddf6 --- /dev/null +++ b/Makefile-mingw.in @@ -0,0 +1,160 @@ +######### General configuration + +PREFIX=@prefix@ + +### Remove this to disable compiling camlp4 +#CAMLP4=camlp4 + +### Where to install the binaries +BINDIR=$(PREFIX)/bin + +### Where to install the standard library +LIBDIR=$(PREFIX)/lib/ocaml + +### Where to install the stub DLLs +STUBLIBDIR=$(LIBDIR)/stublibs + +### Where to install the info files +DISTRIB=$(PREFIX) + +### Where to install the man pages +MANDIR=$(PREFIX)/man + +########## Toolchain and OS dependencies + +TOOLCHAIN=cc + +### Toolchain prefix +TOOLPREF=@toolpref@- + +CCOMPTYPE=cc +O=o +A=a +S=s +SO=dll +EXE= +EXT_DLL=.dll +EXT_OBJ=.$(O) +EXT_LIB=.$(A) +EXT_ASM=.$(S) +MANEXT=1 +SHARPBANGSCRIPTS=true +PTHREAD_LINK= +X11_INCLUDES= +X11_LINK= +DBM_INCLUDES= +DBM_LINK= +BYTECCRPATH= +SUPPORTS_SHARED_LIBRARIES=true +SHAREDCCCOMPOPTS= +MKSHAREDLIBRPATH= +NATIVECCPROFOPTS=-pg +NATIVECCRPATH= +ASM=$(TOOLPREF)as +ASPP=$(TOOLPREF)gcc -c +ASPPPROFFLAGS=-DPROFILING +PROFILING=prof +DYNLINKOPTS=-ldl +DEBUGGER=ocamldebugger +CC_PROFILE=-pg +SYSTHREAD_SUPPORT=true +EXTRALIBS= +NATDYNLINK=true +NATDYNLINKOPTS= +CMXS=cmxs +RUNTIMED=noruntimed +ASM_CFI_SUPPORTED=false + +########## Configuration for the bytecode compiler + +### Which C compiler to use for the bytecode interpreter. +BYTECC=$(TOOLPREF)gcc + +### Additional compile-time options for $(BYTECC). (For static linking.) +BYTECCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused + +### Additional link-time options for $(BYTECC). (For static linking.) +BYTECCLINKOPTS=-L$(PREFIX)/lib + +### Additional compile-time options for $(BYTECC). (For building a DLL.) +DLLCCCOMPOPTS= + +### Libraries needed +BYTECCLIBS= +NATIVECCLIBS= + +### How to invoke the C preprocessor + +### Flexlink +FLEXLINK=$(TOOLPREF)flexlink -chain mingw +FLEXDIR=$(shell $(FLEXLINK) -where) +IFLEXDIR=-I"$(FLEXDIR)" +MKDLL=$(FLEXLINK) +MKEXE=$(FLEXLINK) -exe +MKMAINDLL=$(FLEXLINK) -maindll + +### How to build a static library +MKLIB=$(TOOLPREF)ar rcs $(1) $(2) +#ml let mklib out files opts = Printf.sprintf ("%sar rcs %s %s %s") toolpref out opts files;; + +### Canonicalize the name of a system library +SYSLIB=-l$(1) +#ml let syslib x = "-l"^x;; + +### 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 + +### Name of architecture model for the native-code compiler. +MODEL=default + +### Name of operating system family for the native-code compiler. +SYSTEM=mingw + +### Which C compiler to use for the native-code compiler. +NATIVECC=$(BYTECC) + +### Additional compile-time options for $(NATIVECC). +NATIVECCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused + +### Additional link-time options for $(NATIVECC) +NATIVECCLINKOPTS=-L$(PREFIX)/lib + +### Build partially-linked object file +PACKLD=$(TOOLPREF)ld -r $(NATIVECCLINKOPTS) -o #there must be a space after this '-o' + +############# Configuration for the contributed libraries + +OTHERLIBRARIES=@otherlibraries@ + +### Name of the target architecture for the "num" library +BNG_ARCH=i386 +BNG_ASM_LEVEL=1 + +### Configuration for LablTk +# Set TK_ROOT to the directory where you installed TCL/TK 8.5 +# There must be no spaces or special characters in $(TK_ROOT) +TK_DEFS= +TK_LINK= + +############# Aliases for common commands + +# MAKEREC=$(MAKE) -f Makefile.nt +# MAKECMD=$(MAKE) + +# Build compiler for cross-compilation. +BUILD_MKEXE=gcc +BUILD_RANLIB=ranlib +BUILD_MKDLL=gcc -shared +BUILD_CC=gcc +BUILD_CCLIBS=-lm +BUILD_CFLAGS= + diff --git a/asmrun/Makefile b/asmrun/Makefile index d4f0c56..a535666 100644 --- a/asmrun/Makefile +++ b/asmrun/Makefile @@ -26,7 +26,7 @@ COBJS=startup.o main.o fail.o roots.o globroots.o signals.o signals_asm.o \ misc.o freelist.o major_gc.o minor_gc.o memory.o alloc.o compare.o ints.o \ floats.o str.o array.o io.o extern.o intern.o hash.o sys.o parsing.o \ gc_ctrl.o terminfo.o md5.o obj.o lexing.o printexc.o callback.o weak.o \ - compact.o finalise.o custom.o unix.o backtrace.o natdynlink.o debugger.o \ + compact.o finalise.o custom.o unix.o win32.o backtrace.o natdynlink.o debugger.o \ meta.o dynlink.o ASMOBJS=$(ARCH).o @@ -153,6 +153,8 @@ globroots.c: ../byterun/globroots.c ln -s ../byterun/globroots.c globroots.c unix.c: ../byterun/unix.c ln -s ../byterun/unix.c unix.c +win32.c: ../byterun/win32.c + ln -s ../byterun/win32.c win32.c dynlink.c: ../byterun/dynlink.c ln -s ../byterun/dynlink.c dynlink.c signals.c: ../byterun/signals.c @@ -163,7 +165,7 @@ debugger.c: ../byterun/debugger.c LINKEDFILES=misc.c freelist.c major_gc.c minor_gc.c memory.c alloc.c array.c \ compare.c ints.c floats.c str.c io.c extern.c intern.c hash.c sys.c \ parsing.c gc_ctrl.c terminfo.c md5.c obj.c lexing.c printexc.c callback.c \ - weak.c compact.c finalise.c meta.c custom.c main.c globroots.c unix.c \ + weak.c compact.c finalise.c meta.c custom.c main.c globroots.c unix.c win32.c \ dynlink.c signals.c debugger.c clean:: diff --git a/asmrun/i386.S b/asmrun/i386.S index e8e00a4..800247e 100644 --- a/asmrun/i386.S +++ b/asmrun/i386.S @@ -76,6 +76,9 @@ popl %edx; popl %ecx; popl %eax; popl %ebp #define PROFILE_C \ pushl %ebp; movl %esp, %ebp; call Lmcount$stub; popl %ebp +#elif defined(SYS_mingw) +#define PROFILE_CAML +#define PROFILE_C #endif #else #define PROFILE_CAML diff --git a/byterun/Makefile.common b/byterun/Makefile.common index b519f75..2274562 100755 --- a/byterun/Makefile.common +++ b/byterun/Makefile.common @@ -24,7 +24,7 @@ COMMONOBJS=\ compare.o ints.o floats.o str.o array.o io.o extern.o intern.o \ hash.o sys.o meta.o parsing.o gc_ctrl.o terminfo.o md5.o obj.o \ lexing.o callback.o debugger.o weak.o compact.o finalise.o custom.o \ - dynlink.o + dynlink.o win32.o PRIMS=\ alloc.c array.c compare.c extern.c floats.c gc_ctrl.c hash.c \ diff --git a/byterun/dynlink.c b/byterun/dynlink.c index 5cb2ed7..b6605fa 100644 --- a/byterun/dynlink.c +++ b/byterun/dynlink.c @@ -80,7 +80,12 @@ static char * parse_ld_conf(void) stdlib = getenv("OCAMLLIB"); if (stdlib == NULL) stdlib = getenv("CAMLLIB"); - if (stdlib == NULL) stdlib = OCAML_STDLIB_DIR; + if (stdlib == NULL) +#ifdef OCAML_STDLIB_DIR + stdlib = OCAML_STDLIB_DIR; +#else + stdlib = "."; +#endif ldconfname = caml_stat_alloc(strlen(stdlib) + 2 + sizeof(LD_CONF_NAME)); strcpy(ldconfname, stdlib); strcat(ldconfname, "/" LD_CONF_NAME); diff --git a/byterun/unix.c b/byterun/unix.c index 7d24ef4..3619e67 100644 --- a/byterun/unix.c +++ b/byterun/unix.c @@ -15,6 +15,8 @@ /* Unix-specific stuff */ +#ifndef WIN32 + #define _GNU_SOURCE /* Helps finding RTLD_DEFAULT in glibc */ @@ -323,3 +325,5 @@ int caml_executable_name(char * name, int name_len) } #endif + +#endif /* !WIN32 */ diff --git a/byterun/win32.c b/byterun/win32.c index f8ba9c9..82afc1c 100644 --- a/byterun/win32.c +++ b/byterun/win32.c @@ -13,6 +13,8 @@ /* $Id: win32.c 12686 2012-07-10 11:34:39Z scherer $ */ +#ifdef WIN32 + /* Win32-specific stuff */ #include @@ -35,6 +37,26 @@ #include "flexdll.h" +/* XXX including gets ../byterun/io.h for some reason. + * Including the real io.h using the full path fails because of + * some strange bug in the system header file itself. Give up and + * just define _finddata_t explicitly here. + */ +#ifndef _FSIZE_T_DEFINED +typedef unsigned long _fsize_t; +#define _FSIZE_T_DEFINED + +struct _finddata_t +{ + unsigned attrib; + time_t time_create; + time_t time_access; + time_t time_write; + _fsize_t size; + char name[FILENAME_MAX]; +}; +#endif + #ifndef S_ISREG #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) #endif @@ -93,7 +115,7 @@ CAMLexport char * caml_search_exe_in_path(char * name) pathlen = strlen(name) + 1; if (pathlen < 256) pathlen = 256; while (1) { - fullname = stat_alloc(pathlen); + fullname = caml_stat_alloc(pathlen); retcode = SearchPath(NULL, /* use system search path */ name, ".exe", /* add .exe extension if needed */ @@ -107,7 +129,7 @@ CAMLexport char * caml_search_exe_in_path(char * name) break; } if (retcode < pathlen) break; - stat_free(fullname); + caml_stat_free(fullname); pathlen = retcode + 1; } return fullname; @@ -479,3 +501,5 @@ int caml_win32_random_seed (intnat data[16]) data[2] = GetCurrentProcessId(); return 3; } + +#endif /* WIN32 */ diff --git a/hardcode_mingw_include.patch b/hardcode_mingw_include.patch new file mode 100644 index 0000000..571747d --- /dev/null +++ b/hardcode_mingw_include.patch @@ -0,0 +1,24 @@ +Index: build-tree/ocaml-3.11.1/utils/clflags.ml +=================================================================== +--- build-tree.orig/ocaml-3.12.1/utils/clflags.ml 2010-01-07 04:00:11.000000000 +0100 ++++ build-tree/ocaml-3.12.1/utils/clflags.ml 2010-01-07 04:00:24.000000000 +0100 +@@ -20,7 +20,7 @@ + + let compile_only = ref false (* -c *) + and output_name = ref (None : string option) (* -o *) +-and include_dirs = ref ([] : string list)(* -I *) ++and include_dirs = ref (["@libdir@"] : string list)(* -I *) + and no_std_include = ref false (* -nostdlib *) + and print_types = ref false (* -i *) + and make_archive = ref false (* -a *) +--- build-tree.orig/ocaml-3.12.1/tools/ocamlmklib.mlp 2010-02-22 20:15:57.000000000 -0600 ++++ build-tree/ocaml-3.12.1/tools/ocamlmklib.mlp 2010-02-22 20:16:20.000000000 -0600 +@@ -29,7 +29,7 @@ + and failsafe = ref false (* whether to fall back on static build only *) + and c_libs = ref [] (* libs to pass to mksharedlib and ocamlc -cclib *) + and c_opts = ref [] (* options to pass to mksharedlib and ocamlc -ccopt *) +-and ld_opts = ref [] (* options to pass only to the linker *) ++and ld_opts = ref ["-I @libdir@"] (* options to pass only to the linker *) + and ocamlc = ref (compiler_path "ocamlc") + and ocamlopt = ref (compiler_path "ocamlopt") + and output = ref "a" (* Output name for Caml part of library *) diff --git a/myocamlbuild.ml b/myocamlbuild.ml index c687242..ccdd937 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -107,9 +107,11 @@ let if_mixed_dir dir = if mixed then ".."/dir else dir;; let unix_dir = - match Sys.os_type with - | "Win32" -> if_mixed_dir "otherlibs/win32unix" - | _ -> if_mixed_dir "otherlibs/unix";; + if_mixed_dir ( + let win32path = "otherlibs/win32unix" in + if Sys.file_exists (win32path / "unix.cma") then win32path + else "otherlibs/unix" + );; let threads_dir = if_mixed_dir "otherlibs/threads";; let systhreads_dir = if_mixed_dir "otherlibs/systhreads";; diff --git a/ocamldoc/Makefile b/ocamldoc/Makefile index 74c82d3..61036c8 100644 --- a/ocamldoc/Makefile +++ b/ocamldoc/Makefile @@ -69,6 +69,7 @@ INCLUDES_DEP=-I $(OCAMLSRCDIR)/parsing \ INCLUDES_NODEP= -I $(OCAMLSRCDIR)/stdlib \ -I $(OCAMLSRCDIR)/otherlibs/str \ -I $(OCAMLSRCDIR)/otherlibs/dynlink \ + -I $(OCAMLSRCDIR)/otherlibs/win32unix \ -I $(OCAMLSRCDIR)/otherlibs/unix \ -I $(OCAMLSRCDIR)/otherlibs/num \ -I $(OCAMLSRCDIR)/otherlibs/graph diff --git a/otherlibs/Makefile.shared b/otherlibs/Makefile.shared index 2c084a0..0e13022 100644 --- a/otherlibs/Makefile.shared +++ b/otherlibs/Makefile.shared @@ -33,7 +33,7 @@ MKLIB=$(CAMLRUN) $(ROOTDIR)/tools/ocamlmklib #EXTRACFLAGS= #EXTRACAMLFLAGS= #LINKOPTS= -#LDOPTS= +LDOPTS=-L$(LIBDIR) #HEADERS= CMIFILES ?= $(CAMLOBJS:.cmo=.cmi) @@ -42,7 +42,8 @@ CLIBNAME ?= $(LIBNAME) all: lib$(CLIBNAME).$(A) $(LIBNAME).cma $(CMIFILES) -allopt: lib$(CLIBNAME).$(A) $(LIBNAME).cmxa $(LIBNAME).$(CMXS) $(CMIFILES) +allopt: lib$(CLIBNAME).$(A) $(LIBNAME).cmxa $(CMIFILES) +# $(LIBNAME).$(CMXS) $(LIBNAME).cma: $(CAMLOBJS) $(MKLIB) -o $(LIBNAME) -oc $(CLIBNAME) -ocamlc '$(CAMLC)' -linkall $(CAMLOBJS) $(LINKOPTS) @@ -50,8 +51,8 @@ $(LIBNAME).cma: $(CAMLOBJS) $(LIBNAME).cmxa: $(CAMLOBJS_NAT) $(MKLIB) -o $(LIBNAME) -oc $(CLIBNAME) -ocamlopt '$(CAMLOPT)' -linkall $(CAMLOBJS_NAT) $(LINKOPTS) -$(LIBNAME).cmxs: $(LIBNAME).cmxa lib$(CLIBNAME).$(A) - $(CAMLOPT) -shared -o $(LIBNAME).cmxs -I . $(LIBNAME).cmxa +#$(LIBNAME).cmxs: $(LIBNAME).cmxa lib$(CLIBNAME).$(A) +# $(CAMLOPT) -shared -o $(LIBNAME).cmxs -I . $(LIBNAME).cmxa lib$(CLIBNAME).$(A): $(COBJS) $(MKLIB) -oc $(CLIBNAME) $(COBJS) $(LDOPTS) diff --git a/otherlibs/bigarray/Makefile b/otherlibs/bigarray/Makefile index d442edb..dc34d6d 100644 --- a/otherlibs/bigarray/Makefile +++ b/otherlibs/bigarray/Makefile @@ -14,8 +14,8 @@ # $Id: Makefile 11156 2011-07-27 14:17:02Z doligez $ LIBNAME=bigarray -EXTRACFLAGS=-I../unix -DIN_OCAML_BIGARRAY -DCAML_NAME_SPACE -EXTRACAMLFLAGS=-I ../unix +EXTRACFLAGS=-I../win32unix -I../unix -DIN_OCAML_BIGARRAY -DCAML_NAME_SPACE +EXTRACAMLFLAGS=-I ../win32unix -I ../unix COBJS=bigarray_stubs.$(O) mmap_unix.$(O) CAMLOBJS=bigarray.cmo HEADERS=bigarray.h diff --git a/otherlibs/systhreads/Makefile b/otherlibs/systhreads/Makefile index 502498f..7ed53df 100644 --- a/otherlibs/systhreads/Makefile +++ b/otherlibs/systhreads/Makefile @@ -15,13 +15,13 @@ include ../../config/Makefile -CAMLC=../../ocamlcomp.sh -I ../unix -CAMLOPT=../../ocamlcompopt.sh -I ../unix +CAMLC=../../ocamlcomp.sh -I ../win32unix -I ../unix +CAMLOPT=../../ocamlcompopt.sh -I ../win32unix -I ../unix MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib COMPFLAGS=-warn-error A -g -BYTECODE_C_OBJS=st_stubs_b.o -NATIVECODE_C_OBJS=st_stubs_n.o +BYTECODE_C_OBJS=st_stubs_b.o win32_b.o +NATIVECODE_C_OBJS=st_stubs_n.o win32_n.o THREAD_OBJS= thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo @@ -37,6 +37,10 @@ st_stubs_b.o: st_stubs.c st_posix.h -c st_stubs.c mv st_stubs.o st_stubs_b.o +win32_b.$(O): st_stubs.c st_win32.h + $(BYTECC) -I ../../byterun $(BYTECCCOMPOPTS) $(CFLAGS) -c st_stubs.c + mv st_stubs.$(O) win32_b.$(O) + # Dynamic linking with -lpthread is risky on many platforms, so # do not create a shared object for libthreadsnat. libthreadsnat.a: $(NATIVECODE_C_OBJS) @@ -46,9 +50,13 @@ st_stubs_n.o: st_stubs.c st_posix.h $(NATIVECC) -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) $(SHAREDCCCOMPOPTS) -DNATIVE_CODE -DTARGET_$(ARCH) -DSYS_$(SYSTEM) -c st_stubs.c mv st_stubs.o st_stubs_n.o +win32_n.$(O): st_stubs.c st_win32.h + $(NATIVECC) -DNATIVE_CODE -O -I../../asmrun -I../../byterun $(NATIVECCCOMPOPTS) -c st_stubs.c + mv st_stubs.$(O) win32_n.$(O) + threads.cma: $(THREAD_OBJS) $(MKLIB) -ocamlc '$(CAMLC)' -o threads $(THREAD_OBJS) \ - -cclib -lunix $(PTHREAD_LINK) + -cclib -lunix $(PTHREAD_LINK) -lcamlrun # See remark above: force static linking of libthreadsnat.a threads.cmxa: $(THREAD_OBJS:.cmo=.cmx) diff --git a/otherlibs/systhreads/Makefile.nt b/otherlibs/systhreads/Makefile.nt index dc118b7..4b53d6e 100644 --- a/otherlibs/systhreads/Makefile.nt +++ b/otherlibs/systhreads/Makefile.nt @@ -21,6 +21,7 @@ CAMLOPT=../../boot/ocamlrun ../../ocamlopt -I ../../stdlib -I ../win32unix COMPFLAGS=-warn-error A -g MKLIB=../../boot/ocamlrun ../../tools/ocamlmklib CFLAGS=-I../../byterun $(EXTRACFLAGS) +LDOPTS=-L@libdir@ CAMLOBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo CMIFILES=$(CAMLOBJS:.cmo=.cmi) @@ -34,7 +35,7 @@ all: lib$(LIBNAME).$(A) $(LIBNAME).cma $(CMIFILES) allopt: lib$(LIBNAME).$(A) $(LIBNAME).cmxa $(LIBNAME).cmxs $(CMIFILES) $(LIBNAME).cma: $(CAMLOBJS) - $(MKLIB) -o $(LIBNAME) -ocamlc "..\\..\\boot\\ocamlrun ..\\..\\ocamlc" -linkall $(CAMLOBJS) $(LINKOPTS) + $(MKLIB) -o $(LIBNAME) -ocamlc "../../boot/ocamlrun ../../ocamlc" -linkall $(CAMLOBJS) $(LINKOPTS) lib$(LIBNAME).$(A): $(COBJS) $(MKLIB) -o $(LIBNAME) $(COBJS) $(LDOPTS) @@ -46,7 +47,7 @@ st_stubs_b.$(O): st_stubs.c st_win32.h $(LIBNAME).cmxa: $(CAMLOBJS:.cmo=.cmx) - $(MKLIB) -o $(LIBNAME)nat -ocamlopt "..\\..\\boot\\ocamlrun ..\\..\\ocamlopt" -linkall $(CAMLOBJS:.cmo=.cmx) $(LINKOPTS) + $(MKLIB) -o $(LIBNAME)nat -ocamlopt "../../boot/ocamlrun ../../ocamlopt" -linkall $(CAMLOBJS:.cmo=.cmx) $(LINKOPTS) mv $(LIBNAME)nat.cmxa $(LIBNAME).cmxa mv $(LIBNAME)nat.$(A) $(LIBNAME).$(A) @@ -71,6 +72,7 @@ clean: partialclean install: cp dllthreads.dll $(STUBLIBDIR)/dllthreads.dll cp libthreads.$(A) $(LIBDIR)/libthreads.$(A) + cd $(LIBDIR); $(RANLIB) libthreads.$(A) mkdir -p $(LIBDIR)/threads cp $(CMIFILES) threads.cma $(LIBDIR)/threads rm -f $(LIBDIR)/threads/stdlib.cma @@ -78,6 +80,7 @@ install: installopt: cp libthreadsnat.$(A) $(LIBDIR)/libthreadsnat.$(A) + cd $(LIBDIR); $(RANLIB) libthreadsnat.$(A) cp $(THREAD_OBJS:.cmo=.cmx) threads.cmxa threads.$(A) $(LIBDIR)/threads cp threads.cmxs $(LIBDIR)/threads diff --git a/otherlibs/systhreads/st_win32.h b/otherlibs/systhreads/st_win32.h index da602b7..7e1dcb9 100644 --- a/otherlibs/systhreads/st_win32.h +++ b/otherlibs/systhreads/st_win32.h @@ -17,7 +17,7 @@ #define _WIN32_WINNT 0x0400 #include -#include +#include #include #include diff --git a/otherlibs/win32graph/Makefile.nt b/otherlibs/win32graph/Makefile.nt index 62c4678..e7c6d6b 100644 --- a/otherlibs/win32graph/Makefile.nt +++ b/otherlibs/win32graph/Makefile.nt @@ -18,10 +18,11 @@ COBJS=open.$(O) draw.$(O) events.$(O) dib.$(O) CAMLOBJS=graphics.cmo WIN32LIBS=$(call SYSLIB,kernel32) $(call SYSLIB,gdi32) $(call SYSLIB,user32) LINKOPTS=-cclib "\"$(WIN32LIBS)\"" -LDOPTS=-ldopt "$(WIN32LIBS)" include ../Makefile.nt +LDOPTS=-L@libdir@ -ldopt "$(WIN32LIBS)" + graphics.ml: ../graph/graphics.ml cp ../graph/graphics.ml graphics.ml graphics.mli: ../graph/graphics.mli diff --git a/otherlibs/win32unix/Makefile.nt b/otherlibs/win32unix/Makefile.nt index 76a1c19..c401bbb 100644 --- a/otherlibs/win32unix/Makefile.nt +++ b/otherlibs/win32unix/Makefile.nt @@ -40,7 +40,6 @@ LIBNAME=unix COBJS=$(ALL_FILES:.c=.$(O)) CAMLOBJS=unix.cmo unixLabels.cmo LINKOPTS=-cclib $(WSOCKLIB) -LDOPTS=-ldopt $(WSOCKLIB) EXTRACAMLFLAGS=-nolabels EXTRACFLAGS=-I../unix HEADERS=unixsupport.h socketaddr.h @@ -48,6 +47,8 @@ HEADERS=unixsupport.h socketaddr.h include ../Makefile.nt +LDOPTS=-L@libdir@ -ldopt $(WSOCKLIB) + clean:: rm -f $(UNIX_FILES) $(UNIX_CAML_FILES) diff --git a/utils/config.mlp b/utils/config.mlp index cdf67d4..b905059 100644 --- a/utils/config.mlp +++ b/utils/config.mlp @@ -86,11 +86,7 @@ let ext_asm = "%%EXT_ASM%%" let ext_lib = "%%EXT_LIB%%" let ext_dll = "%%EXT_DLL%%" -let default_executable_name = - match Sys.os_type with - "Unix" -> "a.out" - | "Win32" | "Cygwin" -> "camlprog.exe" - | _ -> "camlprog" +let default_executable_name = "camlprog.exe" let systhread_supported = %%SYSTHREAD_SUPPORT%%;; @@ -118,7 +114,7 @@ let print_config oc = p "ext_asm" ext_asm; p "ext_lib" ext_lib; p "ext_dll" ext_dll; - p "os_type" Sys.os_type; + p "os_type" "Win32"; p "default_executable_name" default_executable_name; p_bool "systhread_supported" systhread_supported; flush oc; -- 1.7.9.5