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