]>
jfr.im git - irc/unrealircd/unrealircd.git/blob - Config
3 # Config script for UnrealIRCd
4 # (C) 2001-2019 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.
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)."
30 echo "Please run './Config' without -quick and answer all questions."
38 # Do this even if we're not in advanced mode
39 if [ "$SHOWLISTMODES" = "1" ] ; then
40 ARG
="$ARG--with-showlistmodes "
42 if [ "$ADVANCED" = "1" ] ; then
43 if [ "$TOPICNICKISNUH" = "1" ] ; then
44 ARG
="$ARG--with-topicisnuhost "
46 if [ "$SHUNNOTICES" = "1" ] ; then
47 ARG
="$ARG--with-shunnotices "
49 if [ "$NOOPEROVERRIDE" = "1" ] ; then
50 ARG
="$ARG--with-no-operoverride "
52 if [ "$DISABLEUSERMOD" = "1" ] ; then
53 ARG
="$ARG--with-disableusermod "
55 if [ "$OPEROVERRIDEVERIFY" = "1" ] ; then
56 ARG
="$ARG--with-operoverride-verify "
58 if [ "$DISABLEEXTBANSTACKING" = "1" ]; then
59 ARG
="$ARG--with-disable-extendedban-stacking ";
62 if test x
"$SSLDIR" = "x" ; then
63 ARG
="$ARG--enable-ssl "
65 ARG
="$ARG--enable-ssl=$SSLDIR "
67 if [ "$REMOTEINC" = "1" ] ; then
68 ARG
="$ARG--enable-libcurl=$CURLDIR "
70 if [ "$PREFIXAQ" != "1" ]; then
71 ARG
="$ARG--disable-prefixaq "
73 if [ "$MAXCONNECTIONS_REQUEST" != "auto" ]; then
74 ARG
="$ARG--with-maxconnections=$MAXCONNECTIONS_REQUEST "
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
100 if [ "x$INSTALLCURL" = "x1" ]; then
101 extras
/curlinstall
"$LIBDIR" || exit 1
106 if [ "$QUICK" != "1" ] ; then
107 if [ ! -f $CONFDIR/ssl
/server.cert.pem
]; then
110 while [ -z "$TEST" ] ; do
111 if [ "$GENCERTIFICATE" = "1" ] ; then
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"
121 if [ -z "$cc" ] ; then
133 echo "You must enter either Yes or No"
138 if [ "$GENCERTIFICATE" = 1 ]; then
140 echo "Certificate created successfully."
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."
147 echo "SSL certificate exists in $CONFDIR/ssl/server.cert.pem, no need to regenerate."
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
159 while [ -z "$TEST" ] ; do
160 if [ "$SHOWLISTMODES" = "1" ] ; then
166 echo "Do you want to show the modes a channel has set in the /list output?"
167 echo $n "[$TEST] -> $c"
169 if [ -z "$cc" ] ; then
181 echo "You must enter either Yes or No"
188 while [ -z "$TEST" ] ; do
189 if [ "$TOPICNICKISNUH" = "1" ] ; then
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"
199 if [ -z "$cc" ] ; then
211 echo "You must enter either Yes or No"
218 while [ -z "$TEST" ] ; do
219 if [ "$SHUNNOTICES" = "1" ] ; then
225 echo "Should UnrealIRCd notify a user when they are no longer shunned?"
226 echo $n "[$TEST] -> $c"
228 if [ -z "$cc" ] ; then
240 echo "You must enter either Yes or No"
247 while [ -z "$TEST" ] ; do
248 if [ "$NOOPEROVERRIDE" = "1" ] ; then
254 echo "Do you want to disable oper override?"
255 echo $n "[$TEST] -> $c"
257 if [ -z "$cc" ] ; then
269 echo "You must enter either Yes or No"
276 while [ -z "$TEST" ] ; do
277 if [ "$DISABLEUSERMOD" = "1" ] ; then
283 echo "Do you want to disable /sethost, /setident, /chgname,"
284 echo "/chghost, and /chgident?"
285 echo $n "[$TEST] -> $c"
287 if [ -z "$cc" ] ; then
299 echo "You must enter either Yes or No"
306 while [ -z "$TEST" ] ; do
307 if [ "$OPEROVERRIDEVERIFY" = "1" ] ; then
313 echo "Do you want to require opers to /invite themselves into a +s or +p channel?"
314 echo $n "[$TEST] -> $c"
316 if [ -z "$cc" ] ; then
321 OPEROVERRIDEVERIFY
="1"
324 OPEROVERRIDEVERIFY
=""
328 echo "You must enter either Yes or No"
335 while [ -z "$TEST" ] ; do
336 if [ "$DISABLEEXTBANSTACKING" = "1" ] ; then
342 echo "Do you want to disable extended ban stacking (~q:~c:#test, etc) support?"
343 echo $n "[$TEST] -> $c"
345 if [ -z "$cc" ] ; then
350 DISABLEEXTBANSTACKING
="1"
353 DISABLEEXTBANSTACKING
="0"
357 echo "You must enter either Yes or No"
367 BASEPATH
="$HOME/unrealircd"
370 NICKNAMEHISTORYLENGTH
="2000"
371 MAXSENDQLENGTH
="3000000"
372 MAXCONNECTIONS_REQUEST
="auto"
381 OPEROVERRIDEVERIFY
=""
382 DISABLEEXTBANSTACKING
=""
385 if [ "`eval echo -n 'a'`" = "-n a" ] ; then
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"
404 echo "Press ENTER to continue"
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"
426 elif [ $1 = "-nocache" ] ; then
428 elif [ $1 = "-nointro" ] ; then
430 elif [ $1 = "-quick" -o $1 = "-q" ] ; then
432 echo "running quick config"
433 if [ -f "config.settings" ] ; then
439 elif [ $1 = "-clean" -o $1 = "-C" ] ; then
441 elif [ $1 = "-advanced" ] ; then
447 if [ "$PREADVANCED" = "1" ] ; then
449 elif [ "$ADVANCED" = "1" ]; then
453 if [ -n "$CLEAN" ] ; then
459 if [ -f ".CHANGES.NEW" -a -z "$NOINTRO" ] ; then
461 echo $n "[Enter to continue]"
465 if [ -f "doc/RELEASE-NOTES" -a -z "$NOINTRO" ] ; then
466 more doc
/RELEASE
-NOTES
467 echo $n "[Enter to continue]"
472 echo "We will now ask you a number of questions."
473 echo "You can just press ENTER to accept the defaults!"
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
482 # Try to load a previous config.settings
483 for x
in $UNREALRELEASES
485 if [ -f ..
/$x/config.settings
]; then
486 IMPORTEDSETTINGS
="../$x"
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."
498 echo "If you install UnrealIRCd for the first time on this shell, then just hit Enter";
501 TEST
="$IMPORTEDSETTINGS"
502 echo $n "[$TEST] -> $c"
504 if [ -z "$cc" ]; then
505 IMPORTEDSETTINGS
="$TEST"
507 IMPORTEDSETTINGS
="$cc"
509 if [ "$IMPORTEDSETTINGS" = "none" ]; then
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"
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
522 [ -e "$f" ] && cp $f src
/modules
/third
/
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
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"
544 if [ -z "$cc" ] ; then
547 BASEPATH
=`eval echo $cc` # modified
549 if [ "$BASEPATH" = "$UNREALCWD" ]; then
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"
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"
570 while [ -z "$TEST" ] ; do
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"
577 if [ -z "$cc" ] ; then
587 echo "You must enter a number"
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."
601 if [ -z "$SSLDIR" ]; then
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/"
614 echo $n "[$TEST] -> $c"
616 if [ -z "$cc" ] ; then
619 SSLDIR
=`eval echo $cc` # modified
623 while [ -z "$TEST" ] ; do
624 if [ "$REMOTEINC" = "1" ] ; then
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"
635 if [ -z "$cc" ] ; then
648 echo "You must enter either Yes or No"
654 if [ "$REMOTEINC" = "1" ] ; then
655 if [ ! -d "$CURLDIR" ]; then
656 # Reset any previous CURLDIR if it doesn't exist (anymore)
663 if [ -d "/usr/local/include/curl" ]; then
664 SUGGESTCURLDIR
="/usr/local"
666 if [ -d "/usr/include/curl" ]; then
667 SUGGESTCURLDIR
="/usr"
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"
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
681 if [ "$GOTASYNC" != "1" ]; then
682 SUGGESTCURLDIRBAD
="$CURLDIR"
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:
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"
698 echo "WARNING: We no longer use $HOME/curl nowadays."
699 echo "Use the automatic download and install feature below."
704 if [ "x$CURLDIR" = "x" ]; then
705 CURLDIR
="$SUGGESTCURLDIR"
706 # NOTE: CURLDIR may still be empty after this
708 # System curl has no asyncdns, so install our own.
709 if [ "$GOTASYNC" != "1" ]; then
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."
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)"
729 if [ "x$CURLDIR" = "x" ]; then
732 while [ -z "$TEST" ] ; do
735 echo "Do you want me to automatically download and install curl for you?"
736 echo $n "[$TEST] -> $c"
738 if [ -z "$cc" ] ; then
744 CURLDIR
="$UNREALCWD/extras/curl"
751 echo "You must enter either Yes or No"
758 if [ "$INSTALLCURL" != "1" ]; then
760 while [ -z "$TEST" ] ; do
763 echo "Specify the directory you installed libcurl to"
764 echo $n "[$TEST] -> $c"
766 if [ -z "$cc" ] ; then
770 CURLDIR
=`eval echo $cc` # modified
778 while [ -z "$TEST" ] ; do
779 if [ "$PREFIXAQ" = "1" ] ; then
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"
792 if [ -z "$cc" ] ; then
804 echo "You must enter either Yes or No"
811 while [ -z "$TEST" ] ; do
812 TEST
="$NICKNAMEHISTORYLENGTH"
814 echo "How far back do you want to keep the nickname history?"
815 echo $n "[$TEST] -> $c"
817 if [ -z "$cc" ] ; then
818 NICKNAMEHISTORYLENGTH
=$TEST
823 NICKNAMEHISTORYLENGTH
="$cc"
827 echo "You must enter a number"
834 while [ -z "$TEST" ] ; do
835 TEST
="$MAXSENDQLENGTH"
837 echo "What is the maximum sendq length you wish to have?"
838 echo $n "[$TEST] -> $c"
840 if [ -z "$cc" ] ; then
845 [1-9][0-9][0-9][0-9]*)
850 echo "You must enter a number greater than or equal to 1000"
858 while [ -z "$TEST" ] ; do
859 TEST
="$MAXCONNECTIONS_REQUEST"
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"
869 if [ -z "$cc" ] ; then
870 MAXCONNECTIONS_REQUEST
=$TEST
875 MAXCONNECTIONS_REQUEST
="$cc"
878 MAXCONNECTIONS_REQUEST
="$cc"
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."
888 if [ -n "$ADVANCED" ] ; then
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"
898 if [ -z "$EXTRAPARA" ]; then
902 rm -f config.settings
903 cat > config.settings
<< __EOF__
909 MODULESDIR="$MODULESDIR"
916 MAXSENDQLENGTH="$MAXSENDQLENGTH"
917 MAXCONNECTIONS_REQUEST="$MAXCONNECTIONS_REQUEST"
918 NICKNAMEHISTORYLENGTH="$NICKNAMEHISTORYLENGTH"
921 REMOTEINC="$REMOTEINC"
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"
938 _______________________________________________________________________
940 | UnrealIRCd Compile-Time Config |
941 |_______________________________________________________________________|
942 |_______________________________________________________________________|
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. |
947 |_______________________________________________________________________|
948 |_______________________________________________________________________|
949 | - The UnrealIRCd Team - |
951 | * Bram Matthys (Syzop) syzop@unrealircd.org |
952 | * Travis McArthur (Heero) heero@unrealircd.org |
953 |_______________________________________________________________________|