aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile14
-rw-r--r--Makefile.win22
-rw-r--r--config14
-rw-r--r--config.win17
-rw-r--r--src/lfs.c6
5 files changed, 47 insertions, 26 deletions
diff --git a/Makefile b/Makefile
index 2c11b58..068f309 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
1# $Id: Makefile,v 1.28 2006/06/08 18:06:18 tomas Exp $ 1# $Id: Makefile,v 1.29 2006/12/04 15:28:53 mascarenhas Exp $
2 2
3T= lfs 3T= lfs
4V= 1.2.1 4V= 1.2.1
@@ -6,26 +6,18 @@ CONFIG= ./config
6 6
7include $(CONFIG) 7include $(CONFIG)
8 8
9ifeq "$(LUA_VERSION_NUM)" "500"
10COMPAT_O= $(COMPAT_DIR)/compat-5.1.o
11endif
12
13SRCS= src/$T.c 9SRCS= src/$T.c
14OBJS= src/$T.o $(COMPAT_O) 10OBJS= src/$T.o
15
16 11
17lib: src/$(LIBNAME) 12lib: src/$(LIBNAME)
18 13
19src/$(LIBNAME): $(OBJS) 14src/$(LIBNAME): $(OBJS)
20 export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(LIBNAME) $(OBJS) 15 export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(LIBNAME) $(OBJS)
21 16
22$(COMPAT_O): $(COMPAT_DIR)/compat-5.1.c
23 $(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c
24
25install: src/$(LIBNAME) 17install: src/$(LIBNAME)
26 mkdir -p $(LUA_LIBDIR) 18 mkdir -p $(LUA_LIBDIR)
27 cp src/$(LIBNAME) $(LUA_LIBDIR) 19 cp src/$(LIBNAME) $(LUA_LIBDIR)
28 cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so 20 cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so
29 21
30clean: 22clean:
31 rm -f src/$(LIBNAME) $(OBJS) $(COMPAT_O) 23 rm -f src/$(LIBNAME) $(OBJS)
diff --git a/Makefile.win b/Makefile.win
new file mode 100644
index 0000000..b9cddc8
--- /dev/null
+++ b/Makefile.win
@@ -0,0 +1,22 @@
1# $Id: Makefile.win,v 1.1 2006/12/04 15:28:53 mascarenhas Exp $
2
3T= lfs
4V= 1.2.1
5CONFIG= ./config.win
6
7include $(CONFIG)
8
9SRCS= src/$T.c
10OBJS= src/$T.obj
11
12lib: src/$(LIBNAME)
13
14src/$(LIBNAME): $(OBJS)
15 link /dll /out:src/$(LIBNAME) $(OBJS) $(LUA_LIB)
16
17install: src/$(LIBNAME)
18 mkdir -p $(LUA_LIBDIR)
19 copy src/$(LIBNAME) $(LUA_LIBDIR)
20
21clean:
22 del src/$(LIBNAME) $(OBJS)
diff --git a/config b/config
index 9958952..1265b77 100644
--- a/config
+++ b/config
@@ -1,25 +1,19 @@
1# Installation directories 1# Installation directories
2# System's libraries directory (where binary libraries are installed) 2# System's libraries directory (where binary libraries are installed)
3LUA_LIBDIR= /usr/local/lib/lua/5.0 3LUA_LIBDIR= /usr/local/lib/lua/5.1
4# Lua includes directory 4# Lua includes directory
5LUA_INC= /usr/local/include 5LUA_INC= /usr/include/lua5.1
6 6
7# OS dependent 7# OS dependent
8LIB_OPTION= -shared #for Linux 8LIB_OPTION= -shared #for Linux
9#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X 9#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X
10 10
11LIBNAME= $T.so.$V 11LIBNAME= $T.so.$V
12# Lua version number
13# (according to Lua 5.1 definition:
14# first version digit * 100 + second version digit
15# e.g. Lua 5.0.2 => 500, Lua 5.1 => 501, Lua 5.1.1 => 501)
16LUA_VERSION_NUM= 500
17COMPAT_DIR= ../compat/src
18 12
19# Compilation directives 13# Compilation directives
20WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings 14WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings
21INCS= -I$(LUA_INC) -I$(COMPAT_DIR) 15INCS= -I$(LUA_INC)
22CFLAGS= $(WARN) $(INCS) 16CFLAGS= $(WARN) $(INCS)
23CC= gcc 17CC= gcc
24 18
25# $Id: config,v 1.15 2006/06/08 16:23:25 tomas Exp $ 19# $Id: config,v 1.16 2006/12/04 15:28:53 mascarenhas Exp $
diff --git a/config.win b/config.win
new file mode 100644
index 0000000..0259106
--- /dev/null
+++ b/config.win
@@ -0,0 +1,17 @@
1# Installation directories
2# System's libraries directory (where binary libraries are installed)
3LUA_LIBDIR= c:/lua51/lib
4# Lua includes directory
5LUA_INC= c:/lua51/include
6# Lua library
7LUA_LIB= c:/lua51/bin/lua51.lib
8
9LIBNAME= $T.dll
10
11# Compilation directives
12WARN= /O2 /Wall
13INCS= /I$(LUA_INC)
14CFLAGS= $(WARN) $(INCS)
15CC= cl
16
17# $Id: config.win,v 1.1 2006/12/04 15:28:53 mascarenhas Exp $
diff --git a/src/lfs.c b/src/lfs.c
index 43d5e9e..e361bd6 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -14,7 +14,7 @@
14** lfs.touch (filepath [, atime [, mtime]]) 14** lfs.touch (filepath [, atime [, mtime]])
15** lfs.unlock (fh) 15** lfs.unlock (fh)
16** 16**
17** $Id: lfs.c,v 1.34 2006/06/08 18:06:18 tomas Exp $ 17** $Id: lfs.c,v 1.35 2006/12/04 15:28:53 mascarenhas Exp $
18*/ 18*/
19 19
20#include <errno.h> 20#include <errno.h>
@@ -39,10 +39,6 @@
39#include "lua.h" 39#include "lua.h"
40#include "lauxlib.h" 40#include "lauxlib.h"
41#include "lualib.h" 41#include "lualib.h"
42#if ! defined (LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
43#include "compat-5.1.h"
44#endif
45
46#include "lfs.h" 42#include "lfs.h"
47 43
48/* Define 'strerror' for systems that do not implement it */ 44/* Define 'strerror' for systems that do not implement it */