summaryrefslogtreecommitdiffstats
path: root/libebl/eblopenbackend.c
diff options
context:
space:
mode:
Diffstat (limited to 'libebl/eblopenbackend.c')
-rw-r--r--libebl/eblopenbackend.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index f3a65cfa..4048f124 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -39,7 +39,6 @@
#include <string.h>
#include <stdio.h>
-#include <system.h>
#include <libeblP.h>
@@ -313,21 +312,26 @@ openbackend (Elf *elf, const char *emulation, GElf_Half machine)
#ifndef LIBEBL_SUBDIR
# define LIBEBL_SUBDIR PACKAGE
#endif
+#if (defined _WIN32 || defined __WIN32__)
+#define ORIGINDIR "..\\lib\\" LIBEBL_SUBDIR "\\"
+#else
#define ORIGINDIR "$ORIGIN/../$LIB/" LIBEBL_SUBDIR "/"
+#endif
+#define LIBEBL_PREFIX LIBPREFIX "ebl_"
/* Give it a try. At least the machine type matches. First
try to load the module. */
char dsoname[100];
- strcpy (stpcpy (stpcpy (dsoname, ORIGINDIR "libebl_"),
+ strcpy (stpcpy (stpcpy (dsoname, ORIGINDIR LIBEBL_PREFIX),
machines[cnt].dsoname),
- ".so");
+ LIBEXT);
void *h = dlopen (dsoname, RTLD_LAZY);
if (h == NULL)
{
- strcpy (stpcpy (stpcpy (dsoname, "libebl_"),
+ strcpy (stpcpy (stpcpy (dsoname, LIBEBL_PREFIX),
machines[cnt].dsoname),
- ".so");
+ LIBEXT);
h = dlopen (dsoname, RTLD_LAZY);
}