[Bug 59705] Fix out of source builddir - autogen

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Apr 2 15:40:24 CEST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=59705

--- Comment #4 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
Comment on attachment 77234
  --> https://bugs.freedesktop.org/attachment.cgi?id=77234
Fix out of source builddir - autogen

Review of attachment 77234:
 --> (https://bugs.freedesktop.org/page.cgi?id=splinter.html&bug=59705&attachment=77234)
-----------------------------------------------------------------

::: autogen.sh
@@ +1,4 @@
>  #!/bin/sh
>  set -e
>  
> +srcdir="`dirname -- \"$0\"`"

I'm not sure how portable "dirname -- x" is: -- is a GNUism.

I'm pretty sure this doesn't need to be this complicated, because word
splitting isn't performed on the result of `` when it's the right-hand side of
an assignment:

    $ a=`echo "b c d"`
    $ echo $a
    b c d

so... srcdir=`dirname "$0"` perhaps?

It looks as though GNOME projects typically do something like this:

    test -n "$srcdir" || srcdir=`dirname "$0"`
    test -n "$srcdir" || srcdir=.

(I usually prefer if/fi rather than ||, &&, but perhaps this is a case simple
enough that || is OK.)

@@ +1,5 @@
>  #!/bin/sh
>  set -e
>  
> +srcdir="`dirname -- \"$0\"`"
> +srcdir="`( cd \"$srcdir\"; pwd )`"

Is there a special reason why srcdir needs to be made absolute? I don't see
anything here that wouldn't work if it was relative, and I believe Autotools is
meant to support relative paths to the srcdir, like this usage sometimes seen
in Debian packages:

    ( mkdir build && cd build && ../configure )
    ( mkdir build2 && cd build2 && ../configure --disable-badgers )
    make -C build
    make -C build2

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list