]> jfr.im git - irc/unrealircd/unrealircd.git/blob - Config
Updates for new repository name of test framework.
[irc/unrealircd/unrealircd.git] / Config
1 #!/bin/sh
2 #
3 # Config script for UnrealIRCd
4 # (C) 2001-2019 The UnrealIRCd Team
5 #
6 # This configure script is free software; the UnrealIRCd Team gives
7 # unlimited permission to copy, distribute and modify as long as the
8 # copyright headers stay intact
9 #
10 #
11 # Rewritten completely to be an interface to autoconf by codemastr
12 # This was inspired by the config by Michael Graff (explorer@flame.org)
13 # but was written from scratch
14
15 # In order to be faster than the old Config, this assumes that all information
16 # in the cache file is valid and therefore doesn't check it, so if you messed with
17 # default values thats your problem :P
18
19 # some bits edited by baafie on March 17 2004, every change marked.
20
21
22 RUN_CONFIGURE () {
23 ARG=" "
24
25 if [ -z "$BINDIR" -o -z "$DATADIR" -o -z "$CONFDIR" -o -z "$MODULESDIR" -o -z "$LOGDIR" -o -z "$CACHEDIR" -o -z "$DOCDIR" -o -z "$TMPDIR" -o -z "$LIBDIR" ]; then
26 echo "Sorry './Config -quick' cannot be used because your 'config.settings'"
27 echo "file either does not exist or is from an old UnrealIRCd version"
28 echo "(older than version 4.0.8)."
29 echo ""
30 echo "Please run './Config' without -quick and answer all questions."
31 echo ""
32 exit
33 fi
34
35
36 mkdir -p $TMPDIR
37
38 # Do this even if we're not in advanced mode
39 if [ "$SHOWLISTMODES" = "1" ] ; then
40 ARG="$ARG--with-showlistmodes "
41 fi
42 if [ "$ADVANCED" = "1" ] ; then
43 if [ "$TOPICNICKISNUH" = "1" ] ; then
44 ARG="$ARG--with-topicisnuhost "
45 fi
46 if [ "$SHUNNOTICES" = "1" ] ; then
47 ARG="$ARG--with-shunnotices "
48 fi
49 if [ "$NOOPEROVERRIDE" = "1" ] ; then
50 ARG="$ARG--with-no-operoverride "
51 fi
52 if [ "$DISABLEUSERMOD" = "1" ] ; then
53 ARG="$ARG--with-disableusermod "
54 fi
55 if [ "$OPEROVERRIDEVERIFY" = "1" ] ; then
56 ARG="$ARG--with-operoverride-verify "
57 fi
58 if [ "$DISABLEEXTBANSTACKING" = "1" ]; then
59 ARG="$ARG--with-disable-extendedban-stacking ";
60 fi
61 fi
62 if test x"$SSLDIR" = "x" ; then
63 ARG="$ARG--enable-ssl "
64 else
65 ARG="$ARG--enable-ssl=$SSLDIR "
66 fi
67 if [ "$REMOTEINC" = "1" ] ; then
68 ARG="$ARG--enable-libcurl=$CURLDIR "
69 fi
70 if [ "$PREFIXAQ" != "1" ]; then
71 ARG="$ARG--disable-prefixaq "
72 fi
73 if [ "$MAXCONNECTIONS_REQUEST" != "auto" ]; then
74 ARG="$ARG--with-maxconnections=$MAXCONNECTIONS_REQUEST "
75 fi
76
77 ARG="$ARG--with-bindir=$BINDIR "
78 ARG="$ARG--with-datadir=$DATADIR "
79 ARG="$ARG--with-pidfile=$DATADIR/unrealircd.pid "
80 ARG="$ARG--with-confdir=$CONFDIR "
81 ARG="$ARG--with-modulesdir=$MODULESDIR "
82 ARG="$ARG--with-logdir=$LOGDIR "
83 ARG="$ARG--with-cachedir=$CACHEDIR "
84 ARG="$ARG--with-docdir=$DOCDIR "
85 ARG="$ARG--with-tmpdir=$TMPDIR "
86 ARG="$ARG--with-privatelibdir=$LIBDIR "
87 ARG="$ARG--with-scriptdir=$BASEPATH "
88 ARG="$ARG--with-nick-history=$NICKNAMEHISTORYLENGTH "
89 ARG="$ARG--with-sendq=$MAXSENDQLENGTH "
90 ARG="$ARG--with-permissions=$DEFPERM "
91 ARG="$ARG--enable-dynamic-linking "
92 ARG="$ARG $EXTRAPARA "
93 CONF="./configure $ARG"
94 # remove possibly old instances of curl in ~/unrealircd/lib/
95 rm -f $LIBDIR/*curl* 1>/dev/null 2>&1
96 # Ensure we install curl even if someone does ./Config -quick...
97 if [ "x$CURLDIR" = "x$UNREALCWD/extras/curl" ]; then
98 INSTALLCURL=1
99 fi
100 if [ "x$INSTALLCURL" = "x1" ]; then
101 extras/curlinstall "$LIBDIR" || exit 1
102 fi
103 echo $CONF
104 $CONF || exit 1
105 cd "$UNREALCWD"
106 if [ "$QUICK" != "1" ] ; then
107 if [ ! -f $CONFDIR/ssl/server.cert.pem ]; then
108 export OPENSSLPATH
109 TEST=""
110 while [ -z "$TEST" ] ; do
111 if [ "$GENCERTIFICATE" = "1" ] ; then
112 TEST="Yes"
113 else
114 TEST="No"
115 fi
116 echo ""
117 echo "Do you want to generate an SSL certificate for the IRCd?"
118 echo "Only answer No if you already have one."
119 echo $n "[$TEST] -> $c"
120 read cc
121 if [ -z "$cc" ] ; then
122 cc=$TEST
123 fi
124 case "$cc" in
125 [Yy]*)
126 GENCERTIFICATE="1"
127 ;;
128 [Nn]*)
129 GENCERTIFICATE=""
130 ;;
131 *)
132 echo ""
133 echo "You must enter either Yes or No"
134 TEST=""
135 ;;
136 esac
137 done
138 if [ "$GENCERTIFICATE" = 1 ]; then
139 make pem
140 echo "Certificate created successfully."
141 sleep 1
142 else
143 echo "Ok, not generating SSL certificate. Make sure that the certificate and key"
144 echo "are installed in conf/ssl/server.crt.pem and conf/ssl/server.key.pem prior to starting the IRCd."
145 fi
146 else
147 echo "SSL certificate exists in $CONFDIR/ssl/server.cert.pem, no need to regenerate."
148 fi
149 fi
150
151 # Silently force a 'make clean' as otherwise part (or whole) of the
152 # compiled source could be using different settings than the user
153 # just requested when re-running ./Config.
154 make clean 1>/dev/null 2>&1
155 }
156
157 RUN_ADVANCED () {
158 TEST=""
159 while [ -z "$TEST" ] ; do
160 if [ "$SHOWLISTMODES" = "1" ] ; then
161 TEST="Yes"
162 else
163 TEST="No"
164 fi
165 echo ""
166 echo "Do you want to show the modes a channel has set in the /list output?"
167 echo $n "[$TEST] -> $c"
168 read cc
169 if [ -z "$cc" ] ; then
170 cc=$TEST
171 fi
172 case "$cc" in
173 [Yy]*)
174 SHOWLISTMODES="1"
175 ;;
176 [Nn]*)
177 SHOWLISTMODES=""
178 ;;
179 *)
180 echo ""
181 echo "You must enter either Yes or No"
182 TEST=""
183 ;;
184 esac
185 done
186
187 TEST=""
188 while [ -z "$TEST" ] ; do
189 if [ "$TOPICNICKISNUH" = "1" ] ; then
190 TEST="Yes"
191 else
192 TEST="No"
193 fi
194 echo ""
195 echo "Do you want the /topic command to show the nick!user@host of the person"
196 echo "who set the topic, rather than just the nickname?"
197 echo $n "[$TEST] -> $c"
198 read cc
199 if [ -z "$cc" ] ; then
200 cc=$TEST
201 fi
202 case "$cc" in
203 [Yy]*)
204 TOPICNICKISNUH="1"
205 ;;
206 [Nn]*)
207 TOPICNICKISNUH=""
208 ;;
209 *)
210 echo ""
211 echo "You must enter either Yes or No"
212 TEST=""
213 ;;
214 esac
215 done
216
217 TEST=""
218 while [ -z "$TEST" ] ; do
219 if [ "$SHUNNOTICES" = "1" ] ; then
220 TEST="Yes"
221 else
222 TEST="No"
223 fi
224 echo ""
225 echo "Should UnrealIRCd notify a user when they are no longer shunned?"
226 echo $n "[$TEST] -> $c"
227 read cc
228 if [ -z "$cc" ] ; then
229 cc=$TEST
230 fi
231 case "$cc" in
232 [Yy]*)
233 SHUNNOTICES="1"
234 ;;
235 [Nn]*)
236 SHUNNOTICES=""
237 ;;
238 *)
239 echo ""
240 echo "You must enter either Yes or No"
241 TEST=""
242 ;;
243 esac
244 done
245
246 TEST=""
247 while [ -z "$TEST" ] ; do
248 if [ "$NOOPEROVERRIDE" = "1" ] ; then
249 TEST="Yes"
250 else
251 TEST="No"
252 fi
253 echo ""
254 echo "Do you want to disable oper override?"
255 echo $n "[$TEST] -> $c"
256 read cc
257 if [ -z "$cc" ] ; then
258 cc=$TEST
259 fi
260 case "$cc" in
261 [Yy]*)
262 NOOPEROVERRIDE="1"
263 ;;
264 [Nn]*)
265 NOOPEROVERRIDE=""
266 ;;
267 *)
268 echo ""
269 echo "You must enter either Yes or No"
270 TEST=""
271 ;;
272 esac
273 done
274
275 TEST=""
276 while [ -z "$TEST" ] ; do
277 if [ "$DISABLEUSERMOD" = "1" ] ; then
278 TEST="Yes"
279 else
280 TEST="No"
281 fi
282 echo ""
283 echo "Do you want to disable /sethost, /setident, /chgname,"
284 echo "/chghost, and /chgident?"
285 echo $n "[$TEST] -> $c"
286 read cc
287 if [ -z "$cc" ] ; then
288 cc=$TEST
289 fi
290 case "$cc" in
291 [Yy]*)
292 DISABLEUSERMOD="1"
293 ;;
294 [Nn]*)
295 DISABLEUSERMOD=""
296 ;;
297 *)
298 echo ""
299 echo "You must enter either Yes or No"
300 TEST=""
301 ;;
302 esac
303 done
304
305 TEST=""
306 while [ -z "$TEST" ] ; do
307 if [ "$OPEROVERRIDEVERIFY" = "1" ] ; then
308 TEST="Yes"
309 else
310 TEST="No"
311 fi
312 echo ""
313 echo "Do you want to require opers to /invite themselves into a +s or +p channel?"
314 echo $n "[$TEST] -> $c"
315 read cc
316 if [ -z "$cc" ] ; then
317 cc=$TEST
318 fi
319 case "$cc" in
320 [Yy]*)
321 OPEROVERRIDEVERIFY="1"
322 ;;
323 [Nn]*)
324 OPEROVERRIDEVERIFY=""
325 ;;
326 *)
327 echo ""
328 echo "You must enter either Yes or No"
329 TEST=""
330 ;;
331 esac
332 done
333
334 TEST=""
335 while [ -z "$TEST" ] ; do
336 if [ "$DISABLEEXTBANSTACKING" = "1" ] ; then
337 TEST="Yes"
338 else
339 TEST="No"
340 fi
341 echo ""
342 echo "Do you want to disable extended ban stacking (~q:~c:#test, etc) support?"
343 echo $n "[$TEST] -> $c"
344 read cc
345 if [ -z "$cc" ] ; then
346 cc=$TEST
347 fi
348 case "$cc" in
349 [Yy]*)
350 DISABLEEXTBANSTACKING="1"
351 ;;
352 [Nn]*)
353 DISABLEEXTBANSTACKING="0"
354 ;;
355 *)
356 echo ""
357 echo "You must enter either Yes or No"
358 TEST=""
359 ;;
360 esac
361 done
362
363 }
364 c=""
365 n=""
366 UNREALCWD="`pwd`"
367 BASEPATH="$HOME/unrealircd"
368 DEFPERM="0600"
369 SSLDIR=""
370 NICKNAMEHISTORYLENGTH="2000"
371 MAXSENDQLENGTH="3000000"
372 MAXCONNECTIONS_REQUEST="auto"
373 REMOTEINC=""
374 CURLDIR=""
375 PREFIXAQ="1"
376 SHOWLISTMODES="1"
377 TOPICNICKISNUH=""
378 SHUNNOTICES=""
379 NOOPEROVERRIDE=""
380 DISABLEUSERMOD=""
381 OPEROVERRIDEVERIFY=""
382 DISABLEEXTBANSTACKING=""
383 GENCERTIFICATE="1"
384 EXTRAPARA=""
385 if [ "`eval echo -n 'a'`" = "-n a" ] ; then
386 c="\c"
387 else
388 n="-n"
389 fi
390
391 date|grep 2019 1>/dev/null 2>&1
392 if [ "$?" -ne 0 ]; then
393 echo "*** WARNING ***"
394 echo "UnrealIRCd 4.x will no longer be supported after December 31, 2020."
395 echo "You should upgrade to UnrealIRCd 5 before that date."
396 echo "See https://www.unrealircd.org/docs/UnrealIRCd_4_EOL"
397 echo $n . $c
398 sleep 1
399 echo $n . $c
400 sleep 1
401 echo $n . $c
402 echo ""
403 sleep 1
404 echo "Press ENTER to continue"
405 read xyz
406 fi
407
408 #parse arguments
409 NOCACHE=""
410 IMPORTEDSETTINGS=""
411 NOINTRO=""
412 QUICK=""
413 CLEAN=""
414 ADVANCED=""
415 while [ $# -ge 1 ] ; do
416 if [ $1 = "--help" ] ; then
417 echo "Config utility for UnrealIRCd"
418 echo "-----------------------------"
419 echo "Syntax: ./Config [options]"
420 echo "-nocache Ignore settings saved in config.settings"
421 echo "-nointro Skip intro (release notes, etc)"
422 echo "-quick Skip questions, go straight to configure"
423 echo "-advanced Include additional advanced questions"
424 echo "-clean Clean ./configure cache"
425 exit 0
426 elif [ $1 = "-nocache" ] ; then
427 NOCACHE="1"
428 elif [ $1 = "-nointro" ] ; then
429 NOINTRO="1"
430 elif [ $1 = "-quick" -o $1 = "-q" ] ; then
431 QUICK="1"
432 echo "running quick config"
433 if [ -f "config.settings" ] ; then
434 . ./config.settings
435 fi
436 RUN_CONFIGURE
437 cd "$UNREALCWD"
438 exit 0
439 elif [ $1 = "-clean" -o $1 = "-C" ] ; then
440 CLEAN="1"
441 elif [ $1 = "-advanced" ] ; then
442 PREADVANCED="1"
443 fi
444 shift 1
445 done
446
447 if [ "$PREADVANCED" = "1" ] ; then
448 ADVANCED="1"
449 elif [ "$ADVANCED" = "1" ]; then
450 ADVANCED=""
451 fi
452
453 if [ -n "$CLEAN" ] ; then
454 rm -f config.cache
455 fi
456
457 clear
458
459 if [ -f ".CHANGES.NEW" -a -z "$NOINTRO" ] ; then
460 more .CHANGES.NEW
461 echo $n "[Enter to continue]"
462 read cc
463 clear
464 fi
465 if [ -f "doc/RELEASE-NOTES" -a -z "$NOINTRO" ] ; then
466 more doc/RELEASE-NOTES
467 echo $n "[Enter to continue]"
468 read cc
469 clear
470 fi
471
472 echo "We will now ask you a number of questions."
473 echo "You can just press ENTER to accept the defaults!"
474 echo ""
475
476 if [ -z "$NOCACHE" ] ; then
477 # This needs to be updated each release so auto-upgrading works for settings, modules, etc!!:
478 UNREALRELEASES="unrealircd-4.2.3-rc1 unrealircd-4.2.2 unrealircd-4.2.2-rc2 unrealircd-4.2.2-rc1 unrealircd-4.2.1.1 unrealircd-4.2.1 unrealircd-4.2.1-rc1 unrealircd-4.2.0 unrealircd-4.0.19-rc2 unrealircd-4.0.19-rc1 unrealircd-4.0.18 unrealircd-4.0.18-rc2 unrealircd-4.0.18-rc1 unrealircd-4.0.17 unrealircd-4.0.17-rc1 unrealircd-4.0.16.1 unrealircd-4.0.16 unrealircd-4.0.15 unrealircd-4.0.14 unrealircd-4.0.14-rc1 unrealircd-4.0.13 unrealircd-4.0.13-rc1 unrealircd-4.0.12.1 unrealircd-4.0.12"
479 if [ -f "config.settings" ]; then
480 . ./config.settings
481 else
482 # Try to load a previous config.settings
483 for x in $UNREALRELEASES
484 do
485 if [ -f ../$x/config.settings ]; then
486 IMPORTEDSETTINGS="../$x"
487 break
488 fi
489 done
490 echo "If you have previously installed UnrealIRCd on this shell then you can specify a"
491 echo "directory here so I can import the build settings and third party modules"
492 echo "to make your life a little easier."
493 if [ ! -z "$IMPORTEDSETTINGS" ]; then
494 echo "Found previous installation in: $IMPORTEDSETTINGS."
495 echo "You can enter a different path or type 'none' if you don't want to use it."
496 echo "Just press Enter to accept the default settings."
497 else
498 echo "If you install UnrealIRCd for the first time on this shell, then just hit Enter";
499 fi
500
501 TEST="$IMPORTEDSETTINGS"
502 echo $n "[$TEST] -> $c"
503 read cc
504 if [ -z "$cc" ]; then
505 IMPORTEDSETTINGS="$TEST"
506 else
507 IMPORTEDSETTINGS="$cc"
508 fi
509 if [ "$IMPORTEDSETTINGS" = "none" ]; then
510 IMPORTEDSETTINGS=""
511 fi
512 if [ "$IMPORTEDSETTINGS" != "" ]; then
513 if [ ! -f $IMPORTEDSETTINGS/config.settings ]; then
514 echo "Directory $IMPORTEDSETTINGS does not exist or does not contain a config.settings file"
515 exit
516 fi
517 # Actually load the settings
518 . $IMPORTEDSETTINGS/config.settings
519 # Copy over 3rd party modules (also deals with 0 file cases, hence the silly looking code)
520 for f in $IMPORTEDSETTINGS/src/modules/third/*.c
521 do
522 [ -e "$f" ] && cp $f src/modules/third/
523 done
524 fi
525 fi
526 # If we just imported settings and the curl dir is set to
527 # something like /home/xxx/unrealircd-4.x.y/extras/curl/
528 # (what we call 'local-curl') then remove this setting as
529 # it would refer to the old UnrealIRCd installation.
530 if [ ! -z "$IMPORTEDSETTINGS" ]; then
531 if echo "$CURLDIR"|grep -qi unrealircd; then
532 CURLDIR=""
533 fi
534 fi
535 fi
536
537 TEST="$BASEPATH"
538 echo ""
539 echo "In what directory do you want to install UnrealIRCd?"
540 echo "(Note: UnrealIRCd 4 will need to be installed somewhere."
541 echo " If this directory does not exist it will be created.)"
542 echo $n "[$TEST] -> $c"
543 read cc
544 if [ -z "$cc" ] ; then
545 BASEPATH=$TEST
546 else
547 BASEPATH=`eval echo $cc` # modified
548 fi
549 if [ "$BASEPATH" = "$UNREALCWD" ]; then
550 echo ""
551 echo "ERROR: The installation directory cannot be the same as the directory"
552 echo " containing the source code ($UNREALCWD)."
553 echo " HINT: Usually the directory containing the source is $HOME/unrealircd-4.x.y"
554 echo " and the installation directory you would need to enter is $HOME/unrealircd"
555 exit 1
556 fi
557
558 # TODO: For -advanced we could prompt the user.
559 BINDIR="$BASEPATH/bin"
560 DATADIR="$BASEPATH/data"
561 CONFDIR="$BASEPATH/conf"
562 MODULESDIR="$BASEPATH/modules"
563 LOGDIR="$BASEPATH/logs"
564 CACHEDIR="$BASEPATH/cache"
565 DOCDIR="$BASEPATH/doc"
566 TMPDIR="$BASEPATH/tmp"
567 LIBDIR="$BASEPATH/lib"
568
569 TEST=""
570 while [ -z "$TEST" ] ; do
571 TEST="$DEFPERM"
572 echo ""
573 echo "What should the default permissions for your configuration files be? (Set this to 0 to disable)"
574 echo "It is strongly recommended that you use 0600 to prevent unwanted reading of the file"
575 echo $n "[$TEST] -> $c"
576 read cc
577 if [ -z "$cc" ] ; then
578 DEFPERM=$TEST
579 break
580 fi
581 case "$cc" in
582 [0-9]*)
583 DEFPERM="$cc"
584 ;;
585 *)
586 echo ""
587 echo "You must enter a number"
588 TEST=""
589 ;;
590 esac
591
592 done
593
594
595
596
597 echo ""
598 echo "If you want, you can manually enter the path to OpenSSL/LibreSSL here."
599 echo "In most cases you can leave this blank and it will be detected automatically."
600
601 if [ -z "$SSLDIR" ]; then
602 uname|grep -q Darwin
603 if [ "$?" = 0 ]; then
604 echo "Looks like you're on a Mac - El Capitan and higher require"
605 echo "a 3rd party OpenSSL installation. We recommend using homebrew"
606 echo "to install OpenSSL, but you may install it any other way as well."
607 echo "We are selecting the default homebrew OpenSSL path - but you can"
608 echo "change it to another path if you have installed OpenSSL another way"
609 SSLDIR="/usr/local/opt/openssl/"
610 fi
611 fi
612
613 TEST="$SSLDIR"
614 echo $n "[$TEST] -> $c"
615 read cc
616 if [ -z "$cc" ] ; then
617 SSLDIR="$TEST"
618 else
619 SSLDIR=`eval echo $cc` # modified
620 fi
621
622 TEST=""
623 while [ -z "$TEST" ] ; do
624 if [ "$REMOTEINC" = "1" ] ; then
625 TEST="Yes"
626 else
627 TEST="No"
628 fi
629 echo ""
630 echo "Do you want to enable remote includes?"
631 echo "This allows stuff like this in your configuration file:"
632 echo "include \"http://www.somesite.org/files/opers.conf\";"
633 echo $n "[$TEST] -> $c"
634 read cc
635 if [ -z "$cc" ] ; then
636 cc=$TEST
637 fi
638 case "$cc" in
639 [Yy]*)
640 REMOTEINC="1"
641 ;;
642 [Nn]*)
643 REMOTEINC=""
644 CURLDIR=""
645 ;;
646 *)
647 echo ""
648 echo "You must enter either Yes or No"
649 TEST=""
650 ;;
651 esac
652 done
653
654 if [ "$REMOTEINC" = "1" ] ; then
655 if [ ! -d "$CURLDIR" ]; then
656 # Reset any previous CURLDIR if it doesn't exist (anymore)
657 CURLDIR=""
658 fi
659
660 INSTALLCURL="0"
661 SUGGESTCURLDIR=""
662
663 if [ -d "/usr/local/include/curl" ]; then
664 SUGGESTCURLDIR="/usr/local"
665 fi
666 if [ -d "/usr/include/curl" ]; then
667 SUGGESTCURLDIR="/usr"
668 fi
669 # This one also works for /usr/include/x86_64-linux-gnu and friends:
670 if [ -f "/usr/bin/curl-config" ]; then
671 SUGGESTCURLDIR="/usr"
672 fi
673
674 GOTASYNC=0
675 if [ "x$SUGGESTCURLDIR" != "x" ]; then
676 # Check if it's of any use: a curl without async dns (cares) hangs the entire ircd..
677 # normally this is done in ./configure but now we're forced to do it also here..
678 if "$SUGGESTCURLDIR"/bin/curl-config --features | grep -q -e AsynchDNS; then
679 GOTASYNC="1"
680 fi
681 if [ "$GOTASYNC" != "1" ]; then
682 SUGGESTCURLDIRBAD="$CURLDIR"
683 SUGGESTCURLDIR=""
684 fi
685 fi
686
687 if [ "x$CURLDIR" = "x$HOME/curl" ]; then
688 if [ "x$SUGGESTCURLDIR" != "x" ]; then
689 # I guess some people will complain about this, but if system wide cURL is available
690 # and many people have old defaults then this is much preferred:
691 echo ""
692 echo "WARNING: Your previous (potentially old) setting is to use cURL from $HOME/curl."
693 echo "However, your operating system also provides a working cURL."
694 echo "I am therefore changing the setting to: $SUGGESTCURLDIR"
695 CURLDIR="$SUGGESTCURLDIR"
696 else
697 echo ""
698 echo "WARNING: We no longer use $HOME/curl nowadays."
699 echo "Use the automatic download and install feature below."
700 CURLDIR=""
701 fi
702 fi
703
704 if [ "x$CURLDIR" = "x" ]; then
705 CURLDIR="$SUGGESTCURLDIR"
706 # NOTE: CURLDIR may still be empty after this
707
708 # System curl has no asyncdns, so install our own.
709 if [ "$GOTASYNC" != "1" ]; then
710 CURLDIR=""
711 fi
712
713 # Need to output it here, as the HOME check from above may cause this to be no longer relevant.
714 if [ "x$CURLDIR" = "x" -a "x$SUGGESTCURLDIRBAD" != "x" ]; then
715 echo "Curl library was found in $SUGGESTCURLDIRBAD, but it does not support Asynchronous DNS (not compiled with c-ares)"
716 echo "so it's of no use to us as it would stall the IRCd on REHASH."
717 fi
718 fi
719
720 # Final check
721 if [ "x$CURLDIR" != "x" ]; then
722 "$CURLDIR/bin/curl-config" --features 2>/dev/null | grep -q -e AsynchDNS
723 if [ "$?" != 0 ]; then
724 echo "Curl from $CURLDIR seems unusable ($CURLDIR/bin/curl-config does not exist)"
725 CURLDIR=""
726 fi
727 fi
728
729 if [ "x$CURLDIR" = "x" ]; then
730 # Still empty?
731 TEST=""
732 while [ -z "$TEST" ] ; do
733 TEST="Yes"
734 echo ""
735 echo "Do you want me to automatically download and install curl for you?"
736 echo $n "[$TEST] -> $c"
737 read cc
738 if [ -z "$cc" ] ; then
739 cc=$TEST
740 fi
741 case "$cc" in
742 [Yy]*)
743 INSTALLCURL="1"
744 CURLDIR="$UNREALCWD/extras/curl"
745 ;;
746 [Nn]*)
747 INSTALLCURL="0"
748 ;;
749 *)
750 echo ""
751 echo "You must enter either Yes or No"
752 TEST=""
753 ;;
754 esac
755 done
756 fi
757
758 if [ "$INSTALLCURL" != "1" ]; then
759 TEST=""
760 while [ -z "$TEST" ] ; do
761 TEST="$CURLDIR"
762 echo ""
763 echo "Specify the directory you installed libcurl to"
764 echo $n "[$TEST] -> $c"
765 read cc
766 if [ -z "$cc" ] ; then
767 cc=$TEST
768 else
769 TEST=$cc
770 CURLDIR=`eval echo $cc` # modified
771 fi
772 done
773 fi
774 fi
775
776
777 TEST=""
778 while [ -z "$TEST" ] ; do
779 if [ "$PREFIXAQ" = "1" ] ; then
780 TEST="Yes"
781 else
782 TEST="No"
783 fi
784 echo ""
785 echo "Do you want to enable prefixes for chanadmin and chanowner?"
786 echo "This will give +a the & prefix and ~ for +q (just like +o is @)"
787 echo "Supported by the major clients (mIRC, xchat, epic, eggdrop, Klient,"
788 echo "PJIRC, irssi, CGI:IRC, etc.)"
789 echo "This feature should be enabled/disabled network-wide."
790 echo $n "[$TEST] -> $c"
791 read cc
792 if [ -z "$cc" ] ; then
793 cc=$TEST
794 fi
795 case "$cc" in
796 [Yy]*)
797 PREFIXAQ="1"
798 ;;
799 [Nn]*)
800 PREFIXAQ=""
801 ;;
802 *)
803 echo ""
804 echo "You must enter either Yes or No"
805 TEST=""
806 ;;
807 esac
808 done
809
810 TEST=""
811 while [ -z "$TEST" ] ; do
812 TEST="$NICKNAMEHISTORYLENGTH"
813 echo ""
814 echo "How far back do you want to keep the nickname history?"
815 echo $n "[$TEST] -> $c"
816 read cc
817 if [ -z "$cc" ] ; then
818 NICKNAMEHISTORYLENGTH=$TEST
819 break
820 fi
821 case "$cc" in
822 [1-9]*)
823 NICKNAMEHISTORYLENGTH="$cc"
824 ;;
825 *)
826 echo ""
827 echo "You must enter a number"
828 TEST=""
829 ;;
830 esac
831 done
832
833 TEST=""
834 while [ -z "$TEST" ] ; do
835 TEST="$MAXSENDQLENGTH"
836 echo ""
837 echo "What is the maximum sendq length you wish to have?"
838 echo $n "[$TEST] -> $c"
839 read cc
840 if [ -z "$cc" ] ; then
841 MAXSENDQLENGTH=$TEST
842 break
843 fi
844 case "$cc" in
845 [1-9][0-9][0-9][0-9]*)
846 MAXSENDQLENGTH="$cc"
847 ;;
848 *)
849 echo ""
850 echo "You must enter a number greater than or equal to 1000"
851 TEST=""
852 ;;
853 esac
854 done
855
856 echo ""
857 TEST=""
858 while [ -z "$TEST" ] ; do
859 TEST="$MAXCONNECTIONS_REQUEST"
860 echo ""
861 echo "What is the maximum number of sockets (and file descriptors) that"
862 echo "UnrealIRCd may use?"
863 echo "It is recommended to leave this at the default setting 'auto',"
864 echo "which at present results in a limit of up to 8192, depending on"
865 echo "the system. When you boot UnrealIRCd later you will always see"
866 echo "the effective limit."
867 echo $n "[$TEST] -> $c"
868 read cc
869 if [ -z "$cc" ] ; then
870 MAXCONNECTIONS_REQUEST=$TEST
871 break
872 fi
873 case "$cc" in
874 auto)
875 MAXCONNECTIONS_REQUEST="$cc"
876 ;;
877 [1-9][0-9][0-9]*)
878 MAXCONNECTIONS_REQUEST="$cc"
879 ;;
880 *)
881 echo ""
882 echo "You must to enter a number greater than or equal to 100."
883 echo "Or enter 'auto' to leave it at automatic, which is recommended."
884 TEST=""
885 ;;
886 esac
887 done
888 if [ -n "$ADVANCED" ] ; then
889 RUN_ADVANCED
890 fi
891
892 TEST="$EXTRAPARA"
893 echo ""
894 echo "Would you like to pass any custom parameters to configure?"
895 echo "See \`./configure --help' and write them here:"
896 echo $n "[$TEST] -> $c"
897 read EXTRAPARA
898 if [ -z "$EXTRAPARA" ]; then
899 EXTRAPARA="$TEST"
900 fi
901
902 rm -f config.settings
903 cat > config.settings << __EOF__
904 #
905 BASEPATH="$BASEPATH"
906 BINDIR="$BINDIR"
907 DATADIR="$DATADIR"
908 CONFDIR="$CONFDIR"
909 MODULESDIR="$MODULESDIR"
910 LOGDIR="$LOGDIR"
911 CACHEDIR="$CACHEDIR"
912 DOCDIR="$DOCDIR"
913 TMPDIR="$TMPDIR"
914 LIBDIR="$LIBDIR"
915 PREFIXAQ="$PREFIXAQ"
916 MAXSENDQLENGTH="$MAXSENDQLENGTH"
917 MAXCONNECTIONS_REQUEST="$MAXCONNECTIONS_REQUEST"
918 NICKNAMEHISTORYLENGTH="$NICKNAMEHISTORYLENGTH"
919 DEFPERM="$DEFPERM"
920 SSLDIR="$SSLDIR"
921 REMOTEINC="$REMOTEINC"
922 CURLDIR="$CURLDIR"
923 SHOWLISTMODES="$SHOWLISTMODES"
924 TOPICNICKISNUH="$TOPICNICKISNUH"
925 SHUNNOTICES="$SHUNNOTICES"
926 NOOPEROVERRIDE="$NOOPEROVERRIDE"
927 DISABLEUSERMOD="$DISABLEUSERMOD"
928 OPEROVERRIDEVERIFY="$OPEROVERRIDEVERIFY"
929 DISABLEEXTBANSTACKING="$DISABLEEXTBANSTACKING"
930 GENCERTIFICATE="$GENCERTIFICATE"
931 EXTRAPARA="$EXTRAPARA"
932 ADVANCED="$ADVANCED"
933 __EOF__
934 RUN_CONFIGURE
935 cd "$UNREALCWD"
936 cat << __EOF__
937
938 _______________________________________________________________________
939 | |
940 | UnrealIRCd Compile-Time Config |
941 |_______________________________________________________________________|
942 |_______________________________________________________________________|
943 | |
944 | Now all you have to do is type 'make' and let it compile. When that's |
945 | done, you will receive other instructions on what to do next. |
946 | |
947 |_______________________________________________________________________|
948 |_______________________________________________________________________|
949 | - The UnrealIRCd Team - |
950 | |
951 | * Bram Matthys (Syzop) syzop@unrealircd.org |
952 | * Travis McArthur (Heero) heero@unrealircd.org |
953 |_______________________________________________________________________|
954 __EOF__
955