iodine icon indicating copy to clipboard operation
iodine copied to clipboard

Autotools

Open barak opened this issue 10 years ago • 7 comments

Complete rewrite of the build system using autotools.

barak avatar Apr 25 '14 13:04 barak

even though i'm not a big fan of autotools (but its still better than alternatives: cmake, scons etc) this would probably at least fix the current issues in the build system:

  • the osflags script is completely unusable for crosscompiling or non-standard filesystem layouts since it has hardcoded a number of header locations. so if your host system has systemd installed, you will compile systemd support into it even though your target toolchain doesn't have the corresponding headers or libs. but if you need systemd support, but have your headers in a different prefix, they won't be picked up even though the toolchain itself is aware of the prefix. the usage of hardcoded header file paths is completely flawed. all such tests should be done by referencing a header from a c file like #include <headeriwannatest.h> and some typedef and try to compile it with the user-supplied $CC.
  • the usage of uname is lame and prevents crosscompiling as well. if you want to crosscompile for mac from linux, uname will detect the host system as linux and will try to compile the linux version.
  • due to the inability (or actually complexity) of make to run configure-style compile tests, the author uses a broken forest of #ifdef with a list of systems that provide daemon(), instead of testing for whether the current toolchain provides it or not. thus the build fails on musl libc and any other system that has daemon, but is not yet part of the ifdef chunk.

each of those points is actually a bug that should be adressed and filed as an issue, but i can't be bothered to register at yet another trac.

rofl0r avatar Dec 25 '16 15:12 rofl0r

doh. i forgot the 4th point that is:

  • there's no way to turn on verbose building. sometimes you actually want to see the commands passed to the compiler, especially when things go wrong. usually the convention is that you can get verbose output via make V=1. see this for an example Makefile-based impl. : https://github.com/uoaerg/wavemon/pull/33

rofl0r avatar Dec 25 '16 15:12 rofl0r

(Just to be clear: I also hate autotools. To really know autotools is to really hate autotools. But it has been forged in the crucible of time and passed through to the other side.)

Do you want me to try to forward-port this patch to your repo tip?

barak avatar Dec 25 '16 16:12 barak

@barak: i (ab)used this PR here to raise my concerns about the existing build system, since the github issue tracker here is locked down (probably the author invested so much time into getting his trac running that he feels somehow attached to it, even though the github issue tracker is much better integrated, and would free him of the maintenance work). since there was apparently no interest in your work i would probably refrain from doing more unless the repo owner (@yarrick) shows up and comments his wishes.

rofl0r avatar Dec 25 '16 18:12 rofl0r

I merged these changes to the development tip, and made a few small changes to integrate them with the intervening changes to the code and to the rest of the system.

barak avatar Dec 28 '16 11:12 barak

Maybe it is time to switch.. Building for windows or android is really hacky now. I also think the android version doesnt run on modern android already because of some link flags - maybe it will be easier to fix with some autotools magic.

It seems the thing in the patch setting the -DDARWIN for mac includes a version number and the compiler does not like that.

Regarding trac, I am fine with using the bug tracker here, I am just too lazy/busy to move the existing issues and wiki pages.

yarrick avatar Dec 28 '16 21:12 yarrick

SUCCESS!!!

barak avatar Dec 28 '16 23:12 barak