Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from davilla/master
Browse files Browse the repository at this point in the history
some osx fixes.
  • Loading branch information
Lars Op den Kamp committed Sep 5, 2012
2 parents 05e3c9a + ed99ba6 commit 94c9f6f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -5,7 +5,7 @@ WARNING: this is work in progress. Don't try to use this unless you know what yo
============================= =============================


Start by executing: Start by executing:
autoreconf -vif ./bootstrap


To install add-ons into /path/to/XBMC: To install add-ons into /path/to/XBMC:
./configure --prefix=/path/to/XBMC ./configure --prefix=/path/to/XBMC
Expand Down
12 changes: 5 additions & 7 deletions addons/Makefile.include.am
Expand Up @@ -15,18 +15,16 @@ if IS_INTREE_BUILD
endif endif


release: $(lib_LTLIBRARIES) release: $(lib_LTLIBRARIES)
cp -f .libs/$(LIBNAME).@DYN_LIB_EXT@ $(ADDONBINNAME).pvr
$(STRIP) -x $(ADDONBINNAME).pvr
if HOST_IS_OSX if HOST_IS_OSX
cp -f .libs/$(LIBNAME).dylib $(ADDONBINNAME).pvr @abs_top_srcdir@/scripts/dylib_fix_paths.sh $(ADDONBINNAME).pvr
else
cp -f .libs/$(LIBNAME).so $(ADDONBINNAME).pvr
endif endif
$(STRIP) -x $(ADDONBINNAME).pvr


debug: $(lib_LTLIBRARIES) debug: $(lib_LTLIBRARIES)
cp -f .libs/$(LIBNAME).@DYN_LIB_EXT@ $(ADDONBINNAME).pvr
if HOST_IS_OSX if HOST_IS_OSX
cp -f .libs/$(LIBNAME).dylib $(ADDONBINNAME).pvr @abs_top_srcdir@/scripts/dylib_fix_paths.sh $(ADDONBINNAME).pvr
else
cp -f .libs/$(LIBNAME).so $(ADDONBINNAME).pvr
endif endif


$(LIB): @BUILD_TYPE@ $(LIB): @BUILD_TYPE@
Expand Down
3 changes: 3 additions & 0 deletions bootstrap
@@ -0,0 +1,3 @@
#!/bin/sh

autoreconf -vif
8 changes: 5 additions & 3 deletions configure.ac
Expand Up @@ -30,6 +30,7 @@ ARCHITECTURE="unknown"
HOST_INCLUDES="" HOST_INCLUDES=""
HOST_CXXFLAGS="" HOST_CXXFLAGS=""
ARCH_DEFINES="-DTARGET_POSIX -DTARGET_LINUX -D_LINUX" ARCH_DEFINES="-DTARGET_POSIX -DTARGET_LINUX -D_LINUX"
DYN_LIB_EXT="so"


case "${host}" in case "${host}" in
arm*-*-linux*) arm*-*-linux*)
Expand Down Expand Up @@ -58,14 +59,14 @@ case "${host}" in
;; ;;
*-apple-darwin*) *-apple-darwin*)
OS="darwin" OS="darwin"
HOST_INCLUDES="-I/opt/local/include"
HOST_CXXFLAGS="-dynamiclib -single_module -undefined dynamic_lookup" HOST_CXXFLAGS="-dynamiclib -single_module -undefined dynamic_lookup"
host_os_osx="yes" host_os_osx="yes"
ARCH_DEFINES="-DTARGET_POSIX -DTARGET_DARWIN" ARCH_DEFINES="-DTARGET_POSIX -DTARGET_DARWIN -D_LINUX"
DYN_LIB_EXT="dylib"
;; ;;
*-freebsd*) *-freebsd*)
OS="freebsd" OS="freebsd"
ARCH_DEFINES="-DTARGET_POSIX -DTARGET_FREEBSD" ARCH_DEFINES="-DTARGET_POSIX -DTARGET_FREEBSD -D_LINUX"
;; ;;
esac esac


Expand All @@ -88,6 +89,7 @@ AC_SUBST(HOST_CXXFLAGS)
AC_SUBST(HOST_INCLUDES) AC_SUBST(HOST_INCLUDES)
AC_SUBST(OS) AC_SUBST(OS)
AC_SUBST(ARCH_DEFINES) AC_SUBST(ARCH_DEFINES)
AC_SUBST(DYN_LIB_EXT)


if test "x$host_os_osx" = "xyes"; then if test "x$host_os_osx" = "xyes"; then
AM_CONDITIONAL(HOST_IS_OSX, true) AM_CONDITIONAL(HOST_IS_OSX, true)
Expand Down
14 changes: 14 additions & 0 deletions scripts/dylib_fix_paths.sh
@@ -0,0 +1,14 @@
#!/bin/sh

EXTERNAL_LIBS=/Users/Shared/xbmc-depends
DYLIB_NAMEPATH=@executable_path/../Frameworks

# change the dylib path used for linking
install_name_tool -id "$(basename $1)" "$1"

# change the dylib paths used for depends loading
for a in $(otool -L "$1" | grep "$EXTERNAL_LIBS" | awk ' { print $1 } ') ; do
echo " Packaging $a"
install_name_tool -change "$a" "$DYLIB_NAMEPATH/$(basename $a)" "$1"
done

0 comments on commit 94c9f6f

Please sign in to comment.