From e12f8c3248614077e92c7ba23386e1f36d570c8f Mon Sep 17 00:00:00 2001 From: Phil Pennock Date: Sat, 27 Aug 2011 15:45:01 -0700 Subject: [PATCH] Use .dylib not .so for dynamic libraries on MacOS Not tested the drtables.c change for dynamically loaded lookups, only the readline loading for -be interactive mode. --- doc/doc-txt/ChangeLog | 2 ++ src/OS/os.h-Darwin | 3 +++ src/src/drtables.c | 3 ++- src/src/exim.c | 4 ++-- src/src/exim.h | 5 +++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 9cef58475..bb182c9dd 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -95,6 +95,8 @@ PP/03 Implement SSL-on-connect outbound with protocol=smtps on smtp transport. Heavily based on revision 40f9a89a from Simon Arlott's tree. Bugzilla 97. +PP/04 Use .dylib instead of .so for dynamic library loading on MacOS. + Exim version 4.76 ----------------- diff --git a/src/OS/os.h-Darwin b/src/OS/os.h-Darwin index 95e088106..888b9c759 100644 --- a/src/OS/os.h-Darwin +++ b/src/OS/os.h-Darwin @@ -32,4 +32,7 @@ updating Exim to use the newer interface. */ #define BIND_8_COMPAT +/* It's not .so for dynamic libraries on Darwin. */ +#define DYNLIB_FN_EXT "dylib" + /* End */ diff --git a/src/src/drtables.c b/src/src/drtables.c index 018c496f8..37ecf4f4b 100644 --- a/src/src/drtables.c +++ b/src/src/drtables.c @@ -450,7 +450,8 @@ void init_lookup_list(void) { DIR *dd; struct dirent *ent; - const pcre *regex_islookupmod = regex_must_compile(US"\\.so$", FALSE, TRUE); + const pcre *regex_islookupmod = regex_must_compile( + US"\\." DYNLIB_FN_EXT "$", FALSE, TRUE); int countmodules = 0; int moduleerrors = 0; struct lookupmodulestr *p; diff --git a/src/src/exim.c b/src/src/exim.c index a0b3e78b4..670319b98 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -1078,9 +1078,9 @@ set_readline(char * (**fn_readline_ptr)(const char *), void (**fn_addhist_ptr)(const char *)) { void *dlhandle; -void *dlhandle_curses = dlopen("libcurses.so", RTLD_GLOBAL|RTLD_LAZY); +void *dlhandle_curses = dlopen("libcurses." DYNLIB_FN_EXT, RTLD_GLOBAL|RTLD_LAZY); -dlhandle = dlopen("libreadline.so", RTLD_GLOBAL|RTLD_NOW); +dlhandle = dlopen("libreadline." DYNLIB_FN_EXT, RTLD_GLOBAL|RTLD_NOW); if (dlhandle_curses != NULL) dlclose(dlhandle_curses); if (dlhandle != NULL) diff --git a/src/src/exim.h b/src/src/exim.h index e979175d1..a45ea0b30 100644 --- a/src/src/exim.h +++ b/src/src/exim.h @@ -48,6 +48,11 @@ making unique names. */ #define LOCALHOST_MAX 10 #endif +/* If not overriden by os.h, dynamic libraries have filenames ending .so */ +#ifndef DYNLIB_FN_EXT +# define DYNLIB_FN_EXT "so" +#endif + /* ANSI C standard includes */ #include -- 2.25.1