diff options
author | Richard Levitte <levitte@openssl.org> | 2016-02-15 17:20:15 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-02-19 11:51:23 +0100 |
commit | e987f9f271a13558213e56659fba943df1578f98 (patch) | |
tree | bc13ba6c0a58711354ba98e91b70f7643fc58013 /crypto/dso | |
parent | a8a421b1136a7aefa6d8658ab1095bb87e90b82e (diff) | |
download | openssl-e987f9f271a13558213e56659fba943df1578f98.tar.gz |
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')
-rw-r--r-- | crypto/dso/dso_dl.c | 12 | ||||
-rw-r--r-- | crypto/dso/dso_dlfcn.c | 15 |
2 files changed, 8 insertions, 19 deletions
diff --git a/crypto/dso/dso_dl.c b/crypto/dso/dso_dl.c index 6407bf7329..73d7ca3a47 100644 --- a/crypto/dso/dso_dl.c +++ b/crypto/dso/dso_dl.c @@ -59,6 +59,7 @@ #include <stdio.h> #include "internal/cryptlib.h" #include <openssl/dso.h> +#include "internal/dso_conf.h" #ifndef DSO_DL DSO_METHOD *DSO_METHOD_dl(void) @@ -288,11 +289,6 @@ static char *dl_merger(DSO *dso, const char *filespec1, const char *filespec2) * elegant way to share one copy of the code would be more difficult and * would not leave the implementations independent. */ -# if defined(__hpux) -static const char extension[] = ".sl"; -# else -static const char extension[] = ".so"; -# endif static char *dl_name_converter(DSO *dso, const char *filename) { char *translated; @@ -303,7 +299,7 @@ static char *dl_name_converter(DSO *dso, const char *filename) transform = (strstr(filename, "/") == NULL); { /* We will convert this to "%s.s?" or "lib%s.s?" */ - rsize += strlen(extension); /* The length of ".s?" */ + rsize += strlen(DSO_EXTENSION); /* The length of ".s?" */ if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0) rsize += 3; /* The length of "lib" */ } @@ -314,9 +310,9 @@ static char *dl_name_converter(DSO *dso, const char *filename) } if (transform) { if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0) - sprintf(translated, "lib%s%s", filename, extension); + sprintf(translated, "lib%s%s", filename, DSO_EXTENSION); else - sprintf(translated, "%s%s", filename, extension); + sprintf(translated, "%s%s", filename, DSO_EXTENSION); } else sprintf(translated, "%s", filename); return (translated); 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); |