Fossil SCM
Added autosetup checks for alternative libraries and names for the res_query() and ns_*() functions that module smtp.c previously depended on finding in libresolv/glibc. Checking it in on a branch because it needs multiplatform testing. This version solves the problem originally reported on the forum by Andy Goth, being that the current trunk doesn't build on CentOS 5.
Commit
ed3b1e4d89b963f040c032feec4d3c5eb2d10161846cb5159336f34a2f08b235
Parent
c285cd081295904…
2 files changed
+5
-1
+3
M
auto.def
+5
-1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -513,11 +513,15 @@ | ||
| 513 | 513 | # Last resort, may be Windows |
| 514 | 514 | if {[is_mingw]} { |
| 515 | 515 | define-append LIBS -lwsock32 |
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | -cc-check-function-in-lib ns_name_uncompress resolv | |
| 518 | +if { ![cc-check-function-in-lib ns_name_uncompress {resolv bind}] && | |
| 519 | + ![cc-check-function-in-lib __ns_name_uncompress {resolv bind}]} { | |
| 520 | + user-error "We need either libresolv or libbind for res_query() and ns_*()." | |
| 521 | +} | |
| 522 | +cc-check-function-in-lib res_query resolv | |
| 519 | 523 | cc-check-functions utime |
| 520 | 524 | cc-check-functions usleep |
| 521 | 525 | cc-check-functions strchrnul |
| 522 | 526 | cc-check-functions pledge |
| 523 | 527 | cc-check-functions backtrace |
| 524 | 528 |
| --- auto.def | |
| +++ auto.def | |
| @@ -513,11 +513,15 @@ | |
| 513 | # Last resort, may be Windows |
| 514 | if {[is_mingw]} { |
| 515 | define-append LIBS -lwsock32 |
| 516 | } |
| 517 | } |
| 518 | cc-check-function-in-lib ns_name_uncompress resolv |
| 519 | cc-check-functions utime |
| 520 | cc-check-functions usleep |
| 521 | cc-check-functions strchrnul |
| 522 | cc-check-functions pledge |
| 523 | cc-check-functions backtrace |
| 524 |
| --- auto.def | |
| +++ auto.def | |
| @@ -513,11 +513,15 @@ | |
| 513 | # Last resort, may be Windows |
| 514 | if {[is_mingw]} { |
| 515 | define-append LIBS -lwsock32 |
| 516 | } |
| 517 | } |
| 518 | if { ![cc-check-function-in-lib ns_name_uncompress {resolv bind}] && |
| 519 | ![cc-check-function-in-lib __ns_name_uncompress {resolv bind}]} { |
| 520 | user-error "We need either libresolv or libbind for res_query() and ns_*()." |
| 521 | } |
| 522 | cc-check-function-in-lib res_query resolv |
| 523 | cc-check-functions utime |
| 524 | cc-check-functions usleep |
| 525 | cc-check-functions strchrnul |
| 526 | cc-check-functions pledge |
| 527 | cc-check-functions backtrace |
| 528 |
+3
| --- src/smtp.c | ||
| +++ src/smtp.c | ||
| @@ -31,10 +31,13 @@ | ||
| 31 | 31 | #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) |
| 32 | 32 | # include <windows.h> |
| 33 | 33 | # include <windns.h> |
| 34 | 34 | # define FOSSIL_WINDOWS_STYLE_DNS 1 |
| 35 | 35 | #endif |
| 36 | +#ifdef HAVE___NS_NAME_UNCOMPRESS | |
| 37 | +# define ns_name_uncompress __ns_name_uncompress | |
| 38 | +#endif | |
| 36 | 39 | |
| 37 | 40 | |
| 38 | 41 | /* |
| 39 | 42 | ** Find the hostname for receiving email for the domain given |
| 40 | 43 | ** in zDomain. Return NULL if not found or not implemented. |
| 41 | 44 |
| --- src/smtp.c | |
| +++ src/smtp.c | |
| @@ -31,10 +31,13 @@ | |
| 31 | #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) |
| 32 | # include <windows.h> |
| 33 | # include <windns.h> |
| 34 | # define FOSSIL_WINDOWS_STYLE_DNS 1 |
| 35 | #endif |
| 36 | |
| 37 | |
| 38 | /* |
| 39 | ** Find the hostname for receiving email for the domain given |
| 40 | ** in zDomain. Return NULL if not found or not implemented. |
| 41 |
| --- src/smtp.c | |
| +++ src/smtp.c | |
| @@ -31,10 +31,13 @@ | |
| 31 | #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) |
| 32 | # include <windows.h> |
| 33 | # include <windns.h> |
| 34 | # define FOSSIL_WINDOWS_STYLE_DNS 1 |
| 35 | #endif |
| 36 | #ifdef HAVE___NS_NAME_UNCOMPRESS |
| 37 | # define ns_name_uncompress __ns_name_uncompress |
| 38 | #endif |
| 39 | |
| 40 | |
| 41 | /* |
| 42 | ** Find the hostname for receiving email for the domain given |
| 43 | ** in zDomain. Return NULL if not found or not implemented. |
| 44 |