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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#!/usr/local/bin/perl5
#****************************************************************************
# install_hints.pl
#
# Function: Help user with termcap/terminfo tweeks for perlmenu.pm file.
#
# Version: 4.0
#
# Date: February 1997
#
# Author: Steven L. Kunz
# Networked Applications
# Iowa State University Computation Center
# Ames, IA 50011
#****************************************************************************
use Curses;
&initscr;
$method1 = $method2 = $method3 = $sim_getcap = 0;
#
# Check for "getcap"
#
eval { $ku = &getcap('ku'); };
if ($@) {
if ($] >= 5.001) {
$method1 = 1;
$sim_getcap = 1;
} else {
$method1 = 0;
$sim_getcap = 0;
}
} else {
$method1 = 1;
}
#
# Check for "tigetstr"
#
eval { $ku = &tigetstr('kcuu1'); };
if ($@) {
$method2 = 0;
} else {
$method2 = 1;
}
#
# Check for "tput"
#
eval { $ku = `tput kcuu1`; };
if ($@||$?) {
$method3 = 0;
} else {
$method3 = 1;
}
&endwin;
#
# Summarize what we found
#
$total = $method1+$method2+$method3;
if ($total) {
print "You should try one of the following methods:\n\n";
if ($method1) {
print "- Method 1 (getcap)\n";
print " (If the demo did not work you probably have a buggy getcap)\n";
if ($sim_getcap) {
print " (You need to simulate the getcap function)\n";
}
}
if ($method2) { print "- Method 2 (tigetstr)\n"; }
if ($method3) { print "- Method 3 (tput)\n"; }
} else { print "Nothing works! You probably need to install \"tput\".\n"; }
print "\nRefer to the INSTALLATION document for what to do next.\n";
|