Build Shared Lib #1049

Merged
merged 14 commits into from Jun 7, 2012
+449 −286
Split
View
@@ -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
@@ -949,6 +949,7 @@
F5D8D732102BB3B1004A11AB /* OverlayRendererGL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D8D72F102BB3B1004A11AB /* OverlayRendererGL.cpp */; };
F5D8D733102BB3B1004A11AB /* OverlayRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D8D731102BB3B1004A11AB /* OverlayRenderer.cpp */; };
F5D8EF5B103912A4004A11AB /* DVDSubtitleParserVplayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5D8EF59103912A4004A11AB /* DVDSubtitleParserVplayer.cpp */; };
+ F5DA82D915803129003EE43C /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5DA82D815803129003EE43C /* main.cpp */; };
F5DC87E2110A287400EE1B15 /* RingBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5DC87E1110A287400EE1B15 /* RingBuffer.cpp */; };
F5DC8801110A46C700EE1B15 /* ModplugCodec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5DC8800110A46C700EE1B15 /* ModplugCodec.cpp */; };
F5DC888B110A654000EE1B15 /* libapetag.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5DC888A110A654000EE1B15 /* libapetag.a */; };
@@ -3011,6 +3012,7 @@
F5D8D731102BB3B1004A11AB /* OverlayRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OverlayRenderer.cpp; sourceTree = "<group>"; };
F5D8EF59103912A4004A11AB /* DVDSubtitleParserVplayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDSubtitleParserVplayer.cpp; sourceTree = "<group>"; };
F5D8EF5A103912A4004A11AB /* DVDSubtitleParserVplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDSubtitleParserVplayer.h; sourceTree = "<group>"; };
+ F5DA82D815803129003EE43C /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
F5DC87E0110A287400EE1B15 /* RingBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RingBuffer.h; sourceTree = "<group>"; };
F5DC87E1110A287400EE1B15 /* RingBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RingBuffer.cpp; sourceTree = "<group>"; };
F5DC87FF110A46C700EE1B15 /* ModplugCodec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModplugCodec.h; sourceTree = "<group>"; };
@@ -4345,6 +4347,7 @@
E38E184F0D25F9FA00618676 /* IProgressCallback.h */,
E38E18580D25F9FA00618676 /* LangInfo.cpp */,
E38E18590D25F9FA00618676 /* LangInfo.h */,
+ F5DA82D815803129003EE43C /* main.cpp */,
880DBE4B0DC223FF00E26B71 /* MediaSource.cpp */,
880DBE4C0DC223FF00E26B71 /* MediaSource.h */,
E38E1DC10D25F9FD00618676 /* NfoFile.cpp */,
@@ -7297,6 +7300,7 @@
7C6EB330155BD1D40080368A /* ImageFile.cpp in Sources */,
7C6EB6FA155F32C30080368A /* HTTPImageHandler.cpp in Sources */,
18E7CACB1578C26D001D4554 /* CDDARipJob.cpp in Sources */,
+ F5DA82D915803129003EE43C /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -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"
Oops, something went wrong.