Improve configure script
This commit is contained in:
parent
ca36b7fb90
commit
6e71909c6e
1 changed files with 17 additions and 18 deletions
35
configure
vendored
35
configure
vendored
|
@ -66,13 +66,13 @@ gen_DC () {
|
||||||
fi
|
fi
|
||||||
if present ldc2; then
|
if present ldc2; then
|
||||||
dc=ldc2
|
dc=ldc2
|
||||||
using ldc2
|
|
||||||
elif present dmd; then
|
elif present dmd; then
|
||||||
dc=dmd
|
dc=dmd
|
||||||
using dmd
|
|
||||||
else
|
else
|
||||||
error "D compiler not found; install ldc or dmd"
|
error "D compiler not found; install ldc or dmd"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
using "$dc"
|
||||||
}
|
}
|
||||||
|
|
||||||
## flags used in the compilation step
|
## flags used in the compilation step
|
||||||
|
@ -82,24 +82,17 @@ gen_CFLAGS () {
|
||||||
ldc2) cflags="-Oz";;
|
ldc2) cflags="-Oz";;
|
||||||
dmd) cflags="-O";;
|
dmd) cflags="-O";;
|
||||||
esac
|
esac
|
||||||
using "$cflags"
|
|
||||||
else
|
else
|
||||||
fdebugsymbols="-g"
|
cflags="-g"
|
||||||
using "$fdebugsymbols"
|
|
||||||
case "$dc" in
|
case "$dc" in
|
||||||
ldc2)
|
ldc2) cflags="$cflags -O0 -d-debug";;
|
||||||
fdebug="-d-debug"
|
dmd) cflags="$cflags -debug";;
|
||||||
using "$fdebug"
|
|
||||||
foptimisation="-O0"
|
|
||||||
using "$foptimisation"
|
|
||||||
;;
|
|
||||||
dmd) fdebug="-debug";;
|
|
||||||
esac
|
esac
|
||||||
cflags="$fdebugsymbols $fdebug"
|
|
||||||
unset fdebug
|
|
||||||
unset fdebugsymbols
|
|
||||||
unset foptimisation
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for flag in $cflags; do
|
||||||
|
using "$flag"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
## flags used in the linking step
|
## flags used in the linking step
|
||||||
|
@ -107,12 +100,18 @@ gen_LDFLAGS () {
|
||||||
if [ "$dc" = ldc2 ]; then
|
if [ "$dc" = ldc2 ]; then
|
||||||
if present ld.lld; then
|
if present ld.lld; then
|
||||||
ldflags="-linker=lld"
|
ldflags="-linker=lld"
|
||||||
using "$ldflags"
|
|
||||||
elif present ld.gold; then
|
elif present ld.gold; then
|
||||||
ldflags="-linker=gold"
|
ldflags="-linker=gold"
|
||||||
using "$ldflags"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [ -z "$debug" ]; then
|
||||||
|
if ! [ -z "$ldflags" ]; then ldflags="$ldflags "; fi
|
||||||
|
ldflags="$ldflags-L--gc-sections"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for flag in $ldflags; do
|
||||||
|
using "$flag"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# command line interface
|
# command line interface
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue