From 9008fd1fd93a3266ff432c8770314f032ba23f07 Mon Sep 17 00:00:00 2001 From: joonicks Date: Wed, 4 Apr 2018 16:25:26 +0200 Subject: [PATCH] blitzfix --- README | 18 +++++++++++++++--- configure | 35 ++++++++++++++++++++--------------- src/h.h | 1 - src/main.c | 6 +++--- src/text.h | 4 ++-- src/toybox.c | 2 +- 6 files changed, 41 insertions(+), 25 deletions(-) diff --git a/README b/README index 7d3262a..655832e 100644 --- a/README +++ b/README @@ -33,12 +33,16 @@ To compile the source: 3) ./configure -- This script will prompt you for features to include or exclude, 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-" -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 - -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: ``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. 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? diff --git a/configure b/configure index d02d537..2f2dde3 100755 --- a/configure +++ b/configure @@ -27,6 +27,7 @@ try_libmusl=no # default optimization goal, speed = -O2, size = -Os optitype=size +cc_arch_flag= set_feature_defaults() { ft_alias=$ft_default @@ -151,8 +152,9 @@ do esac case "$feature" in - alias | botnet | bounce | chanban | ctcp | dccfile | debug | dynamode | dyncmd | greet | hostinfo | idwrap | ircd_ext | libmusl | md5 | newbie | note | notify | perl \ - | profiling | python | rawdns | redirect | seen | session | sha | stats | suppress | tcl | telnet | toybox | trivia | uptime | urlcapture | web | wingate ) + alias | botnet | bounce | chanban | ctcp | dccfile | debug | dynamode | dyncmd | greet | hostinfo | idwrap | ircd_ext | libmusl | md5 \ + | newbie | note | notify | perl | profiling | python | rawdns | redirect | seen | session | sha | stats | suppress | tcl | telnet | toybox \ + | trivia | uptime | urlcapture | web | wingate ) case _"$optarg"_ in _yes_ | _no_ | __ ) ;; @@ -345,27 +347,27 @@ Features and packages: --with-ircd_ext --with-libmusl[=/PATH/TO/musl-gcc] 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-note --with-notify - --with-perl + --with-perl Perl scripting support --with-profiling Profiling (gcc+gprof) - --with-python - --with-rawdns - --with-redirect + --with-python Python scripting support + --with-rawdns Asynchronous DNS lookups + --with-redirect Support fo sending command output to other channels/nicks/files --with-seen SEEN support --with-session Session support - --with-sha + --with-sha Support for hashing passwords with the SHA (SHA-512) --with-stats --with-suppress Command duplication suppression --with-tcl Tcl scripting support --with-telnet Telnet support - --with-toybox - --with-trivia - --with-uptime Include code that sends uptime reports to the IRC bot uptime contest server + --with-toybox An assortment of fun commands + --with-trivia A trivia game + --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-web + --with-web Support for EnergyMech serving documents via the HTTP protocol --with-wingate Wingate support __EOT__ exit 0 @@ -570,7 +572,7 @@ if [ -n "$cf_GNUCC" ]; then echo $ac_n "-fno-strict-aliasing "$ac_c fi # - # -march=i386/i486/i586 + # -mtune=i386/i486/i586/i686/core2 # test -z "$cc_arch_opt" && cc_arch_opt=yes if [ "$cc_arch_opt" = yes ]; then @@ -578,16 +580,19 @@ if [ -n "$cf_GNUCC" ]; then _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 ;; + _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 + echo $ac_n "$cc_arch_flag "$ac_c fi # # -fomit-frame-pointer diff --git a/src/h.h b/src/h.h index 79e5514..d0b17c0 100644 --- a/src/h.h +++ b/src/h.h @@ -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 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 *stringcpy2(char *, const char *, const char *) __attr(CORE_SEG, __regparm(3)); LS char *stringchr(const char *, int) __attr(CORE_SEG, __regparm(2)); LS char *stringdup(const char *) __attr(CORE_SEG, __regparm(1)); LS char *stringcat(char *, const char *) __attr(CORE_SEG, __regparm(2)); diff --git a/src/main.c b/src/main.c index 2a34670..a34a487 100644 --- a/src/main.c +++ b/src/main.c @@ -948,13 +948,13 @@ int main(int argc, char **argv, char **envp) else to_file(1,"error: Missing argument for -p \n"); _exit(0); - case 't': - startup = 666; - break; case 'X': debug_on_exit = TRUE; break; #endif /* DEBUG */ + case 't': + startup = 666; + break; case 'f': if (opt[2] != 0) { diff --git a/src/text.h b/src/text.h index b062506..7ca9a6e 100644 --- a/src/text.h +++ b/src/text.h @@ -80,8 +80,8 @@ #define TEXT_SERVERDELETED "Server has been deleted: %s:%i" #define TEXT_MANYSERVMATCH "Several entries for %s exists, please specify port also" /* do_core() */ -#define TEXT_CURRNICKWANT "Current nick\t%s (Wanted: %s) [#%i]" -#define TEXT_CURRNICKHAS "Current nick\t%s [#%i]" +#define TEXT_CURRNICKWANT "Current nick\t%s (Wanted: %s) [guid #%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_ACTIVECHANS "Active channels\t%s" #define TEXT_MOREACTIVECHANS "\t%s" diff --git a/src/toybox.c b/src/toybox.c index d5ba19a..f230119 100644 --- a/src/toybox.c +++ b/src/toybox.c @@ -361,7 +361,7 @@ ascii_badfile: to_user_q(from,"%s","Bad filename or file does not exist"); return; } - stringcat(stringcpy2(fname,"ascii/"),rest); + stringcat(stringcpy(fname,"ascii/"),rest); if (is_safepath(fname,FILE_MUST_EXIST) != FILE_IS_SAFE) goto ascii_badfile; if ((fd = open(fname,O_RDONLY)) < 0)