Version
3.5.2
Describe the problem you're encountering
Hardcoded include paths are used in several places in couchdb. couchdb is at least considerate enough to check both /usr/include, /usr/local/include and even /opt/homebrew/include/ in the code I reviewed, but this is still insufficient when cross compiling or when building in strange environments like Nix.
The /opt/homebrew/include/ include paths is especially telling. Adding a include path to the hardcoded list of library paths every time a supported target of couchdb needs it is bad.
For example this file includes plenty of hardcoded library paths.
Expected Behaviour
pkg-config should be used to get the appropriate paths. If pkg-config works well on all target environments supported by couchdb, it can fully replace the hardcoded lists, improving the readability and portability of the build system.
Even if pkg-config cannot be used on all supported couchdb systems, the advantages it provides justify it being added as one of the lookup methods (preferably the first) in my opinion. The lookup can fall back to hardcoded paths on systems where pkg-config isn't available.
Version
3.5.2
Describe the problem you're encountering
Hardcoded include paths are used in several places in couchdb. couchdb is at least considerate enough to check both
/usr/include,/usr/local/includeand even/opt/homebrew/include/in the code I reviewed, but this is still insufficient when cross compiling or when building in strange environments like Nix.The
/opt/homebrew/include/include paths is especially telling. Adding a include path to the hardcoded list of library paths every time a supported target of couchdb needs it is bad.For example this file includes plenty of hardcoded library paths.
Expected Behaviour
pkg-configshould be used to get the appropriate paths. If pkg-config works well on all target environments supported by couchdb, it can fully replace the hardcoded lists, improving the readability and portability of the build system.Even if pkg-config cannot be used on all supported couchdb systems, the advantages it provides justify it being added as one of the lookup methods (preferably the first) in my opinion. The lookup can fall back to hardcoded paths on systems where pkg-config isn't available.