Merge pull request #1754 from kinke/build_cmd
Revise build.cmd (remove curl.lib, add -O)
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
commit d62c2960dfc3da42a1ad199976fc4cefdbd647dd
2 parents d70b4ba + e309091
@The Dlang Bot The Dlang Bot authored on 17 Aug 2019
GitHub committed on 17 Aug 2019
Showing 3 changed files
View
2
■■■
build.cmd
@echo module dub.version_; > source\dub\version_.d
@echo enum dubVersion = "%GITVER%"; >> source\dub\version_.d
 
@echo Executing %DC%...
@%DC% -ofbin\dub.exe -g -debug -w -version=DubUseCurl -version=DubApplication -Isource curl.lib %* @build-files.txt
@%DC% -ofbin\dub.exe -g -O -w -version=DubUseCurl -version=DubApplication -Isource %* @build-files.txt
@if errorlevel 1 exit /b 1
 
@echo DUB has been built. You probably also want to add the following entry to your
@echo PATH environment variable:
View
27
build.sh
echo >&2 "Failed to detect D compiler. Use DMD=... to set a dmd compatible binary manually."
exit 1
fi
 
VERSION=$($DMD --version 2>/dev/null | sed -En 's|.*DMD.* v([[:digit:]\.]+).*|\1|p')
# workaround for link order issues with libcurl (phobos needs to come before curl)
if [[ $VERSION < 2.069.0 ]]; then
# link against libcurl
LIBS=`pkg-config --libs libcurl 2>/dev/null || echo "-lcurl"`
 
# fix for modern GCC versions with --as-needed by default
if [[ `$DMD --help | head -n1 | grep 'DMD\(32\|64\)'` ]]; then
if [ `uname` = "Linux" ]; then
LIBS="-l:libphobos2.a $LIBS"
else
LIBS="-lphobos2 $LIBS"
fi
elif [[ `$DMD --help | head -n1 | grep '^LDC '` ]]; then
if [ `uname` = "SunOS" ]; then
LIBS="-lnsl -lsocket -lphobos2-ldc $LIBS"
else
LIBS="-lphobos2-ldc $LIBS"
fi
fi
 
# adjust linker flags for dmd command line
LIBS=`echo "$LIBS" | sed 's/^-L/-L-L/; s/ -L/ -L-L/g; s/^-l/-L-l/; s/ -l/ -L-l/g'`
fi
 
if [ "$GITVER" = "" ]; then
GITVER=$(git describe) || echo "Could not determine a version with git."
fi
if [ "$GITVER" != "" ]; then
# For OSX compatibility >= 10.8
MACOSX_DEPLOYMENT_TARGET=10.8
 
echo Running $DMD...
$DMD -ofbin/dub -g -O -w -version=DubUseCurl -version=DubApplication -Isource $* $LIBS @build-files.txt
$DMD -ofbin/dub -g -O -w -version=DubUseCurl -version=DubApplication -Isource $* @build-files.txt
bin/dub --version
echo DUB has been built as bin/dub.
echo
echo You may want to run
View
curl.lib 100644 → 0
Not supported