From 9f1bd74b09810565502451047b06b6eca7e47f7f Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 25 Mar 2005 19:25:41 +0000 Subject: Added implementation of strlcpy and strlcat for systems that dont have it git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@905 e03df62e-2008-0410-955e-edbf42e46eb7 --- configure | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 6f54c5386..ecc48d7dc 100755 --- a/configure +++ b/configure @@ -100,6 +100,12 @@ exists () { # because some shells don't have test -e fi } +echo "#include ">.test.cpp +echo >"int main() { char a[10]; char b[10]; strlcpy(a,b,10); sprintf("999"); }" >>.test.cpp +gcc -o .test .test.cpp +$HAS_STRLCPY=`./.test` +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:" @@ -399,7 +405,7 @@ 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 ..." +yyecho "Writing cache file for future ./configures ..." if [ "$CONFIG_DIR" != "$ME/conf" ] ; then COPY_CONF=1 @@ -419,6 +425,7 @@ 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 ..." @@ -431,6 +438,9 @@ echo "#define GCC3" >>include/inspircd_config.h 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 echo "#define CONFIG_FILE \"$CONFIG_DIR/inspircd.conf\"" >>include/inspircd_config.h @@ -508,4 +518,3 @@ fi echo -e "*** \033[1;32mRemember to edit your configuration files!!!\033[0;37m ***" echo "" - -- cgit v1.2.3