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" ;
13 t = [ Match '(gcc)' : "$(CC)" ] ;
16 if ( 'gcc' in $(t) ) {
17 gccv = [ Command "$(CC)" '--version' : parse-output no-space-break no-tab-break ] ;
20 t = [ Match "[\t\r\n ]+([0-9]+\\.[0-9]+)\\." : "$(gccv)" ] ;
32 softinclude $(TOP)/Jamrules.local.preconfig ;
33 softinclude $(TOP)/Jamrules.configure ;
34 softinclude $(TOP)/Jamrules.local.pre ;
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 ] ;
47 HAS_LIBBACKTRACE = tan ;
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" ;
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 ;
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 ;
98 CFLAGS.all += -Wtrampolines ;
99 CFLAGS.all += -Wno-unused-parameter ;
100 CFLAGS.all += -Wno-missing-field-initializers ;