]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/x264/x264.mk
Globally replace $(HOST_DIR)/usr/bin with $(HOST_DIR)/bin
[coffee/buildroot.git] / package / x264 / x264.mk
1 ################################################################################
2 #
3 # x264
4 #
5 ################################################################################
6
7 X264_VERSION = df79067c0cf33da712d344b5f8869be7eaf326f3
8 X264_SITE = git://git.videolan.org/x264.git
9 X264_LICENSE = GPL-2.0+
10 X264_DEPENDENCIES = host-pkgconf
11 X264_LICENSE_FILES = COPYING
12 X264_INSTALL_STAGING = YES
13 X264_CONF_OPTS = --disable-avs --disable-lavf --disable-swscale
14
15 ifeq ($(BR2_i386)$(BR2_x86_64),y)
16 # nasm needed for assembly files
17 X264_DEPENDENCIES += host-nasm
18 X264_CONF_ENV += AS="$(HOST_DIR)/bin/nasm"
19 else ifeq ($(BR2_ARM_CPU_ARMV7A)$(BR2_aarch64),y)
20 # We need to pass gcc as AS, because the ARM assembly files have to be
21 # preprocessed
22 X264_CONF_ENV += AS="$(TARGET_CC)"
23 else
24 X264_CONF_OPTS += --disable-asm
25 endif
26
27 ifeq ($(BR2_STATIC_LIBS),)
28 X264_CONF_OPTS += --enable-pic --enable-shared
29 endif
30
31 ifeq ($(BR2_PACKAGE_X264_CLI),)
32 X264_CONF_OPTS += --disable-cli
33 endif
34
35 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
36 X264_CONF_OPTS += --disable-thread
37 endif
38
39 # Even though the configure script is not generated by autoconf, x264
40 # uses config.sub/config.guess, so we want up-to-date versions of
41 # them.
42 X264_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
43
44 # the configure script is not generated by autoconf
45 define X264_CONFIGURE_CMDS
46         (cd $(@D); $(TARGET_CONFIGURE_OPTS) $(X264_CONF_ENV) ./configure \
47                 --prefix=/usr \
48                 --host="$(GNU_TARGET_NAME)" \
49                 --cross-prefix="$(TARGET_CROSS)" \
50                 --disable-ffms \
51                 --enable-static \
52                 --disable-opencl \
53                 $(X264_CONF_OPTS) \
54         )
55 endef
56
57 define X264_BUILD_CMDS
58         $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
59 endef
60
61 define X264_INSTALL_STAGING_CMDS
62         $(TARGET_MAKE_ENV) $(MAKE) DESTDIR="$(STAGING_DIR)" -C $(@D) install
63 endef
64
65 define X264_INSTALL_TARGET_CMDS
66         $(TARGET_MAKE_ENV) $(MAKE) DESTDIR="$(TARGET_DIR)" -C $(@D) install
67 endef
68
69 $(eval $(generic-package))