xref: /OK3568_Linux_fs/buildroot/package/gpm/gpm.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# gpm
4#
5################################################################################
6
7GPM_VERSION = 1.20.7
8GPM_SOURCE = gpm-$(GPM_VERSION).tar.lzma
9GPM_SITE = http://www.nico.schottelius.org/software/gpm/archives
10GPM_LICENSE = GPL-2.0+
11GPM_LICENSE_FILES = COPYING
12GPM_SELINUX_MODULES = gpm
13GPM_INSTALL_STAGING = YES
14GPM_DEPENDENCIES = host-bison
15
16# if not already installed in staging dir, gpm Makefile may fail to find some
17# of the headers needed to generate build dependencies, the first time it is
18# built. CPPFLAGS is used to pass the right include path to dependency rules.
19GPM_CONF_ENV = \
20	CPPFLAGS="$(TARGET_CPPFLAGS) -I$(@D)/src/headers/" \
21	ac_cv_path_emacs=no
22
23# For some reason, Microblaze gcc does not define __ELF__, which gpm
24# configure script uses to determine whether the architecture uses ELF
25# binaries and therefore can build shared libraries. We fix this by
26# telling GPM that ELF is used on Microblaze.
27ifeq ($(BR2_microblaze),y)
28GPM_CONF_ENV += itz_cv_sys_elf=yes
29endif
30
31# gpm and ncurses have a circular dependency. As gpm function GPM_Wgetch()
32# (requiring ncurses) is not recommended for use by ncurses people themselves
33# and as it's better to have gpm support in ncurses that the contrary, we force
34# gpm to not look after ncurses explicitly.
35# http://invisible-island.net/ncurses/ncurses.faq.html#using_gpm_lib
36GPM_CONF_OPTS = --without-curses
37
38# configure is missing but gpm seems not compatible with our autoreconf
39# mechanism so we have to do it manually instead of using GPM_AUTORECONF = YES
40define GPM_RUN_AUTOGEN
41	cd $(@D) && PATH=$(BR_PATH) ./autogen.sh
42endef
43GPM_PRE_CONFIGURE_HOOKS += GPM_RUN_AUTOGEN
44
45GPM_DEPENDENCIES += host-automake host-autoconf host-libtool
46
47# gpm tries to build/install .info doc even if makeinfo isn't installed on the
48# host, so we have to disable global doc installation to prevent autobuild
49# errors.
50define GPM_DISABLE_DOC_INSTALL
51	$(SED) 's/SUBDIRS = src doc contrib/SUBDIRS = src contrib/' \
52		$(@D)/Makefile.in
53endef
54GPM_POST_PATCH_HOOKS += GPM_DISABLE_DOC_INSTALL
55
56ifeq ($(BR2_PACKAGE_GPM_INSTALL_TEST_TOOLS),)
57define GPM_REMOVE_TEST_TOOLS_FROM_TARGET
58	for tools in mev hltest mouse-test display-buttons \
59		get-versions display-coords; do \
60			rm -f $(TARGET_DIR)/usr/bin/$$tools ; \
61	done
62endef
63GPM_POST_INSTALL_TARGET_HOOKS += GPM_REMOVE_TEST_TOOLS_FROM_TARGET
64endif
65
66define GPM_INSTALL_GPM_ROOT_CONF_ON_TARGET
67	$(INSTALL) -m 0644 -D $(@D)/conf/gpm-root.conf $(TARGET_DIR)/etc/
68endef
69
70GPM_POST_INSTALL_TARGET_HOOKS += GPM_INSTALL_GPM_ROOT_CONF_ON_TARGET
71
72$(eval $(autotools-package))
73