-
Notifications
You must be signed in to change notification settings - Fork 1
/
Configure
118 lines (101 loc) · 2.18 KB
/
Configure
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/sh
# pathetic attempt at a configure utility -- bjd
# for one thing it doesn't check if what you specify exists in those
# places -- don't worry, you'll find out soon enough... :^)
#set -x
rm -f Makefile config.h *.o
CC=gcc
echo
echo
echo "Compile sysline for aout or ELF? [ELF]"
echo "1) ELF"
echo "2) aout" # aout-phaseout
read choice
echo
case "$choice" in
2) CC="gcc -bi486-linuxaout # aout"
LDFLAGS="-L/usr/i486-linuxaout/lib " ;;
*) CC="gcc # ELF is assumed" ;;
esac
echo "...using ${CC}"
ask_LIBPATH()
{
#LDFLAGS="${LDFLAGS}"
echo -n "Path lib$1.a? [$2] "
read choice
echo
case "$choice" in
"") ;;
*) LDFLAGS="${LDFLAGS} -L$choice" ;;
esac
}
ask_INCPATH()
{
CFLAGS=-I$2
echo -n "Path for $1 include files? [$2] "
read choice
echo
case "$choice" in
"") ;;
*) CFLAGS=-I$choice ;;
esac
}
echo
echo "Compile sysline for the termcap or the terminfo database? [termcap]"
echo "1) termcap"
echo "2) terminfo (ncurses)"
read choice
case "$choice" in
2) echo -e "...using terminfo (ncurses)\n"
TERMLIB=-lncurses
ask_LIBPATH "ncurses" "/usr/local/lib"
ask_INCPATH "ncurses" "/usr/include/ncurses"
;;
*) echo -e "...using termcap\n"
TERMLIB=-ltermcap
;;
esac
echo
echo "What kind of terminal is sysline going to be used on? [2]"
echo "1) ONLY on the Linux console or other iso-8859-1 terminals"
echo "2) Non-iso-8859-1 terminals (including kterm)"
read choice
case "$choice" in
1) ARROWS='"\\273"'
echo "...using iso-8859-1 guillemet to indicate message body"
;;
*) ARROWS='"->"'
echo "...using traditional ASCII arrow to indicate message body"
;;
esac
# make config.h
echo "...creating config.h"
sed -e '1,$s/"->"/'"$ARROWS"'/g' < config.h.in > config.h
if [ ! "$TERMLIB" = "-ltermcap" ]
then
cat <<- EOT >>config.h
/* terminfo */
#define TERMINFO
#include <term.h>
EOT
fi
# make Makefile
if [ "$TERMLIB" = "-ltermcap" ]
then
cat <<- EOT >>config.h
/* curses */
/*#include <curses.h>*/
EOT
else
cat <<- EOT >>config.h
/* ncurses */
#include <ncurses.h>
#include <unctrl.h>
EOT
fi
echo -e "...creating Makefile\n"
sed "s|@CC@|${CC}|
s|@CFLAGS@|${CFLAGS}|
s|@LDFLAGS@|${LDFLAGS}|
s|@COMMENT@|${COMMENT}|
s|@TERMLIB@|${TERMLIB}|" <Makefile.in >Makefile