From 0030c323d569f8b3f54eebaa00e37c7e29e9bdb3 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Sat, 13 Sep 2014 12:46:27 +0000 Subject: - Add experimental OPTION to avoid memory alignment hacks --- multimedia/mplayer/Makefile | 3 ++- multimedia/mplayer/Makefile.options | 6 +++++- multimedia/mplayer/files/extra-patch-memalign | 26 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 multimedia/mplayer/files/extra-patch-memalign (limited to 'multimedia/mplayer') diff --git a/multimedia/mplayer/Makefile b/multimedia/mplayer/Makefile index 9e18e3776dae..f839a1d5c746 100644 --- a/multimedia/mplayer/Makefile +++ b/multimedia/mplayer/Makefile @@ -11,7 +11,7 @@ COMMENT= High performance media player supporting many formats OPTIONS_DEFINE= AALIB AMR_NB AMR_WB BLURAY CACA DEBUG DV \ ENCA FRIBIDI GIF GSM GUI IPV6 JACK \ - LADSPA LIBMNG LIRC LZO NAS OCFLAGS \ + LADSPA LIBMNG LIRC LZO MEMALIGN NAS OCFLAGS \ OPENAL OPENGL OPENJPEG OPUS OTCHAIN PROFILE \ PULSEAUDIO REAL RTC RTCPU RTMP SCHROEDINGER SDL \ SKINS SMB SVGALIB V4L VDPAU VPX WIN32 \ @@ -26,6 +26,7 @@ OPTIONS_DEFAULT=FRIBIDI IPV6 OCFLAGS OPENGL RTCPU SKINS \ BLURAY_DESC?= BluRay support ENCA_DESC?= Charset conversion via enca LZO_DESC?= External liblzo support +MEMALIGN_DESC?= Avoid memory alignment hacks (EXPERIMENTAL) OCFLAGS_DESC?= Use optimized compiler flags OTCHAIN_DESC?= Use gcc 4.6+ toolchain on legacy systems REAL_DESC?= Enable realplayer plugin diff --git a/multimedia/mplayer/Makefile.options b/multimedia/mplayer/Makefile.options index c927b9f5a151..ac54154575b3 100644 --- a/multimedia/mplayer/Makefile.options +++ b/multimedia/mplayer/Makefile.options @@ -54,6 +54,10 @@ CATEGORIES+= ipv6 CONFIGURE_ARGS+= --disable-inet6 .endif +.if ${PORT_OPTIONS:MMEMALIGN} +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-memalign +.endif + .if ${PORT_OPTIONS:MRTMP} LIB_DEPENDS+= librtmp.so:${PORTSDIR}/multimedia/librtmp CONFIGURE_ARGS+= --enable-librtmp @@ -144,7 +148,7 @@ MAKE_ENV+= COMPILER_PATH=${LOCALBASE}/bin #trying to compile a debug version with the default flags. .if ${PORT_OPTIONS:MDEBUG} WITH_DEBUG= yes -CONFIGURE_ARGS+= --enable-debug +CONFIGURE_ARGS+= --enable-debug=3 .if ${ARCH} == "i386" && !defined(WITH_BASE_CLANG) DEBUG_FLAGS= -g -fomit-frame-pointer .endif diff --git a/multimedia/mplayer/files/extra-patch-memalign b/multimedia/mplayer/files/extra-patch-memalign new file mode 100644 index 000000000000..58c437e434d7 --- /dev/null +++ b/multimedia/mplayer/files/extra-patch-memalign @@ -0,0 +1,26 @@ +--- configure.orig 2014-08-23 15:59:32.000000000 +0200 ++++ configure 2014-09-11 18:37:11.383671007 +0200 +@@ -3766,17 +3766,17 @@ + echores "$aligned_malloc" + + +-echocheck "memalign()" ++echocheck "aligned_alloc()" + # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ? +-def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0' ++def_memalign='#define HAVE_MEMALIGN 0' + _memalign=no +-statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes ++statement_check stdlib.h 'aligned_alloc(32, 32*sizeof(char))' && _memalign=yes + if test "$_memalign" = yes ; then +- def_memalign='#define HAVE_MEMALIGN 1' ++ def_map_memalign='#define memalign(a, b) aligned_alloc(a, b)' ++ def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0' + else +- def_memalign='#define HAVE_MEMALIGN 0' + def_map_memalign='#define memalign(a, b) malloc(b)' +- darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1' ++ def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1' + fi + echores "$_memalign" + -- cgit v1.2.3