OSX DSO fix from HEAD.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 16 Jul 2009 09:58:27 +0000 (09:58 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 16 Jul 2009 09:58:27 +0000 (09:58 +0000)
crypto/dso/dso_dlfcn.c

index 1fd10104c521ccbf29a798091faa078f0e1c81aa..558520d55ab4747d5d5da7e3116490be87b2675b 100644 (file)
@@ -332,6 +332,15 @@ static char *dlfcn_merger(DSO *dso, const char *filespec1,
        return(merged);
        }
 
+#ifdef OPENSSL_SYS_MACOSX
+#define DSO_ext        ".dylib"
+#define DSO_extlen 6
+#else
+#define DSO_ext        ".so"
+#define DSO_extlen 3
+#endif
+
+
 static char *dlfcn_name_converter(DSO *dso, const char *filename)
        {
        char *translated;
@@ -342,8 +351,8 @@ static char *dlfcn_name_converter(DSO *dso, const char *filename)
        transform = (strstr(filename, "/") == NULL);
        if(transform)
                {
-               /* We will convert this to "%s.so" or "lib%s.so" */
-               rsize += 3;     /* The length of ".so" */
+               /* We will convert this to "%s.so" or "lib%s.so" etc */
+               rsize += DSO_extlen;    /* The length of ".so" */
                if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0)
                        rsize += 3; /* The length of "lib" */
                }
@@ -357,9 +366,9 @@ static char *dlfcn_name_converter(DSO *dso, const char *filename)
        if(transform)
                {
                if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0)
-                       sprintf(translated, "lib%s.so", filename);
+                       sprintf(translated, "lib%s" DSO_ext, filename);
                else
-                       sprintf(translated, "%s.so", filename);
+                       sprintf(translated, "%s" DSO_ext, filename);
                }
        else
                sprintf(translated, "%s", filename);