RPM – Meaning of ‘-14’ in RPM Macros Dump

rhelrpmrpm-spec

It's possible to dump the available / defined macros when authoring a RPM spec file by using:

rpm --showrc or rpm --eval %dump

or including the %dump builtin macro in the spec file itself and examining the output from the RPM build process (the build output contains macro definitions).

In either case, some of the lines are prefixed with "-14" or "-11". The lines without either appear to be the body of multi-line definitions.

What is the significance of the "-14" (or less common "-11") in this output? More importantly I'm interested in knowing where this is documented.

Sample Output:

-14: __autoconf autoconf
-14: __autoheader   autoheader
-14: __automake automake
-11= _target_cpu    x86_64
-11= _target_os linux

References:

Best Answer

RPM macros have an associated level which is the recursion depth.

When returning from a recursive expansion, macros at that level are automatically undefined.

Macros with a level <= 0 are always defined (in some sense global).

Negative valued levels were originally used to mark where macros were defined: from rpm internally, or from reading a configuration file.

In practice, nothing in RPM has ever used or needed the macro level.

But that is what the "-14" means.

Not also the change from ":" to "=" in the --showrc output, which tells which macros were defined or used.

Related Question