Hacker News new | ask | show | jobs
by IshKebab 4236 days ago
system_header { name: "gnuradio" name_type: DIRECTORY cflag: "-I/usr/local/include/gnuradio" }

system_header { name: "microhttpd.h" ldflag: "-lmicrohttpd" }

system_header { name: "mysql/mysql.h" ldflag: "-L/usr/lib64/mysql" ldflag: "-lmysqlclient" }

Let's see... hard-coded absolute paths, compiler-specific flags... Yeah I'll stick with QBS and wait for proper modules.

1 comments

No, you're right, it's goofy. Clowny, you might say.

It should be more like this:

pkg-config --identify-file=microhttpd.h --> "libmicrohttpd"

The problem now is that you can't go from the .h name to the package name. Once you have the package name, you can use pkg-config to give you --libs and --cflags, but there's a (big) piece of the puzzle missing at the moment.

Changing pkg-config and its users to add that mapping would be amazing.

Once we had that, tools like this could see #include <foo.h>, look it up to a package name, use that to get the cflags and ldflags, and that would be it. No config needed.

Cool tool, making building easier seems to trend at the moment. :)

The page ("deps.html") that introduces the .build.conf file says "You can use pkg-config to help find those flags if your system has that installed", but then the actual configuration shown uses only absolute paths.

That threw me off, since it's not at all obvious how or where you can insert calls to external tools (like pkg-config) in the static-looking configuration. I think it'd be a good idea to edit in an example showing pkg-config being used.