d8307d
commit c7ac9caaae6f8d02d4e0c7618d4991324a084c66
d8307d
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
d8307d
Date:   Mon May 13 13:57:37 2019 -0300
d8307d
d8307d
    support: Export bindir path on support_path
d8307d
    
d8307d
    Checked on x86_64-linux-gnu.
d8307d
    
d8307d
    	* support/Makefile (CFLAGS-support_paths.c): Add -DBINDIR_PATH.
d8307d
    	* support/support.h (support_bindir_prefix): New variable.
d8307d
    	* support/support_paths.c [BINDIR_PATH] (support_bindir_prefix):
d8307d
    
d8307d
    Reviewed-by: DJ Delorie <dj@redhat.com>
d8307d
d8307d
diff --git a/support/Makefile b/support/Makefile
d8307d
index 64044f6..fe416cd 100644
d8307d
--- a/support/Makefile
d8307d
+++ b/support/Makefile
d8307d
@@ -179,7 +179,8 @@ CFLAGS-support_paths.c = \
d8307d
 		-DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
d8307d
 		-DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
d8307d
 		-DINSTDIR_PATH=\"$(prefix)\" \
d8307d
-		-DLIBDIR_PATH=\"$(libdir)\"
d8307d
+		-DLIBDIR_PATH=\"$(libdir)\" \
d8307d
+		-DBINDIR_PATH=\"$(bindir)\"
d8307d
 
d8307d
 ifeq (,$(CXX))
d8307d
 LINKS_DSO_PROGRAM = links-dso-program-c
d8307d
diff --git a/support/support.h b/support/support.h
d8307d
index 97fef2c..b162491 100644
d8307d
--- a/support/support.h
d8307d
+++ b/support/support.h
d8307d
@@ -105,6 +105,8 @@ extern const char support_objdir_elf_ldso[];
d8307d
 extern const char support_install_prefix[];
d8307d
 /* Corresponds to the install's lib/ or lib64/ directory.  */
d8307d
 extern const char support_libdir_prefix[];
d8307d
+/* Corresponds to the install's bin/ directory.  */
d8307d
+extern const char support_bindir_prefix[];
d8307d
 
d8307d
 extern ssize_t support_copy_file_range (int, off64_t *, int, off64_t *,
d8307d
 					size_t, unsigned int);
d8307d
diff --git a/support/support_paths.c b/support/support_paths.c
d8307d
index 937e6e1..75634aa 100644
d8307d
--- a/support/support_paths.c
d8307d
+++ b/support/support_paths.c
d8307d
@@ -57,3 +57,10 @@ const char support_libdir_prefix[] = LIBDIR_PATH;
d8307d
 #else
d8307d
 # error please -DLIBDIR_PATH=something in the Makefile
d8307d
 #endif
d8307d
+
d8307d
+#ifdef BINDIR_PATH
d8307d
+/* Corresponds to the install's bin/ directory.  */
d8307d
+const char support_bindir_prefix[] = BINDIR_PATH;
d8307d
+#else
d8307d
+# error please -DBINDIR_PATH=something in the Makefile
d8307d
+#endif