ncurses.mk 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #############################################################
  2. #
  3. # ncurses
  4. # this installs only a few vital termcap entries
  5. #
  6. #############################################################
  7. # Copyright (C) 2002 by Ken Restivo <ken@246gt.com>
  8. # $Id: ncurses.mk,v 1.7 2005/01/03 04:38:13 andersen Exp $
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU Library General Public License as
  12. # published by the Free Software Foundation; either version 2 of the
  13. # License, or (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful, but
  16. # WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. # Library General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU Library General Public
  21. # License along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  23. # USA
  24. # TARGETS
  25. NCURSES_VERSION = 5.7
  26. NCURSES_SITE = $(BR2_GNU_MIRROR)/ncurses
  27. NCURSES_INSTALL_STAGING = YES
  28. NCURSES_DEPENDENCIES = host-ncurses
  29. NCURSES_CONF_OPT = \
  30. --with-shared \
  31. --without-cxx \
  32. --without-cxx-binding \
  33. --without-ada \
  34. --without-progs \
  35. --without-tests \
  36. --disable-big-core \
  37. --without-profile \
  38. --disable-rpath \
  39. --enable-echo \
  40. --enable-const \
  41. --enable-overwrite \
  42. --enable-broken_linker \
  43. --disable-static
  44. ifneq ($(BR2_ENABLE_DEBUG),y)
  45. NCURSES_CONF_OPT += --without-debug
  46. endif
  47. define NCURSES_BUILD_CMDS
  48. $(MAKE1) -C $(@D) DESTDIR=$(STAGING_DIR)
  49. endef
  50. define NCURSES_PATCH_NCURSES_CONFIG
  51. $(SED) 's^prefix="^prefix="$(STAGING_DIR)^' \
  52. $(STAGING_DIR)/usr/bin/ncurses5-config
  53. endef
  54. NCURSES_POST_STAGING_INSTALL_HOOKS += NCURSES_PATCH_NCURSES_CONFIG
  55. ifeq ($(BR2_HAVE_DEVFILES),y)
  56. define NCURSES_INSTALL_TARGET_DEVFILES
  57. mkdir -p $(TARGET_DIR)/usr/include
  58. cp -dpf $(NCURSES_DIR)/include/curses.h $(TARGET_DIR)/usr/include/curses.h
  59. cp -dpf $(NCURSES_DIR)/include/ncurses_dll.h $(TARGET_DIR)/usr/include/ncurses_dll.h
  60. cp -dpf $(NCURSES_DIR)/include/term.h $(TARGET_DIR)/usr/include/
  61. cp -dpf $(NCURSES_DIR)/include/unctrl.h $(TARGET_DIR)/usr/include/
  62. cp -dpf $(NCURSES_DIR)/include/termcap.h $(TARGET_DIR)/usr/include/
  63. cp -dpf $(NCURSES_DIR)/lib/libncurses.a $(TARGET_DIR)/usr/lib/
  64. (cd $(TARGET_DIR)/usr/lib; \
  65. ln -fs libncurses.a libcurses.a; \
  66. ln -fs libncurses.a libtermcap.a; \
  67. )
  68. (cd $(TARGET_DIR)/usr/include; ln -fs curses.h ncurses.h)
  69. rm -f $(TARGET_DIR)/usr/lib/libncurses.so
  70. (cd $(TARGET_DIR)/usr/lib; ln -fs libncurses.so.$(NCURSES_VERSION) libncurses.so)
  71. endef
  72. endif
  73. ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PANEL),y)
  74. define NCURSES_INSTALL_TARGET_PANEL
  75. cp -dpf $(NCURSES_DIR)/lib/libpanel.so* $(TARGET_DIR)/usr/lib/
  76. endef
  77. endif
  78. ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM),y)
  79. define NCURSES_INSTALL_TARGET_FORM
  80. cp -dpf $(NCURSES_DIR)/lib/libform.so* $(TARGET_DIR)/usr/lib/
  81. endef
  82. endif
  83. ifeq ($(BR2_PACKAGE_NCURSES_TARGET_MENU),y)
  84. define NCURSES_INSTALL_TARGET_MENU
  85. cp -dpf $(NCURSES_DIR)/lib/libmenu.so* $(TARGET_DIR)/usr/lib/
  86. endef
  87. endif
  88. define NCURSES_INSTALL_TARGET_CMDS
  89. mkdir -p $(TARGET_DIR)/usr/lib
  90. cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/usr/lib/
  91. $(NCURSES_INSTALL_TARGET_PANEL)
  92. $(NCURSES_INSTALL_TARGET_FORM)
  93. $(NCURSES_INSTALL_TARGET_MENU)
  94. ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
  95. mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
  96. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm $(TARGET_DIR)/usr/share/terminfo/x
  97. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-color $(TARGET_DIR)/usr/share/terminfo/x
  98. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-xfree86 $(TARGET_DIR)/usr/share/terminfo/x
  99. mkdir -p $(TARGET_DIR)/usr/share/terminfo/v
  100. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt100 $(TARGET_DIR)/usr/share/terminfo/v
  101. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt102 $(TARGET_DIR)/usr/share/terminfo/v
  102. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt200 $(TARGET_DIR)/usr/share/terminfo/v
  103. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt220 $(TARGET_DIR)/usr/share/terminfo/v
  104. mkdir -p $(TARGET_DIR)/usr/share/terminfo/a
  105. cp -dpf $(STAGING_DIR)/usr/share/terminfo/a/ansi $(TARGET_DIR)/usr/share/terminfo/a
  106. mkdir -p $(TARGET_DIR)/usr/share/terminfo/l
  107. cp -dpf $(STAGING_DIR)/usr/share/terminfo/l/linux $(TARGET_DIR)/usr/share/terminfo/l
  108. $(NCURSES_INSTALL_TARGET_DEVFILES)
  109. endef # NCURSES_INSTALL_TARGET_CMDS
  110. #
  111. # On systems with an older version of tic, the installation of ncurses hangs
  112. # forever. To resolve the problem, build a static version of tic on host
  113. # ourselves, and use that during installation.
  114. #
  115. define HOST_NCURSES_BUILD_CMDS
  116. $(MAKE1) -C $(@D) sources
  117. $(MAKE) -C $(@D)/progs tic
  118. endef
  119. HOST_NCURSES_DEPENDENCIES =
  120. HOST_NCURSES_CONF_OPT = \
  121. --without-shared --without-gpm
  122. $(eval $(call AUTOTARGETS))
  123. $(eval $(call AUTOTARGETS,host))