title: How does ncurses search for terminal descriptions
body: <p>I'm building ncurses 6.1 from source for some reasons. First I configure the sources with</p>
  
  <pre><code>./configure
  </code></pre>
  
  <p>and then I build it with</p>
  
  <pre><code>make
  </code></pre>
  
  <p>both without arguments. When I try to run tests I get the error message</p>
  
  <pre><code>Error opening terminal: xterm-256color.
  </code></pre>
  
  <p>on my local system (Ubuntu 17.10) and </p>
  
  <pre><code>Error opening terminal: xterm
  </code></pre>
  
  <p>on the build server (Jenkins Docker container).</p>
  
  <p>I found out that this build is looking for terminal descriptions in <code>/usr/share/terminfo/</code>. There are many descriptions but no <code>xterm-256color</code> on my local system. On the build server the folder <code>/usr/share/terminfo/</code> is empty. I found <code>xterm-256color</code> and <code>xterm</code> at <code>/lib/terminfo</code>. When I install ncurses with package manager (apt for Ubuntu 17.10), it works. So I assume that this package chooses the right path. I copied <code>xterm-256color</code> resp. <code>xterm</code> from <code>/lib/terminfo</code> to <code>/usr/share/terminfo/</code> and my build works on both systems now. Why do two different paths exist and why do these two versions of ncurses choose two different paths? I need a conan package of ncurses that works out of the box without copying description files.</p>
  
  <p>This could be a duplicate of:
  <a href="https://stackoverflow.com/questions/7158602/how-to-set-custom-search-paths-for-the-terminfo-database-when-building-ncurses-f">How to set custom search paths for the terminfo database when building ncurses from source</a></p>