Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

libxbmc: option for shared libxbmc.so

  • Loading branch information...
commit bc14f0cc09b6518f787e3e11d6ca78a7ab5c77cc 1 parent 5f561f7
theuni authored
Showing with 31 additions and 3 deletions.
  1. +21 −3 Makefile.in
  2. +10 −0 configure.in
View
24 Makefile.in
@@ -183,13 +183,20 @@ CXXFLAGS=@CXXFLAGS@
LDFLAGS=@LDFLAGS@
INCLUDES=$(sort @INCLUDES@)
-CLEAN_FILES=xbmc.bin xbmc-xrandr
+CLEAN_FILES=xbmc.bin xbmc-xrandr libxbmc.so
DISTCLEAN_FILES=config.h config.log config.status tools/Linux/xbmc.sh \
tools/Linux/xbmc-standalone.sh autom4te.cache config.h.in~ \
system/libcpluff-@ARCH@.so
-all : Makefile externals xbmc.bin xbmc-xrandr skins
+ifeq (@USE_LIBXBMC@,1)
+FINAL_TARGETS+=libxbmc.so
+else
+FINAL_TARGETS=xbmc.bin skins xbmc-xrandr
+endif
+FINAL_TARGETS+=Makefile externals
+
+all : $(FINAL_TARGETS)
@echo '-----------------------'
@echo 'XBMC built successfully'
@echo '-----------------------'
@@ -335,7 +342,14 @@ OBJSXBMC:=$(filter-out $(DYNOBJSXBMC), $(OBJSXBMC))
LIBS += @PYTHON_LDFLAGS@
-xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) $(NWAOBJSXBMC)
+libxbmc.so: $(OBJSXBMC) $(DYNOBJSXBMC)
+ifeq ($(findstring osx,@ARCH@), osx)
+ $(SILENT_LD) $(CXX) $(LDFLAGS) -bundle -o $@ -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(OBJSXBMC) $(LIBS)
+else
+ $(SILENT_LD) $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $@ -Wl,--whole-archive $(DYNOBJSXBMC) $(OBJSXBMC) -Wl,--no-whole-archive $(LIBS)
+endif
+
+xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC)
ifeq ($(findstring osx,@ARCH@), osx)
$(SILENT_LD) $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
@@ -379,8 +393,12 @@ install-binaries: install-scripts
ifeq (1,@USE_XRANDR@)
@install xbmc-xrandr $(DESTDIR)$(libdir)/xbmc/xbmc-xrandr
endif
+ifeq (@USE_LIBXBMC@,1)
+ @install libxbmc.so $(DESTDIR)$(libdir)/xbmc/libxbmc.so
+else
@echo "You can run XBMC with the command 'xbmc'"
endif
+endif
install-arch:
@# Arch dependent files
View
10 configure.in
@@ -147,6 +147,11 @@ dashes="------------------------"
final_message="\n XBMC Configuration:"
final_message="\n$dashes$final_message\n$dashes"
+AC_ARG_ENABLE([shared-lib],
+ [AS_HELP_STRING([--enable-shared-lib],
+ [build libxbmc. helpful for tests (default is no)])],
+ [build_shared_lib=$enableval],
+ [build_shared_lib=no])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
@@ -561,6 +566,11 @@ case $host in
esac
AC_SUBST([ARCH])
+if test "$build_shared_lib" = "yes"; then
+ final_message="$final_message\n Shared lib\tYes"
+ AC_SUBST(USE_LIBXBMC,1)
+fi
+
# platform debug flags
if test "$use_debug" = "yes"; then
final_message="$final_message\n Debugging:\tYes"
Please sign in to comment.
Something went wrong with that request. Please try again.