]>
jfr.im git - irc/unrealircd/unrealircd.git/blob - Config
3 # Config script for UnrealIRCd
4 # (C) 2001 The UnrealIRCd Team
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
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
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
19 # some bits edited by baafie on March 17 2004, every change marked.
24 # Do this even if we're not in advanced mode
25 if [ "$SHOWLISTMODES" = "1" ] ; then
26 ARG
="$ARG--with-showlistmodes "
28 if [ "$ADVANCED" = "1" ] ; then
29 if [ "$TOPICNICKISNUH" = "1" ] ; then
30 ARG
="$ARG--with-topicisnuhost "
32 if [ "$SHUNNOTICES" = "1" ] ; then
33 ARG
="$ARG--with-shunnotices "
35 if [ "$NOOPEROVERRIDE" = "1" ] ; then
36 ARG
="$ARG--with-no-operoverride "
38 if [ "$DISABLEUSERMOD" = "1" ] ; then
39 ARG
="$ARG--with-disableusermod "
41 if [ "$OPEROVERRIDEVERIFY" = "1" ] ; then
42 ARG
="$ARG--with-operoverride-verify "
44 if [ "$DISABLEEXTBANSTACKING" = "1" ]; then
45 ARG
="$ARG--with-disable-extendedban-stacking ";
48 if [ "$NOSPOOF" != "1" ] ; then
49 ARG
="$ARG--disable-nospoof "
51 if [ "$CRYPTOIRCD" = "1" ] ; then
52 if test x
"$SSLDIR" = "x" ; then
53 ARG
="$ARG--enable-ssl "
55 ARG
="$ARG--enable-ssl=$SSLDIR "
58 if [ "$ZIPLINKS" = "1" ] ; then
59 if test x
"$ZIPLINKSDIR" = "x" ; then
60 ARG
="$ARG--enable-ziplinks "
62 ARG
="$ARG--enable-ziplinks=$ZIPLINKSDIR "
65 if [ "$REMOTEINC" = "1" ] ; then
66 ARG
="$ARG--enable-libcurl=$CURLDIR "
68 if [ "$INET6" = "1" ] ; then
69 ARG
="$ARG--enable-inet6 "
71 if [ "$PREFIXAQ" != "1" ]; then
72 ARG
="$ARG--disable-prefixaq "
74 ARG
="$ARG--with-listen=$LISTEN_SIZE "
75 ARG
="$ARG--with-dpath=$DPATH "
76 ARG
="$ARG--with-spath=$SPATH "
77 ARG
="$ARG--with-nick-history=$NICKNAMEHISTORYLENGTH "
78 ARG
="$ARG--with-sendq=$MAXSENDQLENGTH "
79 ARG
="$ARG--with-bufferpool=$BUFFERPOOL "
80 ARG
="$ARG--with-permissions=$DEFPERM "
81 ARG
="$ARG--with-fd-setsize=$MAXCONNECTIONS "
82 ARG
="$ARG--enable-dynamic-linking "
83 ARG
="$ARG $EXTRAPARA "
84 CONF
="./configure $ARG"
85 if [ "x$INSTALLCURL" = "x1" ]; then
86 .
/curlinstall
|| exit 1
91 if [ "$CRYPTOIRCD" = "1" ] ; then
92 if [ ! -f server.req.pem
]; then
98 echo "SSL certificate already existing, no need to regenerate"
105 while [ -z "$TEST" ] ; do
106 if [ "$SHOWLISTMODES" = "1" ] ; then
112 echo "Do you want to show the modes a channel has set in the /list output?"
113 echo $n "[$TEST] -> $c"
115 if [ -z "$cc" ] ; then
127 echo "You must enter either Yes or No"
134 while [ -z "$TEST" ] ; do
135 if [ "$TOPICNICKISNUH" = "1" ] ; then
141 echo "Do you want the /topic command to show the nick!user@host of the person"
142 echo "who set the topic, rather than just the nickname?"
143 echo $n "[$TEST] -> $c"
145 if [ -z "$cc" ] ; then
157 echo "You must enter either Yes or No"
164 while [ -z "$TEST" ] ; do
165 if [ "$SHUNNOTICES" = "1" ] ; then
171 echo "Should Unreal notify a user when they are no longer shunned?"
172 echo $n "[$TEST] -> $c"
174 if [ -z "$cc" ] ; then
186 echo "You must enter either Yes or No"
193 while [ -z "$TEST" ] ; do
194 if [ "$NOOPEROVERRIDE" = "1" ] ; then
200 echo "Do you want to disable oper override?"
201 echo $n "[$TEST] -> $c"
203 if [ -z "$cc" ] ; then
215 echo "You must enter either Yes or No"
222 while [ -z "$TEST" ] ; do
223 if [ "$DISABLEUSERMOD" = "1" ] ; then
229 echo "Do you want to disable /sethost, /setident, /chgname,"
230 echo "/chghost, and /chgident?"
231 echo $n "[$TEST] -> $c"
233 if [ -z "$cc" ] ; then
245 echo "You must enter either Yes or No"
252 while [ -z "$TEST" ] ; do
253 if [ "$OPEROVERRIDEVERIFY" = "1" ] ; then
259 echo "Do you want to require opers to /invite themselves into a +s or +p channel?"
260 echo $n "[$TEST] -> $c"
262 if [ -z "$cc" ] ; then
267 OPEROVERRIDEVERIFY
="1"
270 OPEROVERRIDEVERIFY
=""
274 echo "You must enter either Yes or No"
281 while [ -z "$TEST" ] ; do
282 if [ "$DISABLEEXTBANSTACKING" = "1" ] ; then
288 echo "Do you want to disable extended ban stacking (~q:~c:#test, etc) support?"
289 echo $n "[$TEST] -> $c"
291 if [ -z "$cc" ] ; then
296 DISABLEEXTBANSTACKING
="1"
299 DISABLEEXTBANSTACKING
="0"
303 echo "You must enter either Yes or No"
315 SPATH
="`pwd`/src/ircd"
322 NICKNAMEHISTORYLENGTH
="2000"
323 MAXSENDQLENGTH
="3000000"
325 MAXCONNECTIONS
="1024"
335 OPEROVERRIDEVERIFY
=""
336 DISABLEEXTBANSTACKING
=""
338 if [ "`eval echo -n 'a'`" = "-n a" ] ; then
350 while [ $# -ge 1 ] ; do
351 if [ $1 = "--help" ] ; then
352 echo "Config utility for UnrealIRCd"
353 echo "-----------------------------"
354 echo "Syntax: ./Config [options]"
355 echo "-nocache Ignore settings saved in config.settings"
356 echo "-nointro Skip intro (release notes, etc)"
357 echo "-quick Skip questions, go straight to configure"
358 echo "-advanced Include additional advanced questions"
359 echo "-clean Clean ./configure cache"
361 elif [ $1 = "-nocache" ] ; then
363 elif [ $1 = "-nointro" ] ; then
365 elif [ $1 = "-quick" -o $1 = "-q" ] ; then
366 echo "running quick config"
367 if [ -f "config.settings" ] ; then
373 elif [ $1 = "-clean" -o $1 = "-C" ] ; then
375 elif [ $1 = "-advanced" ] ; then
381 if [ -f "config.settings" -a -z "$NOCACHE" ] ; then
385 if [ "$PREADVANCED" = "1" ] ; then
387 elif [ "$ADVANCED" = "1" ]; then
391 if [ -n "$CLEAN" ] ; then
397 if [ -f ".CHANGES.NEW" -a -z "$NOINTRO" ] ; then
399 echo $n "[Enter to continue]"
403 if [ -f ".RELEASE.NOTES" -a -z "$NOINTRO" ] ; then
405 echo $n "[Enter to continue]"
411 while [ -z "$TEST" ] ; do
412 if [ "$NOSPOOF" = "1" ] ; then
418 echo "Many older operating systems have an insecure TCP/IP stack"
419 echo "which may be vulnerable to IP spoofing attacks, if you run"
420 echo "an operating system that is vulnerable to such attacks"
421 echo "enable this option."
422 echo "This option also prevents blind proxies (eg: HTTP POST proxies)"
423 echo "and other blind clients from connecting (eg: protects against"
424 echo "the Firefox XPS IRC Attack)."
426 echo "Do you want to enable the server anti-spoof protection?"
427 echo $n "[$TEST] -> $c"
429 if [ -z "$cc" ] ; then
441 echo "You must enter either Yes or No"
449 echo "What directory are all the server configuration files in?"
450 echo $n "[$TEST] -> $c"
452 if [ -z "$cc" ] ; then
455 DPATH
=`eval echo $cc` # modified
460 while [ -z "$TEST" ] ; do
463 echo "What is the path to the ircd binary including the name of the binary?"
464 echo $n "[$TEST] -> $c"
466 if [ -z "$cc" ] ; then
469 SPATH
=`eval echo $cc` # modified
471 if [ "$SPATH" = "$DPATH" ]; then
473 echo "You need to specify the path to the BINARY, not to a directory."
474 echo "The answer to this question can never be identical to the previous one."
475 echo "HINT: perhaps you want $DPATH/ircd ?"
481 while [ -z "$TEST" ] ; do
484 echo "What should the default permissions for your configuration files be? (Set this to 0 to disable)"
485 echo "It is strongly recommended that you use 0600 to prevent unwanted reading of the file"
486 echo $n "[$TEST] -> $c"
488 if [ -z "$cc" ] ; then
498 echo "You must enter a number"
506 while [ -z "$TEST" ] ; do
507 if [ "$CRYPTOIRCD" = "1" ] ; then
513 echo "Do you want to support SSL (Secure Sockets Layer) connections?"
514 echo $n "[$TEST] -> $c"
516 if [ -z "$cc" ] ; then
528 echo "You must enter either Yes or No"
534 if [ "$CRYPTOIRCD" = "1" ] ; then
537 echo "If you know the path to OpenSSL on your system, enter it here. If not"
538 echo "leave this blank (in most cases it will be detected automatically)."
539 echo $n "[$TEST] -> $c"
541 if [ -z "$cc" ] ; then
544 SSLDIR
=`eval echo $cc` # modified
549 while [ -z "$TEST" ] ; do
550 if [ "$INET6" = "1" ] ; then
556 echo "Do you want to enable IPv6 support?"
557 echo $n "[$TEST] -> $c"
559 if [ -z "$cc" ] ; then
571 echo "You must enter either Yes or No"
578 while [ -z "$TEST" ] ; do
579 if [ "$ZIPLINKS" = "1" ] ; then
585 echo "Do you want to enable ziplinks support?"
586 echo $n "[$TEST] -> $c"
588 if [ -z "$cc" ] ; then
600 echo "You must enter either Yes or No"
606 if [ "$ZIPLINKS" = "1" ] ; then
609 echo "If you know the path to zlib on your system, enter it here. If not"
610 echo "leave this blank"
611 echo $n "[$TEST] -> $c"
613 if [ -z "$cc" ] ; then
616 ZIPLINKSDIR
=`eval echo $cc` # modified
621 while [ -z "$TEST" ] ; do
622 if [ "$REMOTEINC" = "1" ] ; then
628 echo "Do you want to enable remote includes?"
629 echo "This allows stuff like this in your configuration file:"
630 echo "include \"http://www.somesite.org/files/opers.conf\";"
631 echo $n "[$TEST] -> $c"
633 if [ -z "$cc" ] ; then
646 echo "You must enter either Yes or No"
652 if [ "$REMOTEINC" = "1" ] ; then
653 if [ ! -d "$CURLDIR" ]; then
654 # Reset any previous CURLDIR if it doesn't exist (anymore)
660 if [ "x$CURLDIR" = "x" ]; then
661 # There is no reason to support this:
662 if [ -d "/usr/local/include/curl" ]; then
665 # Zeroeth, let's act SANE
666 if [ -d "/usr/include/curl" ]; then
669 # First, let's make shell admins happy...
670 if [ -d "/usr/share/unreal-curl" ]; then
671 CURLDIR
="/usr/share/unreal-curl"
675 if [ "x$CURLDIR" != "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 "$CURLDIR"/bin
/curl
-config --features | grep -q -e AsynchDNS
; then
681 if [ "$GOTASYNC" != "1" ]; then
682 PREVCURLDIR
="$CURLDIR"
687 # Second, use the local curl if it exists (overrides above)
688 if [ -d "$HOME/curl" ]; then
691 # Check if it's recent enough...
692 # But first, check if curl-config can be trusted at all: it depends
693 # on 'bc' for some reason and not all systems have that installed!
694 echo "1+1"|bc 1>/dev
/null
2>&1
695 if [ "$?" = 0 ]; then
696 "$CURLDIR"/bin
/curl
-config --checkfor 7.21.0
697 if [ "$?" != 0 ]; then
699 echo "Your self-compiled CURL library in $CURLDIR is slightly outdated."
700 echo "This probably means you had the library from a previous installation of UnrealIRCd."
701 echo "Because previous versions may be linked to a previous version to c-ares which"
702 echo "were not ABI compatible it is highly recommended to remove the version"
703 echo "and recompile it. We now have an automatic downloader and installer to compile"
704 echo "and install curl for you (in $CURLDIR). You can choose to do so in the question"
705 echo "after this one."
707 while [ -z "$TEST" ] ; do
709 echo "Shall I rename $CURLDIR to $CURLDIR.old so it can be rebuild later on?"
710 echo $n "[$TEST] -> $c"
712 if [ -z "$cc" ] ; then
717 rm -rf "$CURLDIR".old
718 mv "$CURLDIR" "$CURLDIR".old
721 # wow the GOTASYNC=1 is hackish, but we need to prevent the error from later on
724 echo "Uh, ok... I hope you know what you are doing..."
729 echo "You must enter either Yes or No"
738 # Need to output it here, as the HOME check from above may cause this to be no longer relevant.
739 if [ "x$CURLDIR" = "x" -a "$GOTASYNC" != "1" ]; then
740 echo "Curl library was found in $PREVCURLDIR, but it does not support Asynchronous DNS (not compiled with c-ares)"
741 echo "so it's of no use to us."
745 if [ "x$CURLDIR" = "x" ]; then
748 while [ -z "$TEST" ] ; do
751 echo "Do you want me to automatically download and install curl for you?"
752 echo "(will install in $HOME/curl)"
753 echo $n "[$TEST] -> $c"
755 if [ -z "$cc" ] ; then
768 echo "You must enter either Yes or No"
775 if [ "$INSTALLCURL" != "1" ]; then
777 while [ -z "$TEST" ] ; do
780 echo "Specify the directory you installed libcurl to"
781 echo $n "[$TEST] -> $c"
783 if [ -z "$cc" ] ; then
787 CURLDIR
=`eval echo $cc` # modified
795 while [ -z "$TEST" ] ; do
796 if [ "$PREFIXAQ" = "1" ] ; then
802 echo "Do you want to enable prefixes for chanadmin and chanowner?"
803 echo "This will give +a the & prefix and ~ for +q (just like +o is @)"
804 echo "Supported by the major clients (mIRC, xchat, epic, eggdrop, Klient,"
805 echo "PJIRC, irssi, CGI:IRC, etc.)"
806 echo "This feature should be enabled/disabled network-wide."
807 echo $n "[$TEST] -> $c"
809 if [ -z "$cc" ] ; then
821 echo "You must enter either Yes or No"
829 while [ -z "$TEST" ] ; do
832 echo "What listen() backlog value do you wish to use? Some older servers"
833 echo "have problems with more than 5, others work fine with many more."
834 echo $n "[$TEST] -> $c"
836 if [ -z "$cc" ] ; then
846 echo "You must enter a number"
853 while [ -z "$TEST" ] ; do
854 TEST
="$NICKNAMEHISTORYLENGTH"
856 echo "How far back do you want to keep the nickname history?"
857 echo $n "[$TEST] -> $c"
859 if [ -z "$cc" ] ; then
860 NICKNAMEHISTORYLENGTH
=$TEST
865 NICKNAMEHISTORYLENGTH
="$cc"
869 echo "You must enter a number"
876 while [ -z "$TEST" ] ; do
877 TEST
="$MAXSENDQLENGTH"
879 echo "What is the maximum sendq length you wish to have?"
880 echo $n "[$TEST] -> $c"
882 if [ -z "$cc" ] ; then
887 [1-9][0-9][0-9][0-9]*)
892 echo "You must enter a number greater than or equal to 1000"
899 while [ -z "$TEST" ] ; do
902 echo "How many buffer pools would you like?"
903 echo "This number will be multiplied by MAXSENDQLENGTH."
904 echo $n "[$TEST] -> $c"
906 if [ -z "$cc" ] ; then
916 echo "You must enter a number"
925 while [ -z "$TEST" ] ; do
926 TEST
="$MAXCONNECTIONS"
928 echo "How many file descriptors (or sockets) can the IRCd use?"
929 echo $n "[$TEST] -> $c"
931 if [ -z "$cc" ] ; then
941 echo "You must to enter a number greater than or equal to 100"
946 if [ -n "$ADVANCED" ] ; then
952 echo "Would you like to pass any custom parameters to configure?"
953 echo "See \`./configure --help' and write them here:"
954 echo $n "[$TEST] -> $c"
956 if [ -z "$EXTRAPARA" ]; then
960 rm -f config.settings
961 cat > config.settings
<< __EOF__
968 LISTEN_SIZE="$LISTEN_SIZE"
969 MAXSENDQLENGTH="$MAXSENDQLENGTH"
970 BUFFERPOOL="$BUFFERPOOL"
971 MAXCONNECTIONS="$MAXCONNECTIONS"
972 NICKNAMEHISTORYLENGTH="$NICKNAMEHISTORYLENGTH"
974 CRYPTOIRCD="$CRYPTOIRCD"
977 ZIPLINKSDIR="$ZIPLINKSDIR"
978 REMOTEINC="$REMOTEINC"
980 SHOWLISTMODES="$SHOWLISTMODES"
981 TOPICNICKISNUH="$TOPICNICKISNUH"
982 SHUNNOTICES="$SHUNNOTICES"
983 NOOPEROVERRIDE="$NOOPEROVERRIDE"
984 DISABLEUSERMOD="$DISABLEUSERMOD"
985 OPEROVERRIDEVERIFY="$OPEROVERRIDEVERIFY"
986 DISABLEEXTBANSTACKING="$DISABLEEXTBANSTACKING"
987 EXTRAPARA="$EXTRAPARA"
994 _______________________________________________________________________
996 | UnrealIRCd Compile-Time Config |
997 |_______________________________________________________________________|
998 |_______________________________________________________________________|
1000 | Now all you have to do is type 'make' and let it compile. When that's |
1001 | done, you will receive other instructions on what to do next. |
1003 |_______________________________________________________________________|
1004 |_______________________________________________________________________|
1005 | - The UnrealIRCd Team - |
1007 | * Syzop syzop@unrealircd.com |
1008 |_______________________________________________________________________|