Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[sb2] Don't use bundled liblua. Contributes to JB#52528
  • Loading branch information
Thaodan committed Feb 11, 2021
1 parent cc1bcb9 commit 08f1220
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
1 change: 1 addition & 0 deletions rpm/scratchbox2.spec
Expand Up @@ -9,6 +9,7 @@ Prefix: /usr
ExclusiveArch: %{ix86}
BuildRequires: make
BuildRequires: autoconf
BuildRequires: pkgconfig(lua)
Requires: fakeroot
Requires: libsb2 = %{version}-%{release}

Expand Down
1 change: 0 additions & 1 deletion scratchbox2/Makefile
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scratchbox2/autogen.sh
Expand Up @@ -3,7 +3,7 @@
#automake_version=1.9

rm -rf configure autom4te.cache
#aclocal
aclocal
autoheader
autoconf

4 changes: 2 additions & 2 deletions scratchbox2/config.mak.in
Expand Up @@ -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@

6 changes: 3 additions & 3 deletions scratchbox2/configure.ac
Expand Up @@ -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
Expand Down Expand Up @@ -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
8 changes: 4 additions & 4 deletions scratchbox2/luaif/Makefile
Expand Up @@ -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 \
Expand All @@ -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

4 changes: 2 additions & 2 deletions scratchbox2/preload/Makefile
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions scratchbox2/sb2d/Makefile
Expand Up @@ -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

0 comments on commit 08f1220

Please sign in to comment.