Commit cd99de83d3bb2c3d99169eeb5aba0e934ca9b64b

Thomas de Grivel 2023-11-16T15:31:41

configure bundle libs

diff --git a/libc3/window/cairo/quartz/demo/Makefile b/libc3/window/cairo/quartz/demo/Makefile
index df12f45..65fc5d1 100644
--- a/libc3/window/cairo/quartz/demo/Makefile
+++ b/libc3/window/cairo/quartz/demo/Makefile
@@ -21,6 +21,7 @@ DISTCLEANFILES = ${CLEANFILES} config.mk
 
 build:
 	${MAKE} ${APP_PROG}
+	${MAKE} ${APP_PROG_FRAMEWORKS}
 
 all:
 	${MAKE} build
diff --git a/libc3/window/cairo/quartz/demo/configure b/libc3/window/cairo/quartz/demo/configure
index cfe9417..5109e5b 100755
--- a/libc3/window/cairo/quartz/demo/configure
+++ b/libc3/window/cairo/quartz/demo/configure
@@ -197,4 +197,20 @@ echo >> ${CONFIG_MK}
 echo "${APP_PROG_DEBUG}: ${PROG_DEBUG}" >> ${CONFIG_MK}
 echo "	cp .libs/${PROG_DEBUG} ${APP_PROG_DEBUG}" >> ${CONFIG_MK}
 
+BUNDLE_LIBS="
+../../../../.libs/libc3.0.dylib
+../../../.libs/libc3_window.0.dylib
+../../.libs/libc3_window_cairo.0.dylib
+../.libs/libc3_window_cairo_quartz.dylib
+"
+
+echo "${APP_PROG_FRAMEWORKS}: ${BUNDLE_LIBS}" >> ${CONFIG_MK}
+echo "	mkdir -p ${APP}/Contents/Frameworks" >> ${CONFIG_MK}
+echo "	cp ${BUNDLE_LIBS} ${APP}/Contents/Frameworks/" >> ${CONFIG_MK}
+for BUNDLE_LIB in ${BUNDLE_LIBS}; do
+    L=$(basename $BUNDLE_LIB)
+    echo "	install_name_tool -id @executable_path/../Frameworks/ ${APP}/Contents/Frameworks/$L"
+    echo "	install_name_tool -change ${LIBDIR}/$L @executable_path/../Frameworks/$L ${APP}/Contents/MacOS/${PROG}"
+done
+
 update_config_mk