preserve library directories
Should avoid overwriting libraries when there are multiple versions of a library used by different programs.
This commit is contained in:
parent
356dc9bc17
commit
74fb57d1c4
2 changed files with 10 additions and 4 deletions
10
Makefile
10
Makefile
|
@ -152,10 +152,14 @@ osxapp: $(bins)
|
|||
install -d "$(OSXAPP_BASE)/git-core"
|
||||
(cd "$(shell git --exec-path)" && tar c .) | (cd "$(OSXAPP_BASE)"/git-core && tar x)
|
||||
|
||||
install -d "$(OSXAPP_BASE)/lib"
|
||||
touch "$(OSXAPP_BASE)/libdirs.tmp"
|
||||
for lib in $$(otool -L "$(OSXAPP_BASE)"/bin/* "$(OSXAPP_BASE)"/git-core/* | egrep '^ ' | cut -d ' ' -f 1 | sed 's/^ //' | sort | uniq); do \
|
||||
base=$$(basename "$$lib"); \
|
||||
cp "$$lib" "$(OSXAPP_BASE)/lib/$$base"; \
|
||||
dir=$$(dirname "$$lib"); \
|
||||
install -d "$(OSXAPP_BASE)/$$dir"; \
|
||||
echo "$$dir" >> "$(OSXAPP_BASE)/libdirs.tmp"; \
|
||||
cp "$$lib" "$(OSXAPP_BASE)/$$dir"; \
|
||||
done
|
||||
sort "$(OSXAPP_BASE)/libdirs.tmp" | uniq > "$(OSXAPP_BASE)/libdirs"
|
||||
rm -f "$(OSXAPP_BASE)/libdirs.tmp"
|
||||
|
||||
.PHONY: $(bins) test install
|
||||
|
|
|
@ -29,7 +29,9 @@ cd "$orig"
|
|||
PATH=$base/bin:$PATH
|
||||
export PATH
|
||||
|
||||
DYLD_LIBRARY_PATH=$base/lib:$DYLD_LIBRARY_PATH
|
||||
for lib in "$(cat libdirs)"; do
|
||||
DYLD_LIBRARY_PATH="$base/$lib:$DYLD_LIBRARY_PATH"
|
||||
done
|
||||
export DYLD_LIBRARY_PATH
|
||||
|
||||
GIT_EXEC_PATH=$base/git-core
|
||||
|
|
Loading…
Reference in a new issue