lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On Wed, Mar 14, 2018 at 12:38 AM, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
>>>>> "Luiz" == Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> writes:

 Luiz> All feedback welcome. Thanks.

Building on freebsd doesn't work without adding CC=cc (since gcc is not
installed by default and if you install it from ports, it's usually
under a version-specific name such as gcc6), and also enabling readline
requires adding -I/usr/local/include and -L/usr/local/lib, or tweaking
things to use libedit instead.

I've tried these, which all seem to work on my system (though obviously
the presence of a port build would make this somewhat moot):

# with base system libedit:
freebsd:
        $(MAKE) $(ALL) CC="cc" SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit"

# ... with readline from ports:
freebsd-readline:
        $(MAKE) $(ALL) CC="cc" SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/local/include" SYSLIBS="-Wl,-E -L/usr/local/lib -lreadline"

# ... with editing disabled
freebsd-noedit:
        $(MAKE) $(ALL) CC="cc" SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E"

and speaking of readline, it would still be good for lua.c to set
rl_readline_name and (maybe) rl_inhibit_completion as discussed
recently.

Hi,

I'd be really pleased to see the Makefile patched for FreeBSD, and all the BSDs for 5.4. There were a few discussions last summer about what's actually required to build on FreeBSD, other BSDs, Mac and Solaris. I'd like to help out with the other BSDs, but I'm mostly interested in FreeBSD and Windows right now. On FreeBSD, an official patch would be great, but I could live with patching it myself in ports. Some items of interest to me:

- As Andrew nicely illustrated, libeditline is the standard readline package on FreeBSD.

- Andrew: luaconf.h indicates to me that LUA_USE_READLINE is not required when using LUA_USE_LINUX?  Also, -fPIC is required for Arm and was added to x86/amd64. Do you have any input on -fPIC? I understood why some time ago, but my understanding was pretty weak.

- There was a lengthy discussion (on my part. tee hee) which concluded that dlopen library (or whatever it's called) is only required on glibc. My less than stellar memory says that I concluded (potentially) LUA_USE_DLOPEN isn't needed on ANY of the BSDs or OSX. I also checked what Solaris documentation and found that dlopen was also not required there (not surprisingly).

Given the above, for a 5.4.0 port, I'd like to see something as close as possible to this:
CC=cc
...
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_READLINE -fPIC -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit"

OR

Perhaps the Makefile can be modified to have a single target (that FreeBSD, BSD, MACOSX point to) using a new define of LUA_USE_NON_GNU? That define would then be  LUA_USE_POSIX and LUA_USE_READLINE?

There are other combinations that could be better I'm sure so I'm asking if there is stomach for that kind of change?

I tested much of this this some time ago but will retest in case there is interest. I've put a message on Google+ for the openbsd group and will send some emails for input from others.

Thanks for listening.

Russ



Thoughts?

Russ


--
Andrew.