ncurses.mk 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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_SITE:=ftp://ftp.gnu.org/pub/gnu/ncurses
  26. NCURSES_DIR:=$(BUILD_DIR)/ncurses-5.2
  27. NCURSES_SOURCE:=ncurses-5.2.tar.gz
  28. $(DL_DIR)/$(NCURSES_SOURCE):
  29. $(WGET) -P $(DL_DIR) $(NCURSES_SITE)/$(NCURSES_SOURCE)
  30. $(NCURSES_DIR)/.dist: $(DL_DIR)/$(NCURSES_SOURCE)
  31. gunzip -c $(DL_DIR)/$(NCURSES_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  32. #use the local tic and not whatever the build system was going to find.
  33. $(SED) 's~\$$srcdir/shlib tic\$$suffix~/usr/bin/tic~' \
  34. $(NCURSES_DIR)/misc/run_tic.in
  35. toolchain/patch-kernel.sh $(NCURSES_DIR) package/ncurses/ ncurses\*.patch
  36. $(CONFIG_UPDATE) $(NCURSES_DIR)
  37. touch $(NCURSES_DIR)/.dist
  38. $(NCURSES_DIR)/.configured: $(NCURSES_DIR)/.dist
  39. (cd $(NCURSES_DIR); rm -rf config.cache; \
  40. BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
  41. $(TARGET_CONFIGURE_OPTS) \
  42. CFLAGS="$(TARGET_CFLAGS)" \
  43. ./configure \
  44. --target=$(GNU_TARGET_NAME) \
  45. --host=$(GNU_TARGET_NAME) \
  46. --build=$(GNU_HOST_NAME) \
  47. --prefix=/usr \
  48. --exec-prefix=/usr \
  49. --bindir=/usr/bin \
  50. --sbindir=/usr/sbin \
  51. --sysconfdir=/etc \
  52. --datadir=/usr/share \
  53. --localstatedir=/var \
  54. --mandir=/usr/man \
  55. --infodir=/usr/info \
  56. --with-terminfo-dirs=/usr/share/terminfo \
  57. --with-default-terminfo-dir=/usr/share/terminfo \
  58. --libdir=$(STAGING_DIR)/lib \
  59. --with-shared --without-cxx --without-cxx-binding \
  60. --without-ada --without-progs $(DISABLE_NLS) \
  61. --without-profile --without-debug --disable-rpath \
  62. --enable-echo --enable-const --enable-overwrite \
  63. --enable-broken_linker \
  64. );
  65. touch $(NCURSES_DIR)/.configured
  66. $(NCURSES_DIR)/lib/libncurses.so.5.2: $(NCURSES_DIR)/.configured
  67. $(MAKE1) BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
  68. BUILD_CCFLAGS="-I$(NCURSES_DIR) -I$(NCURSES_DIR)/include" \
  69. BUILD_LDFLAGS="" DESTDIR=$(STAGING_DIR) -C $(NCURSES_DIR) \
  70. libs panel menu form headers
  71. $(STAGING_DIR)/lib/libncurses.a: $(NCURSES_DIR)/lib/libncurses.so.5.2
  72. BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) CC=$(TARGET_CC) \
  73. $(MAKE1) \
  74. prefix=$(STAGING_DIR) \
  75. exec_prefix=$(STAGING_DIR) \
  76. bindir=$(STAGING_DIR)/bin \
  77. sbindir=$(STAGING_DIR)/sbin \
  78. libexecdir=$(STAGING_DIR)/lib \
  79. datadir=$(STAGING_DIR)/usr/share \
  80. sysconfdir=$(STAGING_DIR)/etc \
  81. localstatedir=$(STAGING_DIR)/var \
  82. libdir=$(STAGING_DIR)/lib \
  83. infodir=$(STAGING_DIR)/info \
  84. mandir=$(STAGING_DIR)/man \
  85. includedir=$(STAGING_DIR)/include \
  86. gxx_include_dir=$(STAGING_DIR)/include/c++ \
  87. ticdir=$(STAGING_DIR)/usr/share/terminfo \
  88. -C $(NCURSES_DIR) install;
  89. chmod a-x $(NCURSES_DIR)/lib/libncurses.so*
  90. touch -c $(STAGING_DIR)/lib/libncurses.a
  91. $(TARGET_DIR)/lib/libncurses.so.5.2: $(STAGING_DIR)/lib/libncurses.a
  92. cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/
  93. -cp -dpf $(STAGING_DIR)/usr/lib/terminfo $(TARGET_DIR)/usr/lib/
  94. mkdir -p $(TARGET_DIR)/usr/share/terminfo/x
  95. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm $(TARGET_DIR)/usr/share/terminfo/x
  96. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-color $(TARGET_DIR)/usr/share/terminfo/x
  97. cp -dpf $(STAGING_DIR)/usr/share/terminfo/x/xterm-xfree86 $(TARGET_DIR)/usr/share/terminfo/x
  98. mkdir -p $(TARGET_DIR)/usr/share/terminfo/v
  99. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt100 $(TARGET_DIR)/usr/share/terminfo/v
  100. cp -dpf $(STAGING_DIR)/usr/share/terminfo/v/vt200 $(TARGET_DIR)/usr/share/terminfo/v
  101. mkdir -p $(TARGET_DIR)/usr/share/terminfo/a
  102. cp -dpf $(STAGING_DIR)/usr/share/terminfo/a/ansi $(TARGET_DIR)/usr/share/terminfo/a
  103. mkdir -p $(TARGET_DIR)/usr/share/terminfo/l
  104. cp -dpf $(STAGING_DIR)/usr/share/terminfo/l/linux $(TARGET_DIR)/usr/share/terminfo/l
  105. touch -c $(TARGET_DIR)/lib/libncurses.so.5.2
  106. $(TARGET_DIR)/usr/lib/libncurses.a: $(STAGING_DIR)/lib/libncurses.a
  107. mkdir -p $(TARGET_DIR)/usr/include
  108. cp -dpf $(NCURSES_DIR)/include/curses.h $(TARGET_DIR)/usr/include/ncurses.h
  109. cp -dpf $(NCURSES_DIR)/include/term.h $(TARGET_DIR)/usr/include/
  110. cp -dpf $(NCURSES_DIR)/include/unctrl.h $(TARGET_DIR)/usr/include/
  111. cp -dpf $(NCURSES_DIR)/include/termcap.h $(TARGET_DIR)/usr/include/
  112. cp -dpf $(NCURSES_DIR)/lib/libncurses.a $(TARGET_DIR)/usr/lib/
  113. rm -f $(TARGET_DIR)/usr/lib/terminfo
  114. (cd $(TARGET_DIR)/usr/lib; ln -fs /usr/share/terminfo)
  115. (cd $(TARGET_DIR)/usr/lib; ln -fs libncurses.a libcurses.a)
  116. (cd $(TARGET_DIR)/usr/lib; ln -fs libncurses.a libtermcap.a)
  117. (cd $(TARGET_DIR)/usr/include; ln -fs ncurses.h curses.h)
  118. rm -f $(TARGET_DIR)/lib/libncurses.so
  119. (cd $(TARGET_DIR)/usr/lib; ln -fs ../../lib/libncurses.so.5.2 libncurses.so)
  120. -$(STRIP) --strip-unneeded $(TARGET_DIR)/lib/libncurses.so.5.2
  121. touch -c $(TARGET_DIR)/usr/lib/libncurses.a
  122. ncurses: $(TARGET_DIR)/lib/libncurses.so.5.2
  123. ncurses-headers: $(TARGET_DIR)/usr/lib/libncurses.a
  124. ncurses-source: $(DL_DIR)/$(NCURSES_SOURCE)
  125. ncurses-clean:
  126. rm -f $(STAGING_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/libncurses.so*
  127. rm -rf $(STAGING_DIR)/usr/share/tabset $(TARGET_DIR)/usr/share/tabset
  128. rm -rf $(STAGING_DIR)/usr/share/terminfo $(TARGET_DIR)/usr/share/terminfo
  129. -$(MAKE) -C $(NCURSES_DIR) clean
  130. ncurses-dirclean:
  131. rm -rf $(NCURSES_DIR)
  132. #############################################################
  133. #
  134. # Toplevel Makefile options
  135. #
  136. #############################################################
  137. ifeq ($(strip $(BR2_PACKAGE_NCURSES)),y)
  138. TARGETS+=ncurses
  139. endif
  140. ifeq ($(strip $(BR2_PACKAGE_NCURSES_TARGET_HEADERS)),y)
  141. TARGETS+=ncurses-headers
  142. endif