[PATCH modular 03/13] build.sh: allow user to specify an alternate bin directory
Gaetan Nadon
memsize at videotron.ca
Wed Dec 29 18:58:53 PST 2010
On Wed, 2010-12-29 at 20:28 -0500, Trevor Woerner wrote:
> 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}
isn't it ${BINDIR:-$EPREFIX/bin} ?
> 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"}
isn't it ${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?
I like it. The principle is to test for BINDIR at each usage. The
conditional variable substitution
makes it possible without having to use if/then/else all the time. This
alternative had not come
to my mind.
I'll repost later.
Thanks
Gaetan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101229/c4aefd8c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101229/c4aefd8c/attachment.pgp>
More information about the xorg-devel
mailing list