Fossil

Check-in [ed3b1e4d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | libbind-ns-alternative
Files: files | file ages | folders
SHA3-256:ed3b1e4d89b963f040c032feec4d3c5eb2d10161846cb5159336f34a2f08b235
User & Date: wyoung 2018-09-22 05:47:20
Context
2018-09-22
06:46
The previous checkin on this branch prevented src/smtp.c from both building and linking because the code previously assumed that it could only build against libresolv for MX lookups and such on Linux, but the checkin gave it enough slack to *attempt* to build on macOS. This checkin prevents that from happening if run on stock macOS, but if you install libbind via Homebrew, it also opens up the possibilty to biuld against it for the first time. It's a complicated sequence of checks due to the way libbind interacts with the stock libresolv. This means we have yet more reason to want to test this widely before merging it to trunk. check-in: 4d9970f6 user: wyoung tags: libbind-ns-alternative
05:47
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. check-in: ed3b1e4d user: wyoung tags: libbind-ns-alternative
00:54
Second attempt at blockquote styling, this time restricting it to forum posts only. (Previous: [2190f86c324d0]) check-in: c285cd08 user: wyoung tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to auto.def.

511
512
513
514
515
516
517




518
519
520
521
522
523
524
525
cc-check-function-in-lib gethostbyname nsl
if {![cc-check-function-in-lib socket {socket network}]} {
    # Last resort, may be Windows
    if {[is_mingw]} {
        define-append LIBS -lwsock32
    }
}




cc-check-function-in-lib ns_name_uncompress resolv
cc-check-functions utime
cc-check-functions usleep
cc-check-functions strchrnul
cc-check-functions pledge
cc-check-functions backtrace

# Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE







>
>
>
>
|







511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
cc-check-function-in-lib gethostbyname nsl
if {![cc-check-function-in-lib socket {socket network}]} {
    # Last resort, may be Windows
    if {[is_mingw]} {
        define-append LIBS -lwsock32
    }
}
if {    ![cc-check-function-in-lib   ns_name_uncompress {resolv bind}] &&
        ![cc-check-function-in-lib __ns_name_uncompress {resolv bind}]} {
	user-error "We need either libresolv or libbind for res_query() and ns_*()."
}
cc-check-function-in-lib res_query resolv
cc-check-functions utime
cc-check-functions usleep
cc-check-functions strchrnul
cc-check-functions pledge
cc-check-functions backtrace

# Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE

Changes to src/smtp.c.

29
30
31
32
33
34
35



36
37
38
39
40
41
42
#  define FOSSIL_UNIX_STYLE_DNS 1
#endif
#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
#  include <windows.h>
#  include <windns.h>
#  define FOSSIL_WINDOWS_STYLE_DNS 1
#endif





/*
** Find the hostname for receiving email for the domain given
** in zDomain.  Return NULL if not found or not implemented.
** If multiple email receivers are advertized, pick the one with
** the lowest preference number.







>
>
>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#  define FOSSIL_UNIX_STYLE_DNS 1
#endif
#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
#  include <windows.h>
#  include <windns.h>
#  define FOSSIL_WINDOWS_STYLE_DNS 1
#endif
#ifdef HAVE___NS_NAME_UNCOMPRESS
#  define ns_name_uncompress __ns_name_uncompress
#endif


/*
** Find the hostname for receiving email for the domain given
** in zDomain.  Return NULL if not found or not implemented.
** If multiple email receivers are advertized, pick the one with
** the lowest preference number.