Skip to content

Commit

Permalink
don't add a charset if there is no data
Browse files Browse the repository at this point in the history
  • Loading branch information
William Le Ferrand committed Feb 14, 2013
1 parent a51a8fa commit 8e8f5bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 85 deletions.
92 changes: 10 additions & 82 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: 5c75b2643b08e856d4098fa73fdde07c) *)
(* DO NOT EDIT (digest: 7ad46580627e6c28701c77dceeeefa34) *)
module OASISGettext = struct
# 21 "/home/hugo/local/src/besport/oasis-0.3.0~rc6/src/oasis/OASISGettext.ml"
(* # 21 "/Users/william/.opam/4.00.1/build/oasis.0.3.0/src/oasis/OASISGettext.ml" *)

let ns_ str =
str
Expand All @@ -24,7 +24,7 @@ module OASISGettext = struct
end

module OASISExpr = struct
# 21 "/home/hugo/local/src/besport/oasis-0.3.0~rc6/src/oasis/OASISExpr.ml"
(* # 21 "/Users/william/.opam/4.00.1/build/oasis.0.3.0/src/oasis/OASISExpr.ml" *)



Expand Down Expand Up @@ -116,7 +116,7 @@ end

# 117 "myocamlbuild.ml"
module BaseEnvLight = struct
# 21 "/home/hugo/local/src/besport/oasis-0.3.0~rc6/src/base/BaseEnvLight.ml"
(* # 21 "/Users/william/.opam/4.00.1/build/oasis.0.3.0/src/base/BaseEnvLight.ml" *)

module MapString = Map.Make(String)

Expand Down Expand Up @@ -214,7 +214,7 @@ end

# 215 "myocamlbuild.ml"
module MyOCamlbuildFindlib = struct
# 21 "/home/hugo/local/src/besport/oasis-0.3.0~rc6/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml"
(* # 21 "/Users/william/.opam/4.00.1/build/oasis.0.3.0/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)

(** OCamlbuild extension, copied from
* http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild
Expand Down Expand Up @@ -323,7 +323,7 @@ module MyOCamlbuildFindlib = struct
end

module MyOCamlbuildBase = struct
# 21 "/home/hugo/local/src/besport/oasis-0.3.0~rc6/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
(* # 21 "/Users/william/.opam/4.00.1/build/oasis.0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)

(** Base functions for writing myocamlbuild.ml
@author Sylvain Le Gall
Expand All @@ -339,7 +339,7 @@ module MyOCamlbuildBase = struct
type name = string
type tag = string

# 56 "/home/hugo/local/src/besport/oasis-0.3.0~rc6/src/plugins/ocamlbuild/MyOCamlbuildBase.ml"
(* # 56 "/Users/william/.opam/4.00.1/build/oasis.0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" *)

type t =
{
Expand Down Expand Up @@ -395,78 +395,6 @@ module MyOCamlbuildBase = struct
Options.ext_dll, "ext_dll";
]

| Before_rules ->
(* TODO: move this into its own file and conditionnaly include it, if
* needed.
*)
(* OCaml cmxs rules: cmxs available in ocamlopt but not ocamlbuild.
Copied from ocaml_specific.ml in ocamlbuild sources. *)
let has_native_dynlink =
try
bool_of_string (BaseEnvLight.var_get "native_dynlink" env)
with Not_found ->
false
in
if has_native_dynlink && String.sub Sys.ocaml_version 0 4 = "3.11" then
begin
let ext_lib = !Options.ext_lib in
let ext_obj = !Options.ext_obj in
let ext_dll = !Options.ext_dll in
let x_o = "%"-.-ext_obj in
let x_a = "%"-.-ext_lib in
let x_dll = "%"-.-ext_dll in
let x_p_o = "%.p"-.-ext_obj in
let x_p_a = "%.p"-.-ext_lib in
let x_p_dll = "%.p"-.-ext_dll in

rule "ocaml: mldylib & p.cmx* & p.o* -> p.cmxs & p.so"
~tags:["ocaml"; "native"; "profile"; "shared"; "library"]
~prods:["%.p.cmxs"; x_p_dll]
~dep:"%.mldylib"
(OC.native_profile_shared_library_link_mldylib
"%.mldylib" "%.p.cmxs");

rule "ocaml: mldylib & cmx* & o* -> cmxs & so"
~tags:["ocaml"; "native"; "shared"; "library"]
~prods:["%.cmxs"; x_dll]
~dep:"%.mldylib"
(OC.native_shared_library_link_mldylib
"%.mldylib" "%.cmxs");

rule "ocaml: p.cmx & p.o -> p.cmxs & p.so"
~tags:["ocaml"; "native"; "profile"; "shared"; "library"]
~prods:["%.p.cmxs"; x_p_dll]
~deps:["%.p.cmx"; x_p_o]
(OC.native_shared_library_link ~tags:["profile"]
"%.p.cmx" "%.p.cmxs");

rule "ocaml: p.cmxa & p.a -> p.cmxs & p.so"
~tags:["ocaml"; "native"; "profile"; "shared"; "library"]
~prods:["%.p.cmxs"; x_p_dll]
~deps:["%.p.cmxa"; x_p_a]
(OC.native_shared_library_link ~tags:["profile"; "linkall"]
"%.p.cmxa" "%.p.cmxs");

rule "ocaml: cmx & o -> cmxs"
~tags:["ocaml"; "native"; "shared"; "library"]
~prods:["%.cmxs"]
~deps:["%.cmx"; x_o]
(OC.native_shared_library_link "%.cmx" "%.cmxs");

rule "ocaml: cmx & o -> cmxs & so"
~tags:["ocaml"; "native"; "shared"; "library"]
~prods:["%.cmxs"; x_dll]
~deps:["%.cmx"; x_o]
(OC.native_shared_library_link "%.cmx" "%.cmxs");

rule "ocaml: cmxa & a -> cmxs & so"
~tags:["ocaml"; "native"; "shared"; "library"]
~prods:["%.cmxs"; x_dll]
~deps:["%.cmxa"; x_a]
(OC.native_shared_library_link ~tags:["linkall"]
"%.cmxa" "%.cmxs");
end

| After_rules ->
(* Declare OCaml libraries *)
List.iter
Expand Down Expand Up @@ -507,7 +435,7 @@ module MyOCamlbuildBase = struct
(* When ocaml link something that use the C library, then one
need that file to be up to date.
*)
dep ["link"; "ocaml"; "program"; tag_libstubs lib]
dep ["link"; "ocaml"; "program"; tag_libstubs lib]
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];

dep ["compile"; "ocaml"; "program"; tag_libstubs lib]
Expand Down Expand Up @@ -545,7 +473,7 @@ module MyOCamlbuildBase = struct
end


# 548 "myocamlbuild.ml"
# 476 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
Expand Down Expand Up @@ -670,6 +598,6 @@ let package_default =

let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;

# 674 "myocamlbuild.ml"
# 602 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;
4 changes: 2 additions & 2 deletions src/aws.mllib
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# OASIS_START
# DO NOT EDIT (digest: 0f6357a50cda6a691ec01d248befe6be)
# DO NOT EDIT (digest: dfe43d99057a93e09520744c0d1a54c5)
Creds
Aws_sigs
Xml
Aws_util
Policy
EC2_factory
Expand All @@ -13,4 +12,5 @@ FPS_factory
Dynamo_factory
IAM_factory
SES_factory
Xml
# OASIS_STOP
3 changes: 2 additions & 1 deletion src/sES_factory.ml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ let send_basic_email ~creds ?message_text ?bcc ?cc ?charset ?reply_to_addresses
subject = { charset; data = subject } ;
body = {
html = { charset; data = message_html } ;
text = { charset; data = (match message_text with | Some m -> m | None -> "") }
text = { charset = (match message_text with Some "" | None -> "" | _ -> charset);
data = (match message_text with | Some m -> m | None -> "") }
}
} in

Expand Down

0 comments on commit 8e8f5bf

Please sign in to comment.