about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-04-11 14:47:58 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2021-04-11 14:47:58 +0000
commit0a6fbf1d52537f4bc3da9c98e9ab8f950512fa15 (patch)
tree9a52f763468f0e91b05f840af48ca625035b753d /configure
parent98d7928be3a453331daf5d58bc9e46c382d32e5d (diff)
downloads6-frontend-0a6fbf1d52537f4bc3da9c98e9ab8f950512fa15.tar.gz
s6-frontend-0a6fbf1d52537f4bc3da9c98e9ab8f950512fa15.tar.xz
s6-frontend-0a6fbf1d52537f4bc3da9c98e9ab8f950512fa15.zip
Do not compile or link into /dev/null
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure10
1 files changed, 6 insertions, 4 deletions
diff --git a/configure b/configure
index 2587fef..5a3d667 100755
--- a/configure
+++ b/configure
@@ -97,7 +97,7 @@ stripdir () {
 tryflag () {
   echo "Checking whether compiler accepts $2 ..."
   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"
     eval "$1=\"\${$1} \$2\""
     eval "$1=\${$1# }"
@@ -111,7 +111,7 @@ tryflag () {
 tryldflag () {
   echo "Checking whether linker accepts $2 ..."
   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"
     eval "$1=\"\${$1} \$2\""
     eval "$1=\${$1# }"
@@ -240,13 +240,15 @@ set -C
 while : ; do
   i=$(($i+1))
   tmpc="./tmp-configure-$$-$PPID-$i.c"
+  tmpo="./tmp-configure-$$-$PPID-$i.o"
   tmpe="./tmp-configure-$$-$PPID-$i.tmp"
   2>|/dev/null > "$tmpc" && break
+  2>|/dev/null > "$tmpo" && break
   2>|/dev/null > "$tmpe" && break
   test "$i" -gt 50 && fail "$0: cannot create temporary files"
 done
 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
 if $slashpackage ; then
@@ -309,7 +311,7 @@ test -n "$CC_AUTO" || { echo "$0: cannot find a C compiler" ; exit 1 ; }
 echo "  ... $CC_AUTO"
 echo "Checking whether C compiler works... "
 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"
 else
   echo "  ... no. Compiler output follows:"