This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Provide a windows-specific ORIGINDIR for eblopenbackend


$ORIGIN and $LIB are not supported by all implementations of dlopen() and
on windows we need backslashes as directory separators.

Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
 libebl/ChangeLog        | 5 +++++
 libebl/eblopenbackend.c | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index f9f5d89..7de7236 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-04  Ulf Hermann  <ulf.hermann@qt.io>
+
+	* eblopenbackend.c: On windows use an ORIGINDIR without $ORIGIN and
+	$LIB.
+
 2017-04-28  Ulf Hermann  <ulf.hermann@qt.io>
 
 	* Makefile.am: Forward LIBPREFIX and LIBEXT as defined by configure.
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index 0b261e7..4048f12 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -312,7 +312,11 @@ 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
-- 
2.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]