#!/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 # OS="osx" DEFAULT_UI="glw" CONFIGURE_POSTFIX="osx" source support/configure.inc CPU=generic ARCH=`uname -m` MACOSXTARGET="" MACOSXSDK="" CC=cc CXX=c++ 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]" exit 1 } enable sqlite_internal enable libfreetype enable glw enable glw_frontend_cocoa enable glw_backend_opengl enable coreaudio enable bonjour enable spotlight enable stdin enable httpserver enable timegm enable realpath enable polarssl enable librtmp enable dvd enable vda enable fsevents enable webpopup for opt do optval="${opt#*=}" case "$opt" in --prefix=*) PREFIX="$optval" ;; --cpu=*) CPU="$optval" ;; --help) show_help ;; --release) enable release ;; --cc=*) CC="$optval" ;; --arch=*) ARCH="$optval" ;; --macosx-sdk=*) MACOSXSDK="$optval" ;; *) common_opt $opt $optval esac done setup_env "$@" enable libpthread enable zlib # # 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" echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework Webkit" # IOKit for dvd echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework IOKit" echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework OpenGL" echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework CoreVideo" echo >>${CONFIG_MAK} "LDFLAGS_cfg += -weak_framework VideoDecodeAcceleration" echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework CoreAudio" echo >>${CONFIG_MAK} "LDFLAGS_cfg += -framework AudioToolBox" freetype_setup LIBAV_ARCH_FLAGS="--disable-shared --enable-static" libav_setup rtmpdump_setup xmp_setup gumbo_setup # # 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 # # Finalize # echo >>${CONFIG_MAK} LDFLAGS_cfg += -lpthread finalize