Out-of-the-tree build fixes

Adrián Pérez <[email protected]> Sat, 11 Sep 2004 03:37:27 +0200
Newsgroups gmane.comp.lang.lua.luacheia
Message-ID <[email protected]>
--Apple-Mail-1-595330583
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed


Hello people,

I hav been working this evening in the Glib module, and I noticed that 
out-of-the-tree builds (i.e: configuring & building from a directory 
not into the source tree) didn't work, so I fixed "configure.ac" and 
some "Makefile.am"s (under src/modules).

Now you can build without touching the source tree:

    $ cvs -z3 co luacheia
    $ mkdir lc-build
    $ cd lc-build
    $ ../luacheia/configure
    $ make

The problem were directories being referenced with relative paths, 
example line from "src/modules/lxp/Makefile.am":

    INCLUDES = -I@LUA_SRCDIR@ -Iexpat

...that must be changed to:

    INCLUDES = -I@LUA_SRCDIR@ -I$(top_srcdir)/src/modules/lxp/expat

...and so on. From within "configure.ac" you can use the "${srcdir}" 
shell variable, it contains exactly the same path as "$(top_srcdir)" in 
Makefiles. If someone changes the build system (e.g: because of a 
module being added to LuaCheia) _please_ take care with that.

Note that with some automake variables (like luafoo_la_SOURCES, 
luafoo_la_LIBADD, etc) you can use relative paths as usual. It seems 
that automake effectively takes care about that, but for some reason it 
doesn't do the same with other variables. Strange, ehm?

-ap

--Apple-Mail-1-595330583
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: Mensaje firmado digitalmente
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iEYEARECAAYFAkFCVtsACgkQghBwwjayrGSYFQCgtRHiZS9/MBgvIkCB3rmyoAqf
oywAoIovrIeHWIXKHCNV3MTExGHHKnWQ
=s4bg
-----END PGP SIGNATURE-----

--Apple-Mail-1-595330583--



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php