diff --git a/.travis.yml b/.travis.yml index 6088b37..e70eee6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,5 +13,5 @@ script: - dub test --compiler=${DC} -c library-nonet - dub build --compiler=${DC} - - DC=${DMD} ./build.sh + - ./build.sh - DUB=`pwd`/bin/dub COMPILER=${DC} test/run-unittest.sh diff --git a/build.sh b/build.sh index 58bd440..3b786e5 100755 --- a/build.sh +++ b/build.sh @@ -1,14 +1,18 @@ #!/bin/sh set -e -if [ "$DC" = "" ]; then - command -v gdmd >/dev/null 2>&1 && DC=gdmd || true - command -v ldmd2 >/dev/null 2>&1 && DC=ldmd2 || true - command -v dmd >/dev/null 2>&1 && DC=dmd || true +if [ "$DMD" = "" ]; then + if [ ! "$DC" = "" ]; then # backwards compatibility with DC + DMD=$DC + else + command -v gdmd >/dev/null 2>&1 && DMD=gdmd || true + command -v ldmd2 >/dev/null 2>&1 && DMD=ldmd2 || true + command -v dmd >/dev/null 2>&1 && DMD=dmd || true + fi fi -if [ "$DC" = "" ]; then - echo >&2 "Failed to detect D compiler. Use DC=... to set a dmd compatible binary manually." +if [ "$DMD" = "" ]; then + echo >&2 "Failed to detect D compiler. Use DMD=... to set a dmd compatible binary manually." exit 1 fi @@ -16,13 +20,13 @@ LIBS=`pkg-config --libs libcurl 2>/dev/null || echo "-lcurl"` # fix for modern GCC versions with --as-needed by default -if [ "$DC" = "dmd" ]; then +if [ "$DMD" = "dmd" ]; then if [ `uname` = "Linux" ]; then LIBS="-l:libphobos2.a $LIBS" else LIBS="-lphobos2 $LIBS" fi -elif [ "$DC" = "ldmd2" ]; then +elif [ "$DMD" = "ldmd2" ]; then LIBS="-lphobos2-ldc $LIBS" fi @@ -33,11 +37,11 @@ GITVER=$(git describe) || GITVER=unknown echo "module dub.version_;" > source/dub/version_.d echo "enum dubVersion = \"$GITVER\";" >> source/dub/version_.d -echo "enum initialCompilerBinary = \"$DC\";" >> source/dub/version_.d +echo "enum initialCompilerBinary = \"$DMD\";" >> source/dub/version_.d -echo Running $DC... -$DC -ofbin/dub -w -version=DubUseCurl -Isource $* $LIBS @build-files.txt +echo Running $DMD... +$DMD -ofbin/dub -w -version=DubUseCurl -Isource $* $LIBS @build-files.txt echo DUB has been built as bin/dub. echo echo You may want to run