<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
On Wed, 2010-12-29 at 20:28 -0500, Trevor Woerner wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
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}
</PRE>
</BLOCKQUOTE>
isn't it <TT>${BINDIR:-$EPREFIX/bin} ?</TT>
<BLOCKQUOTE TYPE=CITE>
<PRE>
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"}
</PRE>
</BLOCKQUOTE>
isn't it <TT>${BINDIR:+--bindir="$BINDIR"} ?</TT>
<BLOCKQUOTE TYPE=CITE>
<PRE>
${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?
</PRE>
</BLOCKQUOTE>
<BR>
I like it. The principle is to test for BINDIR at each usage. The conditional variable substitution<BR>
makes it possible without having to use if/then/else all the time. This alternative had not come<BR>
to my mind.<BR>
<BR>
I'll repost later.<BR>
<BR>
Thanks<BR>
Gaetan
</BODY>
</HTML>