b499b3a09a0df13cf42d6d4d73db73c036de2dd5
[ircu2.10.12-pk.git] / config / config-sh.in
1 # @configure_input@
2 #
3 # By Carlo Wood (carlo@runaway.xs4all.nl)
4 #
5 # For a description of the syntax of this configuration file,
6 # see the config/Configure script.
7 #
8 # TO CONFIGURE THE SERVER, TYPE: 'make config' in the top level directory !
9 #
10
11 #### Start of system configuration section. ####
12
13 prefix=@prefix@
14 exec_prefix=@exec_prefix@
15 bindir=@bindir@
16 mandir=@mandir@
17 CC_DEFAULT="@CC@"
18 CFLAGS_DEFAULT="@CFLAGS@"
19 CPPFLAGS_DEFAULT="@CPPFLAGS@"
20 LDFLAGS_DEFAULT="@LDFLAGS@"
21 LIBS="@LIBS@"
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@
25
26 #### End of system configuration section. ####
27
28 if [ -z "$CONFIG_BATCH" ]; then
29   echo "**************************************************************************"
30   echo "Error: Please run 'make config' that resides in the top level directory!"
31   echo "**************************************************************************"
32   exit -1
33 fi
34
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 '?'"
41     echo "*"
42     USE_DEFAULT=n
43   else
44     USE_DEFAULT=C
45   fi
46   CHANGE_CONFIG=n
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."
51       USE_DEFAULT=C
52     else
53       USE_DEFAULT=n
54     fi
55   else
56     USE_DEFAULT=n
57   fi
58 endmenu
59
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
64   EXTRA_CPPFLAGS=""
65   if [ "$CONFIG_NDEBUG" = "n" ]; then
66     if [ -z "$EXTRA_CPPFLAGS" ]; then
67       EXTRA_CPPFLAGS="-DNDEBUG"
68     else
69       EXTRA_CPPFLAGS="-DNDEBUG $EXTRA_CPPFLAGS"
70     fi
71   fi
72 endmenu
73
74 mainmenu_option next_comment
75 comment 'Compile stuff'
76   if [ "$prefix" = "NONE" ]; then
77     prefix=/usr/local
78   fi
79   if [ "$exec_prefix" = "NONE" ]; then
80     eval exec_prefix="$prefix"
81   fi
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 '?'):"
89       CFLAGS=
90     fi
91   fi
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
96     LDFLAGS_DEFAULT=none
97   else
98     eval LDFLAGS_DEFAULT="$LDFLAGS_DEFAULT"
99   fi
100   string 'Which linker flags do you need [none]' LDFLAGS "$LDFLAGS_DEFAULT"
101   if [ -z "$LIBS" ]; then
102     LIBS=none
103   fi
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"
107   unset ZSTEMP
108   if [ "$DEBUGSYMBOLS" = "y" ] ; then
109     ZSTEMP="-g"
110   fi
111   if [ "$IRCUPROFILE" = "y" ] ; then
112     ZSTEMP="-pg $ZSTEMP"
113   fi
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"
119   fi
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`"
124   eval mandir=$mandir
125   string 'Where should I install the man page' MANDIR $mandir
126   if [ "$CFLAGS" = "none" ]; then
127     CFLAGS=""
128   fi
129   if [ "$EXTRA_INCLUDEDIRS" = "none" ]; then
130     EXTRA_INCLUDEDIRS=""
131   fi
132   if [ "$LDFLAGS" = "none" ]; then
133     LDFLAGS=""
134   fi
135   if [ "$IRCDLIBS" = "none" ]; then
136     IRCDLIBS=""
137   fi
138   if [ -n "$EXTRA_INCLUDEDIRS" ]; then
139     for i in $EXTRA_INCLUDEDIRS; do
140       if [ -z "$EXTRA_CPPFLAGS" ]; then
141         EXTRA_CPPFLAGS=-I$i
142       else
143         EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -I$i"
144       fi
145     done
146   fi
147   if [ -z "$EXTRA_CPPFLAGS" ]; then
148     CPPFLAGS="-I../include -I../config"
149   else
150     CPPFLAGS="-I../include -I../config $EXTRA_CPPFLAGS"
151   fi
152   echo "EXTRA_CPPFLAGS=\"$EXTRA_CPPFLAGS\"" >>$CONFIG
153   echo "CPPFLAGS=\"$CPPFLAGS\"" >>$CONFIG
154   bool 'Use inlining for a few crucial functions' FORCEINLINE y
155 endmenu
156
157 if [ "$ac_cv_header_poll_h" = "yes" ]; then
158   if [ "$unet_cv_func_poll_syscall" = "yes" ]; then
159     define_bool USE_POLL y
160   else
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
164     endmenu
165   fi
166 fi
167
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`"
172   fi
173   if [ -z "$DOMAINNAME_DEFAULT" ]; then
174     DOMAINNAME_DEFAULT="`awk '/^search/ { print "*" $2; exit }' /etc/resolv.conf`"
175   fi
176   if [ -z "$DOMAINNAME_DEFAULT" ]; then
177     DOMAINNAME_DEFAULT=none
178   fi
179   define_string DOMAINNAME $DOMAINNAME_DEFAULT
180 endmenu
181
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
189   else
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 !"
195     fi
196   fi
197 endmenu
198
199
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"
206   else
207     define_string SPATH "$BINDIR/$SYMLINK"
208   fi
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'
213   else
214     define_string LPATH "$LPATH"
215   fi
216 endmenu
217
218 mainmenu_option next_comment
219 comment 'Configuration'
220   int 'Maximum number of network connections (23 - (FD_SETSIZE-4))' MAXCONNECTIONS 252
221 endmenu