The += argument form provides a way of extending the current or default value of a compiler-configuration variable, instead of replacing it (which is something that I've often wanted). For example, CFLAGS+=-std=gnu99 adds -std=gnu99 to the C compiler flags, instead of requiring CFLAGS="-O2 -std=gnu99" to keep the default and add a new flag.
Besides providing a way to extend the default flags, += provides a way to add multiple flags in a set of configure arguments where spaces always separate the configure arguments and not flags (as long as the flags themselves do not have spaces). Using += that way helps avoid trouble when passing a set of configure arguments through YAML, environment variables, and shell scripts.
The
+=
argument form provides a way of extending the current or default value of a compiler-configuration variable, instead of replacing it (which is something that I've often wanted). For example,CFLAGS+=-std=gnu99
adds-std=gnu99
to the C compiler flags, instead of requiringCFLAGS="-O2 -std=gnu99"
to keep the default and add a new flag.Besides providing a way to extend the default flags,
+=
provides a way to add multiple flags in a set ofconfigure
arguments where spaces always separate theconfigure
arguments and not flags (as long as the flags themselves do not have spaces). Using+=
that way helps avoid trouble when passing a set of configure arguments through YAML, environment variables, and shell scripts.