# Contains non-trivial handling of option variables # and build environment. Must be included after # bsd.port.pre.mk # # Some of the knobs are not tunable by the OPTIONS framework. These are # explained here in detail. # # $FreeBSD$ # # Feature options: # These options influence some general behaviour of mplayer. Almost all of the featues, # for example all the codecs, are selected via the OPTIONS framework. # The following options WITH_DVD_DEVICE, WITH_CDROM_DEVICE, WITH_LANG are *not* # selected via the options framework and must be set via make.conf or by passing # the variable to make during build, e.g. make WITH_DVD_DEVICE=/dev/cd0 # # WITH_DVD_DEVICE=/path/to/desired/device # default: /dev/cd0 # This option changes the default device where mplayer looks for # a DVD medium # # WITH_CDROM_DEVICE=/path/to/desired/device # default: /dev/cd0 # This option changes the default cdrom device, maybe useful for VCDs # # WITH_LANG= # default: en # Enables language support bg, cz, de, dk, en, es, fr, gr, hu, it, ko, nl, no, pl, pt_BR, ro, ru, sk, tr, uk, zh # # Non-OPTIONS knob handling # ========================= .if defined(WITH_LANG) CONFIGURE_ARGS+=--language=${WITH_LANG} .endif .if defined(WITH_DVD_DEVICE) DEFAULT_DVD_DEVICE=${WITH_DVD_DEVICE} .else DEFAULT_DVD_DEVICE=/dev/cd0 .endif .if defined(WITH_CDROM_DEVICE) DEFAULT_CDROM_DEVICE=${WITH_CDROM_DEVICE} .else DEFAULT_CDROM_DEVICE=/dev/cd0 .endif .if defined(WITH_KERN_HZ) DEFAULT_KERN_HZ=${WITH_KERN_HZ} .else DEFAULT_KERN_HZ=1024 .endif # Non-simplified OPTIONS handling # =============================== .if ${PORT_OPTIONS:MESOUND} USE_GNOME+= esound .else CONFIGURE_ARGS+= --disable-esd .endif .if ${PORT_OPTIONS:MIPV6} CATEGORIES+= ipv6 .else CONFIGURE_ARGS+= --disable-inet6 .endif .if ${PORT_OPTIONS:MRTMP} LIB_DEPENDS+= librtmp.so:${PORTSDIR}/multimedia/librtmp CONFIGURE_ARGS+= --enable-librtmp EXTRA_LIBS+= -lrtmp .else CONFIGURE_ARGS+= --disable-librtmp .endif .if ${PORT_OPTIONS:MSDL} USE_SDL= sdl LIB_DEPENDS+= libaa.so:${PORTSDIR}/graphics/aalib .else CONFIGURE_ARGS+= --disable-sdl .endif .if ${PORT_OPTIONS:MV4L} BUILD_DEPENDS+= ${LOCALBASE}/include/linux/videodev2.h:${PORTSDIR}/multimedia/v4l_compat LIB_DEPENDS+= libv4l2.so:${PORTSDIR}/multimedia/libv4l CONFIGURE_ARGS+= --enable-tv-v4l1 \ --enable-tv-v4l2 EXTRA_LIBS+= -lv4l1 -lv4l2 .else CONFIGURE_ARGS+= --disable-tv-v4l1 \ --disable-tv-v4l2 .endif # Build system handling (including OPTIONS) # ========================================= #On i386, gcc runs out of general purpose registers when #trying to compile a debug version with the default flags. .if ${PORT_OPTIONS:MDEBUG} WITH_DEBUG= yes CONFIGURE_ARGS+= --enable-debug .if ${ARCH} == "i386" DEBUG_FLAGS= -g -fomit-frame-pointer .endif .else .if ${PORT_OPTIONS:MOCFLAGS} CFLAGS+= -O3 -fomit-frame-pointer -ffast-math .else CFLAGS+= -O -fomit-frame-pointer .endif #OCFLAGS .endif #DEBUG # Supported architectures for clang .if ${ARCH} == "amd64" || ${ARCH} == "i386" MPLAYER_CLANG_SUPPORTED_ARCH= yes .endif # Supported architectures for runtime CPU detection .if ${ARCH} == "amd64" || ${ARCH} == "i386" || ${ARCH} == "ppc" MPLAYER_RTCPU_SUPPORTED_ARCH= yes .endif # Unsupported architectures for inline assembly .if ${ARCH} == "ppc" CONFIGURE_ARGS+= --disable-asm .endif # Unsupported architectures .if ${ARCH} == "sparc64" BROKEN= Does not compile on sparc64 .endif .if ${PORT_OPTIONS:MRTCPU} \ && defined(MPLAYER_RTCPU_SUPPORTED_ARCH) CONFIGURE_ARGS+=--enable-runtime-cpudetection .endif .if ${OSVERSION} >= 900033 \ && exists(/usr/bin/clang) \ && defined(MPLAYER_CLANG_SUPPORTED_ARCH) WITH_BASE_CLANG=yes .endif .if defined(WITH_BASE_CLANG) CC= clang CXX= clang++ CPP= clang-cpp EXTRA_PATCHES+= ${FILESDIR}/extra-patch-clang-version .else .if ${PORT_OPTIONS:MOTCHAIN} USE_GCC?= yes BUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils .else CONFIGURE_ARGS+=--disable-ssse3 --disable-sse4 --disable-sse42 \ --disable-avx --disable-fast-cmov EXTRA_PATCHES+= ${FILESDIR}/extra-patch-base_system_gcc .if ${ARCH} == "amd64" BUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils CONFIGURE_ENV+= COMPILER_PATH=${LOCALBASE}/bin MAKE_ENV+= COMPILER_PATH=${LOCALBASE}/bin .endif .endif .endif .if ${ARCH} == "i386" || ${ARCH} == "amd64" .if ${PORT_OPTIONS:MWIN32} && !defined(PACKAGE_BUILDING) && ${ARCH} == "i386" RUN_DEPENDS+= ${CODEC_DETECTION_FILE}:${CODEC_PORT} CONFIGURE_ARGS+= --codecsdir=${LOCALBASE}/lib/win32 CODEC_PORT= ${PORTSDIR}/multimedia/win32-codecs CODEC_DETECTION_FILE!= ${MAKE} -f ${CODEC_PORT}/Makefile -V CODEC_DETECTION_FILE .else CONFIGURE_ARGS+= --disable-win32dll \ --disable-qtx .endif .endif # ARCH == i386/amd64 .if defined(EXTRA_LIBS) CONFIGURE_ARGS+= --extra-libs="${EXTRA_LIBS}" .endif