VLC framework
Create a VLC framework that can be used by both VLC.app and VLCplugin.bundle.
An example on how to do that from make files might be found in these auto* files of libR https://svn.r-project.org/R/trunk/configure.ac https://svn.r-project.org/R/trunk/Makefile.in
Specific section configure.ac
## Allow the user to specify building an R framework (Darwin).
AC_ARG_ENABLE([R-framework],
[AC_HELP_STRING([--enable-R-framework@<:@=DIR@:>@],
[MacOS X only: build R framework (if possible), and specify
its installation prefix @<:@yes, /Library/Frameworks@:>@])],
[want_R_framework="${enableval}"],
[want_R_framework=yes])
## Can only build frameworks on Darwin.
if test "${want_R_framework}" != no; then
case "${host_os}" in
darwin*)
if test "${want_R_framework}" = yes; then
## If we build a framework and 'prefix' was not given, we need
## to set it to '/Library/Frameworks' rather than '/usr/local'.
## Note that Autoconf sets things up so that by default, prefix
## and exec_prefix are set to 'NONE'. Let's hope for no change.
if test "x${prefix}" = xNONE; then
prefix="/Library/Frameworks"
fi
else
prefix="${want_R_framework}"
want_R_framework=yes
fi
## FW_VERSION is the sub-directory name used in R.framework/Version
## By default it's the a.b form of the full a.b.c version to simplify
## binary updates.
: ${FW_VERSION=`echo "${PACKAGE_VERSION}" | sed -e "s/[[\.]][[0-9]]$//"`}
;;
*)
want_R_framework=no
;;
esac
fi
AM_CONDITIONAL(WANT_R_FRAMEWORK, [test "x${want_R_framework}" = xyes])
specific section Makefile.in
install-R-framework:
@echo "Creating R framework ..."
@(cd "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)" && \
ln -f -s -n Resources/include Headers && \
ln -f -s -n Resources/lib/libR.dylib R)
@(cd "$(R_FRAMEWORK_DIR)/Versions" && \
ln -f -s -n $(FW_VERSION) Current)
@(cd "$(R_FRAMEWORK_DIR)" && \
ln -f -s -n Versions/Current/PrivateHeaders PrivateHeaders&& \
ln -f -s -n Versions/Current/Headers Headers&& \
ln -f -s -n Versions/Current/R R && \
ln -f -s -n Versions/Current/Resources Resources)
@## the resulting libR will point dyld to the fat libR regardless of its origin
@(cd "$(R_FRAMEWORK_DIR)/Resources/lib" && \
install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" $(Rexeclibdir)/libR.dylib)
@(for lib in Rlapack Rblas R; do \
if test -e "$(Rexeclibdir)/lib$${lib}.dylib"; then echo " lib$${lib}"; \
find "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/" -name '*.so' -or -name '*.dylib' | \
xargs -n 1 install_name_tool -change \
`otool -L $(Rexeclibdir)/lib$${lib}.dylib |sed -n -e '2 s/.\(.*\) (compat.*/\1/p'` \
"$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" ; \
find "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/" -name '*.so' -or -name '*.dylib' | \
xargs -n 1 install_name_tool -change lib$${lib}.dylib \
"$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" ; \
install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" \
"$(Rexeclibdir)/lib$${lib}.dylib"; \
if [ "$(Rexeclibdir)" != "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib" ]; then \
$(srcdir)/tools/updatefat "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" "$(Rexeclibdir)/lib$${lib}.dylib"; \
install_name_tool -id "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib" \
"$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/lib$${lib}.dylib"; \
fi; \
fi; \
done)
@(cp -R $(srcdir)/src/include $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders && \
cp src/include/config.h $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders/ && \
find $(R_FRAMEWORK_DIR)/Versions/Current/PrivateHeaders -name .svn | xargs rm -rf)
@(install_name_tool -change libR.dylib \
"$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/lib/libR.dylib" \
$(Rexecbindir2)/R)
@(if [ -n "${R_ARCH}" ]; then \
if [ "${R_ARCH}" != /ppc -a "${R_ARCH}" != /i386 -a "${R_ARCH}" != /ppc64 ]; then \
echo "\
*** WARNING: The architecture name is incompatible with Apple's naming~ convention. This may prevent applications from using the R~ framework. Please use i386, ppc or ppc64 as architecture~ names to allow universal builds."|sed 'y/~/\n/' >&2; \
else \
for f in `ls "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Headers/${R_ARCH}/"*.h|xargs basename`; do \
echo "/* This is an automatically generated universal stub for architecture-dependent headers. */~#ifdef __i386__~#include <i386/$$f>~#else~#ifdef __ppc__~#include <ppc/$$f>~#else~#ifdef __ppc64__~#include <ppc64/$$f>~#else~#error Cannot determine the correct architecture. To force a certain configuration, include architecture-specific include path *before* general R headers path.~#endif~#endif~#endif" |sed -e 'y/~/\n/' > "$(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Headers/$$f"; \
done; \
fi; \
fi )
@( echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>~<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">~<plist version=\"1.0\">~<dict>~ <key>CFBundleIdentifier</key>~ <string>org.r-project.R-framework</string>~ <key>CFBundleInfoDictionaryVersion</key>~ <string>6.0</string>~ <key>CFBundleName</key>~ <string>R</string>~ <key>CFBundlePackageType</key>~ <string>FMWK</string>~ <key>CFBundleVersion</key>~ <string>$(VERSION)</string>~</dict>~</plist>" |sed -e 'y/~/\n/' > $(R_FRAMEWORK_DIR)/Versions/$(FW_VERSION)/Resources/Info.plist)