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.

wyoung 2018-09-22 05:47 trunk
Commit ed3b1e4d89b963f040c032feec4d3c5eb2d10161846cb5159336f34a2f08b235
2 files changed +5 -1 +3
+5 -1
--- auto.def
+++ auto.def
@@ -513,11 +513,15 @@
513513
# Last resort, may be Windows
514514
if {[is_mingw]} {
515515
define-append LIBS -lwsock32
516516
}
517517
}
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
519523
cc-check-functions utime
520524
cc-check-functions usleep
521525
cc-check-functions strchrnul
522526
cc-check-functions pledge
523527
cc-check-functions backtrace
524528
--- 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 @@
3131
#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
3232
# include <windows.h>
3333
# include <windns.h>
3434
# define FOSSIL_WINDOWS_STYLE_DNS 1
3535
#endif
36
+#ifdef HAVE___NS_NAME_UNCOMPRESS
37
+# define ns_name_uncompress __ns_name_uncompress
38
+#endif
3639
3740
3841
/*
3942
** Find the hostname for receiving email for the domain given
4043
** in zDomain. Return NULL if not found or not implemented.
4144
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button