207 lines
5.6 KiB
207 lines
5.6 KiB
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
# |
|
# Filename: package/.../ncurses/ncurses.conf |
|
# Copyright (C) 2006 - 2012 The OpenSDE Project |
|
# Copyright (C) 2004 - 2006 The T2 SDE Project |
|
# Copyright (C) 1998 - 2003 Clifford Wolf |
|
# |
|
# More information can be found in the files COPYING and README. |
|
# |
|
# This program is free software; you can redistribute it and/or modify |
|
# it under the terms of the GNU General Public License as published by |
|
# the Free Software Foundation; version 2 of the License. A copy of the |
|
# GNU General Public License can be found in the file COPYING. |
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
prefix= |
|
set_confopt |
|
|
|
if ! atstage native; then |
|
var_append extraconfopt " " "--without-cxx --without-cxx-binding --with-build-cppflags=-D_GNU_SOURCE" |
|
fi |
|
|
|
# saving our local patches and empty the patchfiles variable |
|
localpatches=$patchfiles |
|
patchfiles= |
|
|
|
# append official patches |
|
for x in `match_source_file -p 'patch'` ; do |
|
var_append patchfiles " " "$x" |
|
done |
|
|
|
# append our local patches |
|
var_append patchfiles " " "$localpatches" |
|
|
|
# on dietlibc we won't use NLS |
|
[ "$SDECFG_LIBC" != dietlibc ] || SDECFG_DISABLE_NLS=1 |
|
|
|
# custmain for toolchain stage |
|
tic_only() { |
|
mkdir build-tic |
|
cd build-tic |
|
# build a standalone termlib and dependendencyless ticlib |
|
../configure --prefix=$root --without-debug --with-termlib \ |
|
--with-ticlib --disable-tic-depends --with-shared |
|
# build needed header files |
|
make -C include |
|
# build and install a tic which is linked against libtinfo |
|
# and libtic only |
|
make -C progs tic |
|
cp -a lib/libtinfo.so* $root/lib |
|
cp -a lib/libtic.so* $root/lib |
|
cp -a progs/tic $root/bin |
|
} |
|
|
|
ncurses_preconf() { |
|
if [ $buildloop -eq 1 ]; then |
|
# first loop is easy, always simply narrowc |
|
mkdir -p narrowc |
|
cd narrowc |
|
# generate separate tic library |
|
var_append confopt ' ' "--with-ticlib" |
|
else |
|
# suppress to build programs |
|
var_append confopt ' ' "--without-progs" |
|
|
|
cd .. |
|
# then the things get a bit uglier |
|
if [ "$SDECFG_DISABLE_NLS" != 1 ]; then |
|
# NLS support |
|
if [ $buildloop -eq 2 ]; then |
|
# loop 2: normal wide |
|
mkdir -p widec |
|
cd widec |
|
var_append confopt " " "--enable-widec" |
|
var_append makeinstopt " " "includedir=$includedir/ncursesw" |
|
elif [ $buildloop -eq 3 ]; then |
|
# loop 3: altered arch, narrow. |
|
var_remove GCC_WRAPPER_INSERT ' ' '-m64' |
|
alter_arch |
|
|
|
mkdir -p narrowc_32 |
|
cd narrowc_32 |
|
var_remove makeinstopt " " "includedir=$includedir/ncursesw" |
|
else |
|
# loop 4: alreday altered arch, wide. |
|
mkdir -p widec_32 |
|
cd widec_32 |
|
var_append confopt " " "--enable-widec" |
|
var_append makeinstopt " " "includedir=$includedir/ncursesw" |
|
fi |
|
else |
|
# no NLS support |
|
# loop 2: altered arch, narrow. |
|
var_remove GCC_WRAPPER_INSERT ' ' '-m64' |
|
alter_arch |
|
|
|
mkdir -p narrowc_32 |
|
cd narrowc_32 |
|
fi |
|
fi |
|
} |
|
|
|
# create compatibility symlinks for curses |
|
make_curses_symlinks() { |
|
echo "Creating compatibility symlinks for curses." |
|
|
|
if [ "$SDECFG_STATIC" != 1 ]; then |
|
ln -svf "$( readlink $root$libdir/libncurses.so )" $root$libdir/libcurses.so |
|
fi |
|
|
|
ln -svf libncurses.a $root$libdir/libcurses.a |
|
} |
|
|
|
# functions we use when termcap package is installed |
|
remove_include_termcap() { |
|
echo "Removing 'termcap.h' from include/Makefile for 'make install'." |
|
sed -i 's,termcap.h,,g' include/Makefile |
|
} |
|
|
|
make_termcap_symlinks() { |
|
echo "Creating compatibility symlinks for termcap." |
|
|
|
if [ "$SDECFG_STATIC" != 1 ]; then |
|
ln -svf "$( readlink $root$libdir/libtinfo.so )" $root$libdir/libtermcap.so |
|
fi |
|
|
|
ln -svf libtinfo.a $root$libdir/libtermcap.a |
|
} |
|
|
|
# function to create a compatibility symlink '/usr/lib/terminfo' |
|
make_terminfo_symlink() { |
|
# construct the path to the old terminfo dir (taken from run_tic.sh) |
|
local compatdir="$(echo $datadir/terminfo | sed -e 's%/share/\([^/]*\)$%/lib/\1%')" |
|
|
|
if [ ! -e $root$compatdir ]; then |
|
ln -svf ../share/terminfo $root$compatdir |
|
fi |
|
} |
|
|
|
if atstage toolchain; then |
|
buildloops=1 |
|
custmain='tic_only' |
|
else |
|
# on systems having NLS support we build ncurses twice |
|
if [ "$SDECFG_DISABLE_NLS" != 1 ]; then |
|
buildloops=2 |
|
fi |
|
|
|
# sparc64 may need extra love |
|
if [ "$arch" == "sparc64" -a "$SDECFG_SPARC64_32BIT" = 1 ]; then |
|
# double the loops |
|
buildloops=$( expr $buildloops \* 2 ) |
|
fi |
|
|
|
configscript="../configure" |
|
|
|
hook_add preconf 3 "ncurses_preconf" |
|
|
|
[ "$SDECFG_STATIC" != 1 ] && var_append extraconfopt " " "--with-shared" |
|
|
|
var_append extraconfopt " " "--with-normal" |
|
|
|
# Fine-Tuning: |
|
# |
|
# make tic use symbolic links not hard links |
|
var_append extraconfopt " " "--enable-symlinks" |
|
|
|
# Extensions: |
|
# |
|
# compile with SIGWINCH handler |
|
var_append extraconfopt " " "--enable-sigwinch" |
|
|
|
# Development Code: |
|
# |
|
# compile with hard-tabs code |
|
var_append extraconfopt " " "--enable-hard-tabs" |
|
|
|
# Experimental Code: |
|
# |
|
# compile with $COLORFGBG code |
|
var_append extraconfopt " " "--enable-colorfgbg" |
|
|
|
# always create compatibility symlinks for curses |
|
hook_add postmake 5 "make_curses_symlinks" |
|
|
|
# always create compatibility symlinks for terminfo directory |
|
hook_add postmake 5 "make_terminfo_symlink" |
|
|
|
if pkginstalled termcap ; then |
|
echo_status "Found termcap package ->" \ |
|
"disable ncurses internal termcap library." |
|
var_append extraconfopt " " "--disable-termcap" |
|
hook_add inmake 5 "remove_include_termcap" |
|
else |
|
# generate separate terminfo library |
|
var_append extraconfopt " " "--with-termlib" |
|
hook_add postmake 6 "make_termcap_symlinks" |
|
fi |
|
|
|
# generate and install .pc files for pkg-config |
|
if pkginstalled pkgconfig; then |
|
var_append extraconfopt " " "--enable-pc-files" |
|
# without this .pc files will get installed into $datadir/pkgconfig |
|
var_append extraconfopt " " "--with-pkg-config-libdir=$libdir/pkgconfig" |
|
fi |
|
fi
|
|
|