git: fix build with with no threads
[buildroot-gz.git] / package / motion / motion.mk
blobd76b54701781c61a991f87fbb1244ea9459befd5
1 ################################################################################
3 # motion
5 ################################################################################
7 MOTION_VERSION = release-4.0.1
8 MOTION_SITE = $(call github,Motion-Project,motion,$(MOTION_VERSION))
9 MOTION_LICENSE = GPLv2
10 MOTION_LICENSE_FILES = COPYING
11 MOTION_DEPENDENCIES = host-pkgconf jpeg
12 # From git and patched configure.ac
13 MOTION_AUTORECONF = YES
15 # motion does not use any specific function of jpeg-turbo, so just relies on
16 # jpeg selection
17 MOTION_CONF_OPTS += --without-jpeg-turbo --without-optimizecpu
19 ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
20 MOTION_DEPENDENCIES += ffmpeg
21 MOTION_CONF_OPTS += --with-ffmpeg
22 else
23 MOTION_CONF_OPTS += --without-ffmpeg
24 endif
26 ifeq ($(BR2_PACKAGE_MYSQL),y)
27 MOTION_DEPENDENCIES += mysql
28 MOTION_CONF_OPTS += \
29 --with-mysql \
30 --with-mysql-include=$(STAGING_DIR)/usr/include/mysql \
31 --with-mysql-lib=$(STAGING_DIR)/usr/lib
32 # static link of mysql needs -lz
33 ifeq ($(BR2_STATIC_LIBS)$(BR2_PACKAGE_ZLIB),yy)
34 MOTION_CONF_ENV += LIBS="-lz"
35 endif
36 else
37 MOTION_CONF_OPTS += --without-mysql
38 endif
40 ifeq ($(BR2_PACKAGE_POSTGRESQL),y)
41 MOTION_DEPENDENCIES += postgresql
42 MOTION_CONF_OPTS += \
43 --with-pgsql \
44 --with-pgsql-include=$(STAGING_DIR)/usr/include \
45 --with-pgsql-lib=$(STAGING_DIR)/usr/lib
46 else
47 MOTION_CONF_OPTS += --without-pgsql
48 endif
50 ifeq ($(BR2_PACKAGE_SDL),y)
51 MOTION_DEPENDENCIES += sdl
52 MOTION_CONF_OPTS += --with-sdl=$(STAGING_DIR)/usr
53 # overwrite ac_cv_path_CONFIG_SDL in case sdl development is
54 # installed on the host
55 MOTION_CONF_ENV += ac_cv_path_CONFIG_SDL=$(STAGING_DIR)/usr/bin/sdl-config
56 else
57 MOTION_CONF_OPTS += --without-sdl
58 endif
60 ifeq ($(BR2_PACKAGE_SQLITE),y)
61 MOTION_DEPENDENCIES += sqlite
62 MOTION_CONF_OPTS += --with-sqlite3
63 else
64 MOTION_CONF_OPTS += --without-sqlite3
65 endif
67 # Do not use default install target as it installs many unneeded files and
68 # directories: docs, examples and init scripts
69 define MOTION_INSTALL_TARGET_CMDS
70 $(INSTALL) -D -m 0644 $(@D)/motion-dist.conf \
71 $(TARGET_DIR)/etc/motion.conf
72 $(INSTALL) -D -m 0755 $(@D)/motion $(TARGET_DIR)/usr/bin/motion
73 endef
75 define MOTION_INSTALL_INIT_SYSV
76 $(INSTALL) -D -m 0755 package/motion/S99motion \
77 $(TARGET_DIR)/etc/init.d/S99motion
78 endef
80 define MOTION_INSTALL_INIT_SYSTEMD
81 $(INSTALL) -D -m 644 package/motion/motion.service \
82 $(TARGET_DIR)/usr/lib/systemd/system/motion.service
83 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
84 ln -sf ../../../../usr/lib/systemd/system/motion.service \
85 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/motion.service
86 endef
88 $(eval $(autotools-package))