Commit 3d692c56 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Simpler way to create the diskimage (10.3 and higher only)

* realigning of some of the configure --help options
* added --with-macosx-sdk
  - compiles VLC (not contrib) with the 10.3.9 SDK
  - uses a small hack to enforce the deployment target when you do make in the srcdir
  - requires you to use gcc 4.0 on on Mac OS X 10.4
parent b815369d
......@@ -36,6 +36,7 @@ EXTRA_DIST = \
BUILT_SOURCES_distclean = vlc-config compile
BUILT_SOURCES_clean = \
stamp-api \
macosx-sdk \
src/misc/modules_builtin.h \
src/misc/version.c \
$(NULL)
......@@ -253,7 +254,6 @@ EXTRA_DIST += \
extras/MacOSX/Resources/vlc.scriptTerminology \
extras/MacOSX/Resources/README \
extras/MacOSX/vlc.pbproj/project.pbxproj \
extras/MacOSX/macosx-dmg \
extras/MacOSX/Delete_Preferences.app/Contents/Info.plist \
extras/MacOSX/Delete_Preferences.app/Contents/PkgInfo \
extras/MacOSX/Delete_Preferences.app/Contents/MacOS/applet \
......@@ -1054,23 +1054,28 @@ package-beos:
rm -Rf $(srcdir)/tmp ;
package-macosx:
# Check that tmp isn't in the way
@if test -e "$(top_builddir)/tmp"; then \
echo "Error: please remove $(top_builddir)/tmp, it is in the way"; \
false; \
else \
echo "OK."; mkdir -p "$(top_builddir)/tmp"; \
# Check that the temporary location isn't in the way
@if test -e "$(top_builddir)/vlc-${VERSION}/"; then \
rm -Rf "$(top_builddir)/vlc-${VERSION}/" ; \
fi
echo "Create package directory: vlc-${VERSION}/";
mkdir -p "$(top_builddir)/vlc-${VERSION}/";
# Copy relevant files
cp -R "$(top_builddir)/VLC-release.app" "$(top_builddir)/tmp/VLC.app"
cd "$(srcdir)" && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS $(top_builddir)/tmp/ && cp -R extras/MacOSX/Delete_Preferences.app $(top_builddir)/tmp/
cp -R "$(top_builddir)/VLC-release.app" "$(top_builddir)/vlc-${VERSION}/VLC.app"
cd "$(srcdir)" && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS $(top_builddir)/vlc-${VERSION}/ && cp -R extras/MacOSX/Delete_Preferences.app $(top_builddir)/vlc-${VERSION}/
# Create disk image
$(srcdir)/extras/MacOSX/macosx-dmg "vlc-${VERSION}" $(top_builddir)/tmp
echo "Creating disk image" ;
rm -f "$(top_builddir)/vlc-${VERSION}.dmg" ;
hdiutil create -srcfolder "$(top_builddir)/vlc-${VERSION}" \
"$(top_builddir)/vlc-${VERSION}.dmg" -format UDZO -quiet ;
echo; echo "Disk image creation completed:" ;
ls -la "$(top_builddir)/vlc-${VERSION}.dmg" ; echo ;
# Clean up
rm -Rf $(top_builddir)/tmp
rm -Rf "$(top_builddir)/vlc-${VERSION}" ;
package-translations:
@if test -e "$(srcdir)/vlc-translations-${VERSION}"; then \
......@@ -1143,6 +1148,12 @@ stamp-api: Makefile.in $(HEADERS_include) vlc-config vlc-api.pl
top_srcdir="$(top_srcdir)" perl $(top_srcdir)/vlc-api.pl
touch stamp-api
###############################################################################
# Enforce Mac OS X deployment target environment variable
###############################################################################
macosx-sdk: Makefile.in $(HEADERS_include) vlc-config vlc-api.pl
export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET)
###############################################################################
# Force rule
###############################################################################
......
......@@ -143,7 +143,8 @@ case "${target_os}" in
SYS="${target_os}"
CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
;;
darwin*)
darwin1.[0123])
dnl Mac OS X < 10.3
SYS=darwin
CFLAGS_save="${CFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="${CXXFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; CXXFLAGS="${CXXFLAGS_save}"
......@@ -154,6 +155,15 @@ case "${target_os}" in
VLC_ADD_CFLAGS([vlc],[-x objective-c])
VLC_ADD_LDFLAGS([vlc],[-Wl,-m -Wl,-multiply_defined -Wl,suppress])
;;
darwin*)
SYS=darwin
CFLAGS_save="${CFLAGS_save} -D_INTL_REDIRECT_MACROS"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="${CXXFLAGS_save} -D_INTL_REDIRECT_MACROS"; CXXFLAGS="${CXXFLAGS_save}"
OBJCFLAGS_save="${OBJCFLAGS_save} -D_INTL_REDIRECT_MACROS"; OBJCFLAGS="${OBJCFLAGS_save}"
VLC_ADD_LDFLAGS([mp4], [-framework IOKit -framework CoreFoundation])
VLC_ADD_CFLAGS([libvlc],[-x objective-c])
VLC_ADD_CFLAGS([vlc],[-x objective-c])
;;
*mingw32* | *cygwin* | *wince* | *mingwce* | *pe*)
AC_CHECK_TOOL(WINDRES, windres, :)
......@@ -232,6 +242,20 @@ AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
AM_CONDITIONAL(HAVE_WINCE, test "${SYS}" = "mingwce")
dnl
dnl Check for Mac OS X SDK settings
dnl
AC_ARG_WITH(macosx-sdk,
[ --with-macosx-sdk compile for Mac OS X 10.3 SDK],[],[])
if test -n "${with_macosx-sdk}"; then
CFLAGS_save="${CFLAGS_save} -DMACOSX_DEPLOYMENT_TARGET=10.3 -isysroot /Developer/SDKs/MacOSX10.3.9.sdk"; CFLAGS="${CFLAGS_save}"
CXXFLAGS_save="${CXXFLAGS_save} -DMACOSX_DEPLOYMENT_TARGET=10.3 -isysroot /Developer/SDKs/MacOSX10.3.9.sdk"; CXXFLAGS="${CXXFLAGS_save}"
OBJCFLAGS_save="${OBJCFLAGS_save} -DMACOSX_DEPLOYMENT_TARGET=10.3 -isysroot /Developer/SDKs/MacOSX10.3.9.sdk"; OBJCFLAGS="${OBJCFLAGS_save}"
LDFLAGS_save="${LDFLAGS_save} -isysroot /Developer/SDKs/MacOSX10.3.9.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.3.9.sdk"; LDFLAGS="${LDFLAGS_save}"
export MACOSX_DEPLOYMENT_TARGET=10.3
MACOSX_DEPLOYMENT_TARGET="10.3"
fi
dnl
dnl Gettext stuff
dnl
......@@ -910,15 +934,12 @@ if test "${ac_cv_c_dynamic_no_pic}" != "no"; then
fi
dnl Check for Darwin plugin linking flags
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error],
[ac_cv_ld_darwin],
[CFLAGS="${CFLAGS_save} -bundle -undefined error -lcc_dynamic"
[CFLAGS="${CFLAGS_save} -bundle -undefined error"
AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test "${ac_cv_ld_darwin}" != "no"; then
VLC_ADD_LDFLAGS([plugin],[-bundle -undefined error])
AC_CHECK_LIB(cc_dynamic, main,[
VLC_ADD_LDFLAGS([plugin],[-lcc_dynamic])
])
fi
dnl Check for standard plugin linking flags
......@@ -1756,7 +1777,7 @@ dnl
dnl libdvbpsi ts demux/mux
dnl
AC_ARG_ENABLE(dvbpsi,
[ --enable-dvbpsi dvbpsi ts mux and demux module (default enabled)])
[ --enable-dvbpsi dvbpsi ts mux and demux module (default enabled)])
if test "${enable_dvbpsi}" != "no"
then
AC_ARG_WITH(dvbpsi,
......@@ -5042,6 +5063,7 @@ AC_SUBST(XPIDL_INCL)
AC_SUBST(LIBEXT)
AC_SUBST(INCLUDES)
AC_SUBST(ALL_LINGUAS)
AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
dnl Import substitutions generated by bootstrap
VLC_SUBSTS
......
#!/bin/sh
#
# Posted to the projectbuilder-users list by Mike Ferris
# Modified for vlc by Jon Lech Johansen
#
set -e
# Requires at least three args
if [ $# -lt 2 ] ; then
echo "usage: $0 imgName dirName ..." 1>&2
exit 1
fi
# Grab size and name
imgName=$1
shift
dirName=$1
shift
imgSize=`du -sk ${dirName} | cut -f1`
imgSize=$((${imgSize} / 1024 + 2))
if [ $((${imgSize} < 5)) != 0 ] ; then
imgSize=5;
fi
# Create the image and format it
rm -f "${imgName}.dmg"
echo; echo "Creating ${imgSize} MB disk image named ${imgName}"
hdiutil create "${imgName}.dmg" -megabytes "${imgSize}" -layout NONE -quiet
dev=`hdid -nomount "${imgName}.dmg" | grep '/dev/disk[0-9]*' | cut -d " " -f 1`
/sbin/newfs_hfs -w -v "${imgName}" -b 4096 "${dev}" > /dev/null
# Mount the image and copy stuff
mkdir ./mountpoint
mount -t hfs ${dev} ./mountpoint
HOSTMACHINE=`gcc -dumpmachine`
case $HOSTMACHINE in
ppc-darwin)
# Mac OS X < 10.4
CP="/Developer/Tools/CpMac -r"
CPR="-r"
;;
*)
CP="cp -R"
CPR="-R"
;;
esac
echo "Copying contents to ${imgName}:"
for i in ${dirName}/* ; do
echo " ${i}"
${CP} "${i}" ./mountpoint
done
umount ./mountpoint
rmdir ./mountpoint
hdiutil eject "${dev}" -quiet
# Compress the image
echo "Compressing ${imgName} disk image"
mv "${imgName}.dmg" "${imgName}.orig.dmg"
hdiutil convert "${imgName}.orig.dmg" -format UDZO -o "${imgName}" -quiet
rm "${imgName}.orig.dmg"
# Done
echo; echo "Disk image creation completed:"
ls -la "${imgName}.dmg"; echo
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment