lua-users home
lua-l archive

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


For linking with other interfaces to the Lua libraries, I added the following
to the Makefile.

1. -fPIC on CFLAGS.
2. A new target.
liblua.so: $(BASE_O)
    cc -shared $(BASE_O) -o liblua.so

Making that target triggers a warning I do not get with `make linux`.

$ make liblua.so
cc -shared lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o
lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o
ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o
lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o
lutf8lib.o loadlib.o linit.o  -o liblua.so
loslib.o: In function `os_tmpname':
loslib.c:(.text+0x29d): warning: the use of `tmpnam' is dangerous,
better use `mkstemp'

`man mkstemp` reveals its availability under the following conditions:

mkstemp():
           _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 ||
           _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
           || /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200112L