Use .dylib not .so for dynamic libraries on MacOS
authorPhil Pennock <pdp@exim.org>
Sat, 27 Aug 2011 22:45:01 +0000 (15:45 -0700)
committerPhil Pennock <pdp@exim.org>
Sat, 27 Aug 2011 22:45:01 +0000 (15:45 -0700)
Not tested the drtables.c change for dynamically loaded lookups, only
the readline loading for -be interactive mode.

doc/doc-txt/ChangeLog
src/OS/os.h-Darwin
src/src/drtables.c
src/src/exim.c
src/src/exim.h

index 9cef584757cb008560d5cbfd2e621984727f8d6a..bb182c9dd938723eff068b5ccd142c419154d0cf 100644 (file)
@@ -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.
 
       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
 -----------------
 
 Exim version 4.76
 -----------------
index 95e08810677f1c69457373c0a333f844193c00da..888b9c759c1805ec892513ec386db9e1c4a1ca98 100644 (file)
@@ -32,4 +32,7 @@ updating Exim to use the newer interface. */
 
 #define BIND_8_COMPAT
 
 
 #define BIND_8_COMPAT
 
+/* It's not .so for dynamic libraries on Darwin. */
+#define DYNLIB_FN_EXT "dylib"
+
 /* End */
 /* End */
index 018c496f8dd738987d2f040f0be5bd4db6047481..37ecf4f4b8cf92790a6fd3dfe292351538b82c79 100644 (file)
@@ -450,7 +450,8 @@ void init_lookup_list(void)
 {
   DIR *dd;
   struct dirent *ent;
 {
   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;
   int countmodules = 0;
   int moduleerrors = 0;
   struct lookupmodulestr *p;
index a0b3e78b463e6e547503793598839d6c8b37f33d..670319b989db251032d98d02ae12564e4d25eff5 100644 (file)
@@ -1078,9 +1078,9 @@ set_readline(char * (**fn_readline_ptr)(const char *),
              void   (**fn_addhist_ptr)(const char *))
 {
 void *dlhandle;
              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)
 if (dlhandle_curses != NULL) dlclose(dlhandle_curses);
 
 if (dlhandle != NULL)
index e979175d178dfc50af2a8908f1444edb747a02f1..a45ea0b30433a613353488cf5e7db27e661c34cb 100644 (file)
@@ -48,6 +48,11 @@ making unique names. */
 #define LOCALHOST_MAX  10
 #endif
 
 #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>
 /* ANSI C standard includes */
 
 #include <ctype.h>