ncurses.mk 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. touch $(NCURSES_DIR)/.dist
  37. $(NCURSES_DIR)/.configured: $(NCURSES_DIR)/.dist
  38. (cd $(NCURSES_DIR); rm -rf config.cache; \
  39. BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
  40. $(TARGET_CONFIGURE_OPTS) \
  41. CFLAGS="$(TARGET_CFLAGS)" \
  42. ./configure \
  43. --target=$(GNU_TARGET_NAME) \
  44. --host=$(GNU_TARGET_NAME) \
  45. --build=$(GNU_HOST_NAME) \
  46. --prefix=/usr \
  47. --exec-prefix=/usr \
  48. --bindir=/usr/bin \
  49. --sbindir=/usr/sbin \
  50. --sysconfdir=/etc \
  51. --datadir=/usr/share \
  52. --localstatedir=/var \
  53. --mandir=/usr/man \
  54. --infodir=/usr/info \
  55. --with-terminfo-dirs=/usr/share/terminfo \
  56. --with-default-terminfo-dir=/usr/share/terminfo \
  57. --libdir=$(STAGING_DIR)/lib \
  58. --with-shared --without-cxx --without-cxx-binding \
  59. --without-ada --without-progs $(DISABLE_NLS) \
  60. --without-profile --without-debug --disable-rpath \
  61. --enable-echo --enable-const --enable-overwrite \
  62. --enable-broken_linker \
  63. );
  64. touch $(NCURSES_DIR)/.configured
  65. $(NCURSES_DIR)/lib/libncurses.so.5.2: $(NCURSES_DIR)/.configured
  66. $(MAKE1) BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
  67. BUILD_CCFLAGS="-I$(NCURSES_DIR) -I$(NCURSES_DIR)/include" \
  68. BUILD_LDFLAGS="" DESTDIR=$(STAGING_DIR) -C $(NCURSES_DIR) \
  69. libs panel menu form headers
  70. $(STAGING_DIR)/lib/libncurses.a: $(NCURSES_DIR)/lib/libncurses.so.5.2
  71. BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) CC=$(TARGET_CC) \
  72. $(MAKE1) \
  73. prefix=$(STAGING_DIR) \
  74. exec_prefix=$(STAGING_DIR) \
  75. bindir=$(STAGING_DIR)/bin \
  76. sbindir=$(STAGING_DIR)/sbin \
  77. libexecdir=$(STAGING_DIR)/lib \
  78. datadir=$(STAGING_DIR)/usr/share \
  79. sysconfdir=$(STAGING_DIR)/etc \
  80. localstatedir=$(STAGING_DIR)/var \
  81. libdir=$(STAGING_DIR)/lib \
  82. infodir=$(STAGING_DIR)/info \
  83. mandir=$(STAGING_DIR)/man \
  84. includedir=$(STAGING_DIR)/include \
  85. gxx_include_dir=$(STAGING_DIR)/include/c++ \
  86. ticdir=$(STAGING_DIR)/usr/share/terminfo \
  87. -C $(NCURSES_DIR) install;
  88. chmod a-x $(NCURSES_DIR)/lib/libncurses.so*
  89. touch -c $(STAGING_DIR)/lib/libncurses.a
  90. $(TARGET_DIR)/lib/libncurses.so.5.2: $(STAGING_DIR)/lib/libncurses.a
  91. cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/
  92. -cp -dpf $(STAGING_DIR)/usr/lib/terminfo $(TARGET_DIR)/usr/lib/
  93. mkdir -p $(TARGET_DIR)/usr/share/terminfo
  94. for i in x/xterm x/xterm-color x/xterm-xfree86 v/vt100 v/vt200 a/ansi l/linux; do \
  95. cp -dpf $(STAGING_DIR)/usr/share/terminfo/$${i} $(TARGET_DIR)/usr/share/terminfo/; \
  96. done
  97. touch -c $(TARGET_DIR)/lib/libncurses.so.5.2
  98. $(TARGET_DIR)/usr/lib/libncurses.a: $(STAGING_DIR)/lib/libncurses.a
  99. mkdir -p $(TARGET_DIR)/usr/include
  100. cp -dpf $(NCURSES_DIR)/include/curses.h $(TARGET_DIR)/usr/include/ncurses.h
  101. cp -dpf $(NCURSES_DIR)/include/term.h $(TARGET_DIR)/usr/include/
  102. cp -dpf $(NCURSES_DIR)/include/unctrl.h $(TARGET_DIR)/usr/include/
  103. cp -dpf $(NCURSES_DIR)/include/termcap.h $(TARGET_DIR)/usr/include/
  104. cp -dpf $(NCURSES_DIR)/lib/libncurses.a $(TARGET_DIR)/usr/lib/
  105. rm -f $(TARGET_DIR)/usr/lib/terminfo
  106. (cd $(TARGET_DIR)/usr/lib; ln -fs /usr/share/terminfo)
  107. (cd $(TARGET_DIR)/usr/lib; ln -fs libncurses.a libcurses.a)
  108. (cd $(TARGET_DIR)/usr/lib; ln -fs libncurses.a libtermcap.a)
  109. (cd $(TARGET_DIR)/usr/include; ln -fs ncurses.h curses.h)
  110. rm -f $(TARGET_DIR)/lib/libncurses.so
  111. (cd $(TARGET_DIR)/usr/lib; ln -fs ../../lib/libncurses.so.5.2 libncurses.so)
  112. -$(STRIP) --strip-unneeded $(TARGET_DIR)/lib/libncurses.so.5.2
  113. touch -c $(TARGET_DIR)/usr/lib/libncurses.a
  114. ncurses: $(TARGET_DIR)/lib/libncurses.so.5.2
  115. ncurses-headers: $(TARGET_DIR)/usr/lib/libncurses.a
  116. ncurses-source: $(DL_DIR)/$(NCURSES_SOURCE)
  117. ncurses-clean:
  118. rm -f $(STAGING_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/libncurses.so*
  119. rm -rf $(STAGING_DIR)/usr/share/tabset $(TARGET_DIR)/usr/share/tabset
  120. rm -rf $(STAGING_DIR)/usr/share/terminfo $(TARGET_DIR)/usr/share/terminfo
  121. -$(MAKE) -C $(NCURSES_DIR) clean
  122. ncurses-dirclean:
  123. rm -rf $(NCURSES_DIR)
  124. #############################################################
  125. #
  126. # Toplevel Makefile options
  127. #
  128. #############################################################
  129. ifeq ($(strip $(BR2_PACKAGE_NCURSES)),y)
  130. TARGETS+=ncurses
  131. endif