Skip to content

configure.ac: remaining path-loop searches append spurious -L flags #378

Description

@thegushi

Issue #105 is now partially fixed:

However, the same for d in $*dirs pattern that caused #105 remains in configure.ac for every other optional library. When a library is found in the default search path, the loop picks the first directory from the hard-coded list and appends it to LDFLAGS unnecessarily — or worse, picks the wrong one (e.g. a 32-bit /usr/lib on a 64-bit system).

The affected loops, by line number in the current configure.ac:

Line Variable Library
281 $strldirs strl
721 $gcdirs gc
871 $ssldirs OpenSSL
1061/1124 $milterdirs / lib lib64 lib/libmilter libmilter (no-explicit-path case)
1208 $librrddirs librrd
1281 $libmcddirs libmcd
1365 $unbounddirs libunbound
1427 $libeventdirs libevent
1532 $tredirs libtre
1772 $odbxdirs odbx
1859 $ldapdirs LDAP
1948 $sasldirs SASL
2009 $mdbdirs libmdb
2093 $curldirs libcurl
2225 $janssondirs jansson
2348/2377 $bdbdirs BerkeleyDB

The fix for each is the same: try the empty path (no -L) first before iterating the hard-coded list, so that libraries available in the default search path are found without adding a spurious -L. For libraries where a .pc file is reliably available, PKG_CHECK_MODULES is the cleaner solution and eliminates the loop entirely.

OpenSSL and libmilter are the most impactful since they are required dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions