[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luafilesystem makefile issue
- From: Julien MARBACH <jmh@...>
- Date: Tue, 12 Apr 2005 18:55:33 +0200
Tomas a écrit :
This library is used for lua to acces
the luafilesystem functions, am I right?
Yes.
The question is : is it
possible to built luafilesystem staticly in lua to avoid the use of a
shared lib?
Sure! You'll need to change the Makefile to build a static
library. Do you know how to do that?
Here is the makefile I wrote to build a static library (liblfs.a) as you
sugested :
all: lfs.o compat-5.1.o lib
lfs.o : lfs.c
gcc -Os -Wall -c lfs.c -o lfs.o
compat-5.1.o : compat-5.1.c
gcc -Os -Wall -c compat-5.1.c -o compat-5.1.o
lib : lfs.o compat-5.1.o
ar rcu lfslib.a lfs.o compat-5.1.o
ranlib lfslib.a
clean :
rm -f lfs.o compat-5.1.o liblfs.a
Is that ok?
Then, the static library should
be used to build the launcher executable,
Do I only have to add my newly created liblfs.a to the objects when
linking the launcher?
BUT you'll have to call the
initialization function (luaopen_lfs) or register it at `package.preload'
table (this way, require() will find it when trying to load the package).
I've no idea of how to add luaopen_lfs in 'package.preload'... it sounds
like chinese to me :-(
Enough for me today... See you tomorow!
Thanks again,
Julien