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