You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/10/08 00:52:48 UTC
[5/6] git commit: Support portable static lib creation commands.
Support portable static lib creation commands.
Format commands for `ar` and `ranlib` or equivalent.
Project: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/commit/303df8a5
Tree: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/tree/303df8a5
Diff: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/diff/303df8a5
Branch: refs/heads/master
Commit: 303df8a58ba3965127bcb6edc9058bed73a7aec7
Parents: 334b1e7
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Sep 23 17:49:02 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Tue Sep 23 17:49:02 2014 -0700
----------------------------------------------------------------------
src/Charmonizer/Core/Compiler.c | 22 ++++++++++++++++++++++
src/Charmonizer/Core/Compiler.h | 15 +++++++++++++++
2 files changed, 37 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/303df8a5/src/Charmonizer/Core/Compiler.c
----------------------------------------------------------------------
diff --git a/src/Charmonizer/Core/Compiler.c b/src/Charmonizer/Core/Compiler.c
index dbe36e7..9317c42 100644
--- a/src/Charmonizer/Core/Compiler.c
+++ b/src/Charmonizer/Core/Compiler.c
@@ -376,4 +376,26 @@ chaz_CC_link_command() {
}
}
+char*
+chaz_CC_format_archiver_command(const char *target, const char *objects) {
+ if (chaz_CC.intval__MSC_VER) {
+ /* TODO: Write `objects` to a temporary file in order to avoid
+ * exceeding line length limits. */
+ char *out = chaz_Util_join("", "/OUT:", target, NULL);
+ char *command = chaz_Util_join(" ", "lib", "/NOLOGO", out, NULL);
+ free(out);
+ return command;
+ }
+ else {
+ return chaz_Util_join(" ", "ar", "rcs", target, objects, NULL);
+ }
+}
+
+char*
+chaz_CC_format_ranlib_command(const char *target) {
+ if (chaz_CC.intval__MSC_VER) {
+ return NULL;
+ }
+ return chaz_Util_join(" ", "ranlib", target, NULL);
+}
http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/303df8a5/src/Charmonizer/Core/Compiler.h
----------------------------------------------------------------------
diff --git a/src/Charmonizer/Core/Compiler.h b/src/Charmonizer/Core/Compiler.h
index e33cf81..af1a7dd 100644
--- a/src/Charmonizer/Core/Compiler.h
+++ b/src/Charmonizer/Core/Compiler.h
@@ -111,6 +111,21 @@ chaz_CC_sun_c_version_num(void);
const char*
chaz_CC_link_command(void);
+/* Create a command for building a static library.
+ *
+ * @param target The target library filename.
+ * @param objects The list of object files to be archived in the library.
+ */
+char*
+chaz_CC_format_archiver_command(const char *target, const char *objects);
+
+/* Returns a "ranlib" command if valid.
+ *
+ * @param target The library filename.
+ */
+char*
+chaz_CC_format_ranlib_command(const char *target);
+
#ifdef __cplusplus
}
#endif