This commit is contained in:
joonicks 2018-04-04 16:25:26 +02:00
parent 581c44e7fb
commit 9008fd1fd9
6 changed files with 41 additions and 25 deletions

18
README
View File

@ -33,12 +33,16 @@ To compile the source:
3) ./configure 3) ./configure
-- This script will prompt you for features to include or exclude, -- This script will prompt you for features to include or exclude,
going with the default is not a bad idea. going with the default is not a bad idea.
If you want to cross compile export the prefix of your toolchain: -- If you want to cross compile export the prefix of your toolchain:
export CROSS_COMPILE="armv7a-hardfloat-linux-gnueabi-" export CROSS_COMPILE="armv7a-hardfloat-linux-gnueabi-"
4) make clean install 4) make install
-- If you have a modern/more powerful machine you can try to compile
the mech with ``make mega'' or ``make mega-install''. This way
produces a slightly more compact and efficient executable.
-- On a modern multi-core cpu, you can run make with the appropriate -- On a modern multi-core cpu, you can run make with the appropriate
-j switch to shave off a few seconds of compile time. -j switch to shave off a few seconds of compile time. (This will
not work with ``make mega'' or ``mage mega-install''.
For example: For example:
``make -j4'' for a 4 core cpu system. ``make -j4'' for a 4 core cpu system.
@ -94,6 +98,14 @@ If you get an 'Unknown option -d', you need to answer 'Y' to debug
support when running ./configure from the compiling section above. support when running ./configure from the compiling section above.
Or run with ``./configure --with-debug''. Or run with ``./configure --with-debug''.
If you are unsure about if you configured everything correctly and
want to test the configuration, you can run:
./energymech -t
This will run the startup sequence in a normal way, but will quit
right before the bot enters the main loop.
---*--- ---*---
Updated Files? Updated Files?

35
configure vendored
View File

@ -27,6 +27,7 @@ try_libmusl=no
# default optimization goal, speed = -O2, size = -Os # default optimization goal, speed = -O2, size = -Os
optitype=size optitype=size
cc_arch_flag=
set_feature_defaults() { set_feature_defaults() {
ft_alias=$ft_default ft_alias=$ft_default
@ -151,8 +152,9 @@ do
esac esac
case "$feature" in case "$feature" in
alias | botnet | bounce | chanban | ctcp | dccfile | debug | dynamode | dyncmd | greet | hostinfo | idwrap | ircd_ext | libmusl | md5 | newbie | note | notify | perl \ alias | botnet | bounce | chanban | ctcp | dccfile | debug | dynamode | dyncmd | greet | hostinfo | idwrap | ircd_ext | libmusl | md5 \
| profiling | python | rawdns | redirect | seen | session | sha | stats | suppress | tcl | telnet | toybox | trivia | uptime | urlcapture | web | wingate ) | newbie | note | notify | perl | profiling | python | rawdns | redirect | seen | session | sha | stats | suppress | tcl | telnet | toybox \
| trivia | uptime | urlcapture | web | wingate )
case _"$optarg"_ in case _"$optarg"_ in
_yes_ | _no_ | __ ) _yes_ | _no_ | __ )
;; ;;
@ -345,27 +347,27 @@ Features and packages:
--with-ircd_ext --with-ircd_ext
--with-libmusl[=/PATH/TO/musl-gcc] --with-libmusl[=/PATH/TO/musl-gcc]
Try to use libmusl instead of system default Try to use libmusl instead of system default
--with-md5 --with-md5 Support for hashing passwords with the MD5 hashing algorithm
--with-newbie Newbie support for extra sanity checks and error messages --with-newbie Newbie support for extra sanity checks and error messages
--with-note --with-note
--with-notify --with-notify
--with-perl --with-perl Perl scripting support
--with-profiling Profiling (gcc+gprof) --with-profiling Profiling (gcc+gprof)
--with-python --with-python Python scripting support
--with-rawdns --with-rawdns Asynchronous DNS lookups
--with-redirect --with-redirect Support fo sending command output to other channels/nicks/files
--with-seen SEEN support --with-seen SEEN support
--with-session Session support --with-session Session support
--with-sha --with-sha Support for hashing passwords with the SHA (SHA-512)
--with-stats --with-stats
--with-suppress Command duplication suppression --with-suppress Command duplication suppression
--with-tcl Tcl scripting support --with-tcl Tcl scripting support
--with-telnet Telnet support --with-telnet Telnet support
--with-toybox --with-toybox An assortment of fun commands
--with-trivia --with-trivia A trivia game
--with-uptime Include code that sends uptime reports to the IRC bot uptime contest server --with-uptime Include code that sends uptime reports to the IRC bot uptime contest server (https://www.eggheads.org/irc/uptime_stats)
--with-urlcapture URL capture support --with-urlcapture URL capture support
--with-web --with-web Support for EnergyMech serving documents via the HTTP protocol
--with-wingate Wingate support --with-wingate Wingate support
__EOT__ __EOT__
exit 0 exit 0
@ -570,7 +572,7 @@ if [ -n "$cf_GNUCC" ]; then
echo $ac_n "-fno-strict-aliasing "$ac_c echo $ac_n "-fno-strict-aliasing "$ac_c
fi fi
# #
# -march=i386/i486/i586 # -mtune=i386/i486/i586/i686/core2
# #
test -z "$cc_arch_opt" && cc_arch_opt=yes test -z "$cc_arch_opt" && cc_arch_opt=yes
if [ "$cc_arch_opt" = yes ]; then if [ "$cc_arch_opt" = yes ]; then
@ -578,16 +580,19 @@ if [ -n "$cf_GNUCC" ]; then
_95_i486_ | _33_i486_ ) _95_i486_ | _33_i486_ )
if $CC -march=i486 -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then if $CC -march=i486 -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
cc_arch_flag="-march=i486" cc_arch_flag="-march=i486"
echo $ac_n "-march=i486 "$ac_c
fi fi
;; ;;
_95_i[56789]86_ | _33_i[56789]86_ ) _95_i[56789]86_ | _33_i[56789]86_ )
if $CC -march=i586 -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then if $CC -march=i586 -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
cc_arch_flag="-march=i586" cc_arch_flag="-march=i586"
echo $ac_n "-march=i586 "$ac_c
fi fi
;; ;;
_33_x86_64_ )
if $CC -march=native -mtune=native -S -o - -xc /dev/null 1> /dev/null 2> /dev/null; then
cc_arch_flag="-march=native -mtune=native"
fi
esac esac
echo $ac_n "$cc_arch_flag "$ac_c
fi fi
# #
# -fomit-frame-pointer # -fomit-frame-pointer

