diff --git a/samples/csvparser/build.sh b/samples/csvparser/build.sh index b1bba9f01df..a44a9b766d0 100755 --- a/samples/csvparser/build.sh +++ b/samples/csvparser/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi if [ x$TARGET == x ]; then case "$OSTYPE" in diff --git a/samples/gitchurn/build.sh b/samples/gitchurn/build.sh index 12e0895f3e8..4967e3afdda 100755 --- a/samples/gitchurn/build.sh +++ b/samples/gitchurn/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi CFLAGS_macbook="-I/opt/local/include -I/usr/local/include" CFLAGS_linux=-I/usr/include diff --git a/samples/gtk/build.sh b/samples/gtk/build.sh index d5265490c4c..aac610f2fc0 100755 --- a/samples/gtk/build.sh +++ b/samples/gtk/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi IPREFIX_macbook=-I/opt/local/include IPREFIX_linux=-I/usr/include diff --git a/samples/html5Canvas/build.sh b/samples/html5Canvas/build.sh index cfe2f1f43f5..c7411e17709 100755 --- a/samples/html5Canvas/build.sh +++ b/samples/html5Canvas/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi if [ x$TARGET == x ]; then case "$OSTYPE" in diff --git a/samples/libcurl/build.sh b/samples/libcurl/build.sh index 58fa19e9327..c6fe4ce8d36 100755 --- a/samples/libcurl/build.sh +++ b/samples/libcurl/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi CFLAGS_macbook=-I/opt/local/include CFLAGS_linux="-I /usr/include -I /usr/include/x86_64-linux-gnu" diff --git a/samples/nonBlockingEchoServer/build.sh b/samples/nonBlockingEchoServer/build.sh index 4df7aba8bcb..523e3aa81b2 100755 --- a/samples/nonBlockingEchoServer/build.sh +++ b/samples/nonBlockingEchoServer/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi if [ x$TARGET == x ]; then case "$OSTYPE" in diff --git a/samples/opengl/build.sh b/samples/opengl/build.sh index 7137928c286..8853cf65e62 100755 --- a/samples/opengl/build.sh +++ b/samples/opengl/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi if [ x$TARGET == x ]; then case "$OSTYPE" in diff --git a/samples/socket/build.sh b/samples/socket/build.sh index 70c81c84c70..5f1d83c9b33 100755 --- a/samples/socket/build.sh +++ b/samples/socket/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi mkdir -p $DIR/build/bin/ diff --git a/samples/tensorflow/build.sh b/samples/tensorflow/build.sh index 09737c04758..08d13a33ba3 100755 --- a/samples/tensorflow/build.sh +++ b/samples/tensorflow/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi $DIR/downloadTensorflow.sh diff --git a/samples/tensorflow/downloadTensorflow.sh b/samples/tensorflow/downloadTensorflow.sh index 2d89de58873..096e66652a3 100755 --- a/samples/tensorflow/downloadTensorflow.sh +++ b/samples/tensorflow/downloadTensorflow.sh @@ -1,8 +1,5 @@ #!/usr/bin/env bash -DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH - TF_TARGET_DIRECTORY="$HOME/.konan/third-party/tensorflow" TF_TYPE="cpu" # Change to "gpu" for GPU support diff --git a/samples/tetris/build.sh b/samples/tetris/build.sh index 1beb7d9317c..b3c01865616 100755 --- a/samples/tetris/build.sh +++ b/samples/tetris/build.sh @@ -1,7 +1,13 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi + DEPS="$HOME/.konan/dependencies" CFLAGS_macbook=-I$HOME/Library/Frameworks/SDL2.framework/Headers diff --git a/samples/workers/build.sh b/samples/workers/build.sh index 02f827fd7ec..5807eef7b37 100755 --- a/samples/workers/build.sh +++ b/samples/workers/build.sh @@ -1,7 +1,12 @@ #!/usr/bin/env bash DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH + +if [ -z "$KONAN_HOME" ]; then + PATH="$DIR/../../dist/bin:$DIR/../../bin:$PATH" +else + PATH="$KONAN_HOME/bin:$PATH" +fi SUFFIX=kexe if [ x$TARGET == x ]; then