Gitweb:
http://git.exim.org/exim.git/commitdiff/e12f8c3248614077e92c7ba23386e1f36d570c8f
Commit: e12f8c3248614077e92c7ba23386e1f36d570c8f
Parent: 061b7ebd7d69db7674f03025d552fa0bedd0fef8
Author: Phil Pennock <pdp@???>
AuthorDate: Sat Aug 27 15:45:01 2011 -0700
Committer: Phil Pennock <pdp@???>
CommitDate: Sat Aug 27 15:45:01 2011 -0700
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 9cef584..bb182c9 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 95e0881..888b9c7 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 018c496..37ecf4f 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 a0b3e78..670319b 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 e979175..a45ea0b 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 <ctype.h>