lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] [10/14] git commit: refs/heads/master - Add some EXTRA_CFLAGS using charmonizer.
Date Wed, 02 Jan 2013 20:38:07 GMT
Add some EXTRA_CFLAGS using charmonizer.

Process debugging and valgrind-facilitating environment variables using
charmonizer.  Add a command-line argument to charmonizer to disable
threads.


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

Branch: refs/heads/master
Commit: 9c1d101115bf15c62d4283270956fed817d811ec
Parents: 33a67f3
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Wed Dec 12 13:38:58 2012 -0800
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Wed Jan 2 12:10:12 2013 -0800

----------------------------------------------------------------------
 clownfish/runtime/common/charmonizer.main |   25 +++++++++++++++++++++++
 common/charmonizer.main                   |   26 ++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/9c1d1011/clownfish/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/clownfish/runtime/common/charmonizer.main b/clownfish/runtime/common/charmonizer.main
index b65dc01..4ffef3b 100644
--- a/clownfish/runtime/common/charmonizer.main
+++ b/clownfish/runtime/common/charmonizer.main
@@ -39,6 +39,21 @@
 #include "Charmonizer/Core/ConfWriterPerl.h"
 #include "Charmonizer/Core/ConfWriterRuby.h"
 
+static void
+S_add_compiler_flags(struct chaz_CLIArgs *args) {
+    if (chaz_Probe_gcc_version_num()) {
+        if (getenv("LUCY_VALGRIND")) {
+            chaz_CC_add_extra_cflags("-DLUCY_VALGRIND -fno-inline-functions");
+        }
+        else if (getenv("LUCY_DEBUG")) {
+            chaz_CC_add_extra_cflags(
+                "-DLUCY_DEBUG -pedantic -Wall -Wextra "
+                "-Wno-variadic-macros "
+            );
+        }
+    }
+}
+
 int main(int argc, const char **argv) {
     /* Initialize. */
     {
@@ -48,6 +63,16 @@ int main(int argc, const char **argv) {
             chaz_Probe_die_usage();
         }
         chaz_Probe_init(&args);
+        S_add_compiler_flags(&args);
+    }
+    {
+        int i;
+        for (i = 0; i < argc; i++) {
+            if (strncmp(argv[i], "--disable-threads", 17) == 0) {
+                chaz_CC_add_extra_cflags("-DLUCY_NOTHREADS");
+                break;
+            }
+        }
     }
 
     /* Run probe modules. */

http://git-wip-us.apache.org/repos/asf/lucy/blob/9c1d1011/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index 7090033..0a54b88 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -38,6 +38,21 @@
 #include "Charmonizer/Core/ConfWriterPerl.h"
 #include "Charmonizer/Core/ConfWriterRuby.h"
 
+static void
+S_add_compiler_flags(struct chaz_CLIArgs *args) {
+    if (chaz_Probe_gcc_version_num()) {
+        if (getenv("LUCY_VALGRIND")) {
+            chaz_CC_add_extra_cflags("-DLUCY_VALGRIND -fno-inline-functions");
+        }
+        else if (getenv("LUCY_DEBUG")) {
+            chaz_CC_add_extra_cflags(
+                "-DLUCY_DEBUG -pedantic -Wall -Wextra "
+                "-Wno-variadic-macros "
+            );
+        }
+    }
+}
+
 int main(int argc, const char **argv) {
     /* Initialize. */
     {
@@ -47,6 +62,17 @@ int main(int argc, const char **argv) {
             chaz_Probe_die_usage();
         }
         chaz_Probe_init(&args);
+        S_add_compiler_flags(&args);
+
+    }
+    {
+        int i;
+        for (i = 0; i < argc; i++) {
+            if (strncmp(argv[i], "--disable-threads", 17) == 0) {
+                chaz_CC_add_extra_cflags("-DLUCY_NOTHREADS");
+                break;
+            }
+        }
     }
 
     /* Run probe modules. */


Mime
View raw message