pkgsrc/multimedia/mplayer-share/Makefile.cflags
bouyer e40f62ab58 Add -mstackrealign -mpreferred-stack-boundary=4 to CFLAGS on i386 for all
gcc 4.x versions. Fix mplayer coredumping on mp4 videos on netbsd-7.
Patch from John D. Baker
Bump PKGREVISION for all affected packages.
2014-12-03 15:08:02 +00:00

34 lines
1.2 KiB
Text

# $NetBSD: Makefile.cflags,v 1.7 2014/12/03 15:08:02 bouyer Exp $
# This must be included after everything else to truly clear ${CFLAGS}
# in the non-runtime-cpu-detection case. If ${CFLAGS} is non-empty, the
# configure script refuses to add any optimizations at all.
.if !empty(PKG_OPTIONS:Mmplayer-default-cflags)
. if ${MACHINE_ARCH} == "i386" && !empty(PKGSRC_COMPILER:Mgcc)
# Schedule for the typical machine fast enough to run mplayer. This
# is nearly optimal for K6-2 as well. Anything slower will still run
# (but would probably benefit greatly from turning off the run-time
# cpu detection).
. include "../../mk/compiler.mk"
# alignment flags for builtin ffmpeg
# --yasm='' disables asm altogether for gcc < 4.2
. if !empty(CC_VERSION:Mgcc-[123]*) || \
!empty(CC_VERSION:Mgcc-4.[01].*)
CONFIGURE_ARGS+= --yasm=''
. elif !empty(CC_VERSION:Mgcc-4.*)
CFLAGS+=-mstackrealign -mpreferred-stack-boundary=4
. endif
. if !empty(CC_VERSION:Mgcc-4*)
CFLAGS+= -O3 -ffast-math -fomit-frame-pointer -mtune=pentiumpro
. else
CFLAGS+= -O3 -ffast-math -fomit-frame-pointer -mcpu=pentiumpro
. endif
. else
CFLAGS+= -O3 -ffast-math -fomit-frame-pointer
. endif
.endif