Skip to content

Commit

Permalink
Code changes for external python. Changes include submissions by cpts…
Browse files Browse the repository at this point in the history
…piff,WiSo,blinkseb, and jcarroll

changed: limit the scope of the python includes. this will be useful in an upcomming patch. credit jcarroll
changed: use a m4 check to set the python path directly, and ditch the old hardcoded version nonsense. credit jcarroll
Fixed the build for when --enable-external-python is not used.
Fixed the warnings due to Python.h not being the first header as required by Python.
Final fix to the osx make build so that external python works. Needed to change the m4 macro to account for .dylib on osx and the dependant ./configure call to pass the installed location of the python xbmc is to be built against. Also updated .gitignore for the osx dependency builds.
There was a name collision between the python datetime.h and the xbmc/DateTime.h on file systems that are not case sensitive. This is now fixed by renaming DateTime.h to XBDateTime.h
By request, the .cpp files now sorted alphabetically in the Makefile.in.
the m4 macros is a mess of mixed spaces and tabs. In order to make my couple line change more readable I changed the spaces to tabs so it would be consistent with the surrounding area. This was per the request of jmarshall.
Fixed an error where under internal python the correct header wasn't being used.
if --enable-external-python is selected then don't build the internal python at all and not using any of the wrappers.
Modified the xcode project to work with the external python changes.
There was a bug in the Makefile.in where the internal python build target wasn't being set correctly. This is now fixed.
[WIN32] removed some uneeded files, renamed DateTime* to XBDateTime* and defined USE_EXTERNAL_PYTHON
Added xbmc/cores/DllLoader/Makefile to .gitignore since it's being autogened.
Made it so that the distinction between internal and external python is limited to mostly just Makefile's now. Most of the code no longer needs to make the distinction. This should make it much easier to move forward in windows and eventually with removing the internal python.
updated: .gitignore
  • Loading branch information
spiff authored and Jim Carroll committed Apr 5, 2011
1 parent 3b508b2 commit b768137
Show file tree
Hide file tree
Showing 84 changed files with 613 additions and 835 deletions.
13 changes: 4 additions & 9 deletions .gitignore
Expand Up @@ -385,15 +385,7 @@ lib/cmyth/Makefile
/system/profiles.xml /system/profiles.xml


# /system/python # /system/python
/system/python/Lib/ /system/python/
/system/python/python24.zip
/system/python/python24.dll
/system/python/DLLs/_socket.pyd
/system/python/DLLs/pyexpat.pyd
/system/python/DLLs/select.pyd
/system/python/DLLs/unicodedata.pyd
/system/python/DLLs/zlib.pyd
/system/python/DLLs/bz2.pyd


# /system/webserver # /system/webserver
/system/webserver /system/webserver
Expand Down Expand Up @@ -496,6 +488,7 @@ lib/cmyth/Makefile
/xbmc/cores/DllLoader/exports/build_wrapper.sh /xbmc/cores/DllLoader/exports/build_wrapper.sh
/xbmc/cores/DllLoader/exports/wrapper.def /xbmc/cores/DllLoader/exports/wrapper.def
/xbmc/cores/DllLoader/Makefile /xbmc/cores/DllLoader/Makefile

/xbmc/cores/Makefile /xbmc/cores/Makefile


/xbmc/cores/VideoRenderers/Makefile /xbmc/cores/VideoRenderers/Makefile
Expand Down Expand Up @@ -1029,6 +1022,8 @@ lib/cmyth/Makefile


# /xbmc/interfaces/ # /xbmc/interfaces/
/xbmc/interfaces/Makefile /xbmc/interfaces/Makefile
/xbmc/interfaces/python/Makefile
/xbmc/interfaces/python/xbmcmodule/Makefile
/xbmc/interfaces/python/linux/Makefile /xbmc/interfaces/python/linux/Makefile
/xbmc/interfaces/python/linux/wrapper_python.def /xbmc/interfaces/python/linux/wrapper_python.def


Expand Down
23 changes: 22 additions & 1 deletion Makefile.in
Expand Up @@ -120,11 +120,14 @@ LIB_DIRS=\
lib/libhdhomerun \ lib/libhdhomerun \
lib/libid3tag \ lib/libid3tag \
lib/libapetag \ lib/libapetag \
xbmc/interfaces/python/linux \
lib/cpluff \ lib/cpluff \
lib/xbmc-dll-symbols \ lib/xbmc-dll-symbols \
lib/jsoncpp/src/lib_json lib/jsoncpp/src/lib_json


