iptables: bump to version 1.6.1
[buildroot-gz.git] / package / gmock / gmock.mk
blob4f04422a5d00ebf14a7c6112174face45d04cb54
1 ################################################################################
3 # gmock
5 ################################################################################
7 # Make sure this remains the same version as the gtest one
8 GMOCK_VERSION = 1.7.0
9 GMOCK_SOURCE = gmock-$(GMOCK_VERSION).zip
10 GMOCK_SITE = http://googlemock.googlecode.com/files
11 GMOCK_INSTALL_STAGING = YES
12 GMOCK_INSTALL_TARGET = NO
13 GMOCK_LICENSE = BSD-3c
14 GMOCK_LICENSE_FILES = LICENSE
15 GMOCK_DEPENDENCIES = gtest host-gmock
17 # GMock 1.7.0 relies on Python 2.7 syntax which is NOT compatible with Python3.
18 HOST_GMOCK_DEPENDENCIES = host-python
19 HOST_GMOCK_PYTHONPATH=$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
21 # Static linking is required in order to keep the GMock package completely
22 # separated from GTest. According to GMock's README file:
24 # "Google Mock can be used as a DLL, but the same DLL must contain Google
25 # Test as well. See Google Test's README file for instructions on how to
26 # set up necessary compiler settings".
27 GMOCK_CONF_OPTS = --enable-static --disable-shared
29 define GMOCK_EXTRACT_CMDS
30 $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(BUILD_DIR)
31 endef
33 # We can't use the default rule for autotools-package staging because it fails
34 # because it tries to rebuild/install gtest stuff and fails after this error:
35 # "'make install' is dangerous and not supported. Instead, see README for
36 # how to integrate Google Test into your build system."
37 define GMOCK_INSTALL_STAGING_CMDS
38 $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock.a $(STAGING_DIR)/usr/lib/libgmock.a
39 $(INSTALL) -D -m 0755 $(@D)/lib/.libs/libgmock_main.a $(STAGING_DIR)/usr/lib/libgmock_main.a
40 $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gmock/
41 cp -rp $(@D)/include/gmock/* $(STAGING_DIR)/usr/include/gmock/
42 $(INSTALL) -D -m 0755 package/gmock/gmock.pc \
43 $(STAGING_DIR)/usr/lib/pkgconfig/gmock.pc
44 endef
46 # Unzipping inside $(@D) and moving everything from the created subdirectory is
47 # required because unzipping directly in $(BUILD_DIR) would cause host-gmock to
48 # overwrite the gmock subdir instead of unzipping in a host-gmock subdir.
49 define HOST_GMOCK_EXTRACT_CMDS
50 $(UNZIP) $(DL_DIR)/$(GMOCK_SOURCE) -d $(@D)
51 mv $(@D)/gmock-$(GMOCK_VERSION)/* $(@D)
52 rmdir $(@D)/gmock-$(GMOCK_VERSION)
53 endef
55 define HOST_GMOCK_INSTALL_CMDS
56 $(INSTALL) -D -m 0755 $(@D)/scripts/generator/gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen.py
57 ln -sf gmock_gen.py $(HOST_DIR)/usr/bin/gmock_gen
58 cp -rp $(@D)/scripts/generator/cpp $(HOST_GMOCK_PYTHONPATH)
59 endef
61 $(eval $(autotools-package))
62 # The host package does not build anything, just installs gmock_gen stuff, so
63 # it does not need to be a host-autotools-package.
64 $(eval $(host-generic-package))