PREPENDDEF( )
Prepend to an existing define Build directive
The PREPENDDEF( ) m4 directive allows you to insert new information before that which was previously defined. To illustrate, consider a custom C-language library you want searched first during the loading phase of compiling, where the default list of libraries (for SunOS.5.7) looks like this:
-lsocket -lnsl
If you need to insert another library at the head of this list, without erasing what is already there, you can use this PREPENDDEF( ) directive:
PREPENDDEF(`confLIBS', `-llocal')
This causes the previous declaration to be prefixed with a new (third) library:
-llocal -lsocket -lnsl
Note that you can safely use this PREPENDDEF( ) directive when in doubt as to whether a macro has been given a value by default because no harm can be caused by prepending to an empty definition. (See also APPENDDEF( ) in APPENDDEF( ) on page 69.)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access