File: configure

package info (click to toggle)
uronode 2.15-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 948 kB
  • sloc: ansic: 6,347; sh: 289; makefile: 99
file content (350 lines) | stat: -rwxr-xr-x 10,162 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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
#!/bin/sh

_sleep()
{
  [ "$NON_INTERACTIVE" = 1 ] || sleep "$@"
}

_whiptail()
{
  [ "$NON_INTERACTIVE" = 1 ] || whiptail "$@"
}

echo "Cleaning the directory for a fresh configuration..."
_sleep 2
make distclean > make.debug

[ "$ETC_DIR" ] || ETC_DIR=/etc/ax25
[ "$SBIN_DIR" ] || SBIN_DIR=/usr/sbin
[ "$BIN_DIR" ] || BIN_DIR=/usr/bin
[ "$LIB_DIR" ] || LIB_DIR=/usr/lib
[ "$DATA_DIR" ] || DATA_DIR=/usr/share
[ "$MAN_DIR" ] || MAN_DIR=/usr/share/man
[ "$VAR_DIR" ] || VAR_DIR=/var/lib/ax25

echo "Welcome to the configuration utility for URONode. This configure script"
echo "will very simply and easily guide you into installling URONode with as"
echo "very little trouble as possible. All you need to really do is simply"
echo "answer the following questions below properly. If you make a mistake"
echo "just break out of it (ctrl+c) and rerun ./configure. Let's get started!"
_sleep 1
echo " "
_sleep 1
echo -n "you need gcc to build URONode: "
GCC=`which gcc`
_sleep 2
if [ -e "$GCC" ]
   then
   echo -n "saw $GCC... "
   _sleep 1
   echo "GCC found! Congratulations!!"
else
   echo "gcc not found!"
   echo " "
   echo "You need this compiler to build URONode."
   echo "Please install gcc, and rerun this ./configure script."
   echo "If you have a copy of gcc installed, please insure you have a"
   echo "symlink by typing as root: ln -s /usr/bin/gcc-#.## /usr/bin/gcc"
   echo "and rerun ./configure to continue."
   exit 1
fi
_sleep 1
echo -n "you need make to make URONode: "
MAKE=`which make`
_sleep 2
if [ -e "$MAKE" ]
   then
   echo -n "saw $MAKE... "
   _sleep 1
   echo "MAKE found!"
else
   echo "make not found!"
   echo " "
   echo "You need this utility to make URONode."
   echo "Please install make, and rerun this ./configure script."
   echo "If you have a copy of make installed, please insure you have"
   echo "it in your path and rerun ./configure to continue."
   exit 1
fi

echo -n "Your machine architecture is: "
_sleep 1
ARCH=`uname -m`
echo $ARCH
_sleep 1
echo -n "Checking for the existence of the Zlib headers... "
ZLIB=""
HAVEZLIB="#undef HAVE_ZLIB"
for zlibdir in /usr/include /usr/local/include
do
	if [ -f $zlibdir/zlib.h ]
	then
		echo $zlibdir/zlib.h
		ZLIB="-lz"
		HAVEZLIB="#define HAVE_ZLIB	1"
	fi
done
if [ -z "$ZLIB" ]
then
	echo "not found."
	echo "            Without Zlib Node will lack compression support"
	echo "            See INSTALL for more information."
	echo
fi

# Global protocol definition symbols for programmers that want to conditionally
# compile
	HAVEAX25="#undef HAVE_AX25"
	HAVEFLEX="#undef HAVE_FLEX"
	FLEXNET=" "
	IN="#"
	HAVENETROM="#undef HAVE_NETROM"
	HAVEROSE="#undef HAVE_ROSE"
	HAVEMHEARD="#undef HAVE_JHEARD"
	HAVEAUTOROUTE="#undef HAVE_AUTOROUTE"
	HAVETCPIP="#undef HAVE_TCPIP"
	HAVEMOTD="#undef HAVE_MOTD"
	MOTDPATH=
#	echo -n "Include support for the AX.25 protocol ? [Y/n]: "; read answer
#	if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
	if [ "$NON_INTERACTIVE" = 1 ]
	then
		echo "$@" | grep -vqe "--without-ax25"
	else
		whiptail --title "URONode Options:" --yesno "Support AX25?" 7 22
	fi
	if [ $? -ne 1 ]
	then
		HAVEAX25="#define HAVE_AX25	1"
	fi
	#
