ncurses.mk 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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:=http://ftp.gnu.org/pub/gnu/ncurses
  27. NCURSES_DIR:=$(BUILD_DIR)/ncurses-$(NCURSES_VERSION)
  28. NCURSES_SOURCE:=ncurses-$(NCURSES_VERSION).tar.gz
  29. NCURSES_CAT:=$(ZCAT)
  30. ifneq ($(strip $(BR2_PACKAGE_NCURSES_TARGET_HEADERS)),y)
  31. NCURSES_WANT_STATIC=--disable-static
  32. endif
  33. $(DL_DIR)/$(NCURSES_SOURCE):
  34. $(WGET) -P $(DL_DIR) $(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 \
  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=/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)/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)/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. touch -c $@
  97. $(TARGET_DIR)/lib/libncurses.so.$(NCURSES_VERSION): $(STAGING_DIR)/lib/libncurses.so.$(NCURSES_VERSION)
  98. cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/
  99. -cp -dpf $(STAGING_DIR)/usr/lib/terminfo $(TARGET_DIR)/usr/lib/
  100. mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
  101. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm $(TARGET_DIR)/usr/share/terminfo/x
  102. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-color $(TARGET_DIR)/usr/share/terminfo/x
  103. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-xfree86 $(TARGET_DIR)/usr/share/terminfo/x
  104. mkdir -p $(TARGET_DIR)/usr/share/terminfo/v
  105. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt100 $(TARGET_DIR)/usr/share/terminfo/v
  106. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt102 $(TARGET_DIR)/usr/share/terminfo/v
  107. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt200 $(TARGET_DIR)/usr/share/terminfo/v
  108. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt220 $(TARGET_DIR)/usr/share/terminfo/v
  109. mkdir -p $(TARGET_DIR)/usr/share/terminfo/a
  110. cp -dpf $(STAGING_DIR)/usr/share/terminfo/a/ansi $(TARGET_DIR)/usr/share/terminfo/a
  111. mkdir -p $(TARGET_DIR)/usr/share/terminfo/l
  112. cp -dpf $(STAGING_DIR)/usr/share/terminfo/l/linux $(TARGET_DIR)/usr/share/terminfo/l
  113. -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
  114. touch -c $@
  115. $(TARGET_DIR)/usr/lib/libncurses.a: $(STAGING_DIR)/lib/libncurses.a
  116. mkdir -p $(TARGET_DIR)/usr/include
  117. cp -dpf $(NCURSES_DIR)/include/curses.h $(TARGET_DIR)/usr/include/ncurses.h
  118. cp -dpf $(NCURSES_DIR)/include/ncurses_dll.h $(TARGET_DIR)/usr/include/ncurses_dll.h
  119. cp -dpf $(NCURSES_DIR)/include/term.h $(TARGET_DIR)/usr/include/
  120. cp -dpf $(NCURSES_DIR)/include/unctrl.h $(TARGET_DIR)/usr/include/
  121. cp -dpf $(NCURSES_DIR)/include/termcap.h $(TARGET_DIR)/usr/include/
  122. cp -dpf $(NCURSES_DIR)/lib/libncurses.a $(TARGET_DIR)/usr/lib/
  123. rm -f $(TARGET_DIR)/usr/lib/terminfo
  124. (cd $(TARGET_DIR)/usr/lib; ln -fs ../share/terminfo; \
  125. ln -fs libncurses.a libcurses.a; \
  126. ln -fs libncurses.a libtermcap.a; \
  127. )
  128. (cd $(TARGET_DIR)/usr/include; ln -fs ncurses.h curses.h)
  129. rm -f $(TARGET_DIR)/lib/libncurses.so
  130. (cd $(TARGET_DIR)/usr/lib; ln -fs ../../lib/libncurses.so.$(NCURSES_VERSION) libncurses.so)
  131. -$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/lib/libncurses.so.$(NCURSES_VERSION)
  132. touch -c $@
  133. ncurses: $(TARGET_DIR)/lib/libncurses.so.$(NCURSES_VERSION)
  134. ncurses-headers: $(TARGET_DIR)/usr/lib/libncurses.a
  135. ncurses-source: $(DL_DIR)/$(NCURSES_SOURCE)
  136. ncurses-clean:
  137. rm -f $(STAGING_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/libncurses.so*
  138. rm -f $(STAGING_DIR)/usr/lib/libncurses.so* $(TARGET_DIR)/usr/lib/libncurses.so*
  139. rm -rf $(STAGING_DIR)/usr/share/tabset $(TARGET_DIR)/usr/share/tabset
  140. rm -rf $(STAGING_DIR)/usr/share/terminfo $(TARGET_DIR)/usr/share/terminfo
  141. -$(MAKE) -C $(NCURSES_DIR) clean
  142. ncurses-dirclean:
  143. rm -rf $(NCURSES_DIR)
  144. #############################################################
  145. #
  146. # Toplevel Makefile options
  147. #
  148. #############################################################
  149. ifeq ($(strip $(BR2_PACKAGE_NCURSES)),y)
  150. TARGETS+=ncurses
  151. endif
  152. ifeq ($(strip $(BR2_PACKAGE_NCURSES_TARGET_HEADERS)),y)
  153. TARGETS+=ncurses-headers
  154. endif