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 2012/12/13 03:27:50 UTC

[lucy-commits] [5/12] git commit: refs/heads/chaz_compiler_flags - Capture build environment info with Charmonizer.

Capture build environment info with Charmonizer.

Add a new module, "BuildEnv" which captures data such as the name of the
compiler executable, compiler flags, and so on.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/224a5c4f
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/224a5c4f
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/224a5c4f

Branch: refs/heads/chaz_compiler_flags
Commit: 224a5c4f0466089e99d44bdb5a1ba746979f23ab
Parents: 6cafda6
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Dec 11 16:46:26 2012 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Tue Dec 11 16:46:26 2012 -0800

----------------------------------------------------------------------
 charmonizer/src/Charmonizer/Probe/BuildEnv.c |   32 +++++++++++++
 charmonizer/src/Charmonizer/Probe/BuildEnv.h |   49 +++++++++++++++++++++
 clownfish/runtime/common/charmonizer.main    |    2 +
 common/charmonizer.main                      |    1 +
 4 files changed, 84 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/224a5c4f/charmonizer/src/Charmonizer/Probe/BuildEnv.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/BuildEnv.c b/charmonizer/src/Charmonizer/Probe/BuildEnv.c
new file mode 100644
index 0000000..1be7d38
--- /dev/null
+++ b/charmonizer/src/Charmonizer/Probe/BuildEnv.c
@@ -0,0 +1,32 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Charmonizer/Core/HeaderChecker.h"
+#include "Charmonizer/Core/ConfWriter.h"
+#include "Charmonizer/Probe/BuildEnv.h"
+
+void
+chaz_BuildEnv_run(void) {
+    chaz_ConfWriter_start_module("BuildEnv");
+
+    chaz_ConfWriter_add_def("CC", chaz_CC_get_cc());
+    chaz_ConfWriter_add_def("CFLAGS", chaz_CC_get_cflags());
+    chaz_ConfWriter_add_def("EXTRA_CFLAGS", chaz_CC_get_extra_cflags());
+
+    chaz_ConfWriter_end_module();
+}
+
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/224a5c4f/charmonizer/src/Charmonizer/Probe/BuildEnv.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/BuildEnv.h b/charmonizer/src/Charmonizer/Probe/BuildEnv.h
new file mode 100644
index 0000000..f2c1670
--- /dev/null
+++ b/charmonizer/src/Charmonizer/Probe/BuildEnv.h
@@ -0,0 +1,49 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Charmonizer/Probe/BuildEnv.h -- Build environment.
+ *
+ * Capture various information about the build environment, including the C
+ * compiler's interface, the shell, the operating system, etc.
+ *
+ * The following symbols will be defined:
+ *
+ * CC - String representation of the C compiler executable.
+ * CFLAGS - C compiler flags.
+ * EXTRA_CFLAGS - Extra C compiler flags.
+ */
+
+#ifndef H_CHAZ_BUILDENV
+#define H_CHAZ_BUILDENV
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+
+/* Run the BuildEnv module.
+ */
+void chaz_BuildEnv_run(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* H_CHAZ_BUILDENV */
+
+
+

http://git-wip-us.apache.org/repos/asf/lucy/blob/224a5c4f/clownfish/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/clownfish/runtime/common/charmonizer.main b/clownfish/runtime/common/charmonizer.main
index de9ba04..b65dc01 100644
--- a/clownfish/runtime/common/charmonizer.main
+++ b/clownfish/runtime/common/charmonizer.main
@@ -22,6 +22,7 @@
 #include <string.h>
 #include "Charmonizer/Probe.h"
 #include "Charmonizer/Probe/AtomicOps.h"
+#include "Charmonizer/Probe/BuildEnv.h"
 #include "Charmonizer/Probe/DirManip.h"
 #include "Charmonizer/Probe/Floats.h"
 #include "Charmonizer/Probe/FuncMacro.h"
@@ -50,6 +51,7 @@ int main(int argc, const char **argv) {
     }
 
     /* Run probe modules. */
+    chaz_BuildEnv_run();
     chaz_DirManip_run();
     chaz_Headers_run();
     chaz_AtomicOps_run();

http://git-wip-us.apache.org/repos/asf/lucy/blob/224a5c4f/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index 2ba57eb..7090033 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -50,6 +50,7 @@ int main(int argc, const char **argv) {
     }
 
     /* Run probe modules. */
+    chaz_BuildEnv_run();
     chaz_DirManip_run();
     chaz_Headers_run();
     chaz_AtomicOps_run();