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