]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Various Build Fixes
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 26 Oct 2008 01:40:10 +0000 (14:40 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 26 Oct 2008 01:40:10 +0000 (14:40 +1300)
Adjust build tests to work out-of-tree in a custom directory tree per run.

Fixes several compile errors uncovered by the above.

Fixes ESILibxml2Parser to use memory-safe snprintf.

errors/Makefile.am
src/ESIExpatParser.cc
src/ESILibxml2Parser.cc
test-builds.sh
test-suite/buildtest.sh

index 9a0f90cde27d5542a85c63799b8bd96e2fea3284..46afda9d269037a123d51e38badda9a48ef7f607 100644 (file)
@@ -73,13 +73,13 @@ install-data-local:
                done; \
          fi \
        done; \
-        $(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET).default; \
-        @if test -f $(DESTDIR)$(DEFAULT_STYLESHEET) ; then \
-                echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_STYLESHEET)" ; \
-        else \
-                echo "$(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET)"; \
-                $(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET); \
-        fi
+       $(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET).default; \
+       if test -f $(DESTDIR)$(DEFAULT_STYLESHEET) ; then \
+               echo "$@ will not overwrite existing $(DESTDIR)$(DEFAULT_STYLESHEET)" ; \
+       else \
+               echo "$(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET)"; \
+               $(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET); \
+       fi
 
 
 uninstall-local:
index ada05ebcd69938664b94593e8d6b52dfe6fafbe1..c7e0e85dac0daa015ae43f5b2877276dec0d42aa 100644 (file)
@@ -34,6 +34,9 @@
  */
 
 #include "squid.h"
+
+#if USE_SQUID_ESI
+
 #include "ESIExpatParser.h"
 
 RegisterESIParser("expat", ESIExpatParser);
@@ -104,3 +107,5 @@ ESIExpatParser::errorString() const
 {
     return XML_ErrorString(XML_GetErrorCode(myParser()));
 }
+
+#endif /* USE_SQUID_ESI */
index 989b75be13e4e00d7a7d7a144091264258a20ae5..1c5e0186ba39143e43fbb73c97ba125ec01ce64f 100644 (file)
  */
 
 #include "squid.h"
-#include "ESILibxml2Parser.h"
 
-#ifdef sprintf
-// ugly, but needed to use correct sprintf function below
-#undef sprintf
-#endif
+#if USE_SQUID_ESI
 
-#include <stdio.h>
+#include "ESILibxml2Parser.h"
 
 // the global document that will store the resolved entity
 // definitions
@@ -99,7 +95,7 @@ xmlEntityPtr esi_getEntitySAXFunc(void * ctx,  const xmlChar * name)
 
         if (ent != NULL) {
             char tmp[32];
-            sprintf(tmp, "&#%d;", ent->value);
+            snprintf(tmp, 32, "&#%d;", ent->value);
             res = xmlAddDocEntity(entity_doc, (const xmlChar *)name, XML_INTERNAL_GENERAL_ENTITY, NULL, NULL, (const xmlChar *)tmp);
         }
     }
@@ -154,3 +150,5 @@ ESILibxml2Parser::errorString() const
 
     return error->message;
 }
+
+#endif /* USE_SQUID_ESI */
index 5014e0e19ea3ef38d7213c98d2fa765ffd003a3b..1e02054fb066ababa2eb7a17652372673ee8c137 100755 (executable)
@@ -6,7 +6,9 @@
 tmp="${1}"
 if test -e ./test-suite/buildtests/os-${tmp}.opts ; then
        echo "TESTING: ${tmp}"
-       ./test-suite/buildtest.sh ./test-suite/buildtests/os-${tmp}
+       rm -f -r btos${tmp} && mkdir btos${tmp} && cd btos${tmp}
+       ../test-suite/buildtest.sh ../test-suite/buildtests/os-${tmp}
+       cd ..
 fi
 
 #
@@ -18,8 +20,11 @@ fi
 #
 
 for f in `ls -1 ./test-suite/buildtests/layer*.opts` ; do
+       layer=`echo "${f}" | grep -o -E "layer-[0-9]*-[^\.]*"`
+       rm -f -r btl${layer} && mkdir btl${layer} && cd btl${layer}
        arg=`echo "${f}" | sed s/\\.opts//`
        echo "TESTING: ${arg}"
-       ./test-suite/buildtest.sh "${arg}" ||
+       ../test-suite/buildtest.sh ".${arg}" ||
        ( grep -E "^ERROR|\ error:\ " buildtest_*.log && exit 1 )
+       cd ..
 done
index 94403634e9fc5a6badbe1fd99bc8f1c68350915d..b7f6c3671ab49536a54385841ce019480e998fe8 100755 (executable)
@@ -32,8 +32,7 @@ make -k distclean || echo "distclean done. errors are unwanted but okay here."
 # above command currently encounters dependancy problems on cleanup.
 #
 rm -f -r src/fs/aufs/.deps src/fs/diskd/.deps &&
-       ./bootstrap.sh &&
-       ./configure --silent ${OPTS} 2>&1 &&
+       ../configure --silent ${OPTS} 2>&1 &&
        make check 2>&1 &&
        make 2>&1