[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua on FreeBSD
- From: William Ahern <william@...>
- Date: Mon, 2 Mar 2015 10:46:28 -0800
On Sun, Mar 01, 2015 at 06:48:06PM +0100, Lev wrote:
> On Fri, 27 Feb 2015 20:08:26 -0800
> William Ahern <william@25thandClement.com> wrote:
>
> > The package name and the pkg-config name are different.
>
> Yes, that confused me.
>
> > $ pkg info | grep lua\*5\*2 | cut -d' ' -f1
> > lua52-5.2.3_4
> >
> > $ find /usr/local -name lua\*5\*2.pc
> > /usr/local/libdata/pkgconfig/lua-5.2.pc
> >
> > $ pkg-config --cflags lua-5.2
> > -I/usr/local/include/lua52
>
> Thanks, that is what I was looking for. I don't think autotools is for
> me, since I don't really distribute my code, so I'm happy with editing
> my Makefiles.
>
You can use autoconf with your own makefiles, although there's little reason
unless you're doing a ton of feature detection. (There's an m4 library in
the autoconf archive for locating Lua headers. But AFAICT it only supports a
single Lua version per invocation, and so I won't be using that.)
Another interesting example is Git:
https://github.com/git/git
They use autoconf to generate a config.mak file which is source-included if
it exists. But they also source-include a config.mak.uname, which has
default values for different parameters based on the platform. See
https://github.com/git/git/blob/master/Makefile#L914
https://github.com/git/git/blob/master/config.mak.in
https://github.com/git/git/blob/master/config.mak.uname
The include directive is a POSIX feature, however the leading hyphen is not.
But both GNU and BSD Make support the leading hyphen.
This is how I'll be using autoconf, as an optional first step. You can
either run ./configure, explicitly provide CFLAGS, CPPFLAGS, etc directly,
or both.