monome / libmonome

makes writing applications for Monomes easy.
ISC License
302 stars 158 forks source link

build fixes, use standard DESTDIR, add LIBDIR #12

Closed iioflow closed 13 years ago

iioflow commented 13 years ago

This allows distributions to use the standard DESTDIR function of autotools. Now people don't need to mess with setting prefix manually, depending on what their systems will do. Also add LIBDIR option, to make it easier for folks that are building on 64-bit, 32-bit, or mixed systems, where the dir is not always /usr/lib, but could be /usr/lib32 or /usr/lib64 or anything else. Also improved the LIBDIR search paths, to remove some redundancies, and work with the existing variables in the configure script.

This is what I had before, to make sure that stuff ends up where it's supposed to across systems:

make BINDIR="${D}"/usr/bin LIBDIR="${D}"/usr/$(get_libdir) \ INCDIR="${D}"/usr/include MANDIR="${D}"/usr/share/man \ PKGCONFIGDIR="${D}"/usr/$(get_libdir)/pkgconfig install

Now, it's just:

make DESTDIR="${D}" install

... where ${D} is the sandbox/destination directory where stuff will be merged. This is a similar fix to the one I made for rove yesterday. Tryin' to get a nicer autotools build system, especially for packagers!

iioflow commented 13 years ago

A more helpful explanation:

DESTDIR is not called during the compile phase, only during the install phase. This is just how make works, whether in autotools or in this particular scripted buildsystem.

During the compile, make ignores DESTDIR (from $(DESTDIR)$(LIBDIR), so the LIBDIR value is the correct one for runtime loading. Only when running "make install" is DESTDIR checked to see where the built files should be installed to.

If you set DESTDIR=/tmp, while the files will show up as /tmp/usr/foo, those built files will still go right to the value of LIBDIR at runtime, /usr/lib, for example, not /tmp/usr/lib.

That's the story on DESTDIR. However, artfwo pointed out a couple of different issues with my changes, such as what happens to libmonome.pc, and the fact that now users can break their systems if they really try, with dumb install locations. That was true before anyway; this is merely a different way it can happen. Bottom line, if someone goes against the GNU standards for make, then we can't control what they'll do to their systems anyway.

So . . . hold off making a decision on these patches for a bit, while we attempt to fix some stuff and find alternatives to all the ways stuff can be broken with the existing system and with the patched version. artfwo proposed using waf or something.

iioflow commented 13 years ago

We've got a working waf build system prototype; closing.

(I do have patches from artfwo for the existing Makefile-based buildsys that don't touch configure except to add smarter --libdir search paths, but DESTDIR is not in those additions whatsoever. It's just changes to Makefiles. The new waf build system is way smarter, tinier, and easier to maintain. I'll have that code in my fork soon.)

iioflow commented 13 years ago

From mssrs nightmorph and artfwo (the latter did most of the work):

We have a proposal for you, good sir, namely migration from vbs (visinin build system) to waf. We humbly request that you look upon our working version, beginning with this commit:

https://github.com/nightmorph/libmonome/commit/eda5d3ffdfff47c27362f43503bb757ce0d4b023