blob: 382dc24dde61e2f286649ad8faf3e7babe322bde [file] [log] [blame]
Eric Andersen63879622002-05-23 19:21:23 +00001#############################################################
2#
3# ncurses
4# this installs only a few vital termcap entries
5#
6#############################################################
7# Copyright (C) 2002 by Ken Restivo <ken@246gt.com>
Eric Andersenb0d088b2005-01-03 04:38:13 +00008# $Id: ncurses.mk,v 1.7 2005/01/03 04:38:13 andersen Exp $
Eric Andersen63879622002-05-23 19:21:23 +00009#
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
25# TARGETS
26NCURSES_SITE:=ftp://ftp.gnu.org/pub/gnu/ncurses
27NCURSES_DIR:=$(BUILD_DIR)/ncurses-5.2
28NCURSES_SOURCE:=ncurses-5.2.tar.gz
29
30$(DL_DIR)/$(NCURSES_SOURCE):
Eric Andersen8a2597e2002-11-20 23:16:10 +000031 $(WGET) -P $(DL_DIR) $(NCURSES_SITE)/$(NCURSES_SOURCE)
Eric Andersen63879622002-05-23 19:21:23 +000032
33$(NCURSES_DIR)/.dist: $(DL_DIR)/$(NCURSES_SOURCE)
Eric Andersenbb05a9a2004-10-09 21:19:47 +000034 gunzip -c $(DL_DIR)/$(NCURSES_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
Eric Andersen63879622002-05-23 19:21:23 +000035 #use the local tic and not whatever the build system was going to find.
Eric Andersen4f889ad2003-11-19 17:17:56 +000036 $(SED) 's~\$$srcdir/shlib tic\$$suffix~/usr/bin/tic~' \
Eric Andersen63879622002-05-23 19:21:23 +000037 $(NCURSES_DIR)/misc/run_tic.in
Eric Andersen44eedc52004-10-09 02:49:33 +000038 toolchain/patch-kernel.sh $(NCURSES_DIR) package/ncurses/ ncurses-\*.patch
Eric Andersen63879622002-05-23 19:21:23 +000039 touch $(NCURSES_DIR)/.dist
40
Eric Andersene9ee5c42002-05-31 11:22:31 +000041$(NCURSES_DIR)/.configured: $(NCURSES_DIR)/.dist
Eric Andersend322f372003-02-12 08:10:40 +000042 (cd $(NCURSES_DIR); rm -rf config.cache; \
Eric Andersend9540bd2003-08-19 06:37:00 +000043 BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
Eric Andersen1fc3f2f2003-03-04 19:16:19 +000044 $(TARGET_CONFIGURE_OPTS) \
Manuel Novoa III d632d422003-11-01 05:34:41 +000045 CFLAGS="$(TARGET_CFLAGS)" \
Eric Andersene4024012003-01-08 18:17:28 +000046 ./configure \
47 --target=$(GNU_TARGET_NAME) \
Eric Andersen1fc3f2f2003-03-04 19:16:19 +000048 --host=$(GNU_TARGET_NAME) \
49 --build=$(GNU_HOST_NAME) \
Eric Andersene4024012003-01-08 18:17:28 +000050 --prefix=/usr \
51 --exec-prefix=/usr \
52 --bindir=/usr/bin \
53 --sbindir=/usr/sbin \
54 --sysconfdir=/etc \
55 --datadir=/usr/share \
56 --localstatedir=/var \
57 --mandir=/usr/man \
58 --infodir=/usr/info \
59 --with-terminfo-dirs=/usr/share/terminfo \
60 --with-default-terminfo-dir=/usr/share/terminfo \
61 --libdir=$(STAGING_DIR)/lib \
Eric Andersenef7784a2003-01-17 08:03:59 +000062 --with-shared --without-cxx --without-cxx-binding \
Manuel Novoa III 0e956fc2003-09-03 07:18:18 +000063 --without-ada --without-progs $(DISABLE_NLS) \
Eric Andersend9540bd2003-08-19 06:37:00 +000064 --without-profile --without-debug --disable-rpath \
65 --enable-echo --enable-const --enable-overwrite \
Eric Andersencbe848f2005-03-02 12:33:58 +000066 --enable-broken_linker \
Eric Andersenef7784a2003-01-17 08:03:59 +000067 );
Eric Andersene9ee5c42002-05-31 11:22:31 +000068 touch $(NCURSES_DIR)/.configured
Eric Andersen63879622002-05-23 19:21:23 +000069
Eric Andersen289395d2003-02-12 12:43:15 +000070$(NCURSES_DIR)/lib/libncurses.so.5.2: $(NCURSES_DIR)/.configured
Eric Andersend9540bd2003-08-19 06:37:00 +000071 $(MAKE) BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
72 BUILD_CCFLAGS="-I$(NCURSES_DIR) -I$(NCURSES_DIR)/include" \
73 BUILD_LDFLAGS="" DESTDIR=$(STAGING_DIR) -C $(NCURSES_DIR) \
74 libs panel menu form headers
Eric Andersen63879622002-05-23 19:21:23 +000075
Eric Andersen289395d2003-02-12 12:43:15 +000076$(STAGING_DIR)/lib/libncurses.a: $(NCURSES_DIR)/lib/libncurses.so.5.2
Eric Andersend9540bd2003-08-19 06:37:00 +000077 BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) CC=$(TARGET_CC) \
Eric Andersenb0d088b2005-01-03 04:38:13 +000078 $(MAKE1) \
Eric Andersene4024012003-01-08 18:17:28 +000079 prefix=$(STAGING_DIR) \
80 exec_prefix=$(STAGING_DIR) \
81 bindir=$(STAGING_DIR)/bin \
82 sbindir=$(STAGING_DIR)/sbin \
83 libexecdir=$(STAGING_DIR)/lib \
84 datadir=$(STAGING_DIR)/usr/share \
85 sysconfdir=$(STAGING_DIR)/etc \
86 localstatedir=$(STAGING_DIR)/var \
87 libdir=$(STAGING_DIR)/lib \
88 infodir=$(STAGING_DIR)/info \
89 mandir=$(STAGING_DIR)/man \
90 includedir=$(STAGING_DIR)/include \
91 gxx_include_dir=$(STAGING_DIR)/include/c++ \
Eric Anderseneffd2aa2003-01-16 22:04:22 +000092 ticdir=$(STAGING_DIR)/usr/share/terminfo \
Eric Andersene4024012003-01-08 18:17:28 +000093 -C $(NCURSES_DIR) install;
Eric Andersend322f372003-02-12 08:10:40 +000094 chmod a-x $(NCURSES_DIR)/lib/libncurses.so*
Eric Andersenb0d088b2005-01-03 04:38:13 +000095 touch -c $(STAGING_DIR)/lib/libncurses.a
Eric Andersen63879622002-05-23 19:21:23 +000096
Eric Andersen289395d2003-02-12 12:43:15 +000097$(TARGET_DIR)/lib/libncurses.so.5.2: $(STAGING_DIR)/lib/libncurses.a
Eric Anderseneffd2aa2003-01-16 22:04:22 +000098 cp -dpf $(NCURSES_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/
Eric Andersene8b26df2003-01-02 08:43:57 +000099 -cp -dpf $(STAGING_DIR)/usr/lib/terminfo $(TARGET_DIR)/usr/lib/
Eric Anderseneffd2aa2003-01-16 22:04:22 +0000100 mkdir -p $(TARGET_DIR)/usr/share/terminfo
Eric Andersen63879622002-05-23 19:21:23 +0000101 for i in x/xterm x/xterm-color x/xterm-xfree86 v/vt100 v/vt200 a/ansi l/linux; do \
Eric Anderseneffd2aa2003-01-16 22:04:22 +0000102 cp -dpf $(STAGING_DIR)/usr/share/terminfo/$${i} $(TARGET_DIR)/usr/share/terminfo/; \
Eric Andersen63879622002-05-23 19:21:23 +0000103 done
Mike Frysinger55703602004-10-09 19:26:10 +0000104 touch -c $(TARGET_DIR)/lib/libncurses.so.5.2
Eric Andersen63879622002-05-23 19:21:23 +0000105
Eric Andersen289395d2003-02-12 12:43:15 +0000106$(TARGET_DIR)/usr/lib/libncurses.a: $(STAGING_DIR)/lib/libncurses.a
Eric Andersen46b489f2004-10-27 20:09:27 +0000107 mkdir -p $(TARGET_DIR)/usr/include
Eric Andersene4024012003-01-08 18:17:28 +0000108 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/
Eric Andersen24613cb2003-01-09 20:28:10 +0000110 cp -dpf $(NCURSES_DIR)/include/unctrl.h $(TARGET_DIR)/usr/include/
Eric Andersene4024012003-01-08 18:17:28 +0000111 cp -dpf $(NCURSES_DIR)/include/termcap.h $(TARGET_DIR)/usr/include/
112 cp -dpf $(NCURSES_DIR)/lib/libncurses.a $(TARGET_DIR)/usr/lib/
Eric Andersend322f372003-02-12 08:10:40 +0000113 rm -f $(TARGET_DIR)/usr/lib/terminfo
114 (cd $(TARGET_DIR)/usr/lib; ln -fs /usr/share/terminfo)
Eric Andersene4024012003-01-08 18:17:28 +0000115 (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)
Eric Andersend322f372003-02-12 08:10:40 +0000118 rm -f $(TARGET_DIR)/lib/libncurses.so
Eric Andersen96478762004-07-28 19:26:04 +0000119 (cd $(TARGET_DIR)/usr/lib; ln -fs ../../lib/libncurses.so.5.2 libncurses.so)
Eric Andersen9c636932003-03-13 20:30:07 +0000120 -$(STRIP) --strip-unneeded $(TARGET_DIR)/lib/libncurses.so.5.2
Eric Andersen8460ba52003-01-23 01:18:58 +0000121 touch -c $(TARGET_DIR)/usr/lib/libncurses.a
Eric Andersen0cea77f2003-01-08 02:29:25 +0000122
Mike Frysinger55703602004-10-09 19:26:10 +0000123ncurses: $(TARGET_DIR)/lib/libncurses.so.5.2
124
Eric Andersene0e8d6e2003-01-21 07:34:29 +0000125ncurses-headers: $(TARGET_DIR)/usr/lib/libncurses.a
Eric Andersen0cea77f2003-01-08 02:29:25 +0000126
Eric Andersen0fee9e92003-11-12 09:31:12 +0000127ncurses-source: $(DL_DIR)/$(NCURSES_SOURCE)
128
Eric Andersenb0d088b2005-01-03 04:38:13 +0000129ncurses-clean:
Eric Andersen63879622002-05-23 19:21:23 +0000130 rm -f $(STAGING_DIR)/lib/libncurses.so* $(TARGET_DIR)/lib/libncurses.so*
Eric Andersenb0d088b2005-01-03 04:38:13 +0000131 rm -rf $(STAGING_DIR)/usr/share/tabset $(TARGET_DIR)/usr/share/tabset
Eric Andersen80014e72002-07-23 23:51:46 +0000132 rm -rf $(STAGING_DIR)/usr/share/terminfo $(TARGET_DIR)/usr/share/terminfo
Eric Andersene8b26df2003-01-02 08:43:57 +0000133 -$(MAKE) -C $(NCURSES_DIR) clean
Eric Andersen63879622002-05-23 19:21:23 +0000134
Eric Andersenb0d088b2005-01-03 04:38:13 +0000135ncurses-dirclean:
Eric Andersen63879622002-05-23 19:21:23 +0000136 rm -rf $(NCURSES_DIR)
Eric Andersend06645d2005-02-10 03:06:39 +0000137#############################################################
138#
139# Toplevel Makefile options
140#
141#############################################################
142ifeq ($(strip $(BR2_PACKAGE_NCURSES)),y)
143TARGETS+=ncurses
144endif