diff --git a/.gitignore b/.gitignore index b334caf22..500d56ef6 100644 --- a/.gitignore +++ b/.gitignore @@ -144,6 +144,7 @@ cmake-build/ *.bak stage/ releases/ +poco_build_stderr.out # vim # ####### diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..1dfbd742b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,261 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Linux GDB Foundation Test", + "variables": { + "libName": "Foundation" + }, + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/${libName}/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "environment": [ { "name": "PATH", "value": "${env:PATH}:${workspaceFolder}/${libName}/testsuite/bin/${env:OSNAME}/${env:OSARCH}" } ], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB XML Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/XML/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB JSON Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/JSON/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Util Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/Util/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Net Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/Net/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Crypto Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/Crypto/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Net SSL Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/NetSSL_OpenSSL/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Data Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/Data/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Data/SQLite Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/Data/SQLite/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Data/ODBC Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/Data/ODBC/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Data/MySQL Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/Data/MySQL/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Data/PostgreSQL Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/Data/PostgreSQL/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB MongoDB Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/MongoDB/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }, + { + "name": "Linux GDB Redis Test", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/Redis/testsuite/bin/${env:OSNAME}/${env:OSARCH}/testrunnerd", + "args": ["-all"], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} diff --git a/build/config/Linux b/build/config/Linux index 959db5e13..84ecf7d47 100644 --- a/build/config/Linux +++ b/build/config/Linux @@ -11,6 +11,9 @@ LINKMODE ?= SHARED SANITIZEFLAGS ?= +#-fsanitize=address +#-fsanitize=undefined +#-fsanitize=thread # # Define Tools diff --git a/build/rules/compile b/build/rules/compile index 06faa2224..d5a5be83b 100644 --- a/build/rules/compile +++ b/build/rules/compile @@ -41,69 +41,69 @@ $(OBJPATH_RELEASE_STATIC) $(OBJPATH_DEBUG_STATIC) $(OBJPATH_RELEASE_SHARED) $(OB $(OBJPATH_DEBUG_STATIC)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(debug, static)" - $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(STATICOPT_CXX) -c $< -o $@ + $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(STATICOPT_CXX) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_RELEASE_STATIC)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(release, static)" - $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(STATICOPT_CXX) -c $< -o $@ + $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(STATICOPT_CXX) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_DEBUG_STATIC)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(debug, static)" - $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(STATICOPT_CC) -c $< -o $@ + $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(STATICOPT_CC) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_RELEASE_STATIC)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(release, static)" - $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(STATICOPT_CC) -c $< -o $@ + $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(STATICOPT_CC) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(debug, shared)" - $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@ + $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_RELEASE_SHARED)/%.o: $(SRCDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(release, shared)" - $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@ + $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_DEBUG_SHARED)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(debug, shared)" - $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(SHAREDOPT_CC) -c $< -o $@ + $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(SHAREDOPT_CC) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_RELEASE_SHARED)/%.o: $(SRCDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(release, shared)" - $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(SHAREDOPT_CC) -c $< -o $@ + $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(SHAREDOPT_CC) -c $< -o $@ $(POCO_BUILD_STDERR) # Generated sources $(OBJPATH_DEBUG_STATIC)/%.o: $(GENDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(debug, static)" - $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(STATICOPT_CXX) -c $< -o $@ + $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(STATICOPT_CXX) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_RELEASE_STATIC)/%.o: $(GENDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(release, static)" - $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(STATICOPT_CXX) -c $< -o $@ + $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(STATICOPT_CXX) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_DEBUG_STATIC)/%.o: $(GENDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(debug, static)" - $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(STATICOPT_CC) -c $< -o $@ + $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(STATICOPT_CC) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_RELEASE_STATIC)/%.o: $(GENDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(release, static)" - $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(STATICOPT_CC) -c $< -o $@ + $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(STATICOPT_CC) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_DEBUG_SHARED)/%.o: $(GENDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(debug, shared)" - $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@ + $(CXX) $(INCLUDE) $(CXXFLAGS) $(DEBUGOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_RELEASE_SHARED)/%.o: $(GENDIR)/%.cpp $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(release, shared)" - $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@ + $(CXX) $(INCLUDE) $(CXXFLAGS) $(RELEASEOPT_CXX) $(SHAREDOPT_CXX) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_DEBUG_SHARED)/%.o: $(GENDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(debug, shared)" - $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(SHAREDOPT_CC) -c $< -o $@ + $(CC) $(INCLUDE) $(CFLAGS) $(DEBUGOPT_CC) $(SHAREDOPT_CC) -c $< -o $@ $(POCO_BUILD_STDERR) $(OBJPATH_RELEASE_SHARED)/%.o: $(GENDIR)/%.c $(DEPPATH)/%.d $(POCO_BASE)/build/config/$(POCO_CONFIG) @echo "** Compiling" $< "(release, shared)" - $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(SHAREDOPT_CC) -c $< -o $@ + $(CC) $(INCLUDE) $(CFLAGS) $(RELEASEOPT_CC) $(SHAREDOPT_CC) -c $< -o $@ $(POCO_BUILD_STDERR) # diff --git a/build/rules/dylib b/build/rules/dylib index 4d8aca3bc..6a7f9394e 100644 --- a/build/rules/dylib +++ b/build/rules/dylib @@ -42,6 +42,7 @@ include $(POCO_BASE)/build/rules/compile # Rules for creating a dynamically loadable shared library # clean: + $(RM) $(POCO_BUILD_STDERR_FILE) $(RM) $(OBJPATH) $(RM) $(DYLIB_DEBUG) $(DYLIB_RELEASE) $(DYLIB_S_DEBUG) $(DYLIB_S_RELEASE) diff --git a/build/rules/exec b/build/rules/exec index 32ec7eef4..889e98ab5 100644 --- a/build/rules/exec +++ b/build/rules/exec @@ -29,6 +29,7 @@ include $(POCO_BASE)/build/rules/compile # Rules for creating an executable # clean: + $(RM) $(POCO_BUILD_STDERR_FILE) $(RM) $(OBJPATH) $(RM) $(EXEC_RELEASE_STATIC) $(EXEC_DEBUG_STATIC) $(EXEC_RELEASE_SHARED) $(EXEC_DEBUG_SHARED) diff --git a/build/rules/global b/build/rules/global index 5e48cd988..ed178814d 100644 --- a/build/rules/global +++ b/build/rules/global @@ -7,6 +7,7 @@ # POCO_BASE: Path to POCO source tree. Must be defined. # POCO_BUILD: Path to directory where build files are put. # Defaults to $(POCO_BASE) +# POCO_BUILD_STDERR: Redirect command for build errors log file. # POCO_CONFIG: Build configuration to use. # Defaults to `uname`. # POCO_TARGET_OSNAME: Target system operating system name (for cross builds) @@ -51,6 +52,15 @@ ifdef POCO_VERBOSE $(info POCO_BUILD = $(POCO_BUILD)) endif +# +# Build errors/warnings output +# +ifndef POCO_BUILD_STDERR +POCO_BUILD_STDERR_FILE = "$(POCO_BASE)/build/poco_build_stderr.out" +$(shell rm -f $(POCO_BUILD_STDERR_FILE)) +POCO_BUILD_STDERR = 2>&1|tee -a $(POCO_BUILD_STDERR_FILE) +endif + # # POCO_BASE/POCO_BUILD/cwd sanity checks # diff --git a/build/rules/lib b/build/rules/lib index 9ba932039..214c6cb31 100644 --- a/build/rules/lib +++ b/build/rules/lib @@ -46,6 +46,7 @@ include $(POCO_BASE)/build/rules/compile # Rules for creating a library # clean: + $(RM) $(POCO_BUILD_STDERR_FILE) $(RM) $(OBJPATH) $(RM) $(LIB_RELEASE_STATIC) $(LIB_DEBUG_STATIC) $(LIB_RELEASE_SHARED) $(LIB_DEBUG_SHARED) $(RM) $(LIB_DEBUG_SHARED_LINK) $(LIB_RELEASE_SHARED_LINK) diff --git a/build/script/makedepend.SunCC b/build/script/makedepend.SunCC index febdce06e..411d3f5a8 100755 --- a/build/script/makedepend.SunCC +++ b/build/script/makedepend.SunCC @@ -19,4 +19,4 @@ shift dir4=$1 shift -CC -xM1 $@ $source | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >$target +CC -xM1 "$@" "$source" | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >"$target" diff --git a/build/script/makedepend.aCC b/build/script/makedepend.aCC index b38de6e62..21be30fae 100755 --- a/build/script/makedepend.aCC +++ b/build/script/makedepend.aCC @@ -19,7 +19,7 @@ shift dir4=$1 shift -tmpfile=`basename $target` -aCC -E +maked $@ $source >/dev/null -sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" <$tmpfile >$target -rm $tmpfile +tmpfile=$(basename $target) +aCC -E +maked "$@" "$source" >/dev/null +sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" <"$tmpfile" >"$target" +rm "$tmpfile" diff --git a/build/script/makedepend.clang b/build/script/makedepend.clang index fa08cd74b..2a0995790 100755 --- a/build/script/makedepend.clang +++ b/build/script/makedepend.clang @@ -26,4 +26,4 @@ else CLANG=clang++ fi -$CLANG -MM $@ $source | sed "s#\(.*\.o\):#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1:#" >$target +$CLANG -MM "$@" "$source" | sed "s#\(.*\.o\):#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1:#" >"$target" diff --git a/build/script/makedepend.cxx b/build/script/makedepend.cxx index 700f90c02..25a2c4f79 100755 --- a/build/script/makedepend.cxx +++ b/build/script/makedepend.cxx @@ -19,4 +19,4 @@ shift dir4=$1 shift -cxx -M $@ $source | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >$target +cxx -M "$@" "$source" | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >"$target" diff --git a/build/script/makedepend.gcc b/build/script/makedepend.gcc index 0ebdeae38..41daa24b4 100755 --- a/build/script/makedepend.gcc +++ b/build/script/makedepend.gcc @@ -19,4 +19,4 @@ shift dir4=$1 shift -$CC -MM $@ $source | sed "s#\(.*\.o\):#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1:#" >$target +$CC -MM "$@" "$source" | sed "s#\(.*\.o\):#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1:#" >"$target" diff --git a/build/script/makedepend.qcc b/build/script/makedepend.qcc index 38c3a5081..b5d50a626 100755 --- a/build/script/makedepend.qcc +++ b/build/script/makedepend.qcc @@ -18,4 +18,4 @@ shift dir4=$1 shift -$CC -E -Wp,-MM $@ $source | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >$target +$CC -E -Wp,-MM "$@" "$source" | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >"$target" diff --git a/build/script/makedepend.xlC b/build/script/makedepend.xlC index c880398af..ead6caaec 100755 --- a/build/script/makedepend.xlC +++ b/build/script/makedepend.xlC @@ -20,12 +20,11 @@ shift dir4=$1 shift -cwd=`pwd` +cwd=$(pwd) -cd `dirname $target` -$CXX -qmakedep -E -w $@ $cwd/$source >/dev/null - -ufile=`basename $source` -ufile=`echo $ufile | sed "s#\.cpp#\.u#"` -cat $ufile | sort | uniq | grep -v '/usr/include' | grep -v '/usr/vacpp' | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >$target +cd "$(dirname "$target")" || exit +$CXX -qmakedep -E -w "$@" "$cwd"/"$source" >/dev/null +ufile=$(basename "$source") +ufile=$(echo "$ufile" | sed "s#\.cpp#\.u#") +sort "$ufile" | uniq | grep -v '/usr/include' | grep -v '/usr/vacpp' | sed "s#\(.*\.o$\)#$dir1/\1 $dir2/\1 $dir3/\1 $dir4/\1#" >"$target" diff --git a/build/script/makeldpath b/build/script/makeldpath index 5e46d2874..6ec224123 100755 --- a/build/script/makeldpath +++ b/build/script/makeldpath @@ -10,16 +10,16 @@ if [ "$POCO_BASE" == "" ] ; then exit 1 fi -projectList=`cat ${POCO_BASE}/components` +projectList=$(cat "${POCO_BASE}"/components) -OSNAME=`uname` -OSARCH=`uname -m | tr " /" "_-"` +OSNAME=$(uname) +OSARCH=$(uname -m | tr " /" "_-") for proj in $projectList ; do path=${POCO_BASE}/${proj}/lib/${OSNAME}/${OSARCH} - echo $path - if [ -d $path ] ; then - echo -n ":"$path + echo "$path" + if [ -d "$path" ] ; then + printf ":%s" "$path" fi done diff --git a/build/script/projname b/build/script/projname index 783253ae7..31e01b657 100755 --- a/build/script/projname +++ b/build/script/projname @@ -10,8 +10,8 @@ # PROJECT_BASE=$1 -cdir=`sh -c pwd` -cd $PROJECT_BASE -projbase=`sh -c pwd` -cd "$cdir" +cdir=$(sh -c pwd) +cd "$PROJECT_BASE" || exit +projbase=$(sh -c pwd) +cd "$cdir" || exit sh -c pwd | sed "s:^$projbase::" | sed "s:^/::" diff --git a/build/script/runtests.sh b/build/script/runtests.sh index 61b67ea76..658d9de1f 100755 --- a/build/script/runtests.sh +++ b/build/script/runtests.sh @@ -21,7 +21,7 @@ # if [ "$POCO_BASE" = "" ] ; then - POCO_BASE=`pwd` + POCO_BASE=$(pwd) fi if [ "$POCO_BUILD" = "" ] ; then @@ -31,7 +31,7 @@ fi TESTRUNNER=./testrunner if [ "$1" = "" ] ; then - components=`cat $POCO_BASE/components` + components=$(cat "$POCO_BASE"/components) else components=$1 fi @@ -43,11 +43,11 @@ else fi if [ "$OSARCH" = "" ] ; then - OSARCH=`uname -m | tr ' /' _-` + OSARCH=$(uname -m | tr ' /' _-) fi if [ "$OSNAME" = "" ] ; then - OSNAME=`uname` + OSNAME=$(uname) case $OSNAME in CYGWIN*) OSNAME=CYGWIN @@ -86,10 +86,10 @@ do echo "****************************************" echo "" - runs=`expr $runs + 1` - sh -c "cd $POCO_BUILD/$comp/testsuite/$BINDIR && PATH=.:$PATH && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH $TESTRUNNER $IGNORE $TESTRUNNERARGS" - if [ $? -ne 0 ] ; then - failures=`expr $failures + 1` + runs=$((runs + 1)) + if ! sh -c "cd $POCO_BUILD/$comp/testsuite/$BINDIR && PATH=.:$PATH && LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH $TESTRUNNER $IGNORE $TESTRUNNERARGS"; + then + failures=$((failures + 1)) failedTests="$failedTests $comp" status=1 fi diff --git a/ci/runtests.sh b/ci/runtests.sh index e29454fef..f98efec97 100755 --- a/ci/runtests.sh +++ b/ci/runtests.sh @@ -1,10 +1,13 @@ +#!/bin/sh + set -ev -osname=`uname` -osarch=`uname -m` -export POCO_BASE=`pwd` -export PATH=$PATH:. -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.:$POCO_BASE/lib/$osname/$osarch -export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:.:$POCO_BASE/lib/$osname/$osarch +osname=$(uname) +osarch=$(uname -m) +POCO_BASE=$(pwd) +export POCO_BASE +export PATH="$PATH":. +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":.:"$POCO_BASE"/lib/"$osname"/"$osarch" +export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH":.:"$POCO_BASE"/lib/"$osname"/"$osarch" if [ "TSAN" = "$1" ] then export TSAN_OPTIONS="suppressions=$POCO_BASE/tsan.suppress,second_deadlock_stack=1" diff --git a/cppignore.lnx b/cppignore.lnx index 2c2376526..49a0a71f4 100644 --- a/cppignore.lnx +++ b/cppignore.lnx @@ -7,6 +7,7 @@ CppUnit::TestCaller.testPurgeAge CppUnit::TestCaller.testFileAttributes2 CppUnit::TestCaller.testExpand CppUnit::TestCaller.testExpandVariableFromPath +CppUnit::TestCaller.testOldBSD CppUnit::TestCaller.testClock CppUnit::TestCaller.testScheduleAtFixedRate CppUnit::TestCaller.testScheduleInterval diff --git a/cppignore.win b/cppignore.win index ecfca7e59..b038cee01 100644 --- a/cppignore.win +++ b/cppignore.win @@ -20,3 +20,4 @@ class CppUnit::TestCaller.testServiceReturnsTrueIfStopped class CppUnit::TestCaller.testSendToReceiveFrom class CppUnit::TestCaller.testMTU class CppUnit::TestCaller.testCachedSession +class CppUnit::TestCaller.testPollClosedServer diff --git a/poco_env.bash b/poco_env.bash new file mode 100644 index 000000000..756438e6f --- /dev/null +++ b/poco_env.bash @@ -0,0 +1,36 @@ +# usage: +# . env.bash +# or +# source env.bash + +self="${BASH_SOURCE[0]}" + +if [ "$self" == "$0" ] ; then + echo "This file must be sourced from bash, not run." + echo "Usage: . $0" + exit 1 +fi + +if [ -d "$self" ] ; then + basedir="$(cd "$self" || exit; pwd -P)" +else + basedir="$(cd "$(dirname "$self")" || exit; pwd -P)" +fi + +OSNAME="${OSNAME:=$(uname -s)}" +export OSNAME +OSARCH="${OSARCH:=$(uname -m)}" +export OSARCH +POCO_BASE="$basedir" +export POCO_BASE +PATH=$POCO_BASE/lib/$OSNAME/$OSARCH:$POCO_BASE:$PATH +export PATH + +# uncomment for sanitizer builds +#LSAN_OPTIONS=verbosity=1:log_threads=1 +#export LSAN_OPTIONS + +echo "\$OSNAME = $OSNAME" +echo "\$OSARCH = $OSARCH" +echo "\$POCO_BASE = $POCO_BASE" +echo "\$PATH = $PATH" diff --git a/runVSCode.sh b/runVSCode.sh new file mode 100755 index 000000000..b613d8c00 --- /dev/null +++ b/runVSCode.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# this script sets the proper build/runtime +# environment before opening poco in vscode + +self="${BASH_SOURCE[0]}" + +if [ -d "$self" ] ; then + basedir="$(cd "$self" || exit; pwd -P)" +else + basedir="$(cd "$(dirname "$self")" || exit; pwd -P)" +fi + +# shellcheck disable=SC1091 +. "$basedir"/poco_env.bash + +code "$basedir"