GNOME Bugzilla – Bug 694889
build : fix out of source build - source gnome-autogen instead executing it
Last modified: 2013-03-18 07:25:50 UTC
Created attachment 237637 [details] [review] source gnome-autogen Attach patch add "." before gnome-autogen in autogen.sh to fix out of source builddir.
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?
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 .
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 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!