diff --git a/rpm/scratchbox2.spec b/rpm/scratchbox2.spec index 6722eb81..bfc5f09f 100644 --- a/rpm/scratchbox2.spec +++ b/rpm/scratchbox2.spec @@ -9,6 +9,7 @@ Prefix: /usr ExclusiveArch: %{ix86} BuildRequires: make BuildRequires: autoconf +BuildRequires: pkgconfig(lua) Requires: fakeroot Requires: libsb2 = %{version}-%{release} diff --git a/scratchbox2/Makefile b/scratchbox2/Makefile index 390fdbcb..c5c3a736 100644 --- a/scratchbox2/Makefile +++ b/scratchbox2/Makefile @@ -66,7 +66,6 @@ subdirs = preload luaif sblib pathmapping execs network rule_tree utils sb2d wra CFLAGS += -O2 -g -Wall -W CFLAGS += -I$(OBJDIR)/include -I$(SRCDIR)/include -CFLAGS += -I$(SRCDIR)/luaif/lua-5.1.4/src CFLAGS += -D_GNU_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 CFLAGS += $(MACH_CFLAG) LDFLAGS += $(MACH_CFLAG) diff --git a/scratchbox2/autogen.sh b/scratchbox2/autogen.sh index 1f9e1ec1..07460316 100755 --- a/scratchbox2/autogen.sh +++ b/scratchbox2/autogen.sh @@ -3,7 +3,7 @@ #automake_version=1.9 rm -rf configure autom4te.cache -#aclocal +aclocal autoheader autoconf diff --git a/scratchbox2/config.mak.in b/scratchbox2/config.mak.in index 08752fd0..7f6880db 100644 --- a/scratchbox2/config.mak.in +++ b/scratchbox2/config.mak.in @@ -5,6 +5,6 @@ CFLAGS=@CFLAGS@ LDFLAGS=@LDFLAGS@ LIBOBJS=@LIBOBJS@ -#LUA51_LIBS=@LUA51_LIBS@ -#LUA51_CFLAGS=@LUA51_CFLAGS@ +LUA_LIBS=@LUA_LIBS@ +LUA_CFLAGS=@LUA_CFLAGS@ diff --git a/scratchbox2/configure.ac b/scratchbox2/configure.ac index 745949c9..b5f4b84f 100644 --- a/scratchbox2/configure.ac +++ b/scratchbox2/configure.ac @@ -19,7 +19,7 @@ AC_PROG_MAKE_SET # Checks for libraries. AC_CHECK_LIB([dl], [dlsym]) -#PKG_CHECK_MODULES(LUA51, lua5.1 >= 5.1.0) +PKG_CHECK_MODULES([LUA], lua >= 5.2.0) # Checks for header files. AC_HEADER_DIRENT @@ -222,7 +222,7 @@ AC_SUBST(CXX, ${CXX}) AC_SUBST(CFLAGS, ${CFLAGS}) AC_SUBST(LDFLAGS, ${LDFLAGS}) -#AC_SUBST(LUA51_LIBS, ${LUA51_LIBS}) -#AC_SUBST(LUA51_CFLAGS, ${LUA51_CFLAGS}) +AC_SUBST(LUA_LIBS, ${LUA_LIBS}) +AC_SUBST(LUA_CFLAGS, ${LUA_CFLAGS}) AC_OUTPUT diff --git a/scratchbox2/luaif/Makefile b/scratchbox2/luaif/Makefile index dd9fa84b..0e85f0f4 100644 --- a/scratchbox2/luaif/Makefile +++ b/scratchbox2/luaif/Makefile @@ -8,10 +8,10 @@ objs := $(D)/sblib_luaif.o $(D)/sblib_luaif.o: preload/exported.h luaif/libluaif.a: $(objs) -luaif/libluaif.a: override CFLAGS := $(CFLAGS) -O2 -g -fPIC -Wall -W -I$(SRCDIR)/$(LUASRC) -I$(OBJDIR)/preload -I$(SRCDIR)/preload \ - $(WERROR) -Wmissing-prototypes -Wstrict-prototypes +luaif/libluaif.a: override CFLAGS := $(CFLAGS) -O2 -g -fPIC -Wall -W -I$(OBJDIR)/preload -I$(SRCDIR)/preload \ + $(WERROR) -Wmissing-prototypes -Wstrict-prototypes $(LUA_CFLAGS) luaif/libluaif.a: override LDFLAGS := $(LDFLAGS) -luaif/libluaif.a: override LIBS := +luaif/libluaif.a: override LIBS := $(LUA_LIBS) lua_sources := loadlib.c lstate.c ldebug.c liolib.c llex.c lauxlib.c ldump.c \ @@ -30,5 +30,5 @@ luaif/liblua.a: override CFLAGS := -O2 -Dfopen=fopen_nomap -g -fPIC -Wall -W $(C luaif/liblua.a: override LDFLAGS := $(LDFLAGS) luaif/liblua.a: override LIBS := -targets := $(targets) $(D)/libluaif.a $(D)/liblua.a +targets := $(targets) $(D)/libluaif.a diff --git a/scratchbox2/preload/Makefile b/scratchbox2/preload/Makefile index 59d4da73..c143c379 100644 --- a/scratchbox2/preload/Makefile +++ b/scratchbox2/preload/Makefile @@ -20,10 +20,10 @@ LIBSB2_LDFLAGS = -Wl,-soname=$(LIBSB2_SONAME) \ # DO NOT add any libraries that depend on libpthread to # LIBSB2_LIBS or LIBS!! see the comments in luaif.c. -LIBSB2_LIBS = +LIBSB2_LIBS = $(LUA_LIBS) SHLIBEXT = so else -LIBSB2_LIBS = +LIBSB2_LIBS = $(LUA_LIBS) SHLIBEXT = dylib endif diff --git a/scratchbox2/sb2d/Makefile b/scratchbox2/sb2d/Makefile index 8bd273f5..a612b2e3 100644 --- a/scratchbox2/sb2d/Makefile +++ b/scratchbox2/sb2d/Makefile @@ -18,9 +18,8 @@ $(D)/sb2d: $(D)/sb2d.o \ pathmapping/paths_ruletree_maint.o \ execs/exec_ruletree_maint.o \ luaif/sblib_luaif.o \ - luaif/liblua.a $(MKOUTPUTDIR) $(P)LD - $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lm -ldl + $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lm -ldl $(LUA_LIBS) targets := $(targets) $(D)/sb2d