public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Provide a windows-specific ORIGINDIR for eblopenbackend
@ 2017-05-04 15:08 Ulf Hermann
  0 siblings, 0 replies; only message in thread
From: Ulf Hermann @ 2017-05-04 15:08 UTC (permalink / raw)
  To: elfutils-devel

$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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-04 14:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-04 15:08 [PATCH] Provide a windows-specific ORIGINDIR for eblopenbackend Ulf Hermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).