ifneq (@USE_EXTERNAL_PYTHON@,1)
LIB_DIRS+=xbmc/interfaces/python/linux
endif

SS_DIRS=\ SS_DIRS=\
xbmc/screensavers/rsxs-0.9/xbmc xbmc/screensavers/rsxs-0.9/xbmc


Expand Down Expand Up @@ -168,6 +171,12 @@ DISTCLEAN_FILES=config.h config.log config.status tools/Linux/xbmc.sh \
lib/python/libpython2.4.so.1.0 \ lib/python/libpython2.4.so.1.0 \
system/libcpluff-@ARCH@.so system/libcpluff-@ARCH@.so


ifneq (@USE_EXTERNAL_PYTHON@,1)
PYTHON_TARGET=python
else
PYTHON_TARGET=
endif

all : Makefile externals xbmc.bin xbmc-xrandr skins all : Makefile externals xbmc.bin xbmc-xrandr skins


include Makefile.include include Makefile.include
Expand Down Expand Up @@ -407,8 +416,10 @@ endif
libpython: dllloader libpython: dllloader
$(MAKE) -C xbmc/interfaces/python $(MAKE) -C xbmc/interfaces/python
$(MAKE) -C xbmc/interfaces/python/xbmcmodule $(MAKE) -C xbmc/interfaces/python/xbmcmodule
ifneq (@USE_EXTERNAL_PYTHON@,1)
python: dllloader python: dllloader
$(MAKE) -C xbmc/interfaces/python/linux $(MAKE) -C xbmc/interfaces/python/linux
endif
dvdpcodecs: dllloader dvdpcodecs: dllloader
$(MAKE) -C lib $(MAKE) -C lib
$(MAKE) -C lib/libdvd $(MAKE) -C lib/libdvd
Expand Down Expand Up @@ -453,6 +464,12 @@ codecs: papcodecs dvdpcodecs
libs: cmyth libhdhomerun libid3tag imagelib libexif python system/libcpluff-@ARCH@.so libs: cmyth libhdhomerun libid3tag imagelib libexif python system/libcpluff-@ARCH@.so
externals: codecs libs python visualizations screensavers externals: codecs libs python visualizations screensavers


ifeq ($(findstring osx,@ARCH@), osx)
libs: libhdhomerun libid3tag imagelib libexif $(PYTHON_TARGET) system/libcpluff-@ARCH@.so system/players/paplayer/libmodplug-@ARCH@.so
else
libs: libhdhomerun libid3tag imagelib libexif $(PYTHON_TARGET) system/libcpluff-@ARCH@.so
endif

xcode_depends: \ xcode_depends: \
codecs libs python visualizations screensavers eventclients skins \ codecs libs python visualizations screensavers eventclients skins \
lib/libsquish/libsquish.a \ lib/libsquish/libsquish.a \
Expand Down Expand Up @@ -579,6 +596,10 @@ ifeq ($(findstring arm,@ARCH@), arm)
LIBS +=-lpython2.6 LIBS +=-lpython2.6
endif endif


ifeq (@USE_EXTERNAL_PYTHON@,1)
LIBS += @PYTHON_LDFLAGS@
endif

xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC) xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC)
ifeq ($(findstring osx,@ARCH@), osx) ifeq ($(findstring osx,@ARCH@), osx)
$(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic $(CXX) $(LDFLAGS) -o xbmc.bin -Wl,-all_load,-ObjC $(DYNOBJSXBMC) $(OBJSXBMC) $(LIBS) -rdynamic
Expand Down
102 changes: 44 additions & 58 deletions XBMC.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

42 changes: 17 additions & 25 deletions configure.in
Expand Up @@ -5,6 +5,7 @@ AC_PREREQ(2.59)
AC_INIT([xbmc], [9.11], [http://trac.xbmc.org]) AC_INIT([xbmc], [9.11], [http://trac.xbmc.org])
AC_CONFIG_HEADERS([xbmc/config.h]) AC_CONFIG_HEADERS([xbmc/config.h])
AH_TOP([#pragma once]) AH_TOP([#pragma once])
m4_include([m4/ax_python_devel.m4])


AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign]) AM_INIT_AUTOMAKE([foreign])
Expand Down Expand Up @@ -891,29 +892,21 @@ fi


# External Python # External Python
if test "$use_external_python" = "yes"; then if test "$use_external_python" = "yes"; then
AC_CHECK_LIB([python2.6], [main], AX_PYTHON_DEVEL([>= 2.4])
[AC_DEFINE([HAVE_LIBPYTHON2_6], [1], PYTHON_VERSION=$ac_python_version
[Define to 1 if you have the 'python2.6' library.])
USE_PYTHON2_6=1], if test -z "$PYTHON_VERSION"; then
[AC_CHECK_LIB([python2.5], [main], AC_MSG_NOTICE($external_python_disabled)
[AC_DEFINE([HAVE_LIBPYTHON2_5], [1], USE_EXTERNAL_PYTHON=0
[Define to 1 if you have the 'python2.5' library.]) else
USE_PYTHON2_5=1], AC_MSG_NOTICE($external_python_enabled)
[AC_CHECK_LIB([python2.4], [main], AC_MSG_NOTICE([Using Python $PYTHON_VERSION])
[AC_DEFINE([HAVE_LIBPYTHON2_4], [1], USE_EXTERNAL_PYTHON=1
[Define to 1 if you have the 'python2.4' library.]) AC_DEFINE([USE_EXTERNAL_PYTHON], [1], [Whether to use external python library.])
USE_PYTHON2_4=1], fi
[AC_MSG_ERROR($missing_library)] )] )] )

AC_MSG_NOTICE($external_python_enabled)
test "$USE_PYTHON2_6" && AC_MSG_NOTICE([Using Python 2.6])
test "$USE_PYTHON2_5" && AC_MSG_NOTICE([Using Python 2.5])
test "$USE_PYTHON2_4" && AC_MSG_NOTICE([Using Python 2.4])
USE_EXTERNAL_PYTHON=1
AC_DEFINE([USE_EXTERNAL_PYTHON], [1], [Whether to use external python library.])
else else
AC_MSG_NOTICE($external_python_disabled)
USE_EXTERNAL_PYTHON=0 USE_EXTERNAL_PYTHON=0
PYTHON_CPPFLAGS="-I\$(abs_top_srcdir)/lib/python/Include"
fi fi


# VDPAU # VDPAU
Expand Down Expand Up @@ -1401,7 +1394,8 @@ OUTPUT_FILES="Makefile \
lib/libsquish/Makefile \ lib/libsquish/Makefile \
lib/libid3tag/Makefile \ lib/libid3tag/Makefile \
lib/cximage-6.0/Makefile \ lib/cximage-6.0/Makefile \
xbmc/interfaces/python/linux/Makefile \ xbmc/interfaces/python/Makefile \
xbmc/interfaces/python/xbmcmodule/Makefile \
lib/libUPnP/Makefile \ lib/libUPnP/Makefile \
xbmc/DllPaths_generated.h \ xbmc/DllPaths_generated.h \
xbmc/linux/Makefile \ xbmc/linux/Makefile \
Expand Down Expand Up @@ -1434,9 +1428,7 @@ AC_SUBST(BUILD_DVDCSS)
AC_SUBST(BUILD_GOOM) AC_SUBST(BUILD_GOOM)
AC_SUBST(USE_EXTERNAL_FFMPEG) AC_SUBST(USE_EXTERNAL_FFMPEG)
AC_SUBST(USE_EXTERNAL_PYTHON) AC_SUBST(USE_EXTERNAL_PYTHON)
AC_SUBST(USE_PYTHON2_6) AC_SUBST(PYTHON_VERSION)
AC_SUBST(USE_PYTHON2_5)
AC_SUBST(USE_PYTHON2_4)
AC_SUBST(OUTPUT_FILES) AC_SUBST(OUTPUT_FILES)
AC_SUBST(HAVE_XBMC_NONFREE) AC_SUBST(HAVE_XBMC_NONFREE)
AC_SUBST(USE_ASAP_CODEC) AC_SUBST(USE_ASAP_CODEC)
Expand Down

0 comments on commit b768137

Please sign in to comment.