aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/x264-devel/Makefile
blob: 54fbef20ff70a27314bd157b452254fce464c32c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# New ports collection makefile for:    x264
# Date created:     2005-01-11
# Whom:         Michael Johnson <ahze@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   x264
PORTVERSION=    0.0.20041029
CATEGORIES= multimedia
MASTER_SITES=   http://download.videolan.org/pub/videolan/contrib/ \
        http://ftp.snt.utwente.nl/pub/software/videolan/contrib/
DISTNAME=   ${PORTNAME}-${PORTVERSION:S/0.0.//}

MAINTAINER= ahze@FreeBSD.org
COMMENT=    Multimedia library for encoding H.264/AVC video streams

BUILD_DEPENDS+= nasm:${PORTSDIR}/devel/nasm

USE_GETOPT_LONG=yes
USE_BZIP2=  yes
WRKSRC=     ${WRKDIR}/${DISTNAME}
USE_REINPLACE=  yes
USE_GMAKE=  yes
ALL_TARGET= default
CFLAGS+=    -DSYS_FREEBSD

PLIST_FILES=    bin/x264 \
        include/x264.h \
        lib/libx264.a

OPTIONS=    DEBUG "Enable Debugging" Off \
        OPTIMIZED_CFLAGS "Enable Optimized CFLAGS" Off

.include <bsd.port.pre.mk>

.if ${ARCH}=="i386"
CFLAGS+=-DARCH_X86
.endif

.if ${MACHINE_CPU:Mmmx}
CFLAGS+=-DHAVE_MMXEXT
.endif

.if ${MACHINE_CPU:Msse}
CFLAGS+=-DHAVE_SSE2
.endif

.if defined(WITH_DEBUG)
CFLAGS+=    -g -DDEBUG
.endif

.if defined(WITH_OPTIMIZED_CFLAGS)
CFLAGS+=    -O2 -funroll-loops
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|%%CFLAGS%%|${CFLAGS} ${CPPFLAGS}|; \
        s|-lm|${LDFLAGS} -lm|' ${WRKSRC}/${MAKEFILE}

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/x264 ${PREFIX}/bin
    ${INSTALL_DATA} ${WRKSRC}/x264.h ${PREFIX}/include
    ${INSTALL_DATA} ${WRKSRC}/libx264.a ${PREFIX}/lib

.include <bsd.port.post.mk>