added "C++FLAGS.all" (and "OBJCFLAGS.all"); "CFLAGS.all" is still in effect
[k8jam.git] / doc / ChangeLog
blobce0bc0eaf2b0d68002e778dd0ed02c9e31100c4a
1   [+] $(HOME)/.jam.rc now included twice -- before everything, and after everything.
2       variable `JAM_USER_RC_PRE` is not empty on "before" stage, and
3       variable `JAM_USER_RC_POST` is not empty on "after" stage.
4       this way you can set various k8jam vars before default initialisation takes place.
6   [+] profile variables restructured a little:
7       variable `OPTIM_COMMON_FLAGS` now contains common flags for all profiles.
8       `OPTIM_USER_COMMON_FLAGS` can be set by user (empty by default), and will
9       be added to `OPTIM_COMMON_FLAGS`.
10       added user vars for various profiles (empty by default):
11         OPTIM_USER_NOOPT
12         OPTIM_USER_SPEED
13         OPTIM_USER_SIZE
14         OPTIM_USER_DEBUG
15         OPTIM_USER_STANDARD
16       added `OPTIM_ARCH_TUNE` which is used at opimised profiles. default is
17         "-march=$(GCC_NATIVE_ARCH) -mtune=$(GCC_NATIVE_ARCH)"
19   [+] PWD/Pwd built-in added; usage:
20       pwd = [ PWD ] ;
21   [+] SORT/Sort built-in added; usage:
22       sorted = [ SORT $(list) ] ;
23   [+] COMMAND/Command built-in added; usage:
24       res = [ COMMAND shellcmd-list [[ : options ]] ];
25       options:
26         exit-status, exit-code:
27           return exit code as last list element
28         no-output:
29           don't return command output
30         no-trim:
31           don't trim command output;
32           default: trim left and right
33         no-trim-left:
34           don't left-trim command output
35         no-trim-right:
36           don't right-trim command output
37         status-first, code-first:
38           put exit code first
39         parse-output:
40           parse output as list (break on whitespaces -- <= ' ')
41         no-space-break:
42           don't break on spaces (' ') when 'parse-output' activated
43         no-tab-break:
44           don't break on tabs ('\t') when 'parse-output' activated
45         no-nl-break, no-lf-break:
46           don't break on LF ('\n') when 'parse-output' activated
47         no-cr-break:
48           don't break on CR ('\r') when 'parse-output' activated
49       default: ignore command output, return empty string if everything is ok
50                or numeric exit code (non-zero)
51   [+] COMMAND/Command built-in synthax changed; new synthax:
52       res = [ COMMAND shellcmd-list [[ : options ]] ];
53       new options (added to common description)
54   [+] COMMAND/Command built-in now can parse command output
56   [+] rule RemoveOpt
57       # VAR = [ RemoveOpt options-to-remove : options-list ] ;
58       # remove options from list
59   [+] rule RemoveOptWild
60       # VAR = [ RemoveOpt regexp-options-to-remove : options-list ] ;
61       # remove options from list with egrep-like regexps
62   [+] rule profile
63       # profile "name" ;
64       # set compile flags for profile; works only for gcc/g++
65       # available profiles:
66       #  none, default: don't change
67       #  empty: remove optimisation flags
68       #  speed: optimise for speed and pIII
69       #  size: optimise for size
70       #  debug: don't optimize, add debug info
71       #  standard: -O2
72   [+] rule ObjectNoAliasing
73       # ObjectNoAliasing filelist ;
74       # turn off aliasing optimization for specified files
75       # works only for gcc/g++
77   [*] MainC++ wasn't working properly
78   [*] XXXC++ variables changed to XXXC++ZZZ (MainC++ --> C++Main)
79   [+] LOCATE_BIN and ALL_LOCATE_BIN variables added (for Main and MainC++ targets)
80       so now one can do something like this:
81         ALL_LOCATE_TARGET = $(TOP)/build/obj ;
82         ALL_LOCATE_BIN = $(TOP)/build ;
83       and have a nice bunch of *.o files in build/obj and binary in build/
84   [+] new rule: lib-config
85       call $(1) --cflags and $(1) --libs (many libs provides such configurators)
86       add necessary flags to compiler and linker vars
87       return "tan" (non-empty string) if library is present
88       if $(2) != "" -- don't add flags, just check
89   [+] PATH_SEPARATOR variable added
90   [*] build process changed (.o and .a moved to subdir)
91   [+] allow []...] and [^]...] in globs (so ranges can include ']')
92   [+] :Q now quotes all special shell chars, not only '\'
93   [*] some regexprs were broken by tab expansion; fixed
94   [*] OPTIMC++ renamed to C++OPTIM
96   [+] LOCATE_LIB, LOCATE_LIBSO and ALL_LOCATE_LIB[SO] variables added (for Library and SharedLibrary targets)
97       so now one can do something like this:
98         ALL_LOCATE_TARGET = $(TOP)/build/obj ;
99         ALL_LOCATE_LIB = $(TOP)/build/liba ;
100         ALL_LOCATE_LIBSO = $(TOP)/build/libso ;
101         ALL_LOCATE_BIN = $(TOP)/build ;
102       and have a nice bunch of files in various dirs.
104   [*] JAMCMDARGS now set before parsing Jamfiles (and what sense was to set it after? %-)
105   [+] JAM_TARGETS variable added; scripts are free to modify it, so we can easy define targets from whithin scripts
107   [+] SubIncludeOnce varname : TOP ... ;
108       will do SubInclude iff 'varname' is not set (and will set 'varname')
109       so one can include all necessary libraries in all necessary projects
111   [+] partial Objective C support:
112       ObjC-Main, std. set of OBJC* vars
113         OBJC_GNUSTEP_BASE_LIB = gnustep-base ;
114         OBJC_GNUSTEP_GUI_LIB = gnustep-gui ;
115       rules: ObjCUseGNUstepBase, ObjCUseGNUstepGui, ObjCUseGNUstep
117   [+] 'lib-config-ex' rule:
118       lib-config-ex "command" : "var-name-to-modify"
119       "var-name-to-modify" can be omited;
120       rule returs value of command
122   [+] new built-ins:
123       Echo-n: same as Echo, but does not writes '\n'
124       O-Flush: flush standard output (for Echo-n)
125   [+] added rules: LinkFlagsOn, C++LinkFlagsOn, ObjCLinkFlagsOn
126       same as Object*Flags, but for linker flags
127       we need this due to 'gristing' in multidir builds
129   [+] new variable: JAM_FORCE_GCC_OPTIONS
130       set it to override GCC detection
132   [+] rule set-profile:
133       selects 'debug', 'standard', 'speed' or 'size' profile according to vars:
134         DEBUG = 1 : debug
135         OPT_SIZE = 1 : size
136         OPT_SPEED = 1 : speed
137         default: standard
139   [+] rule set-default-subdir-locates (sets my defaults for ALL_LOCATE_XXX: _build/, etc)
141   [+] alias for set-default-subdir-locates: set-default-target-locations ;
143   [+] rule pkg-config
145   [+] jam now correctly creates dirs for files like 'dir/source'
146   [+] alias for set-default-subdir-locates: set-default-locations ;
148   [+] added acions for WINDOZE=1 (my own way to cross-build windoze soft with wine and mingw)
149       vars for invocation:
150         WINE -- wine command; default is "wine"
151         MGPATH -- path to mingw bin dir; default is "c:\mingw\bin\" (note the last '\')
152         MGCC -- mingw gcc compiler name; default is "mingw32-gcc.exe";
153         MG -- mingw g++ compiler name; default is "mingw32-g++.exe -static-libgcc"
154       vars for 'windoze-fix' rule (this rule should be invoked in Jamrules; it is harmless to
155       invoke it for any build scheme):
156         WINDOZE_THREADS -- if not empty, add "-mthreads"
157         WINSUBSYS -- either 'console' or 'windows'; default is 'console'
158         WINLIBS -- list of windoze libraries to add; default is '-lkernel32'
160   [!] WARNING! COMPATIBILITY BREAKING CHANGE!
161   [*] old SubInclude rule renamed to SubIncludeMany
162   [*] new SubInclude rule works as SubIncludeOnce (autogenerates guard var)
164   [+] new built-in: [ ExprI1 num0 op num1 ]
165       integer math; understands 5 standard ops ('%' as C '%')
166       [ ExprI1 40 + 2 ] ==> "42"
167       it also understands "<", "<=", ">", ">=", "=" and "!="
168   [+] [ ExprI1 "#" string ] -- return string length
169   [+] new built-in: [ Split str : delims ]
170       split `str` using `delims`
171         [ Split "a,b,c;d" : ",;" ] ==> a b c d
172       if `delims` is not specified, split string to chars
174   [+] lexer now needs less spaces (and sometimes more quoting)
175   [+] added header caching (when using set-default-locations rule)
177   [+] new built-in: [ NormPath pathstr ]
178       it will add 'pwd' if path is not absolute and will try to resolve some '.' and '..'
179       (only leading '..' though).
180       it can be used in SubDir replacement to automate dir building
182   [+] added 'rule name expansion':
183         rule print-foo { Echo "foo" ; }
184         variable = "print" ;
185         $(variable)-foo ;
187   [+] added default 'help' and 'push' targets
188       redefine actions AShowHelp and AGitPush in Jamrules to use the correspoinding target
190   [+] added help-profile target
192   [+] new variables: CFLAGS.all, OPTIM.all, LINKFLAGS.all, LINKLIBS.all
193       profile now sets *.all flags
195   [+] K8JAM-PROGRESS-TIME-DELTA variable (float, seconds between progress/time indicator)
197   [+] regexp engine now undestands some character classes (like :space:) and non-greedy ops
199   [+] call 'check-setup-windoze' rule to enable WINDOZE=1 builds
200   [+] setup-windoze rule will setup windoze build regardless of WINDOZE=1
201   [+] call use-mingw32 rule to use i686-pc-mingw32 crosscompiler instead of wine
202   [+] call windoze-fix after setting WINDOZE_THREADS, WINLIBS and WINSUBSYS
204   [+] sys-has-command cmd -- perform `which`, return "tan" or ""
206   [+] new built-in: ListLength
208   [+] `PreUserObject` rule
209       this rule will be called before `Object` rule decides how to build something;
210       the calling convention is the same as for `UserObject`, but `PreUserObject`
211       should return non-empty string if it wants to bypass default generator rules.
213   [+] documentation: built-in DependsList
214       DependsList all ;
215       returns a list of child dependencies for a given target
217   [+] new built-ins: HaveRule, HaveActions
218       HaveRule rulename [rulename...] [ : glob/regexp case-insensitive ignore-case ]
219       HaveActions rulename [rulename...] [ : glob/regexp case-insensitive ignore-case ]
220       returns non-empty string if all specified rules or actions are defined
221       note that we can have rule without actions and actions without rule
222       specify `glob` option to treat names as shell-like globs
223       specify `regexp` option to treat names as regexps
224       specify `case-insensitive` option to ignore case
226   [+] new built-in: ForceFile
227       reverts NoFile effect
229   [+] added flags to Glob and Match: now we can use globs and regexps, and do
230       that ignoring the case.
232   [+] new rule: FileExists fname [fname...] ;
233       returns non-empty string if all files exists; understand pathes.
235   [+] Glob flags:
236         case-sensitive
237         case-insensitive
238         ignore-case
239         glob
240         regexp
241         plain
242         dirs-only
243         files-only
244         any
245         names-only
246         full-path
248   [+] set-default-locations now recognizes DEBUG and respects BUILD_DIR
250   [+] new variables: CC.standard and C++.standard; defaults to gnu99 and gnu++98 if set-profile called
252   [+] new rule: DetectLibrary libnames [: includes [: pathes]]
253       default path list is $(DETECT_LIBRARY_PATH)
254       it will check $(p)/lib for library and $(p)/include for header
255       returns prefix or empty list
256       usage:
257         LIBJIMTCL_PFX = [ DetectLibrary libjim.a : jim.h : /opt/jim /opt/jim-tcl ] ;
258         if $(LIBJIMTCL_PFX) {
259           LINKFLAGS.all += -L$(LIBJIMTCL_PFX)/lib ;
260           LINKLIBS.all += -ljim ;
261           HDRS += $(LIBJIMTCL_PFX)/include ;
262           DEFINES += USE_JIM_TCL ;
263         }
265   [+] you can set K8JAM-JOBS variable to force number of jobs
267   [+] use DBG=1 to suppress NDEBUG define for non-debug profiles
269   [+] easy independent targets in *Main:
270       specify independent target name as 3rd arg to *Main:
271         Main alsatest : alsatest.c : alsatest ;  # or Main alsatest : alsatest.c : _ ;
272         Main zytest : zytest.c : test tests ;
273       to cleanup, do:
274         jam alsatest_clean
275       or
276         jam alsatest clean
278   [+] 'clean' now doesn't clean 'Jamrules.auto.configure'; use 'distclean' to kill it
280   [+] JAMCONFIGARGS variable, which collects --* arguments
281   [+] 'config' now understands '--prefix' and sets PREFIX =? xxx
282   [+] InstallUserDefined rule:
283         # $(1): gristed source file
284         # $(2): source file
285         # $(3): directory to install
286         # $(LOCATE): the same as $(2) -- can be used in actions
288   [+] -configure-detect-library- now allows additional parameters (allow-any-lib and allow-any-header)
289       as parameter #7
291   [+] *Main now understands some flags, which must be specified after file name:
292       Main mysoft :
293         main.c
294         processing.c !no-aliasing  # add OPTIM_NOALIAS to build command
295       ;
296       '!xyz' actually calls rule named --main-option-xyz-- if any, passing GRISTED filename as $(1) and
297       UNMODIFIED file name as $(2). sample no-aliasing rule:
298       rule --main-option-no-aliasing-- {
299         if $(OPTIM_NOALIAS) {
300           CCFLAGS on $(1) += $(OPTIM_NOALIAS) ;
301           C++FLAGS on $(1) += $(OPTIM_NOALIAS) ;
302           OBJCFLAGS on $(1) += $(OPTIM_NOALIAS) ;
303         }
304       }
305       use '!!filename' if your file name starts with '!'
307   [+] -configure-pkg-config-necessary- rule
308       optional: set PROJECT_NAME to project name which should be displayed on failure
309       -configure-pkg-config-necessary-
310         "GLib"    "glib-2.0 >= 2.30.0"
311         "X11"     "x11"
312         "GTK+2"   "gtk+-2.0"
313       ;
315   [+] -configure-enable-disable-vars- variable to easy '--enable-xxx' and '--disable-xxx' options:
316       # "auto": check with pkg-config or so, show '--disable-xxx'
317       # "": disabled by default, show '--enable-xxx'
318       # non-empty string: enabled by default, show '--disable-xxx'
319       -configure-enable-disable-vars- +=
320         "sqlite"    USE_SQLITE    "auto"  "don't use sqlite"
321         "gtkhtml"   USE_GTKHTML   "auto"  "don't use GTKHTML"
322         "gtkspell"  USE_GTKSPELL  "auto"  "don't use GTKSpell"
323         "svg"       USE_RSVG      "auto"  "don't use librsvg"
324         "soup"      USE_SOUP      "auto"  "don't use libsoup"
325         "curl"      USE_CURL      "auto"  "don't use libcurl"
326         "dock"      USE_DOCK      "tan"   "disable dock icon"
327       ;
329   [*] Exit ; now exits without output and with SUCCESS exit code
331   [+] PROFILE variable now selects profile in set-profile rule
333   [+] RandName rule: generate random name
334       [ RandName ] -- /tmp/XXX
335       [ RandName "abc/" ] -- abc/XXX
336       [ RandName "" ] -- XXX
338   [+] ListWrite rule: write string list to file
339       ListFileWrite filename : list [: terminator] [: append]
340       default terminator is '\n'
341       return success flag
343   [+] -configure-try-compile-cc- rule
344       $(1) -- program, string list
345       $(2) -- additional compiler flags (optional)
346       $(3) -- additional linker flags (optional)
347       rule -configure-test-timegm- {
348         return [ -configure-try-compile-cc-
349           "#include <stdlib.h>"
350           "#include <time.h>"
351           "int main() {"
352           "struct tm _tm = { 0 };"
353           "_tm.tm_year = 2000;"
354           "_tm.tm_mon = 1;"
355           "_tm.tm_mday = 1;"
356           "timegm(&_tm);"
357           "return 0;"
358           "}"
359         ] ;
360       }
362   [+] -configure-test-compile-cc- rule:
363       $(1) -- test name
364       $(2) -- program, string list
365       $(3) -- additional compiler flags (optional)
366       $(4) -- additional linker flags (optional)
368   [*] Echo-n removed, O-Flush removed, Echo now accepts some flags as $(2):
369       -n -- don't write newline
370       -Q -- don't write anything (so Echo : -n -Q will effectively do fflush(stdout);)
371       -S -- don't print spaces betwen args
372       -s -- print space after last arg (if there were some args at all)
373       -w -- use stderr instead of stdout
375   [*] Exit now accepts the same $(2) args as Echo
377   [+] semaphores (TOTALLY UNTESTED!)
378       It is sometimes desirable to disallow parallel execution of some actions. For example:
379       Old versions of yacc use files with fixed names. So, running two yacc actions is dangerous.
380       One might want to perform parallel compiling, but not do parallel linking, because linking
381       is i/o bound and only gets slower. Craig McPeeters has extended Perforce Jam to solve such
382       problems, and that extension was integrated in Boost.Jam (and in k8jam).
384       Any target can be assigned a semaphore, by setting a variable called JAM_SEMAPHORE on that
385       target. The value of the variable is the semaphore name. It must be different from names of
386       any declared target, but is arbitrary otherwise.
388       The semantic of semaphores is that in a group of targets which have the same semaphore, only
389       one can be updated at the moment, regardless of "-j" option.
391   [+] binding rules
392       Whenever a target is bound to a location in the filesystem, K8Jam will
393       look for a variable called BINDRULE. If non-empty, $(BINDRULE[1]) names
394       a rule which is called with the name of the target and the path it is
395       being bound to. The signature of the rule named by $(BINDRULE[1]) should
396       match the following:
398         rule bind-rule target : path
400       This facility is useful for correct header file scanning, since many
401       compilers will search for #included files first in the directory
402       containing the file doing the #include directive. $(BINDRULE) can be
403       used to make a record of that directory.
405   [+] for local var in xyz { ... }
407   [+] strings in single quotes -- '\' in such strings backslash is just an ordinary character
408       to embed single quote in such string use "''" (two single quotes in a row)
409       this is useful for regular expressions
411   [+] define -configure-user-help- rule to show user 'configure' options
413   [+] single-quoted strings now should not be expanded. i.e. '$(a)' means literal
414       string "$(a)", not string with value of $(a) expanded.
416   [+] ListRemoveDuplicates rule added. *Main now will remove all duplicate '.o' from
417       linking list.
419   [*] heavily modified GenFile rule:
420        GenFile target : image sources [: dependencies ] ;
422        Runs the command "_image_ _target_ _sources_" to create _target_ from
423        _sources_ and _image_ (where _image_ is an executable built by the @Main rule).
424        'source' starting with '-' or '/' is an option, don't include it in the dependency graph.
425        'source' starting with '*' switches generator to GenFile2, which will not automatically
426        add target to argument list.
427        'source' equal to $$ means 'target' and switches to GenFile2.
428        if 'image' starts with ':', this is standalone file, don't append any suffix to it.
430   [+] added 'UserObject' rule chain. define rule with arbitrary name and signature:
431       / <grist>outfile.o : <grist>infile.ext : exetarget ;
432       then add it to chain with 'RegisterUserObjectRule rulename'.
433       'rulename' should return true if it is in effect (to break chain).
434       if no rule in chain in effect, standard 'UserObject' rule will be called.
436   [+] added $(out) and $(in) as aliases for $(1) and $(2) (tnx to tzirechnoy)
438   [+] added `~=` for regexp comparison:
439       $(a) ~= '^hey!$'
441   [+] all regexps now can contain options. if regexp starts with '/', it MUST
442       be closed with '/' too, and can have such options after it:
443         i: ignore case
444         u: this is utf-8 string
445         m: '.' matches newline
446       default mode: case-sensitive non-utf-8, '.' will not match newline
448   [*] new variable expander: bigger, better and uncut!
449       WARNING! selector logic changed!
450       you can do the things like this now:
451         a = /usr/local/bin/fuck.elf ;
452         Echo $(a:B=heh:BS) ;
453       previously this prints 'fuck.elf', but now it prints 'heh.elf'
455   [*] Q modifier extended: now it can have '=qset' argument; it will use
456       first char from qset as 'screening' char and other chars as chars
457       that must be screened. if there is only one char, it will use
458       'shell quoting set'.
460   [*] new scanner; sometimes better, sometimes worser. sample of the better case:
461       $(a:Q=\\/) -- no more "\\\\" here!
463   [+] :W=width: pad string to the given width; if width<0: left padding
464   [+] :W -- return string length
465   [+] :C=width: cut string to the given width
467   [-] NormPath
468   [+] NormalizePath path [: pwd ]
469       prepend 'pwd' if path is not absolute (use current working dir if no 'pwd' given).
470       resolve '.' and '..' (it will not use filesystem for this, just string processing).
471       if path ends with '/', result will end with '/' too
473   [*] FReverse rule removed: use ListReverse instead.
475   [+] k8jam will try to load ~/.jam.rc before main Jamfile. you can use it to disable
476       idiotic 'diagnostic caret' in gcc 4.8+. just put this to ~/.jam.rc:
477         CFLAGS.all += -fno-diagnostics-show-caret ;
479   [+] if user-set-subdir-locates rule is present, it will be called from set-target-locations
480       after jam locations processed, with build dir as arg. rule MUST return dir
482   [+] added UNITTEST, RELEASE and NODEBUG flags for D
484   [+] -configure-pkg-config-var- rule: the same as -configure-pkg-config- but 1st arg is
485       'enable/disable' var name. var value will be changed accordingly to check result
487   [+] D support in set-profile:
488       RELEASE=1 -- build release version
489       UNITTEST=1 -- build unittest version
490       for non-release mode:
491         D_NO_ASSERT=1: turn off assert()
492         D_NO_IN=1: turn off in {}
493         D_NO_OUT=1: turn off out {}
494         D_NO_INVARIANTS=1: turn off invariant {}
495         D_NO_BOUNDS=1: turn off bounds checking
496         D_NO_DEBUG=1: turn off 'debug'
497         D_DEBUG=list: add -fdebug=xxx for each list item
498         D_MAXSPEED=1: DON'T USE!
500   [+] set-profile now understands 'speed', 'size', 'debug' and 'release' targets
501       'release' target sets RELEASE variable and some flags for GDC compiler
503   [+] set-profile now accepts list of flags. known flags:
504         no-targets -- don't process 'profile targets'
506   [-] no more D_RELEASE and D_UNITTEST
508   [+] D_VERSION variable; works similar to DEFINES but for gdc
510   [+] TARGET_SUBDIR variable, contains custom subdir for targets set with set-target-locations.
511       can be used to differentiate builds by specifying CLI vars or so
512       if it's a list, it will be joined with PATH_SEPARATOR
514   [+] ObjectDFlags rule
516   [+] ObjectDInlineFlags rule which adds $(GDC_INLINE_FLAGS) to force gdc do maximal inlining
517       without resorting to -O3
519   [+] added HDRPATH_IGNORE var which contains list of path prefixes to ignore in header scanner
521   [+] you can list libxyz.a in Main rule now, this will work exactly as LinkLibraries
523   [+] added JAM_BINARY var, which can be used in Command to exec ourself
525   [+] added "jammod" command to invoke various k8jam modules
527   [+] added "genman" module
529   [+] added "CompareVersions" rule; it compares semver versions ("num.num.num", etc.), and
530       returns '0', '-1', or '1'.