2014-03-08 19:56:21 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
|
|
|
|
# EnergyMech, IRC Bot software
|
2018-02-28 23:39:23 +01:00
|
|
|
# Copyright (c) 1997-2018 proton
|
2014-03-08 19:56:21 -05:00
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
umask 077
|
|
|
|
|
|
|
|
|
|
# perl still unsupported
|
|
|
|
|
has_perl=no
|
2018-03-16 02:45:13 +01:00
|
|
|
compile=no
|
|
|
|
|
install=no
|
|
|
|
|
silentopt=no
|
2014-03-08 19:56:21 -05:00
|
|
|
|
2018-03-21 22:49:46 +01:00
|
|
|
# default optimization goal, speed = -O2, size = -Os
|
|
|
|
|
optitype=size
|
|
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
for opt
|
|
|
|
|
do
|
|
|
|
|
|
|
|
|
|
case "$opt" in
|
|
|
|
|
-*=*)
|
|
|
|
|
optarg=`echo $opt | sed 's/.*=//;'` ;;
|
|
|
|
|
*)
|
|
|
|
|
optarg= ;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
yesno=
|
|
|
|
|
case "$opt" in
|
|
|
|
|
--with=* ) yesno=yes ;;
|
|
|
|
|
--enable=* ) yesno=yes ;;
|
|
|
|
|
--without=* ) yesno=no ;;
|
|
|
|
|
--disable=* ) yesno=no ;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
if [ "$yesno" = yes -o "$yesno" = no ]; then
|
|
|
|
|
IFSBACKUP=$IFS
|
|
|
|
|
IFS='=,'
|
|
|
|
|
notfirst=
|
|
|
|
|
for nn in $opt
|
|
|
|
|
do
|
|
|
|
|
if [ "$notfirst" ]; then
|
|
|
|
|
case "$nn" in
|
|
|
|
|
alias ) ft_alias=$yesno ;;
|
|
|
|
|
botnet ) ft_botnet=$yesno ;;
|
|
|
|
|
bounce ) ft_bounce=$yesno ;;
|
|
|
|
|
chanban ) ft_chanban=$yesno ;;
|
|
|
|
|
ctcp ) ft_ctcp=$yesno ;;
|
|
|
|
|
dccfile ) ft_dccfile=$yesno ;;
|
|
|
|
|
debug ) ft_debug=$yesno ;;
|
|
|
|
|
dynamode ) ft_dynamode=$yesno ;;
|
|
|
|
|
dyncmd ) ft_dyncmd=$yesno ;;
|
|
|
|
|
greet ) ft_greet=$yesno ;;
|
2018-03-13 02:39:29 +01:00
|
|
|
hostinfo ) ft_hostinfo=$yesno ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
idwrap ) ft_idwrap=$yesno ;;
|
|
|
|
|
ircd_ext ) ft_ircd_ext=$yesno ;;
|
|
|
|
|
md5 ) ft_md5=$yesno ;;
|
|
|
|
|
newbie ) ft_newbie=$yesno ;;
|
|
|
|
|
note ) ft_note=$yesno ;;
|
|
|
|
|
notify ) ft_notify=$yesno ;;
|
|
|
|
|
perl ) ft_perl=$yesno ;;
|
|
|
|
|
python ) ft_python=$yesno ;;
|
|
|
|
|
rawdns ) ft_rawdns=$yesno ;;
|
|
|
|
|
redirect ) ft_redirect=$yesno ;;
|
|
|
|
|
seen ) ft_seen=$yesno ;;
|
|
|
|
|
session ) ft_session=$yesno ;;
|
2018-03-09 03:51:03 +01:00
|
|
|
sha ) ft_sha=$yesno ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
stats ) ft_stats=$yesno ;;
|
|
|
|
|
tcl ) ft_tcl=$yesno ;;
|
|
|
|
|
telnet ) ft_telnet=$yesno ;;
|
|
|
|
|
toybox ) ft_toybox=$yesno ;;
|
|
|
|
|
trivia ) ft_trivia=$yesno ;;
|
|
|
|
|
uptime ) ft_uptime=$yesno ;;
|
2018-03-14 03:02:30 +01:00
|
|
|
urlcapture ) ft_urlcapture=$yesno ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
web ) ft_web=$yesno ;;
|
|
|
|
|
wingate ) ft_wingate=$yesno ;;
|
|
|
|
|
esac
|
|
|
|
|
else
|
|
|
|
|
notfirst=yes
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
IFS=$IFSBACKUP
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
case "$opt" in
|
|
|
|
|
--enable-*=*)
|
|
|
|
|
feature=`echo $opt | sed 's/^\-\-enable\-//; s/=.*$//'` ;;
|
|
|
|
|
--enable-*)
|
|
|
|
|
feature=`echo $opt | sed 's/^\-\-enable\-//;'` ;;
|
|
|
|
|
--disable-*)
|
|
|
|
|
feature=`echo $opt | sed 's/^\-\-disable\-//;'` ;;
|
|
|
|
|
--with-*=*)
|
|
|
|
|
feature=`echo $opt | sed 's/^\-\-with\-//; s/=.*$//'` ;;
|
|
|
|
|
--with-*)
|
|
|
|
|
feature=`echo $opt | sed 's/^\-\-with\-//;'` ;;
|
|
|
|
|
--without-*)
|
|
|
|
|
feature=`echo $opt | sed 's/^\-\-without\-//;'` ;;
|
|
|
|
|
*)
|
|
|
|
|
feature=___none___ ;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
case "$feature" in
|
2018-03-09 03:51:03 +01:00
|
|
|
debug | botnet | telnet | alias | seen | session | dyncmd | newbie | wingate | md5 | sha \
|
2018-03-13 02:39:29 +01:00
|
|
|
| ctcp | dccfile | uptime | redirect | greet | perl | profiling | tcl | dynamode | web | hostinfo \
|
2018-03-14 03:02:30 +01:00
|
|
|
| note | notify | trivia | toybox | bounce | stats | rawdns | ircd_ext | idwrap | chanban | python | urlcapture )
|
2014-03-08 19:56:21 -05:00
|
|
|
case _"$optarg"_ in
|
|
|
|
|
_yes_ | _no_ | __ )
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "unknown argument for $feature":" $optarg"
|
|
|
|
|
echo "Usage: configure [options]"
|
|
|
|
|
echo "use \"$0 --help\" for help"
|
|
|
|
|
exit 1
|
|
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
___none___ )
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "unknown feature: $feature"
|
|
|
|
|
echo "Usage: configure [options]"
|
|
|
|
|
echo "use \"$0 --help\" for help"
|
|
|
|
|
exit 1
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
case "$opt" in
|
|
|
|
|
--with=* | --without=* | --enable=* | --disable=* ) ;;
|
|
|
|
|
--enable-* | --with-*)
|
|
|
|
|
case "$feature"_"$optarg" in
|
|
|
|
|
alias_yes | alias_ ) ft_alias=yes ;;
|
|
|
|
|
alias_no ) ft_alias=no ;;
|
|
|
|
|
botnet_yes | botnet_ ) ft_botnet=yes ;;
|
|
|
|
|
botnet_no ) ft_botnet=no ;;
|
|
|
|
|
bounce_yes | bounce_ ) ft_bounce=yes ;;
|
|
|
|
|
bounce_no ) ft_bounce=no ;;
|
|
|
|
|
chanban_yes | chanban_ ) ft_chanban=yes ;;
|
|
|
|
|
chanban_no ) ft_chanban=no ;;
|
|
|
|
|
ctcp_yes | ctcp_ ) ft_ctcp=yes ;;
|
|
|
|
|
ctcp_no ) ft_ctcp=no ;;
|
|
|
|
|
dccfile_yes | dccfile_ ) ft_dccfile=yes ;;
|
|
|
|
|
dccfile_no ) ft_dccfile=no ;;
|
|
|
|
|
debug_yes | debug_ ) ft_debug=yes ;;
|
|
|
|
|
debug_no ) ft_debug=no ;;
|
|
|
|
|
dynamode_yes | dynamode_ ) ft_dynamode=yes ;;
|
|
|
|
|
dynamode_no ) ft_dynamode=no ;;
|
|
|
|
|
dyncmd_yes | dyncmd_ ) ft_dyncmd=yes ;;
|
|
|
|
|
dyncmd_no ) ft_dyncmd=no ;;
|
|
|
|
|
greet_yes | greet_ ) ft_greet=yes ;;
|
|
|
|
|
greet_no ) ft_greet=no ;;
|
2018-03-13 02:39:29 +01:00
|
|
|
hostinfo_yes | hostinfo_ ) ft_hostinfo=yes ;;
|
|
|
|
|
hostinfo_no ) ft_hostinfo=no ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
idwrap_yes | idwrap_ ) ft_idwrap=yes ;;
|
|
|
|
|
idwrap_no ) ft_idwrap=no ;;
|
|
|
|
|
ircd_ext_yes | ircd_ext_ ) ft_ircd_ext=yes ;;
|
|
|
|
|
ircd_ext_no ) ft_ircd_ext=no ;;
|
|
|
|
|
md5_yes | md5_ ) ft_md5=yes ;;
|
|
|
|
|
md5_no ) ft_md5=no ;;
|
|
|
|
|
newbie_yes | newbie_ ) ft_newbie=yes ;;
|
|
|
|
|
newbie_no ) ft_newbie=no ;;
|
|
|
|
|
note_yes | note_ ) ft_note=yes ;;
|
|
|
|
|
note_no ) ft_note=no ;;
|
|
|
|
|
notify_yes | notify_ ) ft_notify=yes ;;
|
|
|
|
|
notify_no ) ft_notify=no ;;
|
|
|
|
|
perl_yes | perl_ ) ft_perl=yes ;;
|
|
|
|
|
perl_no ) ft_perl=no ;;
|
|
|
|
|
python_yes | python_ ) ft_python=yes ;;
|
|
|
|
|
python_no ) ft_python=no ;;
|
|
|
|
|
rawdns_yes | rawdns_ ) ft_rawdns=yes ;;
|
|
|
|
|
rawdns_no ) ft_rawdns=no ;;
|
|
|
|
|
redirect_yes | redirect_ ) ft_redirect=yes ;;
|
|
|
|
|
redirect_no ) ft_redirect=no ;;
|
|
|
|
|
seen_yes | seen_ ) ft_seen=yes ;;
|
|
|
|
|
seen_no ) ft_seen=no ;;
|
|
|
|
|
session_yes | session_ ) ft_session=yes ;;
|
|
|
|
|
session_no ) ft_session=no ;;
|
2018-03-09 03:51:03 +01:00
|
|
|
sha_yes | sha_ ) ft_seen=yes ;;
|
|
|
|
|
sha_no ) ft_sha=no ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
stats_yes | stats_ ) ft_stats=yes ;;
|
|
|
|
|
stats_no ) ft_stats=no ;;
|
|
|
|
|
tcl_yes | tcl_ ) ft_tcl=yes ;;
|
|
|
|
|
tcl_no ) ft_tcl=no ;;
|
|
|
|
|
telnet_yes | telnet_ ) ft_telnet=yes ;;
|
|
|
|
|
telnet_no ) ft_telnet=no ;;
|
|
|
|
|
toybox_yes | toybox_ ) ft_toybox=yes ;;
|
|
|
|
|
toybox_no ) ft_toybox=no ;;
|
|
|
|
|
trivia_yes | trivia_ ) ft_trivia=yes ;;
|
|
|
|
|
trivia_no ) ft_trivia=no ;;
|
|
|
|
|
uptime_yes | uptime_ ) ft_uptime=yes ;;
|
|
|
|
|
uptime_no ) ft_uptime=no ;;
|
2018-03-14 03:02:30 +01:00
|
|
|
urlcapture_yes | urlcapture_ ) ft_urlcapture=yes ;;
|
|
|
|
|
urlcapture_no ) ft_urlcapture=no ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
web_yes | web_ ) ft_web=yes ;;
|
|
|
|
|
web_no ) ft_web=no ;;
|
|
|
|
|
wingate_yes | wingate_ ) ft_wingate=yes ;;
|
|
|
|
|
wingate_no ) ft_wingate=no ;;
|
|
|
|
|
profiling_yes | profiling_ ) ft_prof=yes ;;
|
|
|
|
|
profiling_no ) ft_prof=no ;;
|
|
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
--disable-* | --without-*)
|
|
|
|
|
case "$feature" in
|
|
|
|
|
alias ) ft_alias=no ;;
|
|
|
|
|
botnet ) ft_botnet=no ;;
|
|
|
|
|
bounce ) ft_bounce=no ;;
|
|
|
|
|
chanban ) ft_chanban=yes ;;
|
|
|
|
|
ctcp ) ft_ctcp=no ;;
|
|
|
|
|
dccfile ) ft_dccfile=no ;;
|
|
|
|
|
debug ) ft_debug=no ;;
|
|
|
|
|
dynamode ) ft_dynamode=no ;;
|
|
|
|
|
dyncmd ) ft_dyncmd=no ;;
|
|
|
|
|
greet ) ft_greet=no ;;
|
2018-03-13 02:39:29 +01:00
|
|
|
hostinfo ) ft_hostinfo=no ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
idwrap ) ft_idwrap=no ;;
|
|
|
|
|
ircd_ext ) ft_ircd_ext=no ;;
|
|
|
|
|
md5 ) ft_md5=no ;;
|
|
|
|
|
newbie ) ft_newbie=no ;;
|
|
|
|
|
note ) ft_note=no ;;
|
|
|
|
|
notify ) ft_notify=no ;;
|
|
|
|
|
perl ) ft_perl=no ;;
|
|
|
|
|
profiling ) ft_prof=no ;;
|
|
|
|
|
python ) ft_python=no ;;
|
|
|
|
|
rawdns ) ft_rawdns=no ;;
|
|
|
|
|
redirect ) ft_redirect=no ;;
|
|
|
|
|
seen ) ft_seen=no ;;
|
|
|
|
|
session ) ft_session=no ;;
|
2018-03-09 03:51:03 +01:00
|
|
|
sha ) ft_sha=yes ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
stats ) ft_stats=no ;;
|
|
|
|
|
tcl ) ft_tcl=no ;;
|
|
|
|
|
telnet ) ft_telnet=no ;;
|
|
|
|
|
toybox ) ft_toybox=no ;;
|
|
|
|
|
trivia ) ft_trivia=no ;;
|
|
|
|
|
uptime ) ft_uptime=no ;;
|
2018-03-14 03:02:30 +01:00
|
|
|
urlcapture ) ft_urlcapture=no ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
web ) ft_web=no ;;
|
|
|
|
|
wingate ) ft_wingate=no ;;
|
|
|
|
|
esac
|
|
|
|
|
;;
|
2018-03-16 02:45:13 +01:00
|
|
|
--compile) compile=yes ;;
|
|
|
|
|
--install) install=yes ;;
|
|
|
|
|
--silence=options) silentopt=yes ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
--md5=internal) ft_md5=internal ;;
|
2018-03-09 03:51:03 +01:00
|
|
|
--sha=internal) ft_sha=internal ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
--use-cpuflags) cc_arch_opt=yes ;;
|
|
|
|
|
--no-cpuflags) cc_arch_opt=no ;;
|
|
|
|
|
--use-optimize) cc_optimize_opt=yes ;;
|
|
|
|
|
--no-optimize) cc_optimize_opt=no ;;
|
2018-03-21 22:49:46 +01:00
|
|
|
--optimize=speed) optitype=speed ;;
|
|
|
|
|
--optimize=size) optitype=size ;;
|
2014-03-08 19:56:21 -05:00
|
|
|
--use-gnudebug) cc_g_opt=yes ;;
|
|
|
|
|
--no-gnudebug) cc_g_opt=no ;;
|
|
|
|
|
--use-warnflag) cc_wall_opt=yes ;;
|
|
|
|
|
--no-warnflag) cc_wall_opt=no ;;
|
|
|
|
|
--use-pipeflag) cc_pipe_opt=yes ;;
|
|
|
|
|
--no-pipeflag) cc_pipe_opt=no ;;
|
|
|
|
|
--use-ofp) cc_ofp_opt=yes ;;
|
|
|
|
|
--no-ofp) cc_ofp_opt=no ;;
|
|
|
|
|
--yes) ft_alias=yes
|
|
|
|
|
ft_botnet=yes
|
|
|
|
|
ft_bounce=yes
|
|
|
|
|
ft_chanban=yes
|
|
|
|
|
ft_ctcp=yes
|
|
|
|
|
ft_dccfile=yes
|
|
|
|
|
ft_debug=yes
|
|
|
|
|
ft_dynamode=yes
|
|
|
|
|
ft_dyncmd=yes
|
|
|
|
|
ft_greet=yes
|
2018-03-13 02:39:29 +01:00
|
|
|
ft_hostinfo=yes
|
2014-03-08 19:56:21 -05:00
|
|
|
ft_ircd_ext=yes
|
|
|
|
|
ft_md5=yes
|
|
|
|
|
ft_newbie=yes
|
|
|
|
|
ft_note=yes
|
|
|
|
|
ft_notify=yes
|
|
|
|
|
ft_python=yes
|
|
|
|
|
ft_rawdns=yes
|
|
|
|
|
ft_redirect=yes
|
|
|
|
|
ft_seen=yes
|
|
|
|
|
ft_session=yes
|
2018-03-09 03:51:03 +01:00
|
|
|
ft_sha=yes
|
2014-03-08 19:56:21 -05:00
|
|
|
ft_stats=yes
|
|
|
|
|
ft_tcl=yes
|
|
|
|
|
ft_telnet=yes
|
|
|
|
|
ft_toybox=yes
|
|
|
|
|
ft_trivia=yes
|
|
|
|
|
ft_uptime=yes
|
2018-03-14 03:02:30 +01:00
|
|
|
ft_urlcapture=yes
|
2014-03-08 19:56:21 -05:00
|
|
|
ft_web=yes
|
|
|
|
|
ft_wingate=yes
|
|
|
|
|
;;
|
|
|
|
|
--help | -h)
|
|
|
|
|
cat <<__EOT__
|
|
|
|
|
Usage: configure [options]
|
|
|
|
|
Configuration:
|
|
|
|
|
--help print this message
|
|
|
|
|
Features and packages:
|
|
|
|
|
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
|
|
|
|
|
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
|
|
|
|
|
--with-FEATURE[=ARG] use FEATURE [ARG=yes]
|
|
|
|
|
--without-FEATURE do not use FEATURE (same as --with-FEATURE=no)
|
|
|
|
|
--md5=internal Use internal routines for MD5 password hashes instead of system libraries
|
2018-03-09 03:51:03 +01:00
|
|
|
--sha=internal Use internal routines for SHA password hashes instead of system libraries
|
2018-03-16 02:45:13 +01:00
|
|
|
--use-ofp Try to use compiler flag -fomit-frame-pointer
|
|
|
|
|
--no-ofp Do not use compiler flag -fomit-frame-pointer
|
2014-03-08 19:56:21 -05:00
|
|
|
#md5 | ctcp | dccfile | uptime | redirect | greet | perl | dynamode | web \
|
|
|
|
|
#note | notify | trivia | toybox | bounce | stats | rawdns | ircd_ext | idwrap | chanban | python )
|
|
|
|
|
--with-alias ALIAS support
|
|
|
|
|
--with-botnet Botnet support
|
|
|
|
|
--with-debug Debug support
|
|
|
|
|
--with-dyncmd Dynamic command levels support
|
2018-03-13 02:39:29 +01:00
|
|
|
--with-hostinfo Support for code that reveals/displays/shares information about the host
|
2018-03-14 03:02:30 +01:00
|
|
|
that the bot is running on
|
2014-03-08 19:56:21 -05:00
|
|
|
--with-newbie Newbie support
|
|
|
|
|
--with-profiling Profiling (gcc+gprof)
|
|
|
|
|
--with-seen SEEN support
|
|
|
|
|
--with-session Session support
|
|
|
|
|
--with-tcl Tcl support
|
|
|
|
|
--with-telnet Telnet support
|
2018-03-14 03:02:30 +01:00
|
|
|
--with-uptime Include code that sends uptime reports to the IRC bot uptime contest server
|
|
|
|
|
--with-urlcapture URL capture support
|
2014-03-08 19:56:21 -05:00
|
|
|
--with-wingate Wingate support
|
|
|
|
|
__EOT__
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
CC=*)
|
|
|
|
|
CC=`echo $opt | sed 's/.*=//;'`
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "unknown option: $opt"
|
|
|
|
|
echo "Usage: configure [options]"
|
|
|
|
|
echo "use \"$0 --help\" for help"
|
|
|
|
|
exit 1
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
if (echo "testing\c"; echo 1,2,3) | grep c > /dev/null; then
|
|
|
|
|
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn > /dev/null; then
|
|
|
|
|
ac_n=
|
|
|
|
|
ac_c='
|
|
|
|
|
'
|
|
|
|
|
ac_t=' '
|
|
|
|
|
else
|
|
|
|
|
ac_n=-n
|
|
|
|
|
ac_c=
|
|
|
|
|
ac_t=
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
ac_n=
|
|
|
|
|
ac_c='\c'
|
|
|
|
|
ac_t=
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo $ac_n "checking system type ... "$ac_c
|
|
|
|
|
|
|
|
|
|
cf_ERR=yes
|
2018-02-28 23:39:23 +01:00
|
|
|
UNAME=`config/which uname`
|
2014-03-08 19:56:21 -05:00
|
|
|
test -x $UNAME && cf_ERR=
|
|
|
|
|
|
|
|
|
|
if test -z "$cf_ERR" && cf_ERR=yes && $UNAME -s 1> /dev/null 2> /dev/null; then
|
|
|
|
|
cf_SYS=`$UNAME -s`
|
|
|
|
|
cf_ERR=
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test -z "$cf_ERR" && cf_ERR=yes && $UNAME -m 1> /dev/null 2> /dev/null; then
|
|
|
|
|
cf_MACH=`$UNAME -m`
|
|
|
|
|
cf_ERR=
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
case _"$cf_ERR"_ in
|
|
|
|
|
_yes_ )
|
|
|
|
|
echo $ac_t unknown
|
|
|
|
|
echo "Unable to determine system type."
|
|
|
|
|
echo "Dont know how to compile the EnergyMech."
|
|
|
|
|
echo "exiting ..."
|
|
|
|
|
exit 1
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
if [ "$cf_SYS" = AIX ]; then
|
|
|
|
|
cf_MACH=
|
|
|
|
|
cf_SYSMACH="$cf_SYS"
|
|
|
|
|
else
|
|
|
|
|
cf_SYSMACH="$cf_SYS"'-'"$cf_MACH"
|
|
|
|
|
fi
|
2018-02-28 23:39:23 +01:00
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
echo $ac_t "$cf_SYSMACH"
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
echo $ac_n "checking for C compiler ... "$ac_c
|
|
|
|
|
if [ "$CC" ]; then
|
|
|
|
|
CCshort="$CC"
|
|
|
|
|
CC=`config/which $CC`
|
|
|
|
|
else
|
|
|
|
|
CCshort=gcc
|
|
|
|
|
CC=`config/which gcc`
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -x "$CC" ]; then
|
|
|
|
|
CCshort=cc
|
|
|
|
|
CC=`config/which cc`
|
|
|
|
|
if [ ! -x "$CC" ]; then
|
|
|
|
|
echo $ac_t "not found"
|
|
|
|
|
echo "A working C compiler is needed to compile the EnergyMech"
|
|
|
|
|
echo "exiting ..."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
CClong="$CC"
|
|
|
|
|
CC="$CCshort"
|
|
|
|
|
echo $ac_t "$CC"
|
|
|
|
|
|
|
|
|
|
# set up things for test compiling
|
|
|
|
|
|
|
|
|
|
TESTO=./test$$.o
|
|
|
|
|
TESTP=./test$$
|
|
|
|
|
rm -f $TESTO $TESTP
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# does the C compile work?
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
TESTC=config/cc.c
|
|
|
|
|
|
|
|
|
|
echo $ac_n "checking whether $CC works or not ... "$ac_c
|
|
|
|
|
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
|
|
|
|
|
WORK=no
|
|
|
|
|
if [ -x "$TESTP" ]; then
|
|
|
|
|
res=_`$TESTP`_
|
|
|
|
|
WORK=yes
|
|
|
|
|
case $res in
|
|
|
|
|
_yes_ )
|
|
|
|
|
;;
|
|
|
|
|
_gnucc_ )
|
|
|
|
|
cf_GNUCC=yes
|
|
|
|
|
;;
|
|
|
|
|
_gnucc95_ )
|
|
|
|
|
cf_GNUCC=95
|
|
|
|
|
;;
|
|
|
|
|
_gnucc33_ )
|
|
|
|
|
cf_GNUCC=33
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
|
|
|
|
|
if [ "$WORK" = yes ]; then
|
|
|
|
|
echo $ac_t yes
|
|
|
|
|
compiler=$CC
|
|
|
|
|
else
|
|
|
|
|
echo $ac_t no
|
|
|
|
|
echo ''
|
|
|
|
|
echo "A working C compiler is needed to compile the EnergyMech"
|
|
|
|
|
echo "exiting ..."
|
|
|
|
|
echo ''
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# compiler flags
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
echo $ac_n "checking C compiler flags ... "$ac_c
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# -g
|
|
|
|
|
#
|
|
|
|
|
if [ -z "$cc_g_opt" ]; then
|
|
|
|
|
cc_g_opt=no
|
|
|
|
|
if $CC -g -c -o $TESTO $TESTC 1> /dev/null 2> /dev/null && test -r $TESTO; then
|
|
|
|
|
cc_g_opt=yes
|
|
|
|
|
cc_g_flag=-g
|
|
|
|
|
echo $ac_n "-g "$ac_c
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
#
|
|
|
|
|
# GNU GCC
|
|
|
|
|
#
|
|
|
|
|
if [ -n "$cf_GNUCC" ]; then
|
|
|
|
|
#
|
|
|
|
|
# -Wall -Wshadow
|
|
|
|
|
#
|
|
|
|
|
if [ -r .use_warn -o -n "$cc_wall_opt" ]; then
|
|
|
|
|
if [ -z "$cc_wall_opt" -o -z "$cc_wshadow_opt" ]; then
|
|
|
|
|
if $CC -Wall -Wshadow -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
|
|
|
|
|
cc_wall_flag="-Wall"
|
|
|
|
|
cc_wshadow_flag="-Wshadow"
|
|
|
|
|
echo $ac_n "-Wall -Wshadow "$ac_c
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
if [ "$cc_wall_flag" = -Wall -a "$cf_GNUCC" = 33 ]; then
|
|
|
|
|
cc_fnostrictalias="-fno-strict-aliasing"
|
|
|
|
|
echo $ac_n "-fno-strict-aliasing "$ac_c
|
|
|
|
|
fi
|
|
|
|
|
#
|
|
|
|
|
# -march=i386/i486/i586
|
|
|
|
|
#
|
|
|
|
|
test -z "$cc_arch_opt" && cc_arch_opt=yes
|
|
|
|
|
if [ "$cc_arch_opt" = yes ]; then
|
|
|
|
|
case _"$cf_GNUCC"_"$cf_MACH"_ in
|
|
|
|
|
_95_i486_ | _33_i486_ )
|
|
|
|
|
if $CC -march=i486 -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
|
|
|
|
|
cc_arch_flag="-march=i486"
|
|
|
|
|
echo $ac_n "-march=i486 "$ac_c
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
_95_i[56789]86_ | _33_i[56789]86_ )
|
|
|
|
|
if $CC -march=i586 -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
|
|
|
|
|
cc_arch_flag="-march=i586"
|
|
|
|
|
echo $ac_n "-march=i586 "$ac_c
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
#
|
|
|
|
|
# -fomit-frame-pointer
|
|
|
|
|
#
|
|
|
|
|
if [ -z "$cc_ofp_opt" -o "$cc_ofp_opt" = yes ]; then
|
|
|
|
|
if $CC -fomit-frame-pointer -c -o $TESTO $TESTC 1> /dev/null 2> /dev/null && test -r $TESTO; then
|
|
|
|
|
cc_ofp_flag=-fomit-frame-pointer
|
|
|
|
|
echo $ac_n "-fomit-frame-pointer "$ac_c
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -z "$cc_pipe_opt" ]; then
|
|
|
|
|
if $CC -pipe -c -o $TESTO $TESTC 1> /dev/null 2> /dev/null && test -r $TESTO; then
|
|
|
|
|
cc_pipe_flag="-pipe"
|
|
|
|
|
echo $ac_n "-pipe "$ac_c
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2018-03-21 22:49:46 +01:00
|
|
|
oflag="-O2"
|
|
|
|
|
if [ "$optitype" = size ]; then
|
|
|
|
|
oflag="-Os"
|
|
|
|
|
fi
|
|
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
if [ -z "$cc_optimize_opt" ]; then
|
2018-03-21 22:49:46 +01:00
|
|
|
if $CC $oflag -o $TESTO $TESTC 1> /dev/null 2> /dev/null; then
|
|
|
|
|
cc_optimize_flag="$oflag"
|
|
|
|
|
echo $ac_n "$oflag "$ac_c
|
2014-03-08 19:56:21 -05:00
|
|
|
fi
|
|
|
|
|
if [ -z "$cc_optimize_flag" ]; then
|
|
|
|
|
if $CC -O -o $TESTO $TESTC 1> /dev/null 2> /dev/null; then
|
|
|
|
|
cc_optimize_flag="-O"
|
|
|
|
|
echo $ac_n "-O "$ac_c
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo $ac_t ""
|
|
|
|
|
|
|
|
|
|
if [ "$ft_prof" = yes ]; then
|
|
|
|
|
echo $ac_n "checking profiling support ... "$ac_c
|
|
|
|
|
if $CC -pg -o $TESTO $TESTC 1> /dev/null 2> /dev/null; then
|
|
|
|
|
cc_ofp_flag=
|
|
|
|
|
cc_pg_flag="-pg"
|
|
|
|
|
cc_pg_define="-D__profiling__"
|
|
|
|
|
libpgdl=
|
|
|
|
|
echo $ac_t yes
|
|
|
|
|
else
|
|
|
|
|
if $CC -pg -o $TESTO $TESTC -ldl 1> /dev/null 2> /dev/null; then
|
|
|
|
|
cc_ofp_flag=
|
|
|
|
|
cc_pg_flag="-pg"
|
|
|
|
|
cc_pg_define="-D__profiling__"
|
|
|
|
|
libpgdl="-ldl"
|
|
|
|
|
echo $ac_t "-ldl"
|
|
|
|
|
else
|
|
|
|
|
echo $ac_t no
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
rm -f $TESTO $TESTP
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# 32bit? 64bit?
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
TESTC=config/ptr_size.c
|
|
|
|
|
|
|
|
|
|
if [ -z "$ptr_size" ]; then
|
|
|
|
|
ptr_size=unknown
|
|
|
|
|
echo $ac_n "checking pointer size ... "$ac_c
|
|
|
|
|
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
ptr_size=`$TESTP`
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$ptr_size"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
case _"$ptr_size"_ in
|
|
|
|
|
_8_ )
|
|
|
|
|
PTSIZE_DEFINE32='#undef PTSIZE_32BIT'
|
|
|
|
|
PTSIZE_DEFINE64='#define PTSIZE_64BIT'
|
|
|
|
|
;;
|
|
|
|
|
* )
|
|
|
|
|
PTSIZE_DEFINE32='#define PTSIZE_32BIT'
|
|
|
|
|
PTSIZE_DEFINE64='#undef PTSIZE_64BIT'
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
|
2018-03-10 02:55:07 +01:00
|
|
|
#
|
|
|
|
|
# big/little endian
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
TESTC=config/endian.c
|
|
|
|
|
|
|
|
|
|
if [ -z "$endian" ]; then
|
|
|
|
|
endian=unknown
|
|
|
|
|
echo $ac_n "checking endianness ... "$ac_c
|
|
|
|
|
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
endian=`$TESTP`
|
2018-03-21 22:49:46 +01:00
|
|
|
if [ "$endian" = 1 ]; then
|
2018-03-10 02:55:07 +01:00
|
|
|
endian="little"
|
|
|
|
|
else
|
|
|
|
|
endian="big"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$endian endian"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
case "$endian" in
|
|
|
|
|
little )
|
|
|
|
|
LIT_END="#define LITTLE_ENDIAN"
|
|
|
|
|
BIG_END="#undef BIG_ENDIAN"
|
|
|
|
|
;;
|
|
|
|
|
* )
|
|
|
|
|
LIT_END="#undef LITTLE_ENDIAN"
|
|
|
|
|
BIG_END="#define BIG_ENDIAN"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
#
|
2018-03-09 03:51:03 +01:00
|
|
|
# Some processors like Sparc, will cause a bus error (SIGBUS) if you try to access unaligned memory
|
2014-03-08 19:56:21 -05:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
has_unaligned=no
|
|
|
|
|
UNALIGNED_MEM='#undef UNALIGNED_MEM'
|
|
|
|
|
TESTC=config/unaligned.c
|
|
|
|
|
|
|
|
|
|
echo $ac_n "checking if cpu can access unaligned memory ... "$ac_c
|
|
|
|
|
|
|
|
|
|
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ "`$TESTP`" = yes ]; then
|
|
|
|
|
has_unaligned=yes
|
|
|
|
|
UNALIGNED_MEM='#define UNALIGNED_MEM'
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$has_unaligned"
|
|
|
|
|
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# where is inet_addr() ?
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
has_inet_addr=no
|
|
|
|
|
TESTC=config/inet_addr.c
|
|
|
|
|
|
|
|
|
|
echo $ac_n "checking for inet_addr() ... "$ac_c
|
|
|
|
|
|
|
|
|
|
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
has_inet_addr=yes
|
|
|
|
|
else
|
|
|
|
|
$CC -o $TESTP $TESTC -lnsl 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
has_inet_addr=-lnsl
|
|
|
|
|
libnsl=-lnsl
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$has_inet_addr"
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
|
|
|
|
|
#
|
2018-03-09 03:51:03 +01:00
|
|
|
# where is inet_aton() ?
|
2014-03-08 19:56:21 -05:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
has_inet_aton=no
|
|
|
|
|
TESTC=config/inet_aton.c
|
|
|
|
|
|
|
|
|
|
echo $ac_n "checking for inet_aton() ... "$ac_c
|
|
|
|
|
|
|
|
|
|
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
has_inet_aton=yes
|
|
|
|
|
else
|
|
|
|
|
$CC -o $TESTP $TESTC -lresolv 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
has_inet_aton=-lresolv
|
|
|
|
|
libresolv=-lresolv
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$has_inet_aton"
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# where is socket() ?
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
has_socket=no
|
|
|
|
|
TESTC=config/socket.c
|
|
|
|
|
|
|
|
|
|
echo $ac_n "checking for socket() ... "$ac_c
|
|
|
|
|
|
|
|
|
|
$CC -o $TESTP $TESTC 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
has_socket=yes
|
|
|
|
|
else
|
|
|
|
|
$CC -o $TESTP $TESTC -lsocket 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
has_socket=-lsocket
|
|
|
|
|
libsocket=-lsocket
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$has_socket"
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
|
|
|
|
|
#
|
2018-03-09 03:51:03 +01:00
|
|
|
# check for SHA capabilities in libc/glibc/libcrypt
|
2014-03-08 19:56:21 -05:00
|
|
|
#
|
2018-03-09 03:51:03 +01:00
|
|
|
has_sha=no
|
2014-03-08 19:56:21 -05:00
|
|
|
has_md5=no
|
2018-03-09 03:51:03 +01:00
|
|
|
if [ ! "$ft_sha" = no ]; then
|
2014-03-08 19:56:21 -05:00
|
|
|
TESTC=config/pw.c
|
2018-03-09 03:51:03 +01:00
|
|
|
echo $ac_n "checking for SHA in crypt() ... "$ac_c
|
|
|
|
|
sha_internal=
|
|
|
|
|
crypt_func='-DCRYPT_FUNC=crypt'
|
|
|
|
|
CRYPT_FUNCTION='#define CRYPT_FUNC crypt'
|
|
|
|
|
if [ "$ft_sha" = internal ]; then
|
|
|
|
|
sha_internal=config/sha_internal.c
|
|
|
|
|
crypt_func='-DCRYPT_FUNC=sha_crypt'
|
|
|
|
|
CRYPT_FUNCTION='#define CRYPT_FUNC sha_crypt'
|
|
|
|
|
fi
|
|
|
|
|
$CC -o $TESTP $TESTC $sha_internal $crypt_func 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ ! -x $TESTP ]; then
|
|
|
|
|
libcrypt=-lcrypt
|
|
|
|
|
has_sha=yes
|
|
|
|
|
$CC -o $TESTP $TESTC $crypt_func $libcrypt 1> /dev/null 2> /dev/null
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -x $TESTP ]; then
|
|
|
|
|
libcrypt=/usr/lib/libcrypt.so
|
|
|
|
|
has_sha=yes
|
|
|
|
|
$CC -o $TESTP $TESTC $crypt_func $libcrypt 1> /dev/null 2> /dev/null
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -x $TESTP ]; then
|
|
|
|
|
has_sha=no
|
|
|
|
|
libcrypt=
|
|
|
|
|
fi
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
pwhash=`$TESTP`
|
|
|
|
|
case "$pwhash" in
|
|
|
|
|
MD5 ) has_md5=yes ;;
|
|
|
|
|
SHAMD5 )
|
|
|
|
|
has_md5=yes
|
|
|
|
|
has_sha=yes
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$has_sha"
|
|
|
|
|
[ "$has_sha" = yes -a "$sha_internal" ] && has_sha=internal
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# check for MD5 capabilities in libc/glibc/libcrypt
|
|
|
|
|
#
|
|
|
|
|
if [ "$has_md5" = yes ]; then
|
|
|
|
|
echo "checking for MD5 in crypt() ... (cached) yes"
|
|
|
|
|
elif [ ! "$ft_md5" = no ]; then
|
|
|
|
|
TESTC=config/pw.c
|
|
|
|
|
echo $ac_n "checking for MD5 in crypt() ... "$ac_c
|
2014-03-08 19:56:21 -05:00
|
|
|
md5_internal=
|
|
|
|
|
crypt_func='-DCRYPT_FUNC=crypt'
|
|
|
|
|
CRYPT_FUNCTION='#define CRYPT_FUNC crypt'
|
|
|
|
|
if [ "$ft_md5" = internal ]; then
|
|
|
|
|
md5_internal=config/md5_internal.c
|
|
|
|
|
crypt_func='-DCRYPT_FUNC=md5_crypt'
|
|
|
|
|
CRYPT_FUNCTION='#define CRYPT_FUNC md5_crypt'
|
|
|
|
|
fi
|
|
|
|
|
$CC -o $TESTP $TESTC $md5_internal $crypt_func 1> /dev/null 2> /dev/null
|
|
|
|
|
if [ ! -x $TESTP ]; then
|
|
|
|
|
libcrypt=-lcrypt
|
|
|
|
|
has_md5=yes
|
|
|
|
|
$CC -o $TESTP $TESTC $crypt_func $libcrypt 1> /dev/null 2> /dev/null
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -x $TESTP ]; then
|
|
|
|
|
libcrypt=/usr/lib/libcrypt.so
|
|
|
|
|
has_md5=yes
|
|
|
|
|
$CC -o $TESTP $TESTC $crypt_func $libcrypt 1> /dev/null 2> /dev/null
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -x $TESTP ]; then
|
|
|
|
|
has_md5=no
|
|
|
|
|
libcrypt=
|
|
|
|
|
fi
|
|
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
pwhash=`$TESTP`
|
|
|
|
|
case "$pwhash" in
|
|
|
|
|
MD5 ) has_md5=yes ;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$has_md5"
|
|
|
|
|
[ "$has_md5" = yes -a "$md5_internal" ] && has_md5=internal
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# check for tcl
|
|
|
|
|
#
|
|
|
|
|
has_tcl=no
|
|
|
|
|
if [ ! "$ft_tcl" = no ]; then
|
|
|
|
|
echo $ac_n "checking for tcl ... "$ac_c
|
|
|
|
|
TESTC=config/tcl.c
|
2014-11-13 02:09:31 +01:00
|
|
|
tclconfig=
|
|
|
|
|
if [ -f /usr/lib/tclConfig.sh ]; then
|
|
|
|
|
tclconfig=tclconfig
|
|
|
|
|
. /usr/lib/tclConfig.sh
|
|
|
|
|
fi
|
2014-03-08 19:56:21 -05:00
|
|
|
libtcl=
|
2014-11-13 02:09:31 +01:00
|
|
|
inctcl=
|
|
|
|
|
for tclver in $tclconfig empty 8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0
|
2014-03-08 19:56:21 -05:00
|
|
|
do
|
|
|
|
|
if [ -z "$libtcl" ]; then
|
2014-11-13 02:09:31 +01:00
|
|
|
case "$tclver" in
|
|
|
|
|
"tclconfig")
|
|
|
|
|
TCLLIB=$TCL_LIB_FLAG
|
|
|
|
|
TCLINCLUDE=$TCL_INCLUDE_SPEC
|
|
|
|
|
tclver=$TCL_VERSION
|
|
|
|
|
;;
|
|
|
|
|
"empty")
|
|
|
|
|
TCLLIB=-ltcl
|
|
|
|
|
TCLINCLUDE=
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
TCLLIB=-ltcl$tclver
|
|
|
|
|
TCLINCLUDE=
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
if $CC -o $TESTP $TESTC $TCLLIB $TCLINCLUDE 1> /dev/null 2> /dev/null; then
|
2014-03-08 19:56:21 -05:00
|
|
|
libtcl=$TCLLIB
|
2014-11-13 02:09:31 +01:00
|
|
|
inctcl=$TCLINCLUDE
|
2014-03-08 19:56:21 -05:00
|
|
|
has_tcl=$TCLLIB
|
|
|
|
|
test "$tclver" = "empty" && echo $ac_t "yes" || echo $ac_t "yes (version $tclver)"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
if [ -z "$libtcl" ]; then
|
|
|
|
|
has_tcl=no
|
|
|
|
|
echo $ac_t "no"
|
|
|
|
|
fi
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# check for python
|
|
|
|
|
#
|
|
|
|
|
has_python=no
|
|
|
|
|
if [ ! "$ft_python" = no ]; then
|
|
|
|
|
echo $ac_n "checking for python ... "$ac_c
|
|
|
|
|
TESTC=config/python.c
|
|
|
|
|
libpython=
|
|
|
|
|
incpython=
|
|
|
|
|
for pyver in 2.9 2.8 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0
|
|
|
|
|
do
|
|
|
|
|
if [ -z "$libpython" ]; then
|
|
|
|
|
PYINCLUDE=python$pyver/Python.h
|
|
|
|
|
PYLIB=-lpython$pyver
|
|
|
|
|
if $CC -o $TESTP $TESTC -include $PYINCLUDE $PYLIB 1> /dev/null 2> /dev/null; then
|
|
|
|
|
libpython=$PYLIB
|
|
|
|
|
incpython="-include $PYINCLUDE"
|
|
|
|
|
has_python=yes
|
|
|
|
|
echo $ac_t "yes (version $pyver)"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
if [ -z "$libpython" ]; then
|
|
|
|
|
has_python=no
|
|
|
|
|
echo $ac_t "no"
|
|
|
|
|
fi
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# can we use our custom little ld script?
|
|
|
|
|
#
|
|
|
|
|
ldscript=
|
|
|
|
|
has_ldscript=no
|
|
|
|
|
TESTC=config/ldtest.c
|
|
|
|
|
|
|
|
|
|
echo $ac_n "checking for friendly ld ... "$ac_c
|
|
|
|
|
|
2018-03-13 02:39:29 +01:00
|
|
|
$CC -o $TESTP $TESTC -Wl,-T,src/ld/elf64-x86-64 1> /dev/null 2> /dev/null
|
2014-03-08 19:56:21 -05:00
|
|
|
if [ -x $TESTP ]; then
|
|
|
|
|
if [ `$TESTP` = "yes" ]; then
|
2018-03-13 02:39:29 +01:00
|
|
|
ldscript='-Wl,-T,ld/elf64-x86-64'
|
2014-03-08 19:56:21 -05:00
|
|
|
has_ldscript=yes
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$has_ldscript"
|
|
|
|
|
rm -f $TESTP
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# idwrap
|
|
|
|
|
#
|
|
|
|
|
has_idwrap=no
|
|
|
|
|
def_idwrap='#undef IDWRAP'
|
|
|
|
|
IDWRAP_PATH='/* nothing */'
|
|
|
|
|
|
|
|
|
|
if [ -r .use_idwrap -o "$ft_idwrap" = yes ]; then
|
|
|
|
|
echo $ac_n "checking for idwrap path ... "$ac_c
|
|
|
|
|
if test -z "$idwrappath"; then
|
|
|
|
|
idwrappath="/tmp/.ident/"
|
|
|
|
|
fi
|
|
|
|
|
if test -d $idwrappath; then
|
|
|
|
|
IDWRAP_PATH='"'"$idwrappath"'"'
|
|
|
|
|
has_idwrap="$IDWRAP_PATH"
|
|
|
|
|
def_idwrap='#define IDWRAP'
|
|
|
|
|
fi
|
|
|
|
|
echo $ac_t "$has_idwrap"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
echo $ac_n "checking for objcopy ... "$ac_c
|
|
|
|
|
OBJCOPY=`config/which objcopy`
|
|
|
|
|
echo $ac_t "$OBJCOPY"
|
|
|
|
|
PROGSIZE=
|
|
|
|
|
sizecomment='#'
|
|
|
|
|
if [ -r .use_size ]; then
|
|
|
|
|
echo $ac_n "checking for size ... "$ac_c
|
|
|
|
|
PROGSIZE=`config/which size`
|
|
|
|
|
echo $ac_t "$PROGSIZE"
|
|
|
|
|
[ ! "$PROGSIZE" = "not found" ] && sizecomment=
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
objcomment=
|
|
|
|
|
[ "$OBJCOPY" = "not found" ] && objcomment='#'
|
|
|
|
|
|
|
|
|
|
MD5_O=
|
|
|
|
|
if [ "$ft_md5" = internal ]; then
|
|
|
|
|
MD5_O=md5/md5.o
|
|
|
|
|
fi
|
|
|
|
|
|
2018-03-09 03:51:03 +01:00
|
|
|
SHA_O=
|
|
|
|
|
if [ "$ft_sha" = internal ]; then
|
|
|
|
|
SHA_O=sha/sha.o
|
|
|
|
|
fi
|
|
|
|
|
|
2018-03-16 02:45:13 +01:00
|
|
|
out=echo
|
|
|
|
|
if [ "$silentopt" == yes ]; then
|
|
|
|
|
out=/bin/true
|
|
|
|
|
fi
|
|
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
echo
|
2018-03-16 02:45:13 +01:00
|
|
|
$out "Do you want ..."
|
|
|
|
|
$out
|
2014-03-08 19:56:21 -05:00
|
|
|
|
|
|
|
|
def_alias='#undef ALIAS'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Alias support? ............................. [Y/n] "$ac_c
|
|
|
|
|
test "$ft_alias" && $out "$ft_alias" && ans=$ft_alias
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_alias" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_alias='#define ALIAS'
|
|
|
|
|
|
|
|
|
|
def_rawdns='#undef RAWDNS'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[ BETA ] Async DNS support? ......................... [y/N] "$ac_c
|
|
|
|
|
test "$ft_rawdns" && $out "$ft_rawdns" && ans=$ft_rawdns
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_rawdns" && read ans
|
2014-03-08 20:13:25 -05:00
|
|
|
test "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_rawdns='#define RAWDNS'
|
2014-03-08 19:56:21 -05:00
|
|
|
|
|
|
|
|
def_botnet='#undef BOTNET'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Botnet support? ............................ [Y/n] "$ac_c
|
|
|
|
|
test "$ft_botnet" && $out "$ft_botnet" && ans=$ft_botnet
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_botnet" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_botnet='#define BOTNET'
|
|
|
|
|
|
|
|
|
|
def_chanban='#undef CHANBAN'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Channel ban support? ....................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_chanban" && $out "$ft_chanban" && ans=$ft_chanban
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_chanban" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_chanban='#define CHANBAN'
|
|
|
|
|
|
2018-03-16 02:45:13 +01:00
|
|
|
def_redirect='#undef REDIRECT'
|
|
|
|
|
unset ans
|
|
|
|
|
$out $ac_n "[STABLE] Command output redirect? ................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_redirect" && $out "$ft_redirect" && ans=$ft_redirect
|
|
|
|
|
test -z "$ft_redirect" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_redirect='#define REDIRECT'
|
|
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
def_ctcp='#undef CTCP'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] CTCP? ...................................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_ctcp" && $out "$ft_ctcp" && ans=$ft_ctcp
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_ctcp" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_ctcp='#define CTCP'
|
|
|
|
|
|
|
|
|
|
def_dccfile='#undef DCC_FILE'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] DCC file support? .......................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_dccfile" && $out "$ft_dccfile" && ans=$ft_dccfile
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_dccfile" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_dccfile='#define DCC_FILE'
|
|
|
|
|
|
|
|
|
|
def_debug='#undef DEBUG'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Debug support? ............................. [y/N] "$ac_c
|
|
|
|
|
test "$ft_debug" && $out "$ft_debug" && ans=$ft_debug
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_debug" && read ans
|
|
|
|
|
test "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_debug='#define DEBUG'
|
|
|
|
|
|
|
|
|
|
def_dynamode='#undef DYNAMODE'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Dynamic channel limit (+l)? ................ [Y/n] "$ac_c
|
|
|
|
|
test "$ft_dynamode" && $out "$ft_dynamode" && ans=$ft_dynamode
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_dynamode" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_dynamode='#define DYNAMODE'
|
|
|
|
|
|
|
|
|
|
def_dyncmd='#undef DYNCMD'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Dynamic command levels support? ............ [Y/n] "$ac_c
|
|
|
|
|
test "$ft_dyncmd" && $out "$ft_dyncmd" && ans=$ft_dyncmd
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_dyncmd" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_dyncmd='#define DYNCMD'
|
|
|
|
|
|
|
|
|
|
def_greet='#undef GREET'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Greet support? ............................. [Y/n] "$ac_c
|
|
|
|
|
test "$ft_greet" && $out "$ft_greet" && ans=$ft_greet
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_greet" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_greet='#define GREET'
|
|
|
|
|
|
|
|
|
|
def_web='#undef WEB'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[ ALPHA] HTTP server support? ....................... [y/N] "$ac_c
|
|
|
|
|
test "$ft_web" && $out "$ft_web" && ans=$ft_web
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_web" && read ans
|
|
|
|
|
test "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_web='#define WEB'
|
|
|
|
|
|
2018-03-16 02:45:13 +01:00
|
|
|
def_hostinfo='#undef HOSTINFO'
|
2014-03-08 19:56:21 -05:00
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[ BETA ] Host info support? ......................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_hostinfo" && $out "$ft_hostinfo" && ans=$ft_hostinfo
|
|
|
|
|
test -z "$ft_hostinfo" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_hostinfo='#define HOSTINFO'
|
2014-03-08 19:56:21 -05:00
|
|
|
|
2018-03-16 02:45:13 +01:00
|
|
|
def_bounce='#undef BOUNCE'
|
2018-03-09 03:51:03 +01:00
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] IRC proxy support? ......................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_bounce" && $out "$ft_bounce" && ans=$ft_bounce
|
|
|
|
|
test -z "$ft_bounce" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_bounce='#define BOUNCE'
|
2018-03-09 03:51:03 +01:00
|
|
|
|
2018-03-16 02:45:13 +01:00
|
|
|
def_ircd_ext='#undef IRCD_EXTENSIONS'
|
2018-03-13 02:39:29 +01:00
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[ BETA ] IRCD extensions support? ................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_ircd_ext" && $out "$ft_ircd_ext" && ans=$ft_ircd_ext
|
|
|
|
|
test -z "$ft_ircd_ext" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_ircd_ext='#define IRCD_EXTENSIONS'
|
2018-03-13 02:39:29 +01:00
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
def_newbie='#undef NEWBIE'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Newbie support? ............................ [Y/n] "$ac_c
|
|
|
|
|
test "$ft_newbie" && $out "$ft_newbie" && ans=$ft_newbie
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_newbie" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_newbie='#define NEWBIE'
|
|
|
|
|
|
|
|
|
|
def_note='#undef NOTE'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Note support? .............................. [Y/n] "$ac_c
|
|
|
|
|
test "$ft_note" && $out "$ft_note" && ans=$ft_note
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_note" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_note='#define NOTE'
|
|
|
|
|
|
|
|
|
|
def_notify='#undef NOTIFY'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Notify support? ............................ [Y/n] "$ac_c
|
|
|
|
|
test "$ft_notify" && $out "$ft_notify" && ans=$ft_notify
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_notify" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_notify='#define NOTIFY'
|
|
|
|
|
|
2018-03-16 02:45:13 +01:00
|
|
|
def_md5='#undef MD5CRYPT'
|
|
|
|
|
unset ans
|
|
|
|
|
$out $ac_n "[STABLE] Password hashing with MD5? (less secure) ... [Y/n] "$ac_c
|
|
|
|
|
if [ "$has_md5" = no ]; then
|
|
|
|
|
$out 'no (unsupported)'
|
|
|
|
|
else
|
|
|
|
|
test "$ft_md5" && $out "$ft_md5" && ans=$ft_md5
|
|
|
|
|
test -z "$ft_md5" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes -o "$ans" = internal && def_md5='#define MD5CRYPT'
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
def_sha='#undef SHACRYPT'
|
|
|
|
|
unset ans
|
|
|
|
|
$out $ac_n "[ BETA ] Password hashing with SHA? (best) .......... [Y/n] "$ac_c
|
|
|
|
|
if [ "$has_sha" = no ]; then
|
|
|
|
|
$out 'no (unsupported)'
|
|
|
|
|
else
|
|
|
|
|
test "$ft_sha" && $out "$ft_sha" && ans=$ft_sha
|
|
|
|
|
test -z "$ft_sha" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes -o "$ans" = internal && def_sha='#define SHACRYPT'
|
|
|
|
|
fi
|
|
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
#
|
|
|
|
|
# perl support not yet functional (2009-05-11)
|
|
|
|
|
#
|
|
|
|
|
def_perl='#undef PERL'
|
|
|
|
|
# unset ans
|
|
|
|
|
# echo $ac_n "Perl scripting support? .................... [y/N] "$ac_c
|
|
|
|
|
# if [ "$has_perl" = no ]; then
|
|
|
|
|
# echo 'no (unsupported)'
|
|
|
|
|
# else
|
|
|
|
|
# test "$ft_perl" && echo "$ft_perl" && ans=$ft_perl
|
|
|
|
|
# test -z "$ft_perl" && read ans
|
|
|
|
|
# test "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_perl='#define PERL'
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
|
|
def_python='#undef PYTHON'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[ BETA ] Scripting with Python? ..................... [y/N] "$ac_c
|
2014-03-08 19:56:21 -05:00
|
|
|
if [ "$has_python" = no ]; then
|
2018-03-16 02:45:13 +01:00
|
|
|
$out 'no (unsupported)'
|
2014-03-08 19:56:21 -05:00
|
|
|
else
|
2018-03-16 02:45:13 +01:00
|
|
|
test "$ft_python" && $out "$ft_python" && ans=$ft_python
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_python" && read ans
|
|
|
|
|
test "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_python='#define PYTHON'
|
|
|
|
|
fi
|
|
|
|
|
if [ "$def_python" = '#undef PYTHON' ]; then
|
|
|
|
|
libpython=
|
|
|
|
|
incpython=
|
|
|
|
|
fi
|
|
|
|
|
|
2018-02-28 23:39:23 +01:00
|
|
|
def_tcl='#undef TCL'
|
2014-03-08 19:56:21 -05:00
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[ BETA ] Scripting with Tcl? ........................ [y/N] "$ac_c
|
2018-02-28 23:39:23 +01:00
|
|
|
if [ "$has_tcl" = no ]; then
|
2018-03-16 02:45:13 +01:00
|
|
|
$out 'no (unsupported)'
|
2018-02-28 23:39:23 +01:00
|
|
|
else
|
2018-03-16 02:45:13 +01:00
|
|
|
test "$ft_tcl" && $out "$ft_tcl" && ans=$ft_tcl
|
2018-02-28 23:39:23 +01:00
|
|
|
test -z "$ft_tcl" && read ans
|
|
|
|
|
test "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_tcl='#define TCL'
|
|
|
|
|
fi
|
|
|
|
|
if [ "$def_tcl" = '#undef TCL' ]; then
|
|
|
|
|
libtcl=
|
|
|
|
|
inctcl=
|
|
|
|
|
fi
|
2014-03-08 19:56:21 -05:00
|
|
|
|
|
|
|
|
def_seen='#undef SEEN'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Seen support? .............................. [y/N] "$ac_c
|
|
|
|
|
test "$ft_seen" && $out "$ft_seen" && ans=$ft_seen
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_seen" && read ans
|
|
|
|
|
test "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_seen='#define SEEN'
|
|
|
|
|
|
|
|
|
|
def_session='#undef SESSION'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Session support? ........................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_session" && $out "$ft_session" && ans=$ft_session
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_session" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_session='#define SESSION'
|
|
|
|
|
|
|
|
|
|
def_stats='#undef STATS'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Statistics support? ........................ [Y/n] "$ac_c
|
|
|
|
|
test "$ft_stats" && $out "$ft_stats" && ans=$ft_stats
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_stats" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_stats='#define STATS'
|
|
|
|
|
|
|
|
|
|
def_telnet='#undef TELNET'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Telnet support? ............................ [Y/n] "$ac_c
|
|
|
|
|
test "$ft_telnet" && $out "$ft_telnet" && ans=$ft_telnet
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_telnet" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_telnet='#define TELNET'
|
|
|
|
|
|
|
|
|
|
def_trivia='#undef TRIVIA'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Trivia support? ............................ [y/N] "$ac_c
|
|
|
|
|
test "$ft_trivia" && $out "$ft_trivia" && ans=$ft_trivia
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_trivia" && read ans
|
|
|
|
|
test "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_trivia='#define TRIVIA'
|
|
|
|
|
|
2018-03-16 02:45:13 +01:00
|
|
|
def_toybox='#undef TOYBOX'
|
|
|
|
|
unset ans
|
|
|
|
|
$out $ac_n "[STABLE] Toybox fun and games? ...................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_toybox" && $out "$ft_toybox" && ans=$ft_toybox
|
|
|
|
|
test -z "$ft_toybox" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_toybox='#define TOYBOX'
|
|
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
def_uptime='#undef UPTIME'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] Uptime support? ............................ [Y/n] "$ac_c
|
|
|
|
|
test "$ft_uptime" && $out "$ft_uptime" && ans=$ft_uptime
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_uptime" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_uptime='#define UPTIME'
|
|
|
|
|
|
2018-03-14 03:02:30 +01:00
|
|
|
def_urlcapture='#undef URLCAPTURE'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[ BETA ] URL capture support? ....................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_urlcapture" && $out "$ft_urlcapture" && ans=$ft_urlcapture
|
2018-03-14 03:02:30 +01:00
|
|
|
test -z "$ft_urlcapture" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_urlcapture='#define URLCAPTURE'
|
|
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
def_wingate='#undef WINGATE'
|
|
|
|
|
unset ans
|
2018-03-16 02:45:13 +01:00
|
|
|
$out $ac_n "[STABLE] WinGate support? ........................... [Y/n] "$ac_c
|
|
|
|
|
test "$ft_wingate" && $out "$ft_wingate" && ans=$ft_wingate
|
2014-03-08 19:56:21 -05:00
|
|
|
test -z "$ft_wingate" && read ans
|
|
|
|
|
test -z "$ans" -o "$ans" = y -o "$ans" = Y -o "$ans" = yes -o "$ans" = YES -o "$ans" = Yes && def_wingate='#define WINGATE'
|
|
|
|
|
|
2018-03-16 02:45:13 +01:00
|
|
|
$out ''
|
2014-03-08 19:56:21 -05:00
|
|
|
echo "Creating src/Makefile"
|
|
|
|
|
|
|
|
|
|
O_FLAGS="$cc_optimize_flag $cc_arch_flag $cc_march_flag $cc_ofp_flag"
|
|
|
|
|
W_FLAGS="$cc_wall_flag $cc_wshadow_flag $cc_fnostrictalias"
|
|
|
|
|
libflags="$libcrypt $libtcl $libnsl $libsocket $libresolv $libpython"
|
|
|
|
|
lflags="$cc_g_flag -o"
|
|
|
|
|
cprof="$cc_pg_flag $cc_pg_define"
|
|
|
|
|
lprof="$cc_pg_flag $cc_pg_define $libpgdl"
|
|
|
|
|
|
|
|
|
|
echo '# This file is generated from Makefile.in' > src/Makefile
|
|
|
|
|
sed "
|
|
|
|
|
s%@CC@%$CCshort%;
|
|
|
|
|
s%@ldscript@%$ldscript%;
|
|
|
|
|
s%@pipeflag@%$cc_pipe_flag%;
|
|
|
|
|
s%@gdbflag@%$cc_g_flag%;
|
|
|
|
|
/@cprof@/ { s,@cprof@,$cprof,; };
|
|
|
|
|
/@lprof@/ { s,@lprof@,$lprof,; };
|
|
|
|
|
/@lflags@/ { s,@lflags@,$lflags,; };
|
|
|
|
|
/@libflags@/ { s,@libflags@,$libflags,; };
|
|
|
|
|
/@W_FLAGS@/ { s/@W_FLAGS@/$W_FLAGS/; };
|
|
|
|
|
/@O_FLAGS@/ { s/@O_FLAGS@/$O_FLAGS/; };
|
|
|
|
|
/@PYINCLUDE@/ { s,@PYINCLUDE@,$incpython,; };
|
2014-11-13 02:09:31 +01:00
|
|
|
/@TCLINCLUDE@/ { s,@TCLINCLUDE@,$inctcl,; };
|
2014-03-08 19:56:21 -05:00
|
|
|
s|@MD5_O@|$MD5_O|;
|
2018-03-09 03:51:03 +01:00
|
|
|
s|@SHA_O@|$SHA_O|;
|
2014-03-08 19:56:21 -05:00
|
|
|
s%@oc@%$objcomment%;
|
|
|
|
|
s%@sz@%$sizecomment%;
|
|
|
|
|
s/[ ]*\$//g;
|
|
|
|
|
" < src/Makefile.in >> src/Makefile || exit 1
|
|
|
|
|
|
|
|
|
|
echo "Creating src/config.h"
|
|
|
|
|
|
2018-03-09 03:51:03 +01:00
|
|
|
CRYPT_HAS_SHA='#undef CRYPT_HAS_SHA'
|
2014-03-08 19:56:21 -05:00
|
|
|
CRYPT_HAS_MD5='#undef CRYPT_HAS_MD5'
|
|
|
|
|
CRYPT_HAS_DES='#undef CRYPT_HAS_DES'
|
2018-03-09 03:51:03 +01:00
|
|
|
[ "$has_sha" = yes ] && CRYPT_HAS_SHA='#define CRYPT_HAS_SHA'
|
2014-03-08 19:56:21 -05:00
|
|
|
[ "$has_md5" = yes ] && CRYPT_HAS_MD5='#define CRYPT_HAS_MD5'
|
|
|
|
|
[ "$has_des" = yes ] && CRYPT_HAS_DES='#define CRYPT_HAS_DES'
|
|
|
|
|
|
|
|
|
|
echo '/* This file is generated from config.h.in */' > src/config.h
|
|
|
|
|
sed "
|
|
|
|
|
s|@DEF_ALIAS@|$def_alias|;
|
|
|
|
|
s|@DEF_BOTNET@|$def_botnet|;
|
|
|
|
|
s|@DEF_BOUNCE@|$def_bounce|;
|
|
|
|
|
s|@DEF_CHANBAN@|$def_chanban|;
|
|
|
|
|
s|@DEF_CTCP@|$def_ctcp|;
|
|
|
|
|
s|@DEF_DCCFILE@|$def_dccfile|;
|
|
|
|
|
s|@DEF_DEBUG@|$def_debug|;
|
|
|
|
|
s|@DEF_DYNCMD@|$def_dyncmd|;
|
|
|
|
|
s|@DEF_DYNAMODE@|$def_dynamode|;
|
|
|
|
|
s|@DEF_GREET@|$def_greet|;
|
2018-03-13 02:39:29 +01:00
|
|
|
s|@DEF_HOSTINFO@|$def_hostinfo|;
|
2014-03-08 19:56:21 -05:00
|
|
|
s|@DEF_IDWRAP@|$def_idwrap|;
|
|
|
|
|
s|@DEF_IRCD_EXT@|$def_ircd_ext|;
|
|
|
|
|
s|@DEF_MD5@|$def_md5|;
|
2018-03-09 03:51:03 +01:00
|
|
|
s|@DEF_SHA@|$def_sha|;
|
2014-03-08 19:56:21 -05:00
|
|
|
s|@DEF_NEWBIE@|$def_newbie|;
|
|
|
|
|
s|@DEF_NOTE@|$def_note|;
|
|
|
|
|
s|@DEF_NOTIFY@|$def_notify|;
|
|
|
|
|
s|@DEF_PERL@|$def_perl|;
|
|
|
|
|
s|@DEF_PYTHON@|$def_python|;
|
|
|
|
|
s|@DEF_RAWDNS@|$def_rawdns|;
|
|
|
|
|
s|@DEF_REDIRECT@|$def_redirect|;
|
|
|
|
|
s|@DEF_SEEN@|$def_seen|;
|
|
|
|
|
s|@DEF_SESSION@|$def_session|;
|
|
|
|
|
s|@DEF_STATS@|$def_stats|;
|
|
|
|
|
s|@DEF_TCL@|$def_tcl|;
|
|
|
|
|
s|@DEF_TELNET@|$def_telnet|;
|
|
|
|
|
s|@DEF_TOYBOX@|$def_toybox|;
|
|
|
|
|
s|@DEF_TRIVIA@|$def_trivia|;
|
|
|
|
|
s|@DEF_UPTIME@|$def_uptime|;
|
2018-03-14 03:02:30 +01:00
|
|
|
s|@DEF_URLCAPTURE@|$def_urlcapture|;
|
2014-03-08 19:56:21 -05:00
|
|
|
s|@DEF_WEB@|$def_web|;
|
|
|
|
|
s|@DEF_WINGATE@|$def_wingate|;
|
|
|
|
|
|
2018-03-10 02:55:07 +01:00
|
|
|
s|@LIT_END@|$LIT_END|;
|
|
|
|
|
s|@BIG_END@|$BIG_END|;
|
2014-03-08 19:56:21 -05:00
|
|
|
s|@DEF_CRYPT_FUNCTION@|$CRYPT_FUNCTION|;
|
2018-03-09 03:51:03 +01:00
|
|
|
s|@CRYPT_HAS_SHA@|$CRYPT_HAS_SHA|;
|
2014-03-08 19:56:21 -05:00
|
|
|
s|@CRYPT_HAS_MD5@|$CRYPT_HAS_MD5|;
|
|
|
|
|
s|@CRYPT_HAS_DES@|$CRYPT_HAS_DES|;
|
|
|
|
|
s|@IDWRAP_PATH@|$IDWRAP_PATH|;
|
|
|
|
|
s|@PTSIZE_DEFINE32@|$PTSIZE_DEFINE32|;
|
|
|
|
|
s|@PTSIZE_DEFINE64@|$PTSIZE_DEFINE64|;
|
|
|
|
|
s|@UNALIGNED_MEM@|$UNALIGNED_MEM|;
|
|
|
|
|
" < src/config.h.in >> src/config.h
|
|
|
|
|
|
2018-03-21 22:49:46 +01:00
|
|
|
if [ "$install" = yes ]; then
|
2018-03-16 02:45:13 +01:00
|
|
|
make -C src energymech
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
2018-03-21 22:49:46 +01:00
|
|
|
if [ "$compile" = yes ]; then
|
2018-03-16 02:45:13 +01:00
|
|
|
make -C src energymech
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
2014-03-08 19:56:21 -05:00
|
|
|
echo ''
|
|
|
|
|
echo 'All done. You can now "make clean install"'
|
|
|
|
|
echo ''
|
2018-02-28 23:50:08 +01:00
|
|
|
echo 'Submit your bugreports at https://github.com/MadCamel/energymech/issues'
|
2014-03-08 19:56:21 -05:00
|
|
|
echo ''
|
|
|
|
|
echo 'You have read the README file I hope?'
|
|
|
|
|
echo ''
|