ncurses.mk 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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.6
  26. NCURSES_SITE:=$(BR2_GNU_MIRROR)/ncurses
  27. NCURSES_DIR:=$(BUILD_DIR)/ncurses-$(NCURSES_VERSION)
  28. NCURSES_SOURCE:=ncurses-$(NCURSES_VERSION).tar.gz
  29. NCURSES_CAT:=$(ZCAT)
  30. ifneq ($(BR2_PACKAGE_NCURSES_TARGET_HEADERS),y)
  31. NCURSES_WANT_STATIC=--disable-static
  32. endif
  33. $(DL_DIR)/$(NCURSES_SOURCE):
  34. $(call DOWNLOAD,$(NCURSES_SITE),$(NCURSES_SOURCE))
  35. $(NCURSES_DIR)/.patched: $(DL_DIR)/$(NCURSES_SOURCE)
  36. $(NCURSES_CAT) $(DL_DIR)/$(NCURSES_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  37. #use the local tic and not whatever the build system was going to find.
  38. $(SED) 's~\$$srcdir/shlib tic\$$suffix~/usr/bin/tic~' \
  39. $(NCURSES_DIR)/misc/run_tic.in
  40. toolchain/patch-kernel.sh $(NCURSES_DIR) package/ncurses/ ncurses\*.patch
  41. $(CONFIG_UPDATE) $(NCURSES_DIR)
  42. touch $@
  43. $(NCURSES_DIR)/.configured: $(NCURSES_DIR)/.patched
  44. (cd $(NCURSES_DIR); rm -rf config.cache; \
  45. BUILD_CC="$(HOSTCC)" \
  46. $(TARGET_CONFIGURE_OPTS) \
  47. $(TARGET_CONFIGURE_ARGS) \
  48. ./configure $(QUIET) \
  49. --target=$(GNU_TARGET_NAME) \
  50. --host=$(REAL_GNU_TARGET_NAME) \
  51. --build=$(GNU_HOST_NAME) \
  52. --prefix=/usr \
  53. --exec-prefix=/usr \
  54. --bindir=/usr/bin \
  55. --sbindir=/usr/sbin \
  56. --libdir=/usr/lib \
  57. --libexecdir=/usr/lib \
  58. --sysconfdir=/etc \
  59. --datadir=/usr/share \
  60. --localstatedir=/var \
  61. --includedir=/usr/include \
  62. --mandir=/usr/man \
  63. --infodir=/usr/info \
  64. --with-terminfo-dirs=/usr/share/terminfo \
  65. --with-default-terminfo-dir=/usr/share/terminfo \
  66. --with-shared --without-cxx --without-cxx-binding \
  67. --without-ada --without-progs --disable-big-core \
  68. $(DISABLE_NLS) $(DISABLE_LARGEFILE) \
  69. --without-profile --without-debug --disable-rpath \
  70. --enable-echo --enable-const --enable-overwrite \
  71. --enable-broken_linker \
  72. $(NCURSES_WANT_STATIC) \
  73. )
  74. touch $@
  75. $(NCURSES_DIR)/lib/libncurses.so.$(NCURSES_VERSION): $(NCURSES_DIR)/.configured
  76. $(MAKE1) DESTDIR=$(STAGING_DIR) -C $(NCURSES_DIR) \
  77. libs panel menu form headers
  78. $(STAGING_DIR)/usr/lib/libncurses.so.$(NCURSES_VERSION): $(NCURSES_DIR)/lib/libncurses.so.$(NCURSES_VERSION)
  79. $(MAKE1) \
  80. prefix=$(STAGING_DIR)/usr/ \
  81. exec_prefix=$(STAGING_DIR) \
  82. bindir=$(STAGING_DIR)/bin \
  83. sbindir=$(STAGING_DIR)/sbin \
  84. libexecdir=$(STAGING_DIR)/usr/lib \
  85. datadir=$(STAGING_DIR)/usr/share \
  86. sysconfdir=$(STAGING_DIR)/etc \
  87. localstatedir=$(STAGING_DIR)/var \
  88. libdir=$(STAGING_DIR)/usr/lib \
  89. infodir=$(STAGING_DIR)/usr/info \
  90. mandir=$(STAGING_DIR)/usr/man \
  91. includedir=$(STAGING_DIR)/usr/include \
  92. gxx_include_dir=$(STAGING_DIR)/usr/include/c++ \
  93. ticdir=$(STAGING_DIR)/usr/share/terminfo \
  94. -C $(NCURSES_DIR) install
  95. chmod a-x $(NCURSES_DIR)/lib/libncurses.so*
  96. $(SED) 's^prefix="^prefix="$(STAGING_DIR)^' \
  97. $(STAGING_DIR)/bin/ncurses5-config
  98. touch -c $@
  99. $(TARGET_DIR)/usr/lib/libncurses.so.$(NCURSES_VERSION): $(STAGING_DIR)/usr/lib/libncurses.so.$(NCURSES_VERSION)
  100. mkdir -p $(TARGET_DIR)/usr/lib
  101. cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/usr/lib/
  102. ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PANEL),y)
  103. cp -dpf $(NCURSES_DIR)/lib/libpanel.so* $(TARGET_DIR)/usr/lib/
  104. endif
  105. ifeq ($(BR2_PACKAGE_NCURSES_TARGET_FORM),y)
  106. cp -dpf $(NCURSES_DIR)/lib/libform.so* $(TARGET_DIR)/usr/lib/
  107. endif
  108. ifeq ($(BR2_PACKAGE_NCURSES_TARGET_MENU),y)
  109. cp -dpf $(NCURSES_DIR)/lib/libmenu.so* $(TARGET_DIR)/usr/lib/
  110. endif
  111. ln -snf /usr/share/terminfo $(TARGET_DIR)/usr/lib/terminfo
  112. mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
  113. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm $(TARGET_DIR)/usr/share/terminfo/x
  114. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-color $(TARGET_DIR)/usr/share/terminfo/x
  115. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-xfree86 $(TARGET_DIR)/usr/share/terminfo/x
  116. mkdir -p $(TARGET_DIR)/usr/share/terminfo/v
  117. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt100 $(TARGET_DIR)/usr/share/terminfo/v
  118. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt102 $(TARGET_DIR)/usr/share/terminfo/v
  119. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt200 $(TARGET_DIR)/usr/share/terminfo/v
  120. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt220 $(TARGET_DIR)/usr/share/terminfo/v
  121. mkdir -p $(TARGET_DIR)/usr/share/terminfo/a
  122. cp -dpf $(STAGING_DIR)/usr/share/terminfo/a/ansi $(TARGET_DIR)/usr/share/terminfo/a
  123. mkdir -p $(TARGET_DIR)/usr/share/terminfo/l
  124. cp -dpf $(STAGING_DIR)/usr/share/terminfo/l/linux $(TARGET_DIR)/usr/share/terminfo/l
  125. -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
  126. touch -c $@
  127. $(NCURSES_DIR)/lib/libncurses.a: $(NCURSES_DIR)/lib/libncurses.so.$(NCURSES_VERSION)
  128. $(TARGET_DIR)/usr/lib/libncurses.a: $(NCURSES_DIR)/lib/libncurses.a
  129. mkdir -p $(TARGET_DIR)/usr/include
  130. cp -dpf $(NCURSES_DIR)/include/curses.h $(TARGET_DIR)/usr/include/curses.h
  131. cp -dpf $(NCURSES_DIR)/include/ncurses_dll.h $(TARGET_DIR)/usr/include/ncurses_dll.h
  132. cp -dpf $(NCURSES_DIR)/include/term.h $(TARGET_DIR)/usr/include/
  133. cp -dpf $(NCURSES_DIR)/include/unctrl.h $(TARGET_DIR)/usr/include/
  134. cp -dpf $(NCURSES_DIR)/include/termcap.h $(TARGET_DIR)/usr/include/
  135. cp -dpf $(NCURSES_DIR)/lib/libncurses.a $(TARGET_DIR)/usr/lib/
  136. (cd $(TARGET_DIR)/usr/lib; \
  137. ln -fs libncurses.a libcurses.a; \
  138. ln -fs libncurses.a libtermcap.a; \
  139. )
  140. (cd $(TARGET_DIR)/usr/include; ln -fs curses.h ncurses.h)
  141. rm -f $(TARGET_DIR)/usr/lib/libncurses.so
  142. (cd $(TARGET_DIR)/usr/lib; ln -fs libncurses.so.$(NCURSES_VERSION) libncurses.so)
  143. -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libncurses.so.$(NCURSES_VERSION)
  144. touch -c $@
  145. ncurses: $(TARGET_DIR)/usr/lib/libncurses.so.$(NCURSES_VERSION) \
  146. $(if $(BR2_HAVE_DEVFILES),$(TARGET_DIR)/usr/lib/libncurses.a)
  147. ncurses-unpacked: $(NCURSES_DIR)/.patched
  148. ncurses-source: $(DL_DIR)/$(NCURSES_SOURCE)
  149. ncurses-clean:
  150. rm -f $(STAGING_DIR)/usr/lib/libncurses.so* $(TARGET_DIR)/usr/lib/libncurses.so*
  151. rm -rf $(STAGING_DIR)/usr/share/tabset $(TARGET_DIR)/usr/share/tabset
  152. rm -rf $(STAGING_DIR)/usr/share/terminfo $(TARGET_DIR)/usr/share/terminfo
  153. rm -rf $(TARGET_DIR)/usr/lib/terminfo
  154. -$(MAKE) -C $(NCURSES_DIR) clean
  155. ncurses-dirclean:
  156. rm -rf $(NCURSES_DIR)
  157. #############################################################
  158. #
  159. # Toplevel Makefile options
  160. #
  161. #############################################################
  162. ifeq ($(BR2_PACKAGE_NCURSES),y)
  163. TARGETS+=ncurses
  164. endif