0

I'm trying to cross compile Emacs for an armv7l system on my main rig through an Arch virtual-box, and so far I've had no issues until the ./configure stage. I've properly set up the build, host, and target parameters, but I run into this issue:

"The required function 'tputs' was not found in any library. The following libraries were tried (in order): libtinfo, libncurses, libterminfo, libtermcap, libcurses Please try installing whichever of these libraries is most appropriate for your system, together with its header files. For example, a libncurses-dev(el) or similar package."

Googling about it, I've learned that

  1. On Debian and Ubuntu, libcurses-dev is a seperate development package you can install to your system.
  2. On arch, the what would be in libcurses-dev is included in the ncurses package, and not available seperately

I believe the configure file is searching for the resources created by the "libcurses-dev" package and cant find it because it simply is not present seperately in Arch. I found this thread where someone brought up this issue when trying to compile their own code, and the solution was for them to include "ncurses.h" in their program, which I do see in "/usr/include/ncurses.h" on my system. How would I make that change to my configuration file, or add it as a flag in ./configure?

I am pretty new to Linux in general and I'm learning as I go along, so if there is something clearly wrong what I am doing here, please let me know! These are the parameters im using with ./configure, just for context:

    ./configure --build=x86_64-pc-linux-gnu
--host=arm-linux-gnueabihf --target=host=arm-linux-gnueabihf
--with-x-toolkit=no --with-xpm=no --with-jpeg=no --with-png=no
--with-gif=no --with-tiff=no  --without-xml2 --without-gnutls --without-x
--without-dbus

Thank You!

6
  • Do you have the ARM version of ncurses? You’ll need that since you’re cross-compiling. Commented Aug 10, 2021 at 5:49
  • @stephen-kitt Ah! I didn't know that, would this AUR package be the correct one? Ill try it later today. Would I still need to manually point the configuration file to the package, and if so how would I do that? Thanks!
    – itz-el
    Commented Aug 10, 2021 at 16:31
  • It looks like that would be the right package. You shouldn’t have to tell the compiler about it, the cross-compiler should find it on its own. Commented Aug 10, 2021 at 17:07
  • I've tried installing it a few ways but I keep encountering the same error with makepkg, which is "error iso c++17 does not allow dynamic exception specifications". This seems to be an issue of the package being out of date from what I can tell, and I have no idea how to go about fixing it..
    – itz-el
    Commented Aug 11, 2021 at 4:41
  • The solution for that was actually really simple, just adding CXXFLAGS=-std=c++14 after make in the PKGBUILD file. However, the same problem of "'tputs' was not found in any library" still shows up.
    – itz-el
    Commented Aug 11, 2021 at 4:59

1 Answer 1

0

Arch Linux does not provide cross-compiler packages for ncurses (actually I'm unaware of any cross-compiler packages for ncurses, so this is not a special misfeature of Arch).

You can see which packages use or provide ncurses using the pacman search query, e.g.,

pacman -Ss ncurses

Doing that, I see twenty packages, but only the first is useful:

core/ncurses 6.2-2 [installed]
    System V Release 4.0 curses emulation library

According to the guidelines, if there were a package for arm, you would see that in the listing with the architecture name prefixed:

The package name shall not be prefixed with the word cross- (it was previously proposed, but was not adopted in official packages, probably due to additional length of names), and shall consist of the package name, prefixed by GNU triplet without vendor field or with "unknown" in vendor field; example: arm-linux-gnueabihf-gcc. If shorter naming convention exists (e.g. mips-gcc), it may be used, but this is not recommended.

The Arch Linux ncurses package includes the development files such as the header files (e.g., ncurses.h). You can see that using

pacman -Q -l ncurses |grep /include/

which shows me

ncurses /usr/include/
ncurses /usr/include/curses.h
ncurses /usr/include/cursesapp.h
ncurses /usr/include/cursesf.h
ncurses /usr/include/cursesm.h
ncurses /usr/include/cursesp.h
ncurses /usr/include/cursesw.h
ncurses /usr/include/cursslk.h
ncurses /usr/include/eti.h
ncurses /usr/include/etip.h
ncurses /usr/include/form.h
ncurses /usr/include/menu.h  
ncurses /usr/include/nc_tparm.h
ncurses /usr/include/ncurses.h
ncurses /usr/include/ncurses_dll.h
ncurses /usr/include/panel.h    
ncurses /usr/include/term.h
ncurses /usr/include/term_entry.h
ncurses /usr/include/termcap.h
ncurses /usr/include/tic.h
ncurses /usr/include/unctrl.h

However, the header files are generated (and not necessarily identical for every configuration). A cross-compiler package would therefore use different pathnames for its header files to avoid conflict with the core ncurses package.

Since there are no packages to support cross-compiling with ncurses, the solution seems to be to develop those packages, using the file-naming convention that the configure script expects. Arch does not appear to provide a tutorial on that, but comments on the topic hint that learning how to use distcc is a good way to approach it. Arch's documentation on that begins

Disclaimer: This guide will appear vague and incomplete if you aren't sure what you're doing. This is intentional. This is specifically not designed for users new to software compilation and toolchain components.

This is the official cross-compiling method used at Arch Linux ARM. If you plan on building a lot of packages and want to speed up the process, the following guide will turn an x86 Linux computer into an ARM cross-compiler. It's also much easier than most cross-compile setups.

This guide makes use of distcc in order to not have to build a full ARM development environment on x86. As the distcc project website states, "distcc does not require all machines to share a filesystem, have synchronized clocks, or to have the same libraries or header files installed." This is particularly advantageous to us since all that is needed is a working cross-compiler for ARM on a faster machine, while controlling the build from an ARM computer that has all of the current libraries and headers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .