summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CC/foreign/make/EXPRESSIONS62
-rw-r--r--CC/foreign/make/RULES18
2 files changed, 65 insertions, 15 deletions
diff --git a/CC/foreign/make/EXPRESSIONS b/CC/foreign/make/EXPRESSIONS
index be468e7..e175528 100644
--- a/CC/foreign/make/EXPRESSIONS
+++ b/CC/foreign/make/EXPRESSIONS
@@ -2,6 +2,8 @@
{ "vars":
[ "source_dir"
, "subdir"
+ , "configure"
+ , "configure_options"
, "make_targets"
, "make_prefix"
, "make_options"
@@ -108,6 +110,20 @@
}
}
]
+ , [ "PREFIX"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "make_prefix"}
+ , "then":
+ { "type": "join"
+ , "separator": "/"
+ , "$1":
+ { "type": "++"
+ , "$1": [[""], {"type": "var", "name": "make_prefix"}]
+ }
+ }
+ , "else": {"type": "var", "name": "PREFIX", "default": "/"}
+ }
+ ]
, [ "ENV"
, { "type": "map_union"
, "$1":
@@ -187,19 +203,7 @@
{"type": "join", "$1": {"type": "var", "name": "var_prefix"}}
, "else": "PREFIX"
}
- , "value":
- { "type": "if"
- , "cond": {"type": "var", "name": "make_prefix"}
- , "then":
- { "type": "join"
- , "separator": "/"
- , "$1":
- { "type": "++"
- , "$1": [[""], {"type": "var", "name": "make_prefix"}]
- }
- }
- , "else": {"type": "var", "name": "PREFIX", "default": "/"}
- }
+ , "value": {"type": "var", "name": "PREFIX"}
}
]
}
@@ -210,6 +214,21 @@
, "$1": {"type": "var", "name": "subdir", "default": []}
}
]
+ , [ "configure_args"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "configure"}
+ , "then":
+ { "type": "++"
+ , "$1":
+ [ {"type": "var", "name": "configure_options", "default": []}
+ , [ { "type": "join"
+ , "$1": ["--prefix=", {"type": "var", "name": "PREFIX"}]
+ }
+ ]
+ ]
+ }
+ }
+ ]
, [ "make_targets"
, { "type": "if"
, "cond": {"type": "var", "name": "make_targets"}
@@ -247,6 +266,23 @@
, "readonly VAR_DESTDIR=$2"
, "shift 2"
]
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "configure_args"}
+ , "then":
+ [ "( readonly ROOT=\"$(pwd)\""
+ , " cd \"source/${SUBDIR}\""
+ , { "type": "join"
+ , "$1":
+ [ "./configure "
+ , { "type": "join_cmd"
+ , "$1": {"type": "var", "name": "configure_args"}
+ }
+ , " >\"${ROOT}/configure.log\" || (cat \"${ROOT}/configure.log\" && exit 1)"
+ ]
+ }
+ , ")"
+ ]
+ }
, { "type": "foreach"
, "range": {"type": "var", "name": "make_targets"}
, "var": "target"
diff --git a/CC/foreign/make/RULES b/CC/foreign/make/RULES
index b982946..2a6b2da 100644
--- a/CC/foreign/make/RULES
+++ b/CC/foreign/make/RULES
@@ -1,8 +1,10 @@
{ "data":
- { "doc": ["Data produced by Make build and install."]
+ { "doc": ["Data produced by Configure and Make build and install."]
, "target_fields": ["project"]
, "string_fields":
[ "subdir"
+ , "configure"
+ , "configure_options"
, "targets"
, "prefix"
, "options"
@@ -42,6 +44,9 @@
[ "The subdirectory that contains the configure and Makefile. Individual"
, "directory components are joined with \"/\"."
]
+ , "configure": ["Run ./configure if non-empty."]
+ , "configure_options":
+ ["The configure options (the \"--prefix\" option is automatically set."]
, "targets":
[ "The Make targets to build in the specified order"
, "(default: [\"install\"])."
@@ -204,6 +209,8 @@
}
]
, ["subdir", {"type": "FIELD", "name": "subdir"}]
+ , ["configure", {"type": "FIELD", "name": "configure"}]
+ , ["configure_options", {"type": "FIELD", "name": "configure_options"}]
, ["make_targets", {"type": "FIELD", "name": "targets"}]
, ["make_prefix", {"type": "FIELD", "name": "prefix"}]
, ["make_options", {"type": "FIELD", "name": "options"}]
@@ -264,13 +271,15 @@
}
}
, "library":
- { "doc": ["Library produced by Make build and install."]
+ { "doc": ["Library produced by Configure and Make build and install."]
, "target_fields": ["project", "deps"]
, "string_fields":
[ "subdir"
, "name"
, "version"
, "stage"
+ , "configure"
+ , "configure_options"
, "targets"
, "prefix"
, "options"
@@ -328,6 +337,9 @@
[ "The library version, used for pkg-config files. Individual version"
, "components are joined with \".\"."
]
+ , "configure": ["Run ./configure if non-empty."]
+ , "configure_options":
+ ["The configure options (the \"--prefix\" option is automatically set."]
, "targets":
[ "The Make targets to build in the specified order"
, "(default: [\"install\"])."
@@ -599,6 +611,8 @@
}
]
, ["subdir", {"type": "FIELD", "name": "subdir"}]
+ , ["configure", {"type": "FIELD", "name": "configure"}]
+ , ["configure_options", {"type": "FIELD", "name": "configure_options"}]
, ["make_targets", {"type": "FIELD", "name": "targets"}]
, ["make_prefix", {"type": "FIELD", "name": "prefix"}]
, ["make_options", {"type": "FIELD", "name": "options"}]