[PATCH modular 03/13] build.sh: allow user to specify an alternate bin directory

Gaetan Nadon memsize at videotron.ca
Wed Dec 29 07:44:21 PST 2010

Any module can be configured with --bindir but the way the PATH
is setup by build.sh does not allow this freedom. It asumes
that the bin subdir will always be under $EPREFIX.

The default value is "bin" under $EPREFIX but that does not mean
that any alternate subdir value must be under $EPREFIX.
The prefix might be /usr but the executables can be under $HOME/bin.

A BINDIR env variable is added which works in a similar way to
PREFIX and EPREFIX. It follows the Autoconf convention.

If a value other than the default value is used,
the CONFCMD emitted will reflect that with --bindir option.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
 build.sh |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/build.sh b/build.sh
index 80452d3..71142de 100755
--- a/build.sh
+++ b/build.sh
@@ -7,6 +7,8 @@ Environment variables specific to build.sh:
               Each module/components is invoked with --prefix
   EPREFIX     Install architecture-dependent files in EPREFIX [PREFIX]
               Each module/components is invoked with --exec-prefix
+  BINDIR      Install user executables [EPREFIX/bin]
+              Each module/components is invoked with --bindir
   QUIET       Do not print messages saying which checks are being made
               Each module/components is invoked with --quite
   GITROOT     Source code repository path [git://anongit.freedesktop.org/git]
@@ -32,7 +34,7 @@ Environment variables defined by the GNU Build System:
 Environment variables defined by the shell:
   PATH        List of directories that the shell searches for commands
-              \$DESTDIR/\$EPREFIX/bin is prepended
+              \$DESTDIR/\$BINDIR is prepended
 Environment variables defined by the dynamic linker:
   LD_LIBRARY_PATH List directories that the linker searches for shared objects
@@ -67,7 +69,7 @@ setup_buildenv() {
     export LD_LIBRARY_PATH
     # Set the path so that locally built apps will be found and used
     export PATH
     # Choose which make program to use
@@ -366,6 +368,7 @@ process() {
 	    --prefix=${PREFIX} \
 	    ${EPREFIX_SET:+--exec-prefix="$EPREFIX"} \
+	    ${BINDIR_SET:+--bindir="$BINDIR"} \
 	    ${LIB_FLAGS} \
 	    ${QUIET:+--quiet} \
 	    ${CONFFLAGS} \
@@ -984,6 +987,11 @@ if [ X"$EPREFIX" != X ]; then
+# States if the user has exported BINDIR
+if [ X"$BINDIR" != X ]; then
+    BINDIR_SET=yes
 # perform sanity checks on cmdline args which require arguments
 # arguments:
 #   $1 - the option being examined
@@ -1153,6 +1161,11 @@ if [ X"$EPREFIX_SET" = X ]; then
+# Set the default value for BINDIR
+if [ X"$BINDIR_SET" = X ]; then
 HOST_OS=`uname -s`
 export HOST_OS
 HOST_CPU=`uname -m`

More information about the xorg-devel mailing list