Skip to content

Commit 32c1473

Browse files
committed
Update the previous commit to add loader_psths for subdirectories of
Frameworks, making sure that a loader_path for Frameworks is included even if Frameworks doesn't exist.
1 parent 228d7fc commit 32c1473

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

build.macos32x86/common/Makefile.app

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,19 @@ $(APP)/Contents/Resources/%.icns: $(OSXDIR)/%.icns
167167
@mkdir -p $(APP)/Contents/Resources
168168
cp -p $< $(APP)/Contents/Resources
169169

170+
# Make sure that the executable contains a loader_path for Frameworks and all
171+
# its subdirectories. If Frameworks does not exist still add an rpath for it.
170172
pathapp:
171173
install_name_tool -add_rpath @executable_path/../Frameworks $(VMEXE)
172-
install_name_tool -add_rpath @loader_path/../Frameworks $(VMEXE)
174+
if [ -d "$(APP)/Contents/Frameworks" ]; then \
175+
for d in `cd "$(APP)/Contents" >/dev/null; find Frameworks -type d`; do \
176+
echo install_name_tool -add_rpath @loader_path/../$$d $(VMEXE); \
177+
install_name_tool -add_rpath @loader_path/../$$d $(VMEXE); \
178+
done \
179+
else \
180+
echo install_name_tool -add_rpath @loader_path/../Frameworks $(VMEXE); \
181+
install_name_tool -add_rpath @loader_path/../Frameworks $(VMEXE); \
182+
fi
173183

174184
# To sign the app, set SIGNING_IDENTITY in the environment, e.g.
175185
# export SIGNING_IDENTITY="Developer ID Application: Eliot Miranda"

build.macos64x64/common/Makefile.app

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,19 @@ $(APP)/Contents/Resources/%.icns: $(OSXDIR)/%.icns
167167
@mkdir -p $(APP)/Contents/Resources
168168
cp -p $< $(APP)/Contents/Resources
169169

170+
# Make sure that the executable contains a loader_path for Frameworks and all
171+
# its subdirectories. If Frameworks does not exist still add an rpath for it.
170172
pathapp:
171173
install_name_tool -add_rpath @executable_path/../Frameworks $(VMEXE)
172-
install_name_tool -add_rpath @loader_path/../Frameworks $(VMEXE)
174+
if [ -d "$(APP)/Contents/Frameworks" ]; then \
175+
for d in `cd "$(APP)/Contents" >/dev/null; find Frameworks -type d`; do \
176+
echo install_name_tool -add_rpath @loader_path/../$$d $(VMEXE); \
177+
install_name_tool -add_rpath @loader_path/../$$d $(VMEXE); \
178+
done \
179+
else \
180+
echo install_name_tool -add_rpath @loader_path/../Frameworks $(VMEXE); \
181+
install_name_tool -add_rpath @loader_path/../Frameworks $(VMEXE); \
182+
fi
173183

174184
# To sign the app, set SIGNING_IDENTITY in the environment, e.g.
175185
# export SIGNING_IDENTITY="Developer ID Application: Eliot Miranda"

0 commit comments

Comments
 (0)