After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694889 - build : fix out of source build - source gnome-autogen instead executing it
build : fix out of source build - source gnome-autogen instead executing it
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-28 18:02 UTC by Alban Browaeys
Modified: 2013-03-18 07:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
source gnome-autogen (553 bytes, patch)
2013-02-28 18:02 UTC, Alban Browaeys
committed Details | Review

Description Alban Browaeys 2013-02-28 18:02:48 UTC
Created attachment 237637 [details] [review]
source gnome-autogen

Attach patch add "." before gnome-autogen in autogen.sh to fix out of source builddir.
Comment 1 Martin Pitt 2013-03-01 04:30:36 UTC
Can you please explain in more detail when and how this helps? How is that related to out of source builddirs? You are not supposed to run autogen.sh from any different directory than the git's source root. Out-of-tree builds are for calling configure only.

Also, autogen.sh verifies that "gnome-autogen.sh" is available as executable an in $PATH with "which", so we know at this point that we can call it. Why would we suddenly source it? It is a shell program right now of course, but is that a guarantee?
Comment 2 Alban Browaeys 2013-03-06 21:14:12 UTC
sorry I have not looked into the why. It is more a general practice (ie most gnome projects source it and those that do not fails to build). I will investigate why .
Comment 3 Alban Browaeys 2013-03-15 21:13:50 UTC
My previous understanding stand so:
autogen.sh:
- get srcdir from dirname of autogen.sh call (via dirname $0)
- one has to cd to srcdir before calling all sourcedir commands : git submodule, autoreconf, touch
- then one has to execute srcdir/configure from builddir 

I spend a few minutes to investigate gnome-autogen: srcdir is to be set or it defaults to "." current directory. My undertanding is that calling gnome-autogen without sourcing it creates a subshell . If we do not export srcdir from the parent shell then srcdir defaults to "." ie current directory , here builddir. Thus all source commands from gnome-autogen fails (it cannot find confgure.{in|ac}, etc).

Mind I do not understand how autogen.sh could succed in a setup where build dir != src dir if called from srcdir. That is  how could it executes srcdir/configure from builddir if builddir is not the current working directory.
I tend to add a builddir=`pwd` after the initialization of the srcdir variable in non gnome-autogen based autogen.sh. Then first switch to srcdir herafter , execute the source commands, switch back to builddir, execute srcdir/configure.
Ie srcdir/autogen.sh from buildir give srcdir via dirname and builddir via pwd.
Comment 4 Martin Pitt 2013-03-18 07:25:44 UTC
Comment on attachment 237637 [details] [review]
source gnome-autogen

Ah, thanks for the additional explanation. Indeed this makes calling autogen from the build tree work. It doesn't actually buy you much as it will still create the autotools files in srcdir, but it doesn't harm.

Thanks!