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 735420 - building from outside of srcdir is broken
building from outside of srcdir is broken
Status: RESOLVED FIXED
Product: goocanvas
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: goocanvas-maint
goocanvas-maint
Depends on:
Blocks: 414139
 
 
Reported: 2014-08-26 00:10 UTC by Simon Feltman
Modified: 2016-12-16 15:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix configuring and building from outside of top_srcdir (1.51 KB, patch)
2014-08-26 00:12 UTC, Simon Feltman
none Details | Review

Description Simon Feltman 2014-08-26 00:10:36 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
Comment 1 Simon Feltman 2014-08-26 00:12:11 UTC
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.
Comment 2 Damon Chaplin 2014-08-26 16:33:52 UTC
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.)
Comment 3 Simon Feltman 2014-08-26 22:17:54 UTC
(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...
Comment 4 Simon Feltman 2014-08-26 22:19:57 UTC
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 ]
Comment 5 Damon Chaplin 2014-08-28 12:34:26 UTC
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.
Comment 6 Damon Chaplin 2016-12-16 15:52:27 UTC
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.