implemented "M-`" in TTY mode
[sxed.git] / Jamrules
blob6f467caedcd2b9574287f77c1963cb40cdb91809
1 if ! $(THIS_IS_K8JAM) { Exit "You need k8jam to build this: https://repo.or.cz/k8jam.git" ; }
2 if ! [ HasRule CompareVersions ] {
3   Exit "Your k8jam version is obsolete; get the new one at: https://repo.or.cz/k8jam.git" ;
5 if [ CompareVersions $(K8_JAMVERSION) : '2.7.0' ] == '-1' {
6   Exit "Your k8jam version is obsolete; get the new one at: https://repo.or.cz/k8jam.git" ;
10 rule GetGCCVersion {
11   local t gccv ;
13   t = [ Match '(gcc)' : "$(CC)" ] ;
14   #Echo "***000***" ;
15   #Echo "$(t)" ;
16   if ( 'gcc' in $(t) ) {
17     gccv = [ Command "$(CC)" '--version' : parse-output no-space-break no-tab-break ] ;
18     #Echo "***001***" ;
19     #Echo "$(gccv)" ;
20     t = [ Match "[\t\r\n ]+([0-9]+\\.[0-9]+)\\." : "$(gccv)" ] ;
21     #Echo "***002***" ;
22     #Echo "$(t[1])" ;
23     if "$(t[1])" {
24       return "$(t[1])" ;
25     }
26   }
28   return "0.0" ;
32 softinclude $(TOP)/Jamrules.local.preconfig ;
33 softinclude $(TOP)/Jamrules.configure ;
34 softinclude $(TOP)/Jamrules.local.pre ;
36 set-profile ;
37 set-target-locations ;
40 softinclude $(TOP)/Jamrules.local ;
41 softinclude $(TOP)/Jamrules.libs ;
42 softinclude $(TOP)/Jamrules.install ;
45 local lbt = [ FileExists $(TOP)/src/libbacktrace/Jamfile ] ;
46 if $(lbt) {
47   HAS_LIBBACKTRACE = tan ;
48 } else {
49   HAS_LIBBACKTRACE = '' ;
52 if '-s' in $(CFLAGS.all) {
53   HAS_LIBBACKTRACE = '' ;
54 } else if '-g' in $(CFLAGS.all) {
55   if $(HAS_LIBBACKTRACE) {
56     DEFINES += HAS_LIBBACKTRACE ;
57     Echo "MSG: activated libbacktrace" ;
58   }
59 } else {
60   HAS_LIBBACKTRACE = '' ;
63 gccver = [ GetGCCVersion ] ;
64 Echo "MSG: using GCC $(gccver)" ;
66 CFLAGS.all += -Wextra ;
68 CFLAGS.all += -Wformat-security ;
69 CFLAGS.all += -Wparentheses ;
71 if $(WINDOZE) {
72   CFLAGS.all -= -Wformat-security ;
73   CFLAGS.all -= -Wattributes ;
75 CFLAGS.all -= -Wattributes ;
78 if [ CompareVersions $(gccver) : '10.0' ] != '-1' {
79   Echo "MSG: activating warnings for GCC 10+" ;
80   CFLAGS.all += -Wmultistatement-macros ;
81   CFLAGS.all += -Wshadow=local ;
82   CFLAGS.all += -Walloc-zero ;
83   CFLAGS.all += -Wmissing-attributes ;
84   CFLAGS.all += -Wcast-function-type ;
87 if [ CompareVersions $(gccver) : '11.0' ] != '-1' {
88   Echo "MSG: activating warnings for GCC 11+" ;
89   CFLAGS.all += -Wno-address-of-packed-member ;
92 # shut the fuck up, g-shit-cc, i don't care what you think about my coding style
93 if [ CompareVersions $(gccver) : '5.0' ] != '-1' {
94   CFLAGS.all += -Wno-misleading-indentation ;
97 # fix some warnings
98 CFLAGS.all += -Wtrampolines ;
99 CFLAGS.all += -Wno-unused-parameter ;
100 CFLAGS.all += -Wno-missing-field-initializers ;