Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 242 lines (205 sloc) 5.358 kb
#!/bin/bash
#
# HTS configure script for Mac OS X
#
# Copyright (c) 2009-2010 Mattias Wadman
#
# Based on FFmpeg's configure script:
#
# Copyright (c) 2000-2002 Fabrice Bellard
# Copyright (c) 2005-2008 Diego Biurrun
# Copyright (c) 2005-2008 Mans Rullgard
#
PLATFORM="osx"
OSENV="posix"
DEFAULT_UI="glw"
source support/configure.inc
CPU=generic
ARCH=`uname -m`
MACOSXTARGET=""
MACOSXSDK=""
APPDIR=${BUILDDIR}/Showtime.app
show_help(){
common_help
echo " --prefix=PREFIX Install in PREFIX [$PREFIX]"
echo " --arch=arch Build for this architecture [$ARCH]"
echo " --cpu=cpu Build and optimize for specific CPU"
echo " --cc=CC Build using the given compiler"
echo " --release Stage for release"
echo " --macosxsdk=PATH Mac OS X SDK path [$MACOSXSDK]"
echo " --enable-spotify=keyfile Compile support for Spotify (R) Core"
echo " --spotify-framework=PATH Path to libspotify.framework"
exit 1
}
enable libfreetype
enable glw
enable glw_frontend_cocoa
enable glw_backend_opengl
enable coreaudio
enable appleremote
enable bonjour
enable spotlight
enable spidermonkey
enable stdin
enable httpserver
enable timegm
enable realpath
enable polarssl
enable librtmp
enable font_liberation
for opt do
optval="${opt#*=}"
case "$opt" in
--prefix=*) PREFIX="$optval"
;;
--cpu=*) CPU="$optval"
;;
--help) show_help
;;
--release)
enable release
enable embedded_resources
;;
--cc=*) CC="$optval"
;;
--arch=*) ARCH="$optval"
;;
--macosx-sdk=*) MACOSXSDK="$optval"
;;
--enable-spotify=*) SPOTIFY_KEYFILE="$optval"
;;
--spotify-framework=*) SPOTIFY_FRAMEWORK="$optval"
;;
*)
common_opt $opt $optval
esac
done
if [ "$SPOTIFY_KEYFILE" != "" ] ; then
if [ ! -f "$SPOTIFY_KEYFILE" ] ; then
echo "$SPOTIFY_KEYFILE does not exist"
die
fi
if [ "$SPOTIFY_FRAMEWORK" = "" ] ; then
echo "You must specify where the libspotify.framework directory can be found."
echo "Use the --spotify-framework argument"
die
fi
if [ ! -d "$SPOTIFY_FRAMEWORK" ] ; then
echo "$SPOTIFY_FRAMEWORK does not exist"
die
fi
fi
setup_env "$@"
enable libpthread
enable zlib
enable posix_networking
enable dvd
#
# Application bundle
# Override PROG to put binary inside app bundle
#
echo >>${CONFIG_MAK} "APPDIR=${APPDIR}"
PROG="${APPDIR}/Contents/MacOS/showtime"
#
# c compiler
#
checkcc() {
cat >$TMPDIR/1.c <<EOF
int main() {
return 0;
}
EOF
$CC 2>/dev/null $TMPDIR/1.c -o $TMPDIR/1.bin
}
if [ "x$CC" != "x" ]; then
echo >>${CONFIG_MAK} "CC=$CC"
CC="$CC"
else
CC=cc
fi
if checkcc; then
echo "Using C compiler: $CC"
else
echo "C compiler ($CC) is not working"
die
fi
echo >>${CONFIG_MAK} $CC_CONFIG_MAK
#
# Check SDK path and set target version
#
if [ "x$MACOSXSDK" != "x" ] ; then
if [ -d "$MACOSXSDK" ] ; then
SDKSETTINGS="$MACOSXSDK/SDKSettings"
if [ ! -e "$SDKSETTINGS.plist" ] ; then
echo "Could not find $SDKSETTINGS.plist"
die
fi
MACOSXTARGET=`defaults read $SDKSETTINGS Version`
echo "Mac OS X SDK: $MACOSXSDK"
echo "Mac OS X target: $MACOSXTARGET"
else
echo "Mac OS X SDK directory $MACOSXSDK does not exist"
die
fi
MACOSXSDK_CFLAGS="-mmacosx-version-min=$MACOSXTARGET -isysroot $MACOSXSDK"
MACOSXSDK_LDFLAGS="$MACOSXSDK_CFLAGS"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += $MACOSXSDK_LDFLAGS"
echo >>${CONFIG_MAK} "CFLAGS_cfg += $MACOSXSDK_CFLAGS"
else
echo "Mac OS X SDK: default"
echo "Mac OS X target: default (`sw_vers -productVersion`)"
fi
#
# Standard Mac OS X frameworks
#
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework Foundation"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework CoreFoundation"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework Cocoa"
# IOKit for dvd
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework IOKit"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework OpenGL"
# CoreAudio
if enabled coreaudio; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework CoreAudio"
fi
# Carbon, Remote Control Wrapper uses it
if enabled appleremote; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework Carbon"
fi
libav_setup
#
# Freetype
#
echo >>${CONFIG_MAK} "CFLAGS_cfg += -I/usr/X11/include -I/usr/X11/include/freetype2"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -L/usr/X11/lib -lfreetype"
#
# Configure paths, etc
#
if disabled release; then
echo Development build.
echo The generated binary will contain compiled-in paths to
echo the current build tree. If you plan to install the binary,
echo please reconfigure with '--release'.
fi
#
# Some compatibility defines
#
cat >> ${CONFIG_H} << EOF
/* Darwin is default 64 bit */
#define off64_t off_t
#define lseek64 lseek
/* Different name on darwin */
#define MAP_ANONYMOUS MAP_ANON
/* dvdcss, not defined on darwin is default large file and binary */
#define O_LARGEFILE 0
#define O_BINARY 0
EOF
if [ "$SPOTIFY_FRAMEWORK" != "" ] ; then
echo >>${CONFIG_MAK} "SPOTIFY_FRAMEWORK = ${SPOTIFY_FRAMEWORK}"
echo >>${CONFIG_MAK} "LDFLAGS_cfg += -F\$(shell dirname \$(SPOTIFY_FRAMEWORK)) -framework libspotify"
fi
#
# Finalize
#
echo >>${CONFIG_MAK} LDFLAGS_cfg += -lpthread
finalize
Jump to Line
Something went wrong with that request. Please try again.