diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | bytecomp/bytelink.ml | 5 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | utils/config.mlbuild | 5 | ||||
-rw-r--r-- | utils/config.mli | 6 | ||||
-rw-r--r-- | utils/config.mlp | 5 |
6 files changed, 23 insertions, 2 deletions
@@ -425,6 +425,8 @@ utils/config.ml: utils/config.mlp config/Makefile -e 's|%%MKDLL%%|$(MKDLL)|' \ -e 's|%%MKEXE%%|$(MKEXE)|' \ -e 's|%%MKMAINDLL%%|$(MKMAINDLL)|' \ + -e 's|%%HOST%%|$(HOST)|' \ + -e 's|%%TARGET%%|$(TARGET)|' \ utils/config.mlp > utils/config.ml @chmod -w utils/config.ml diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml index 3751a0b77..b5c08898d 100644 --- a/bytecomp/bytelink.ml +++ b/bytecomp/bytelink.ml @@ -307,7 +307,8 @@ let link_bytecode ppf tolink exec_name standalone = Symtable.init(); Consistbl.clear crc_interfaces; let sharedobjs = List.map Dll.extract_dll_name !Clflags.dllibs in - if standalone then begin + let check_dlls = standalone && Config.target = Config.host in + if check_dlls then begin (* Initialize the DLL machinery *) Dll.init_compile !Clflags.no_std_include; Dll.add_path !load_path; @@ -317,7 +318,7 @@ let link_bytecode ppf tolink exec_name standalone = let output_fun = output_string outchan and currpos_fun () = pos_out outchan - start_code in List.iter (link_file ppf output_fun currpos_fun) tolink; - if standalone then Dll.close_all_dlls(); + if check_dlls then Dll.close_all_dlls(); (* The final STOP instruction *) output_byte outchan Opcodes.opSTOP; output_byte outchan 0; output_byte outchan 0; output_byte outchan 0; @@ -1832,6 +1832,8 @@ echo "RUNTIMED=${debugruntime}" >>Makefile echo "CAMLP4=${withcamlp4}" >>Makefile echo "ASM_CFI_SUPPORTED=$asm_cfi_supported" >> Makefile echo "WITH_FRAME_POINTERS=$with_frame_pointers" >> Makefile +echo "TARGET=$target" >> Makefile +echo "HOST=$host" >> Makefile if [ "$ostype" = Cygwin ]; then echo "DIFF=diff -q --strip-trailing-cr" >>Makefile fi diff --git a/utils/config.mlbuild b/utils/config.mlbuild index b8debe8d1..264ed6dad 100644 --- a/utils/config.mlbuild +++ b/utils/config.mlbuild @@ -95,6 +95,9 @@ let ext_asm = C.ext_asm let ext_lib = C.ext_lib let ext_dll = C.ext_dll +let host = C.host +let target = C.target + let default_executable_name = match Sys.os_type with "Unix" -> "a.out" @@ -130,6 +133,8 @@ let print_config oc = p "os_type" Sys.os_type; p "default_executable_name" default_executable_name; p_bool "systhread_supported" systhread_supported; + p "host" host; + p "target" target; p "exec_magic_number" exec_magic_number; p "cmi_magic_number" cmi_magic_number; p "cmo_magic_number" cmo_magic_number; diff --git a/utils/config.mli b/utils/config.mli index d8c02006b..7b178e573 100644 --- a/utils/config.mli +++ b/utils/config.mli @@ -120,4 +120,10 @@ val default_executable_name: string val systhread_supported : bool (* Whether the system thread library is implemented *) +val host : string + (* Whether the compiler is a cross-compiler *) + +val target : string + (* Whether the compiler is a cross-compiler *) + val print_config : out_channel -> unit;; diff --git a/utils/config.mlp b/utils/config.mlp index 9affafe52..f77bc54f9 100644 --- a/utils/config.mlp +++ b/utils/config.mlp @@ -85,6 +85,9 @@ let ext_asm = "%%EXT_ASM%%" let ext_lib = "%%EXT_LIB%%" let ext_dll = "%%EXT_DLL%%" +let host = "%%HOST%%" +let target = "%%TARGET%%" + let default_executable_name = match Sys.os_type with "Unix" -> "a.out" @@ -121,6 +124,8 @@ let print_config oc = p "os_type" Sys.os_type; p "default_executable_name" default_executable_name; p_bool "systhread_supported" systhread_supported; + p "host" host; + p "target" target; (* print the magic number *) p "exec_magic_number" exec_magic_number; |