summaryrefslogtreecommitdiffstats
path: root/crypto/dso/dso_dlfcn.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-02-15 17:20:15 +0100
committerRichard Levitte <levitte@openssl.org>2016-02-19 11:51:23 +0100
commite987f9f271a13558213e56659fba943df1578f98 (patch)
treebc13ba6c0a58711354ba98e91b70f7643fc58013 /crypto/dso/dso_dlfcn.c
parenta8a421b1136a7aefa6d8658ab1095bb87e90b82e (diff)
Let Configure figure out the diverse shared library and DSO extensions
Then it can pass around the information where it belongs. The Makefile templates pick it up along with other target data, the DSO module gets to pick up the information through crypto/include/internal/dso_conf.h Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'crypto/dso/dso_dlfcn.c')
-rw-r--r--crypto/dso/dso_dlfcn.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
index b6155b141b..107abfd54f 100644
--- a/crypto/dso/dso_dlfcn.c
+++ b/crypto/dso/dso_dlfcn.c
@@ -68,6 +68,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/dso.h>
+#include "internal/dso_conf.h"
#ifndef DSO_DLFCN
DSO_METHOD *DSO_METHOD_dlfcn(void)
@@ -324,14 +325,6 @@ 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,7 +335,7 @@ 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" etc */
- rsize += DSO_extlen; /* The length of ".so" */
+ rsize += strlen(DSO_EXTENSION); /* The length of ".so" */
if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0)
rsize += 3; /* The length of "lib" */
}
@@ -353,9 +346,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" DSO_ext, filename);
+ sprintf(translated, "lib%s" DSO_EXTENSION, filename);
else
- sprintf(translated, "%s" DSO_ext, filename);
+ sprintf(translated, "%s" DSO_EXTENSION, filename);
} else
sprintf(translated, "%s", filename);
return (translated);