<!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>
This line does not work. EPREFIX has not been set by the user and has not been assigned a default value.<BR>
Yet, we need a real full path to add to the PATH env variable.<BR>
This is why I need to have the *DIR variables to always be set to a value.<BR>
<BR>
I did a small sample, using the a few lines:<BR>
<BR>
check_full_path ${PREFIX:-/usr/local} PREFIX<BR>
check_full_path ${EPREFIX:-${$PREFIX:-/usr/local}} EPREFIX<BR>
check_full_path ${BINDIR:-${EPREFIX:-${$PREFIX:-/usr/local}}/bin} BINDIR or something similar :-)<BR>
<BR>
Aside from having to specify the default value every where a variable is used, there is a cascading effect<BR>
as many variables depend on the value of another variable. What you propose would work fine in simple cases where you use a variable once or twice and there is no "composite" assignment.<BR>
<BR>
Just to put in different words, in the way the patches are today, the DIR variables hold their final values, the default values and used only once and the _SET variables tells us to isssue the command line option such as --bindir or not.<BR>
<BR>
I think patch 15 is a big improvement and I may be able to make it better later today. <BR>
<BR>
If you have a solution, you can use the same calls to check_full_path to illustrate how it would work.<BR>
<BR>
<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"}
${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>
</BODY>
</HTML>