3 # By Carlo Wood (carlo@runaway.xs4all.nl)
5 # For a description of the syntax of this configuration file,
6 # see the config/Configure script.
8 # TO CONFIGURE THE SERVER, TYPE: 'make config' in the top level directory !
11 #### Start of system configuration section. ####
14 exec_prefix=@exec_prefix@
18 CFLAGS_DEFAULT="@CFLAGS@"
19 CPPFLAGS_DEFAULT="@CPPFLAGS@"
20 LDFLAGS_DEFAULT="@LDFLAGS@"
22 ac_cv_header_poll_h=@ac_cv_header_poll_h@
23 unet_cv_func_poll_syscall=@unet_cv_func_poll_syscall@
24 ac_cv_header_syslog_h=@ac_cv_header_syslog_h@
26 #### End of system configuration section. ####
28 if [ -z "$CONFIG_BATCH" ]; then
29 echo "**************************************************************************"
30 echo "Error: Please run 'make config' that resides in the top level directory!"
31 echo "**************************************************************************"
35 mainmenu_name "Undernet IRC Daemon Configuration"
36 mainmenu_option next_comment
37 if [ "$CONFIG_BATCH" = "n" ]; then
38 echo "* Welcome to the Undernet IRC Daemon Configuration script."
39 echo "* You can restart this configuration at any time by typing 'make config'."
40 echo "* If you need help with your decision on any question, type a '?'"
47 if [ "$DEFAULTS" != "none" ]; then
48 bool 'Do you want to change your previous configuration' CHANGE_CONFIG
49 if [ "$CHANGE_CONFIG" = "n" ]; then
50 echo "Ok, I will only prompt you for NEW parameters."
60 mainmenu_option next_comment
61 comment 'Debugging (do not define this on production servers)'
62 bool 'Do you want to enable debugging output' DEBUGMODE
63 bool 'Do you want to enable asserts and memory allocation checking' CONFIG_NDEBUG
65 if [ "$CONFIG_NDEBUG" = "n" ]; then
66 if [ -z "$EXTRA_CPPFLAGS" ]; then
67 EXTRA_CPPFLAGS="-DNDEBUG"
69 EXTRA_CPPFLAGS="-DNDEBUG $EXTRA_CPPFLAGS"
74 mainmenu_option next_comment
75 comment 'Compile stuff'
76 if [ "$prefix" = "NONE" ]; then
79 if [ "$exec_prefix" = "NONE" ]; then
80 eval exec_prefix="$prefix"
82 string 'Which compiler do you want to use' CC "$CC_DEFAULT"
83 echo "* For the following four questions, specify 'none' when you want it to be empty."
84 if [ -z "$cflags_O3_remark" -a -n "$CFLAGS" ]; then
85 CFLAGS_DEFAULT=`echo "$CFLAGS" | sed -e 's%-O2%-O3%'`
86 if [ "$CFLAGS_DEFAULT" != "$CFLAGS" ]; then
87 echo "You are highly advised to use -O3 instead of -O2 if you're short in cpu cycles!"
88 echo "Please read documentation (press '?'):"
92 eval string "'What flags should I pass to $CC [none]'" CFLAGS "'$CFLAGS_DEFAULT'"
93 define_macro cflags_O3_remark done
94 string 'Do you need extra include directories [none]' EXTRA_INCLUDEDIRS none
95 if [ -z "$LDFLAGS_DEFAULT" ]; then
98 eval LDFLAGS_DEFAULT="$LDFLAGS_DEFAULT"
100 string 'Which linker flags do you need [none]' LDFLAGS "$LDFLAGS_DEFAULT"
101 if [ -z "$LIBS" ]; then
104 string 'Which extra libraries do you need [none]' IRCDLIBS "$LIBS"
105 bool 'Generate debug symbols?' DEBUGSYMBOLS "y"
106 bool 'Compile in profiling support (gcc and maybe SUNpro)?' IRCUPROFILE "n"
108 if [ "$DEBUGSYMBOLS" = "y" ] ; then
111 if [ "$IRCUPROFILE" = "y" ] ; then
114 define_string DEBUGFLAGS "$ZSTEMP"
115 eval bindir="$bindir"
116 string 'In which directory should I install the ircd binary' BINDIR $bindir
117 if [ ! -d "$BINDIR" ]; then
118 echo "$BINDIR : No such directory"
120 string 'What should the name of the installed symbolic link to the exectuable be' SYMLINK ircd
121 string 'Which permissions do you want the binary to have' IRCDMODE 711
122 string 'Which owner do you want the binary to have' IRCDOWN "`id | sed -e 's/.*uid=[0-9]*(//' -e 's/).*//' 2> /dev/null`"
123 string 'Which group do you want the binary to have' IRCDGRP "`id | sed -e 's/.*gid=[0-9]*(//' -e 's/).*//' 2> /dev/null`"
125 string 'Where should I install the man page' MANDIR $mandir
126 if [ "$CFLAGS" = "none" ]; then
129 if [ "$EXTRA_INCLUDEDIRS" = "none" ]; then
132 if [ "$LDFLAGS" = "none" ]; then
135 if [ "$IRCDLIBS" = "none" ]; then
138 if [ -n "$EXTRA_INCLUDEDIRS" ]; then
139 for i in $EXTRA_INCLUDEDIRS; do
140 if [ -z "$EXTRA_CPPFLAGS" ]; then
143 EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -I$i"
147 if [ -z "$EXTRA_CPPFLAGS" ]; then
148 CPPFLAGS="-I../include -I../config"
150 CPPFLAGS="-I../include -I../config $EXTRA_CPPFLAGS"
152 echo "EXTRA_CPPFLAGS=\"$EXTRA_CPPFLAGS\"" >>$CONFIG
153 echo "CPPFLAGS=\"$CPPFLAGS\"" >>$CONFIG
154 bool 'Use inlining for a few crucial functions' FORCEINLINE y
157 if [ "$ac_cv_header_poll_h" = "yes" ]; then
158 if [ "$unet_cv_func_poll_syscall" = "yes" ]; then
159 define_bool USE_POLL y
161 mainmenu_option next_comment
162 comment 'Operating System specific defines.'
163 bool 'You have poll(), but do you want to use it' USE_POLL n
168 mainmenu_option next_comment
169 comment 'Host specific defines'
170 if [ -f /etc/resolv.conf ]; then
171 DOMAINNAME_DEFAULT="`awk '/^domain/ { print "*" $2; exit }' /etc/resolv.conf`"
173 if [ -z "$DOMAINNAME_DEFAULT" ]; then
174 DOMAINNAME_DEFAULT="`awk '/^search/ { print "*" $2; exit }' /etc/resolv.conf`"
176 if [ -z "$DOMAINNAME_DEFAULT" ]; then
177 DOMAINNAME_DEFAULT=none
179 define_string DOMAINNAME $DOMAINNAME_DEFAULT
182 mainmenu_option next_comment
183 comment 'General defines'
184 bool 'Do you want the daemon set its own uid/gid (say yes for chroot!)' CONFIG_SETUGID
185 if [ "$CONFIG_SETUGID" = "y" ]; then
186 int ' UID of irc daemon' IRC_UID
187 int ' GID of irc daemon' IRC_GID
188 bool ' Change root ('/') after start of daemon' CHROOTDIR
190 define_bool CHROOTDIR n
191 define_int IRC_UID $IRC_UID
192 define_int IRC_GID $IRC_GID
193 if [ "$CMDLINE_CONFIG" = "y" ]; then
194 echo " SECURITY: Then don't install the daemon SUID or SGID !"
200 mainmenu_option next_comment
201 comment 'Paths and files'
202 eval DPATH_DEFAULT="${prefix}/lib/ircd"
203 string 'Directory where all ircd stuff resides' DPATH $DPATH_DEFAULT
204 if [ "$CHROOTDIR" = "y" ] ; then
205 define_string SPATH "/$SYMLINK"
207 define_string SPATH "$BINDIR/$SYMLINK"
209 echo "The following filenames are either full paths or files within DPATH"
210 string 'Server configuration file' CPATH 'ircd.conf'
211 if [ "$DEBUGMODE" = "y" ]; then
212 string 'Debug file if DEBUGMODE' LPATH '/tmp/ircd.log'
214 define_string LPATH "$LPATH"
218 mainmenu_option next_comment
219 comment 'Configuration'
220 int 'Maximum number of network connections (23 - (FD_SETSIZE-4))' MAXCONNECTIONS 252