GNOME Bugzilla – Bug 735420
building from outside of srcdir is broken
Last modified: 2016-12-16 15:52:27 UTC
I've hit a couple of issues when trying to configure/build from outside of the root srcdir for the project: * gtkdocize requires running from within srcdir, autogen.sh should enter srcdir and exit when running gtkdocize. * g-ir-scanner needs to find include dir
Created attachment 284465 [details] [review] Fix configuring and building from outside of top_srcdir cd into srcdir when running gtkdocize. Include src directory in g-ir-scanner run.
Is this standard autogen.sh/Makefile.am stuff now? If it is then feel free to push it. (Though please point me to a GNOME module where it is used.)
(In reply to comment #2) > Is this standard autogen.sh/Makefile.am stuff now? > > If it is then feel free to push it. (Though please point me to a GNOME module > where it is used.) By standard do you mean the ability to build outside of srcdir or the techniques I used? I think most modules have the ability to build outside of srcdir (useful when setting different checkoutroot and buildroot dirs in jhbuild). My technique might be questionable though as autotools/bash is not really my forte. For reference, GTK+ and GLib cd into srcdir before running gtkdocize as well: https://git.gnome.org/browse/gtk+/tree/autogen.sh?id=3.13.7 https://git.gnome.org/browse/glib/tree/autogen.sh?id=2.41.3 The reason I chose to use readlink and limit cd'ing into $srcdir for gtkdocize is $srcdir can be a relative path (../) which then breaks because $srcdir is used throughout the rest of autogen.sh...
It looks like gtkdocize accepts arguments which might be another option: usage: gtkdocize [ --copy ] [ --docdir DIR ] [ --flavour {legacy|legacy-flat|no-tmpl|no-tmpl-flat} ] [ --srcdir DIR ]
I think you can use -I$(top_srcdir) in Makefile.am, and so avoid the readlink in autogen.sh. (GTK+ uses -I$(top_srcdir), although indirectly.) I haven't seen anyone else using readlink so I'd like to avoid that. Let me know if that works.
I've pinched a newer version of autogen.sh from gdk-pixbuf, and added -I$(top_srcdir)/src to GooCanvas_2_0_gir_CFLAGS in Makefile.am, so hopefully this is fixed (in goocanvas-2.0 branch at the moment). Reopen if not.