forked from newville/ifeffit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiconf_term
executable file
·48 lines (42 loc) · 1.06 KB
/
iconf_term
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
40
41
42
43
44
45
46
47
#!/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 lib/i386-linux-gnu'
termlibs='ncurses termcap curses'
DIR=''
LIB=''
found='n'
find_lib() {
if [ -f $1/lib$2.dylib ] ; then
DIR=$1
LIB=$2
fi
if [ -f $1/lib$2.a ] ; then
DIR=$1
LIB=$2
fi
if [ -f $1/lib$2.so ] ; 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