View File

@ -364,7 +364,6 @@ LS int nickcmp(const char *, const char *) __attr(CORE_SEG, __regparm(2));
LS char *nickcpy(char *, const char *) __attr(CORE_SEG, __regparm(2)); LS char *nickcpy(char *, const char *) __attr(CORE_SEG, __regparm(2));
LS void stringcpy_n(char *, const char *, int) __attr(CORE_SEG, __regparm(3)); LS void stringcpy_n(char *, const char *, int) __attr(CORE_SEG, __regparm(3));
LS char *stringcpy(char *, const char *) __attr(CORE_SEG, __regparm(2)); LS char *stringcpy(char *, const char *) __attr(CORE_SEG, __regparm(2));
LS char *stringcpy2(char *, const char *, const char *) __attr(CORE_SEG, __regparm(3));
LS char *stringchr(const char *, int) __attr(CORE_SEG, __regparm(2)); LS char *stringchr(const char *, int) __attr(CORE_SEG, __regparm(2));
LS char *stringdup(const char *) __attr(CORE_SEG, __regparm(1)); LS char *stringdup(const char *) __attr(CORE_SEG, __regparm(1));
LS char *stringcat(char *, const char *) __attr(CORE_SEG, __regparm(2)); LS char *stringcat(char *, const char *) __attr(CORE_SEG, __regparm(2));

View File

@ -948,13 +948,13 @@ int main(int argc, char **argv, char **envp)
else else
to_file(1,"error: Missing argument for -p <string>\n"); to_file(1,"error: Missing argument for -p <string>\n");
_exit(0); _exit(0);
case 't':
startup = 666;
break;
case 'X': case 'X':
debug_on_exit = TRUE; debug_on_exit = TRUE;
break; break;
#endif /* DEBUG */ #endif /* DEBUG */
case 't':
startup = 666;
break;
case 'f': case 'f':
if (opt[2] != 0) if (opt[2] != 0)
{ {

View File

@ -80,8 +80,8 @@
#define TEXT_SERVERDELETED "Server has been deleted: %s:%i" #define TEXT_SERVERDELETED "Server has been deleted: %s:%i"
#define TEXT_MANYSERVMATCH "Several entries for %s exists, please specify port also" #define TEXT_MANYSERVMATCH "Several entries for %s exists, please specify port also"
/* do_core() */ /* do_core() */
#define TEXT_CURRNICKWANT "Current nick\t%s (Wanted: %s) [#%i]" #define TEXT_CURRNICKWANT "Current nick\t%s (Wanted: %s) [guid #%i]"
#define TEXT_CURRNICKHAS "Current nick\t%s [#%i]" #define TEXT_CURRNICKHAS "Current nick\t%s [guid #%i]"
#define TEXT_USERLISTSTATS "Users in userlist\t%i (%i Superuser%s, %i Bot%s)" #define TEXT_USERLISTSTATS "Users in userlist\t%i (%i Superuser%s, %i Bot%s)"
#define TEXT_ACTIVECHANS "Active channels\t%s" #define TEXT_ACTIVECHANS "Active channels\t%s"
#define TEXT_MOREACTIVECHANS "\t%s" #define TEXT_MOREACTIVECHANS "\t%s"

View File

@ -361,7 +361,7 @@ ascii_badfile:
to_user_q(from,"%s","Bad filename or file does not exist"); to_user_q(from,"%s","Bad filename or file does not exist");
return; return;
} }
stringcat(stringcpy2(fname,"ascii/"),rest); stringcat(stringcpy(fname,"ascii/"),rest);
if (is_safepath(fname,FILE_MUST_EXIST) != FILE_IS_SAFE) if (is_safepath(fname,FILE_MUST_EXIST) != FILE_IS_SAFE)
goto ascii_badfile; goto ascii_badfile;
if ((fd = open(fname,O_RDONLY)) < 0) if ((fd = open(fname,O_RDONLY)) < 0)