From c7eeba1f8b70844c8a0765ed91aca5655d8a080b Mon Sep 17 00:00:00 2001 From: David Scott Date: Sun, 20 Mar 2016 12:12:24 +0000 Subject: [PATCH 1/2] Make the unix subpackages optional Before this patch we would always build the unix subpackages which internally use tuntap via mirage-net-unix. These unix packages are not useful on OSX (where one should use vmnet via mirage-net-macosx) The unix packages also won't build on Win32, due to tuntap not being generally available (and where we should probably use some-win32-api via mirage-net-win32 instead). This patch only builds the unix subpackages if the mirage-net-unix package is installed. Note the "mirage" tool already does the right thing by: Key.match_ Key.(value target) @@ function | `Unix -> ["mirage-net-unix"] | `MacOSX -> ["mirage-net-macosx"] | `Xen -> ["mirage-net-xen"] As a side-effect, this package now builds on Windows. Signed-off-by: David Scott --- _oasis | 13 +++++++++++++ opam | 10 ++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/_oasis b/_oasis index 5a5798aa5..0d1c993ce 100644 --- a/_oasis +++ b/_oasis @@ -14,6 +14,10 @@ Flag xen Description: Build Xen support Default: false +Flag unix + Description: Build Unix support + Default: true + Library tcpip CompiledObject: best Path: lib @@ -125,6 +129,7 @@ Library "tcpip-stack-direct" tcpip.dhcpv4 Library "ethif-unix" + Build$: flag(unix) CompiledObject: best Path: unix Findlibparent: tcpip @@ -136,6 +141,7 @@ Library "ethif-unix" lwt.unix Library "arpv4-unix" + Build$: flag(unix) CompiledObject: best Path: unix Findlibparent: tcpip @@ -147,6 +153,7 @@ Library "arpv4-unix" lwt.unix Library "ipv4-unix" + Build$: flag(unix) CompiledObject: best Path: unix Findlibparent: tcpip @@ -158,6 +165,7 @@ Library "ipv4-unix" lwt.unix Library "ipv6-unix" + Build$: flag(unix) CompiledObject: best Path: unix Findlibparent: tcpip @@ -169,6 +177,7 @@ Library "ipv6-unix" lwt.unix Library "udpv4-unix" + Build$: flag(unix) CompiledObject: best Path: unix Findlibparent: tcpip @@ -183,6 +192,7 @@ Library "udpv4-unix" io-page.unix Library "udpv6-unix" + Build$: flag(unix) CompiledObject: best Path: unix Findlibparent: tcpip @@ -223,6 +233,7 @@ Library "udpv6-socket" io-page.unix Library "tcpv4-unix" + Build$: flag(unix) CompiledObject: best Path: unix Findlibparent: tcpip @@ -240,6 +251,7 @@ Library "tcpv4-unix" io-page.unix Library "tcpv6-unix" + Build$: flag(unix) CompiledObject: best Path: unix Findlibparent: tcpip @@ -281,6 +293,7 @@ Library "tcpv6-socket" io-page.unix Library "tcpip-stack-unix" + Build$: flag(unix) CompiledObject: best Path: unix Findlibparent: tcpip diff --git a/opam b/opam index 4984fd68b..f7675f98f 100644 --- a/opam +++ b/opam @@ -28,7 +28,10 @@ license: "ISC" tags: ["org:mirage"] build: [ - ["./configure" "--prefix" prefix "--%{mirage-xen:enable}%-xen"] + ["./configure" "--prefix" prefix + "--%{mirage-xen:enable}%-xen" + "--%{mirage-net-unix:enable}%-unix" + ] [make] ] build-test: [ @@ -47,7 +50,6 @@ depends: [ "mirage-unix" {>= "1.1.0"} "mirage-console" "mirage-clock-unix" {>= "1.0.0"} - "mirage-net-unix" {>= "1.1.0"} "ipaddr" {>= "2.2.0"} "mirage-profile" {>= "0.5"} "mirage-flow" {test} @@ -58,5 +60,9 @@ depends: [ ] depopts: [ "mirage-xen" + "mirage-net-unix" +] +conflicts: [ + "mirage-net-unix" { < "1.1.0" } ] available: [ocaml-version >= "4.01.0"] From 0b148f756f99dc7b7732bf234beabd2f2ef18ddc Mon Sep 17 00:00:00 2001 From: David Scott Date: Sun, 20 Mar 2016 12:18:23 +0000 Subject: [PATCH 2/2] Regenerate OASIS Signed-off-by: David Scott --- setup.ml | 70 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 58 insertions(+), 12 deletions(-) diff --git a/setup.ml b/setup.ml index 85d1151f7..ffe9f21cc 100644 --- a/setup.ml +++ b/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.4.5 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 4d4812ef99aa0612194432681173cd76) *) +(* DO NOT EDIT (digest: e0c2680911b1e1f4ed5f1abcc58cdd73) *) (* Regenerated by OASIS v0.4.5 Visit http://oasis.forge.ocamlcore.org for more information and @@ -6926,6 +6926,16 @@ let setup_t = flag_description = Some "Build Xen support"; flag_default = [(OASISExpr.EBool true, false)] }); + Flag + ({ + cs_name = "unix"; + cs_data = PropList.Data.create (); + cs_plugin_data = [] + }, + { + flag_description = Some "Build Unix support"; + flag_default = [(OASISExpr.EBool true, true)] + }); Library ({ cs_name = "tcpip"; @@ -7343,7 +7353,11 @@ let setup_t = cs_plugin_data = [] }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "unix", true) + ]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "unix"; bs_compiled_object = Best; @@ -7379,7 +7393,11 @@ let setup_t = cs_plugin_data = [] }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "unix", true) + ]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "unix"; bs_compiled_object = Best; @@ -7415,7 +7433,11 @@ let setup_t = cs_plugin_data = [] }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "unix", true) + ]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "unix"; bs_compiled_object = Best; @@ -7451,7 +7473,11 @@ let setup_t = cs_plugin_data = [] }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "unix", true) + ]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "unix"; bs_compiled_object = Best; @@ -7487,7 +7513,11 @@ let setup_t = cs_plugin_data = [] }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "unix", true) + ]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "unix"; bs_compiled_object = Best; @@ -7526,7 +7556,11 @@ let setup_t = cs_plugin_data = [] }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "unix", true) + ]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "unix"; bs_compiled_object = Best; @@ -7641,7 +7675,11 @@ let setup_t = cs_plugin_data = [] }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "unix", true) + ]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "unix"; bs_compiled_object = Best; @@ -7683,7 +7721,11 @@ let setup_t = cs_plugin_data = [] }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "unix", true) + ]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "unix"; bs_compiled_object = Best; @@ -7799,7 +7841,11 @@ let setup_t = cs_plugin_data = [] }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "unix", true) + ]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "unix"; bs_compiled_object = Best; @@ -7956,7 +8002,7 @@ let setup_t = }; oasis_fn = Some "_oasis"; oasis_version = "0.4.5"; - oasis_digest = Some "\152\001QçÂ\030MC¥\153VÂTIqÔ"; + oasis_digest = Some "·ÖÇä®ñ\158¿Ã8\154w\155½­;"; oasis_exec = None; oasis_setup_args = []; setup_update = false @@ -7964,6 +8010,6 @@ let setup_t = let setup () = BaseSetup.setup setup_t;; -# 7968 "setup.ml" +# 8014 "setup.ml" (* OASIS_STOP *) let () = setup ();;