News for hackers. Stuff that matters.
Re:How to Write Portable C Without Complicating Your Build by coldtea on Friday March 31, 2017 @07:56AM (#14002852)
>The article downplays a little bit the value of the autotools. It's not just about building for 30-year ago hosts, it's also about providing a lot of convenient tools and providing the user with a known interface. If you write your own configure, people may expect to be able to pass additional CFLAGS (not overriding the existing one), setting the path to various elements, installing in a different root, having certain targets for the generated makefiles (like dist, clean, install, uninstall), having cross-compilation work (including crosscompiling to Windows with mingw64 which solves the toolchain problem of releasing binaries for Windows), ... It's a tedious task and easy to get wrong.

So why not get a tool with 1/10 the complexity and 1/100 the legacy stuff of Autotool, but the same interface otherwise?

People who need the old checks 100% could continue to use Autotool-old, people who don't care for such BS could use the new.

Re:How to Write Portable C Without Complicating Your Build by simias on Friday March 31, 2017 @08:20AM (#14002956)
I don't understand what you mean, if it has the same interface as autotools how do you remove the legacy stuff without breaking anything?

Autotools is a huge pain in the ass for the dev, unfortunately I haven't found any alternative that didn't end up being an even bigger annoyance.

A decent, simple, easily customizable and portable C/C++ build system is still very much a unsolved problem as far as I'm concerned (and I've tried quite a few of them). At least autotools are supported basically everywhere.

Re:How to Write Portable C Without Complicating Your Build by coldtea on Friday March 31, 2017 @10:07AM (#14003888)
>I don't understand what you mean, if it has the same interface as autotools how do you remove the legacy stuff without breaking anything?

By having autotools for the projects that need "everything" (legacy BS checks) and this leaner version for the projects that don't need them.

Re:How to Write Portable C Without Complicating Your Build by scott_s on Friday March 31, 2017 @10:33AM (#14004168)
I'm confused. Are you suggesting this leaner version should exist and it does not? Or are you advocating for a leaner version that I have not heard of?
Re:How to Write Portable C Without Complicating Your Build by coldtea on Friday March 31, 2017 @01:32PM (#14006055)
I am suggesting a leaner version should exist.

The same way there's vim and neovim without the legacy stuff.

Re:How to Write Portable C Without Complicating Your Build by heinrich5991 on Friday March 31, 2017 @09:41AM (#14003631)
Have you tried cmake?
Re:How to Write Portable C Without Complicating Your Build by sqeaky on Friday March 31, 2017 @01:15PM (#14005894)
This whole discussion and article had me thinking about that.

CMake is faster than autotools and works fine with all the compilers talked about so far and all the windows compilers I know of.

Creating a CMakeLists.txt covering moderately complex build that links against a few libraries (but doesn't need and custom logic for moving files or other uncommon stuff) is normally just a few lines of code. Usually just one line of code per source file and per library (depending on how you feel about automatically including files this can be further shortened), then a little bit declaring the language and other settings. There are plenty of 10 line CMakeLists that can build large and seemingly complex projects.

Re:How to Write Portable C Without Complicating Your Build by vbernat on Friday March 31, 2017 @12:18PM (#14005278)
You don't have to use all the legacy stuff. See: https://autotools.io/whosafraid.html. You choose what tests you want to run. No need to check if you have unistd.h if you don't care about that.

As a rewrite using the same user interface but a completely different developer interface, there is mklove (https://github.com/edenhill/mklove). However, this just covers autoconf: you don't get the flexibility of automake. Also, I don't know how complete it is.

A rewrite just to speed up things a little is a bit useless. Autotools are not that slow. And if a rewrite was done, it would be a shame to keep the horrible syntax. What needs to be kept is