ncurses.mk 5.2 KB

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