X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=cc603917b2260ab388a730bebbf585bae1798049;hb=2f07f35dfdfa6f9c5432d37a21c6b53c6468ace2;hp=e9e006bca2098c96304f725fd7abff3f095e42db;hpb=5291e2815ee96821382c197060a1753cf40cc453;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index e9e006bca..cc603917b 100755 --- a/configure +++ b/configure @@ -14,6 +14,7 @@ echo "Configuring default values..." ME=`pwd` GCCVER=`gcc -dumpversion | cut -c 1` +GCC34=`gcc -dumpversion | cut -c 3` CONFIG_DIR=$ME/conf MODULE_DIR=$ME/modules BINARY_DIR=$ME/bin @@ -99,6 +100,13 @@ exists () { # because some shells don't have test -e fi } +echo "#include ">.test.cpp +echo "#include ">>.test.cpp +echo "int main() { char a[10]; char b[10]; strlcpy(a,b,10); printf(\"%d\\n\",999); }" >>.test.cpp +g++ -o .test .test.cpp 2>&1 +HAS_STRLCPY=`./.test 2>&1` +rm -f .test.cpp .test + clear echo -e "'\033[1;33m####\033[0;37m:'\033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m::'\033[1;33m######\033[0;37m::'\033[1;33m########\033[0;37m::'\033[1;33m####\033[0;37m:'\033[1;33m########\033[0;37m:::'\033[1;33m######\033[0;37m::'\033[1;33m########\033[0;37m::" echo -e ". \033[1;33m##\033[0;37m:: \033[1;33m###\033[0;37m:: \033[1;33m##\033[0;37m:'\033[1;33m##\033[0;37m... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:. \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:'\033[1;33m##\033[0;37m... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:" @@ -394,12 +402,13 @@ echo -e "\033[0;37mMax User Channels\033[1;32m\t\t$MAX_CHANNE" echo -e "\033[0;37mMax nickname length:\033[1;32m\t\t$NICK_LENGT" echo -e "\033[0;37mMax channel length:\033[1;32m\t\t$CHAN_LENGT" echo -e "\033[0;37mMax mode length:\033[1;32m\t\t$MAXI_MODES" -echo -e "\033[0;37mGCC Version Found:\033[1;32m\t\t$GCCVER" -echo -e "\033[0;37mOptimation Flag:\033[1;32m\t\t$OPTIMISATI" +echo -e "\033[0;37mGCC Version Found:\033[1;32m\t\t$GCCVER.$GCC34" +echo -e "\033[0;37mOptimatizaton Flag:\033[1;32m\t\t$OPTIMISATI" echo -e "\033[0;37m" echo "Writing cache file for future ./configures ..." +COPY_CONF=0 if [ "$CONFIG_DIR" != "$ME/conf" ] ; then COPY_CONF=1 fi @@ -417,6 +426,8 @@ echo "NICK_LENGT=\"$NICK_LENGT\"" >> .config.cache echo "MAXI_MODES=\"$MAXI_MODES\"" >> .config.cache echo "OPTIMITEMP=\"$OPTIMITEMP\"" >> .config.cache echo "OPTIMISATI=\"$OPTIMISATI\"" >> .config.cache +echo "GCC34=\"$GCC34\"" >> .config.cache +echo "HAS_STRLCPY=\"$HAS_STRLCPY\"" >> .config.cache echo "COPY_CONF=\"$COPY_CONF\"" >> .config.cache echo "Writing include/inspircd_config.h ..." @@ -425,6 +436,12 @@ echo "/* Auto generated by configure, do not modify! */" >include/inspircd_confi echo "" >>include/inspircd_config.h if [ "$GCCVER" -eq "3" ] ; then echo "#define GCC3" >>include/inspircd_config.h + if [ "$GCC34" -gt "3" ] ; then + echo "#define GCC34" >>include/inspircd_config.h + fi +fi +if [ "$HAS_STRLCPY" -eq "999" ] ; then + echo "#define HAS_STRLCPY" >>include/inspircd_config.h fi echo "#define SYSLOG_FACILITY LOG_DAEMON" >>include/inspircd_config.h echo "#define SYSLOG_LEVEL LOG_NOTICE" >>include/inspircd_config.h @@ -503,4 +520,3 @@ fi echo -e "*** \033[1;32mRemember to edit your configuration files!!!\033[0;37m ***" echo "" -