Browse files

clean up lib extension name, add script to fix internal dylib paths (…

…work in progress)
  • Loading branch information...
1 parent e1ab086 commit 482888dd4df98ad62296641d3d55957d3f03ef98 @davilla davilla committed Aug 28, 2012
Showing with 22 additions and 7 deletions.
  1. +5 −7 addons/Makefile.include.am
  2. +3 −0 configure.ac
  3. +14 −0 scripts/dylib_fix_paths.sh
View
12 addons/Makefile.include.am
@@ -13,18 +13,16 @@ clean:
-rm -r -f $(LIB) $(ADDONBINNAME).pvr @abs_top_srcdir@/addons/$(ADDONNAME).@OS@-@ARCHITECTURE@.zip @abs_top_srcdir@/addons/.build/$(ADDONNAME) *.so *.lo *.o *.la *.a *.P *~
release: $(lib_LTLIBRARIES)
+ cp -f .libs/$(LIBNAME).@DYN_LIB_EXT@ $(ADDONBINNAME).pvr
+ $(STRIP) -x $(ADDONBINNAME).pvr
if HOST_IS_OSX
- cp -f .libs/$(LIBNAME).dylib $(ADDONBINNAME).pvr
-else
- cp -f .libs/$(LIBNAME).so $(ADDONBINNAME).pvr
+ @abs_top_srcdir@/scripts/dylib_fix_paths.sh $(ADDONBINNAME).pvr
endif
- $(STRIP) -x $(ADDONBINNAME).pvr
debug: $(lib_LTLIBRARIES)
+ cp -f .libs/$(LIBNAME).@DYN_LIB_EXT@ $(ADDONBINNAME).pvr
if HOST_IS_OSX
- cp -f .libs/$(LIBNAME).dylib $(ADDONBINNAME).pvr
-else
- cp -f .libs/$(LIBNAME).so $(ADDONBINNAME).pvr
+ @abs_top_srcdir@/scripts/dylib_fix_paths.sh $(ADDONBINNAME).pvr
endif
$(LIB): @BUILD_TYPE@
View
3 configure.ac
@@ -29,6 +29,7 @@ ARCHITECTURE="unknown"
HOST_INCLUDES=""
HOST_CXXFLAGS=""
ARCH_DEFINES="-DTARGET_POSIX -DTARGET_LINUX -D_LINUX"
+DYN_LIB_EXT="so"
case "${host}" in
arm*-*-linux*)
@@ -60,6 +61,7 @@ case "${host}" in
HOST_CXXFLAGS="-dynamiclib -single_module -undefined dynamic_lookup"
host_os_osx="yes"
ARCH_DEFINES="-DTARGET_POSIX -DTARGET_DARWIN -D_LINUX"
+ DYN_LIB_EXT="dylib"
;;
*-freebsd*)
OS="freebsd"
@@ -78,6 +80,7 @@ AC_SUBST(HOST_CXXFLAGS)
AC_SUBST(HOST_INCLUDES)
AC_SUBST(OS)
AC_SUBST(ARCH_DEFINES)
+AC_SUBST(DYN_LIB_EXT)
if test "x$host_os_osx" = "xyes"; then
AM_CONDITIONAL(HOST_IS_OSX, true)
View
14 scripts/dylib_fix_paths.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+EXTERNAL_LIBS=/Users/Shared/xbmc-depends
+DYLIB_NAMEPATH=@executable_path/../Frameworks
@garbear
garbear added a note Jun 24, 2013

should this be @executable_path@ like all the variables in XBMC's Makefile.in's?

@opdenkamp
Owner

looks like a typo indeed. though i wonder why it works with this typo in. @davilla ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
+# 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 482888d

Please sign in to comment.