Hello again,

while it it I noticed we historically did the “manual build compiler /tuning/" 
only for the CXXFLAGS (before we had a couple of C files), and before GCC 
gained =native.

So I restructured these to gather all this flags a little better in the CFLAGS, 
and base the CXXFLAGS on it at the end:

--- Makefile    (revision 2058)
+++ Makefile    (revision 2059)
@@ -8,7 +8,6 @@
 
 # -s silcently corrupts binaries on OS X, sigh -ReneR
 CFLAGS := -Wall -O2 # -O1 -ggdb # -fsanitize=address -fsanitize=undefined
-CXXFLAGS := $(CFLAGS) -Wno-sign-compare
 
 # for config.h
 CPPFLAGS += -I .
@@ -21,34 +20,36 @@
             > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
 
 ifeq "$(X_ARCH)" "i686"
-CXXFLAGS += -march=i686
-CXXFLAGS += $(call cc-option,-mtune=pentium4,)
+CFLAGS += -march=i686
+CFLAGS += $(call cc-option,-mtune=pentium4,)
+CFLAGS += $(call cc-option,-mfpmath=sse,)
 endif
 
 # TODO: improve to match i[3456]86
 ifneq  "$(X_ARCH)" "i686"
 CFLAGS += -fPIC
-CXXFLAGS += -fPIC
 endif
 
 ifeq "$(X_ARCH)" "sparc64"
-CXXFLAGS += -mcpu=ultrasparc
-CXXFLAGS += $(call cc-option,-mtune=niagara,)
+CFLAGS += -mcpu=ultrasparc
+CFLAGS += $(call cc-option,-mtune=niagara,)
 endif
 
-CXXFLAGS += -funroll-loops -fomit-frame-pointer
-CXXFLAGS += $(call cc-option,-funswitch-loops,)
-CXXFLAGS += $(call cc-option,-fpeel-loops,)
-CXXFLAGS += $(call cc-option,-ftracer,)
-CXXFLAGS += $(call cc-option,-funit-at-a-time,)
-CXXFLAGS += $(call cc-option,-frename-registers,)
-CXXFLAGS += $(call cc-option,-ftree-vectorize,)
+CFLAGS += $(call cc-option,-march=native)
 
-#CXXFLAGS += $(call cc-option,-mfpmath=sse,)
+CFLAGS += -funroll-loops -fomit-frame-pointer
+CFLAGS += $(call cc-option,-funswitch-loops,)
+CFLAGS += $(call cc-option,-fpeel-loops,)
+CFLAGS += $(call cc-option,-ftracer,)
+CFLAGS += $(call cc-option,-funit-at-a-time,)
+CFLAGS += $(call cc-option,-frename-registers,)
+CFLAGS += $(call cc-option,-ftree-vectorize,)
 
 # we have some unimplemented colorspaces in the Image::iterator :-(
-CXXFLAGS += $(call cc-option,-Wno-switch -Wno-switch-enum,)
+CFLAGS += $(call cc-option,-Wno-switch -Wno-switch-enum,)
 
+CXXFLAGS := $(CFLAGS) -Wno-sign-compare
+
 ifeq "$(STATIC)" "1"
 X_EXEFLAGS += -static
 endif

On Feb 27, 2015, at 13:12, René Rebe <[email protected]> wrote:

> Hi,
> 
> well, with := it works too, so maybe better use := for both?
> 
> --- Makefile  (revision 2057)
> +++ Makefile  (revision 2058)
> @@ -7,8 +7,8 @@
>  X_BUILD_IMPLICIT=1
>  
>  # -s silcently corrupts binaries on OS X, sigh -ReneR
> -CFLAGS ?= -Wall -O2 # -O1 -ggdb # -fsanitize=address -fsanitize=undefined
> -CXXFLAGS = $(CFLAGS) -Wno-sign-compare
> +CFLAGS := -Wall -O2 # -O1 -ggdb # -fsanitize=address -fsanitize=undefined
> +CXXFLAGS := $(CFLAGS) -Wno-sign-compare
>  
>  # for config.h
> 
> 
> On Feb 27, 2015, at 13:09, René Rebe <[email protected]> wrote:
> 
>> Hi,
>> 
>> yeah, well, Makefiles, … in T2 we use wrappers for compilers et al. to 
>> inject everywhere deterministically the compiler flags we want, …
>> 
>> While at it I wanted to make my life easier and base CXXFLAGS on CFLAGS. For 
>> some magic that did not work with
>> 
>> CXXFLAGS ?= $(CFLAGS) …
>> 
>> so I ended up committing this for now:
>> 
>> --- Makefile (revision 2056)
>> +++ Makefile (revision 2057)
>> @@ -7,10 +7,8 @@
>>  X_BUILD_IMPLICIT=1
>>  
>>  # -s silcently corrupts binaries on OS X, sigh -ReneR
>> -CFLAGS = -Wall -O2
>> -CXXFLAGS = -Wall -O2 -Wno-sign-compare
>> -#CFLAGS = -Wall -O0 -ggdb
>> -#CXXFLAGS = -Wall -O0 -ggdb
>> +CFLAGS ?= -Wall -O2 # -O1 -ggdb # -fsanitize=address -fsanitize=undefined
>> +CXXFLAGS = $(CFLAGS) -Wno-sign-compare
>>  
>>  # for config.h
>>  CPPFLAGS += -I .
>> 
>> I hope it works for you.
>> 
>> I will review the other patches a bit later when I have more time.
>> 
>>      René
>> 
>> On Feb 27, 2015, at 11:03, Sven Eckelmann <[email protected]> wrote:
>> 
>>> From: Jakub Wilk <[email protected]>
>>> 
>>> Build environments (like the ones from Distributions like Debian) may want
>>> to overwrite the CFLAGS/CXXFLAGS to introduce things like hardening flags or
>>> prepare special debug builds. This is not cleanly possible when the Makefile
>>> presets a value unconditionally.
>>> ---
>>> Makefile | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/Makefile b/Makefile
>>> index d4e3cce..8b2c69d 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -7,8 +7,8 @@ include utility/Makefile
>>> X_BUILD_IMPLICIT=1
>>> 
>>> # -s silcently corrupts binaries on OS X, sigh -ReneR
>>> -CFLAGS = -Wall -O2
>>> -CXXFLAGS = -Wall -O2 -Wno-sign-compare
>>> +CFLAGS ?= -Wall -O2
>>> +CXXFLAGS = $(CFLAGS) -Wno-sign-compare
>>> #CFLAGS = -Wall -O0 -ggdb
>>> #CXXFLAGS = -Wall -O0 -ggdb
>>> 
>>> -- 
>>> 2.1.4
>>> 
>> 
>> -- 
>>  ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
>>  http://exactcode.com | http://exactscan.com | http://ocrkit.com | 
>> http://t2-project.org | http://rene.rebe.de
>> 
>> ----------------------------------------------------------- 
>> If you wish to unsubscribe from this mailing, send mail to
>> [email protected] with a subject of: unsubscribe exact-image
> 
> -- 
>  ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
>  http://exactcode.com | http://exactscan.com | http://ocrkit.com | 
> http://t2-project.org | http://rene.rebe.de
> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [email protected] with a subject of: unsubscribe exact-image

-- 
 ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
 DE Legal: Amtsgericht Berlin (Charlottenburg) HRB 105123B, Tax-ID#: DE251602478
 Managing Director: René Rebe
 http://exactcode.com | http://exactscan.com | http://ocrkit.com | 
http://t2-project.org | http://rene.rebe.de

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[email protected] with a subject of: unsubscribe exact-image

Reply via email to