#        echo -n "Include support for the FlexNet protocol ? [Y/n]: "; read answer
#        if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]

	if [ "$NON_INTERACTIVE" = 1 ]
	then
		echo "$@" | grep -vqe "--without-flexnet"
	else
		whiptail --title "URONode Options:" --yesno "Support FlexNet?" 7 22
	fi
	if [ $? -ne 1 ]
        then
                HAVEAX25="#define HAVE_AX25	1"
		HAVEFLEX="#define HAVE_FLEX	1"
		FLEXNET="flexd"
		IN=""
        fi
        # 
#	echo -n "Include support for the NetRom protocol ? [Y/n]: "; read answer
#	if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
	if [ "$NON_INTERACTIVE" = 1 ]
	then
		echo "$@" | grep -vqe "--without-netrom"
	else
		whiptail --title "URONode Options:" --yesno "Support NetRom?" 7 22
	fi
	if [ $? -ne 1 ]
	then
		HAVEAX25="#define HAVE_AX25	1"
		HAVENETROM="#define HAVE_NETROM	1"
	fi
	#
#	echo -n "Include support for the Rose protocol ? [Y/n]: "; read answer
#	if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
	if [ "$NON_INTERACTIVE" = 1 ]
	then
		echo "$@" | grep -vqe "--without-rose"
	else
		whiptail --title "URONode Options:" --yesno "Support ROSE?" 7 22
	fi
	if [ $? -ne 1 ]
	then
		HAVEAX25="#define HAVE_AX25	1"
		HAVEROSE="#define HAVE_ROSE	1"
	fi
	#
#	echo -n "Include support for MHeard ports listen ? [Y/n]: "; read answer
#	if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
	if [ "$NON_INTERACTIVE" = 1 ]
	then
		echo "$@" | grep -vqe "--without-mheard"
	else
		whiptail --title "URONode Options:" --yesno "Support MHeard?" 7 22
	fi
	if [ $? -ne 1 ]
	then
		HAVEAX25="#define HAVE_AX25	1"
		HAVEMHEARD="#define HAVE_JHEARD	1"
	fi
	#
#       echo -n "Include support for ax25 AutoRouter ? [Y/n]: "; read answer
#       if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
        if [ "$NON_INTERACTIVE" = 1 ]
        then
                echo "$@" | grep -vqe "--without-autorouter"
        else
                whiptail --title "URONode Options:" --yesno "Support AutoRouter?" 7 23
        fi
        if [ $? -ne 1 ]
        then
                HAVEAX25="#define HAVE_AX25	1"
                HAVEAUTOROUTE="#define HAVE_AUTOROUTE	1"
        fi
        #

#	echo -n "Include support for TCP/IP functions ? [Y/n]: "; read answer
#	if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
	if [ "$NON_INTERACTIVE" = 1 ]
	then
		echo "$@" | grep -vqe "--without-tcpip"
	else
		whiptail --title "URONode Options:" --yesno "Support TCP/IP?" 7 22
	fi
	if [ $? -ne 1 ]
	then
		HAVETCPIP="#define HAVE_TCPIP	1"
		HAVEMOTD="#define HAVEMOTD"
		MOTDPATH='"/etc/ax25/uronode.motd"'
	fi

echo "Creating Makefile"

sed -e  "s~@FLEXNET@~$FLEXNET~g; \
	 s~@IN@~$IN~g" <Makefile.in > Makefile

echo "Creating Makefile.include"

sed -e "s~@ARCH@~$ARCH~g; \
	s~@ETC_DIR@~$ETC_DIR~g; \
	s~@LIB_DIR@~$LIB_DIR~g; \
	s~@SBIN_DIR@~$SBIN_DIR~g; \
	s~@BIN_DIR@~$BIN_DIR~g; \
	s~@VAR_DIR@~$VAR_DIR~g; \
	s~@DATA_DIR@~$DATA_DIR~g; \
	s~@MAN_DIR@~$MAN_DIR~g; \
	s~@ZLIB@~$ZLIB~g" <Makefile.include.in >Makefile.include

echo "Creating config.h"

sed -e "s~@ETC_DIR@~$ETC_DIR~g; \
	s~@LIB_DIR@~$LIB_DIR~g; \
	s~@SBIN_DIR@~$SBIN_DIR~g; \
	s~@BIN_DIR@~$BIN_DIR~g; \
	s~@VAR_DIR@~$VAR_DIR~g; \
	s~@MAN_DIR@~$MAN_DIR~g; \
	s~@DATA_DIR@~$DATA_DIR~g; \
	s~@HAVEAX25@~$HAVEAX25~g; \
	s~@HAVEFLEX@~$HAVEFLEX~g; \
	s~@HAVENETROM@~$HAVENETROM~g; \
	s~@HAVEROSE@~$HAVEROSE~g; \
	s~@HAVEMHEARD@~$HAVEMHEARD~g; \
	s~@HAVEAUTOROUTE@~$HAVEAUTOROUTE~g; \
	s~@HAVETCPIP@~$HAVETCPIP~g; \
	s~@HAVEMOTD@~$HAVEMOTD~g; \
	s~@MOTDPATH@~$MOTDPATH~g; \
	s~@HAVEZLIB@~$HAVEZLIB~g" <config.h.in >config.h

