File: iconf_term

package info (click to toggle)
ifeffit 1:1.3.0-3
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k
  • size: 13,652 kB
  • ctags: 7,237
  • sloc: fortran: 33,599; ansic: 26,405; sh: 7,184; makefile: 5,469; python: 3,273; perl: 3,146; tcl: 95
file content (39 lines) | stat: -rwxr-xr-x 925 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
#
#  This file will test how to build readline support into ifeffit.
#  Essentially, this looks for libtermcap.a, and sets LIBTERMCAP_LIB
#  accordingly.

# where to look for termcap libs
dirnames="/usr/local/ /usr/ /sw/ /opt/ /usr/local/gnu/ /usr/gnu/ /gnu/ /"
libnames='lib64 lib'
termlibs='ncurses termcap curses'
DIR=''
LIB=''
found='n'

find_lib() {
  if [ -f $1/lib$2.a ] ; then 
       DIR=$1 
       LIB=$2
   fi	
}

for base in $dirnames; do
    for xlib in $libnames; do
      tdir=$base$xlib
      if [ -d $dir ] ; then
         for tcap in $termlibs ; do 
            find_lib $tdir $tcap
            if [ "x$DIR" != "x" ] ; then found='y'; break ; fi
         done 
         if [ "$found" = "y" ] ; then break; fi 
         find_lib $tdir/termcap termcap
         if [ "x$DIR" != "x" ] ; then found='y'; break ; fi
      fi
   done 
   if [ "$found" = "y" ] ; then break; fi 
done

echo -L$DIR -l$LIB