confLIBSEARCH

Automatic library search Build macro

The Build script automatically searches for critical (to sendmail) libraries and, if it finds any, automatically enables specific compile-time options. The list of libraries searched is in the internal confLIBSEARCH macro, which defaults to the following list:

db bind resolv 44bsd

The logic is that if a libdb.a or a libdb.so library is found in any of the directories listed with the confLIBSEARCHPATH macro (confLIBSEARCHPATH on page 83), -DNEWDB is automatically[46] defined for confENVDEF (confENVDEF and conf_prog_ENVDEF on page 75).

Then the library that is found first (libbind.a, libbind.so, libresolv.a, or libresolv.so) is added to the list of libraries in the confLIBS macro (confLIBS and conf_prog_LIBS on page 82). If lib44bsd is found, and if libresolv was the first found, 44bsd is also added to the confLIBS macro.

In the rare instance that this automatic search misconfigures for your site or particular build, you can carefully[47] redefine confLIBSEARCH. For example, suppose db has been installed at your site, but it is broken and you don’t have the time to fix it. You might do this:

dnl ********** Note, removed db until we fix it, bob **********
define('confLIBSEARCH', 'bind resolv 44bsd')

Note that you must use the dnl (delete to newline) directive to form a comment in m4(1).

[46] * This is why defining -DNEWDB with confENVDEF sometimes causes two -DNEWDBs to appear when compiling.

[47] Look in devtools/README and in devtools/M4/header.m4 ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.