echo "Creating dependancy files..."
make depend > /dev/null 2>&1
echo "Configuration successful!!"
_sleep 1
echo "about the authors..."
_sleep 3
echo "URONode is a combined effort of years worth of work. Those who's code"
echo "is included in this flavor of a linux based node are:"
_sleep 1
echo "Brian Rogers N1URO (current maintainer), "
_sleep 1
echo "Marius Petrescu YO2LOJ (current team member),"
_sleep 1
echo "Bob Tenty VE3TOK (current team member),"
_sleep 1
echo "Stefano Noferi IZ5AWZ (AWZNode)"
_sleep 1
echo -n "Tomi Manninen OH2BNS, "
_sleep 1
echo -n "Alan Cox GW4PTS, "
_sleep 1
echo "and Roy Van Zundert PE1RJA"
echo ""
_sleep 1
echo "Special thanks to: Morgan, sm6tky for his security report"
echo "and Barry K2MF for his input on some of my routines and supplying"
echo "some source code. If you did not use interactive mode, you must"
echo "run make manually."
_sleep 1
echo ""
#echo -n "Shall I run the make command for you ? [Y/n]: "
	_whiptail --title "Shall I make URONode?" --yesno "Yes to make or No to exit" 7 30 
#	if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
	if [ "$NON_INTERACTIVE" != 1 -a $? -ne 1 ]
        then
#		echo "Making URONode! Please be patient."
#		_sleep 1
#		echo "compile errors will be in make.debug."
#		echo ""
#		_sleep 1
#		echo "You may not see anything until the process is complete..."
		_whiptail --title "Making URONODE..." --msgbox "Making. Check make.debug for errors. Hit OK to continue. You may not see anything for a minute..." 10 45
		make >> make.debug
		echo "let's check for binary errors..."
		_sleep 1
		echo -n "nodeusers: "
		_sleep 1
		if [ -x ./nodeusers ]; then
			echo "SUCCESS!"
		else
			echo "FAILED!"
		fi
		_sleep 1
		echo -n "uronode:   "
		_sleep 1
		if [ -x ./uronode ]; then
			echo "SUCCESS!"
		else
			echo "FAILED!"
		fi
		_sleep 1
		echo -n "axdigi:    "
		_sleep 1
		if [ -x ./axdigi ]; then
			echo "SUCCESS!"
		fi
		 _sleep 1
                echo -n "calibrate: "
                _sleep 1
                if [ -x ./calibrate ]; then
                        echo "SUCCESS!"
                fi

		_sleep 1
		echo -n "flexd:     "
		_sleep 1
		if [ -x ./flexd ]; then
			echo "SUCCESS!"
		_sleep 1
		else
			echo "FAILED! - perhaps you didn't want flexnet?"
			echo "This is not an error if you chose NO to flexnet."
			echo "This only means the flexnet daemon binary was not found."
			echo ""
			echo "Process complete!"
			echo ""
		fi
		_sleep 1
		_whiptail --title "URONode" --msgbox "Check the file make.debug if you had errors. If no errors, type: make install (new install) or make upgrade (existing install) and edit your files in /usr/local/etc/ax25/\n\n**WARNING: if you haven't already, add the following to your startup scripts:\n/usr/local/sbin/axdigi & \nto insure cross-port digipeating.\n\nFor help and release news join the forum at\nhttps://www.n1uro.net/forum\n\nEnjoy URONode - 73 de Brian N1URO" 20 50

#		echo "Check the file make.debug if you had errors."
#		echo "If no errors, type: make install or make upgrade" 
#		echo "and edit your files in /etc/ax25/"
#		echo "**WARNING: if you haven't already, add the following to your"
#		echo "startup scripts:"
#		echo "/usr/sbin/axdigi &"
#		echo "to insure cross-port digipeating."
#		echo ""
#		echo "For support and release news join the forum"
#		echo "at https://www.n1uro.net/forum"
#		echo ""
#		echo "Enjoy URONode! 73 de N1URO."
        fi
exit 0