Skip to content
Snippets Groups Projects
Commit 70b76b5d authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

do not compile or link into /dev/null

parent 57e82905
No related branches found
No related tags found
No related merge requests found
...@@ -130,7 +130,7 @@ stripdir () { ...@@ -130,7 +130,7 @@ stripdir () {
tryflag () { tryflag () {
echo "Checking whether compiler accepts $2 ..." echo "Checking whether compiler accepts $2 ..."
echo "typedef int x;" > "$tmpc" echo "typedef int x;" > "$tmpc"
if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST "$2" -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST "$2" -c -o "$tmpo" "$tmpc" >/dev/null 2>&1 ; then
echo " ... yes" echo " ... yes"
eval "$1=\"\${$1} \$2\"" eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }" eval "$1=\${$1# }"
...@@ -144,7 +144,7 @@ tryflag () { ...@@ -144,7 +144,7 @@ tryflag () {
tryldflag () { tryldflag () {
echo "Checking whether linker accepts $2 ..." echo "Checking whether linker accepts $2 ..."
echo "typedef int x;" > "$tmpc" echo "typedef int x;" > "$tmpc"
if $CC_AUTO $CFLAGS_AUTO $CFLAGS $CFLAGS_POST $LDFLAGS_AUTO $LDFLAGS $LDFLAGS_POST -nostdlib "$2" -o /dev/null "$tmpc" >/dev/null 2>&1 ; then if $CC_AUTO $CFLAGS_AUTO $CFLAGS $CFLAGS_POST $LDFLAGS_AUTO $LDFLAGS $LDFLAGS_POST -nostdlib "$2" -o "$tmpe" "$tmpc" >/dev/null 2>&1 ; then
echo " ... yes" echo " ... yes"
eval "$1=\"\${$1} \$2\"" eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }" eval "$1=\${$1# }"
...@@ -361,13 +361,15 @@ set -C ...@@ -361,13 +361,15 @@ set -C
while : ; do while : ; do
i=$((i+1)) i=$((i+1))
tmpc="./tmp-configure-$$-$PPID-$i.c" tmpc="./tmp-configure-$$-$PPID-$i.c"
tmpo="./tmp-configure-$$-$PPID-$i.o"
tmpe="./tmp-configure-$$-$PPID-$i.tmp" tmpe="./tmp-configure-$$-$PPID-$i.tmp"
2>|/dev/null > "$tmpc" && break 2>|/dev/null > "$tmpc" && break
2>|/dev/null > "$tmpo" && break
2>|/dev/null > "$tmpe" && break 2>|/dev/null > "$tmpe" && break
test "$i" -gt 50 && fail "$0: cannot create temporary files" test "$i" -gt 50 && fail "$0: cannot create temporary files"
done done
set +C set +C
trap 'rm -f "$tmpc" "$tmpe"' EXIT ABRT INT QUIT TERM HUP trap 'rm -f "$tmpc" "$tmpo" "$tmpe"' EXIT ABRT INT QUIT TERM HUP
# Set slashpackage values # Set slashpackage values
if $slashpackage ; then if $slashpackage ; then
...@@ -446,7 +448,7 @@ test -n "$CC_AUTO" || { echo "$0: cannot find a C compiler" ; exit 1 ; } ...@@ -446,7 +448,7 @@ test -n "$CC_AUTO" || { echo "$0: cannot find a C compiler" ; exit 1 ; }
echo " ... $CC_AUTO" echo " ... $CC_AUTO"
echo "Checking whether C compiler works... " echo "Checking whether C compiler works... "
echo "typedef int x;" > "$tmpc" echo "typedef int x;" > "$tmpc"
if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST -c -o /dev/null "$tmpc" 2>"$tmpe" ; then if $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST -c -o "$tmpo" "$tmpc" 2>"$tmpe" ; then
echo " ... yes" echo " ... yes"
else else
echo " ... no. Compiler output follows:" echo " ... no. Compiler output follows:"
...@@ -487,7 +489,6 @@ tryflag CFLAGS -fomit-frame-pointer ...@@ -487,7 +489,6 @@ tryflag CFLAGS -fomit-frame-pointer
tryflag CFLAGS_AUTO -fno-exceptions tryflag CFLAGS_AUTO -fno-exceptions
tryflag CFLAGS_AUTO -fno-unwind-tables tryflag CFLAGS_AUTO -fno-unwind-tables
tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables
tryflag CFLAGS_AUTO -Wa,--noexecstack
tryflag CFLAGS -fno-stack-protector tryflag CFLAGS -fno-stack-protector
tryflag CPPFLAGS_AUTO -Werror=implicit-function-declaration tryflag CPPFLAGS_AUTO -Werror=implicit-function-declaration
tryflag CPPFLAGS_AUTO -Werror=implicit-int tryflag CPPFLAGS_AUTO -Werror=implicit-int
...@@ -497,7 +498,6 @@ tryflag CPPFLAGS_AUTO -Wno-unused-value ...@@ -497,7 +498,6 @@ tryflag CPPFLAGS_AUTO -Wno-unused-value
tryflag CPPFLAGS_AUTO -Wno-parentheses tryflag CPPFLAGS_AUTO -Wno-parentheses
tryflag CFLAGS_AUTO -ffunction-sections tryflag CFLAGS_AUTO -ffunction-sections
tryflag CFLAGS_AUTO -fdata-sections tryflag CFLAGS_AUTO -fdata-sections
tryldflag LDFLAGS_AUTO -Wl,--sort-section=alignment tryldflag LDFLAGS_AUTO -Wl,--sort-section=alignment
tryldflag LDFLAGS_AUTO -Wl,--sort-common tryldflag LDFLAGS_AUTO -Wl,--sort-common
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment