home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

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( ).)

    Previous Section Next Section