source: scripts/scripts/target-scripts/target-ncurses.sh @ 63b3dd5

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 63b3dd5 was 63b3dd5, checked in by Jim Gifford <clfs@…>, 18 years ago

r2508@server (orig r1247): ryan | 2006-03-10 02:07:51 -0800

r1297@rei: lfs | 2006-03-09 18:43:59 +1100
Add ncurses-5.5-fixes-1.patch
-----------------------------
Submitted by: Alexander E. Patrakov
Date: 2005-12-07
Initial Package Version: 5.5
Upstream Status: Backport
Origin: Cherry-picked from ftp://invisible-island.net/ncurses/5.5/*.gz
Description: Fixes the following bugs:




  • Property mode set to 100755
File size: 3.0 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
39case ${NCURSES_VER} in
40   5.5 ) apply_patch ncurses-5.5-fixes-1 ;;
41esac
42
43if [ ! "${libdirname}" = "lib" ]; then
44   extra_conf="--libdir=${BUILD_PREFIX}/${libdirname}"
45
46   # Patch misc/run_tic.in to create
47   # ${libdirname}/terminfo -> share/terminfo link
48   test -f misc/run_tic.in-ORIG ||
49      mv misc/run_tic.in misc/run_tic.in-ORIG
50
51   sed "s:^\(TICDIR.*/\)lib\(.*\):\1${libdirname}\2:g" \
52      misc/run_tic.in-ORIG > misc/run_tic.in
53fi
54
55# replace some deprecated headers
56# strstream deprecated in favour of sstream
57test -f c++/cursesw.h-ORIG ||
58   mv c++/cursesw.h c++/cursesw.h-ORIG
59sed 's/include <strstream.h>/include <sstream>/g' c++/cursesw.h-ORIG > c++/cursesw.h
60
61# CHECK THIS... Should only affect ncurses 5.2 and less,
62# must check whether vsscanf is picked up or not in 5.3
63
64test 5.2 = "${NCURSES_VER}" &&
65{
66   # Apply cursesw.cc vsscanf patch
67   # Unsure who provided the original patch used.
68   # Please contact the authors so we can attribute you correctly.
69   test -f c++/cursesw.cc-ORIG ||
70      cp c++/cursesw.cc c++/cursesw.cc-ORIG
71   grep -v strstreambuf c++/cursesw.cc-ORIG |
72   sed 's@ss.vscan(@::vsscanf(buf, @' > c++/cursesw.cc
73}
74
75# Force xterm to always be colour
76# ( thanks Alexander Patrakov ;-) )
77# TODO: this is the default w ncurses-20040711
78#sed -i -e '/^xterm|/,+1s,^\(.use\)=xterm-r6,\1=xterm-xfree86,' \
79#   misc/terminfo.src
80
81max_log_init Ncurses ${NCURSES_VER} "target (shared)" ${CONFLOGS} ${LOG}
82./configure --prefix=${BUILD_PREFIX} --with-shared \
83   --host=${TARGET} --with-build-cc=gcc \
84   --without-debug ${extra_conf} \
85   >> ${LOGFILE} 2>&1 &&
86echo " o Configure OK" &&
87
88min_log_init ${BUILDLOGS} &&
89make \
90   >> ${LOGFILE} 2>&1 &&
91echo " o Build OK" &&
92
93min_log_init ${INSTLOGS} &&
94make ${INSTALL_OPTIONS} install \
95   >> ${LOGFILE} 2>&1 &&
96echo " o ALL OK" || barf
97
98chmod 755 ${INSTALL_PREFIX}/${libdirname}/*.${NCURSES_VER} &&
99ln -s libncurses.a ${INSTALL_PREFIX}/${libdirname}/libcurses.a
100ln -sf libncurses.so.5 ${INSTALL_PREFIX}/${libdirname}/libcurses.so
101
102#ldconfig
103
104if [ ! -f ${INSTALL_PREFIX}/include/term.h -a -f ${INSTALL_PREFIX}/include/ncurses/term.h ]; then
105   ln -sf ncurses/term.h ${INSTALL_PREFIX}/include
106fi
107
108# also create a curses.h symlink
109if [ ! -f ${INSTALL_PREFIX}/include/curses.h -a -f ${INSTALL_PREFIX}/include/ncurses/curses.h ]; then
110   ln -sf ncurses/curses.h ${INSTALL_PREFIX}/include
111fi
112
Note: See TracBrowser for help on using the repository browser.