bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross compiling to old mips-linux was tricky


From: Thomas Dickey
Subject: Re: Cross compiling to old mips-linux was tricky
Date: Tue, 30 May 2023 20:44:40 -0400

On Tue, May 30, 2023 at 08:20:21PM +0300, Aapo Rantalainen wrote:
> Hi,
> I successfully cross compiled ncurses-6.4-20230527 to (old)
> MIPS-Linux. I think I found one typo in INSTALL.
> 
> --- INSTALL.old    2023-05-29 19:22:29.341932533 +0000
> +++ INSTALL    2023-05-29 19:22:50.289937254 +0000
> @@ -1028,7 +1028,7 @@
>      See also the --enable-getcap option.
> 
>      --with-infocmp-path[=XXX]
> -    Use this option to override the automatic detection of tic in your
> +    Use this option to override the automatic detection of infocmp in your
>      $PATH when building fallbacks (see "--with-fallbacks").

thanks (copy/paste from --with-tic-path...)
 
>      --with-install-prefix=XXX
> --
> 
> I had couple of issues when cross compiling: My host is (intel) Ubuntu
> and target is MIPS-Linux. I'm using gcc-4.3 because of my target and
> thus I'm using older Ubuntu, which has (the known) problem that
> system's /usr/bin/tic produces zero-size fallback.c (because of
> "misc/terminfo.src line X terminal xterm-16color: error writing"). I
> resolved that with --with-infocmp-path and --with-tic-path and
> compiling ncurses two times a row. I though this would be done
> automatically when cross compiling (if --with-build-cc is used).

no... I hadn't thought of tying those two features together (build-cc
is used in other programs, so doing that would mostly be done in the
scripting for fallbacks)

> Also I must use --disable-stripping because it is using system's strip
> and not the cross-strip. (Maybe using "/usr/bin/install
> --strip-program="  could solve this?)

Perhaps - the install program is usually the one that invokes the strip
program -- and checking now -- it seems that AC_PROG_INSTALL is what's
generally used rather than say AC_CHECK_TOOL (which would automatically
select a suitable cross-compiling "install").

If I limited it to the GNU install program, using the --strip-program
option, I could solve it that way (but that would address less than half
of the platforms that ncurses builds on).

To clarify (referring to manpage for the coreutils "install"),
this works in many places

       -s, --strip
              strip symbol tables

but this isn't pervasive:

       --strip-program=PROGRAM
              program used to strip binaries
 
> And my last puzzle was about lib-suffixes. If configuring
> default-suffixes I got libncursesw and libtinfow. With
> --disable-lib-suffixes I got libncurses and libtinfo. Seems that
> some/most/all/at least NetHack expected name libtinfo even when using
> libncursesw. Is this just their own shame?

some packagers prefer that, so that there's one less library to deal with.

Actually (I don't recall all of the details, and would have to research it),
referring to the NEWS file, there's been a libtinfo since 1998, along with
the --with-termlib option -- but I modified that option in 2004 to allow
for this renaming.  But how others have adopted that idea -- that's a
topic for research.
 
> This is my working script:
> 
> #x-tools is crosstool-ng
> export PATH=/home/user/x-tools/mipsel-unknown-linux-gnu/bin:$PATH
> 
> mkdir ~/mips
> mkdir ~/src
> cd ~/src
> wget 
> https://invisible-island.net/archives/ncurses/current/ncurses-6.4-20230527.tgz
> tar xf ncurses-6.4-20230527.tgz
> cd ncurses-6.4-20230527
> ./configure
> make
> mkdir x86
> cp progs/{tic,infocmp} x86
> make clean
> 
> ./configure --with-build-cc=gcc \
> --host=mipsel-unknown-linux-gnu \
> --target=mipsel-unknown-linux-gnu \
> --prefix=/home/user/mips \
> --without-manpages \
> --with-shared \
> --without-normal \
> --with-cxx-shared \
> --without-debug \
> --without-ada \
> --disable-stripping \
> --enable-widec \
> --disable-database \
> --without-xterm-new \
> --disable-home-terminfo \
> --with-termlib \
> --enable-termcap \
> --with-fallbacks=vt100,xterm,xterm-256color \
> --with-infocmp-path=`pwd`/x86/infocmp \
> --with-tic-path=`pwd`/x86/tic
> 
> make
> make install
> mipsel-unknown-linux-gnu-strip /home/user/mips/bin/mips*
> mipsel-unknown-linux-gnu-strip /home/user/mips/lib/*.so.6.4
> 
> cd /home/user/mips/lib/
> ln -s libtinfow.so libtinfo.so
> 
> 
> --
> Aapo Rantalainen
> 

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]