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

Trevor Woerner twoerner at gmail.com
Wed Dec 29 17:28:47 PST 2010


Not to belabour the point too much, but I think the following patch
does what you want to do with #3 of this patch series:

diff --git a/build.sh b/build.sh
index 80452d3..465bd03 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/component 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]
@@ -67,7 +69,7 @@ setup_buildenv() {
     export LD_LIBRARY_PATH

     # Set the path so that locally built apps will be found and used
-    PATH=${DESTDIR}${EPREFIX}/bin${PATH+:$PATH}
+    PATH=${DESTDIR}${BINDIR-$EPREFIX/bin}${PATH+:$PATH}
     export PATH

     # Choose which make program to use
@@ -366,6 +368,7 @@ process() {
        sh ${DIR_CONFIG}/${CONFCMD} \
            --prefix=${PREFIX} \
            ${EPREFIX_SET:+--exec-prefix="$EPREFIX"} \
+           ${BINDIR+--bindir="$BINDIR"}
            ${LIB_FLAGS} \
            ${QUIET:+--quiet} \
            ${CONFFLAGS} \



Of the 3 changes, the first is the same as your original.

In the 2nd change: if BINDIR is set then it will be used in the PATH=
line, otherwise the default of $EPREFIX/bin will be substituted. If
you wanted to be more explicit, a variable called BINDIR_DEFAULT could
be defined as "$EPREFIX/bin" and used in this case.

For the 3rd change: if BINDIR does not exist then the
--bindir="$BINDIR" configuration option will not be emitted.

No need for BINDIR_SET variables, no need for explicitly setting the
default value of BINDIR if BINDIR_SET is not defined. Or am I still
not "getting" it?


More information about the xorg-devel mailing list