source: scripts/target-scripts/target-ncurses.sh@ 7ed0e05

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 7ed0e05 was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100755
File size: 2.9 KB
Line 
1#!/bin/bash
2
3# cross-lfs target ncurses build
4# ------------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11cd ${SRC}
12LOG=ncurses-target.log
13libdirname="lib"
14
15SELF=`basename ${0}`
16set_buildenv
17set_libdirname
18setup_multiarch
19
20if [ "${USE_SYSROOT}" = "Y" ]; then
21 BUILD_PREFIX=/usr
22 INSTALL_PREFIX="${LFS}${BUILD_PREFIX}"
23 INSTALL_OPTIONS="DESTDIR=${LFS}"
24else
25 BUILD_PREFIX="${TGT_TOOLS}"
26 INSTALL_PREFIX="${TGT_TOOLS}"
27 INSTALL_OPTIONS=""
28fi
29
30export CC="${TARGET}-gcc ${ARCH_CFLAGS}"
31export CXX="${TARGET}-g++ ${ARCH_CFLAGS}"
32export RANLIB="${TARGET}-ranlib"
33export AR="${TARGET}-ar"
34export LD="${TARGET}-ld"
35
36unpack_tarball ncurses-${NCURSES_VER} &&
37cd ${PKGDIR}
38
39if [ ! "${libdirname}" = "lib" ]; then
40 extra_conf="--libdir=${BUILD_PREFIX}/${libdirname}"
41
42 # Patch misc/run_tic.in to create
43 # ${libdirname}/terminfo -> share/terminfo link
44 test -f misc/run_tic.in-ORIG ||
45 mv misc/run_tic.in misc/run_tic.in-ORIG
46
47 sed "s:^\(TICDIR.*/\)lib\(.*\):\1${libdirname}\2:g" \
48 misc/run_tic.in-ORIG > misc/run_tic.in
49fi
50
51# replace some deprecated headers
52# strstream deprecated in favour of sstream
53test -f c++/cursesw.h-ORIG ||
54 mv c++/cursesw.h c++/cursesw.h-ORIG
55sed 's/include <strstream.h>/include <sstream>/g' c++/cursesw.h-ORIG > c++/cursesw.h
56
57# CHECK THIS... Should only affect ncurses 5.2 and less,
58# must check whether vsscanf is picked up or not in 5.3
59
60test 5.2 = "${NCURSES_VER}" &&
61{
62 # Apply cursesw.cc vsscanf patch
63 # Unsure who provided the original patch used.
64 # Please contact the authors so we can attribute you correctly.
65 test -f c++/cursesw.cc-ORIG ||
66 cp c++/cursesw.cc c++/cursesw.cc-ORIG
67 grep -v strstreambuf c++/cursesw.cc-ORIG |
68 sed 's@ss.vscan(@::vsscanf(buf, @' > c++/cursesw.cc
69}
70
71# Force xterm to always be colour
72# ( thanks Alexander Patrakov ;-) )
73# TODO: this is the default w ncurses-20040711
74sed -i -e '/^xterm|/,+1s,^\(.use\)=xterm-r6,\1=xterm-xfree86,' \
75 misc/terminfo.src
76
77max_log_init Ncurses ${NCURSES_VER} "target (shared)" ${CONFLOGS} ${LOG}
78./configure --prefix=${BUILD_PREFIX} --with-shared \
79 --host=${TARGET} --with-build-cc=gcc \
80 --without-debug ${extra_conf} \
81 >> ${LOGFILE} 2>&1 &&
82echo " o Configure OK" &&
83
84min_log_init ${BUILDLOGS} &&
85make \
86 >> ${LOGFILE} 2>&1 &&
87echo " o Build OK" &&
88
89min_log_init ${INSTLOGS} &&
90make ${INSTALL_OPTIONS} install \
91 >> ${LOGFILE} 2>&1 &&
92echo " o ALL OK" || barf
93
94chmod 755 ${INSTALL_PREFIX}/${libdirname}/*.${NCURSES_VER} &&
95ln -s libncurses.a ${INSTALL_PREFIX}/${libdirname}/libcurses.a
96ln -sf libncurses.so.5 ${INSTALL_PREFIX}/${libdirname}/libcurses.so
97
98#ldconfig
99
100if [ ! -f ${INSTALL_PREFIX}/include/term.h -a -f ${INSTALL_PREFIX}/include/ncurses/term.h ]; then
101 ln -sf ncurses/term.h ${INSTALL_PREFIX}/include
102fi
103
104# also create a curses.h symlink
105if [ ! -f ${INSTALL_PREFIX}/include/curses.h -a -f ${INSTALL_PREFIX}/include/ncurses/curses.h ]; then
106 ln -sf ncurses/curses.h ${INSTALL_PREFIX}/include
107fi
108
Note: See TracBrowser for help on using the repository browser.