configure failure when whitespace in directory name

Job Snijders job at openbsd.org
Wed Oct 1 10:34:10 AEST 2025


Please see inline

On Wed, Oct 01, 2025 at 10:00:16AM +1000, Darren Tucker wrote:
> diff --git a/Makefile.in b/Makefile.in
> index 769ec17f4..760fbaa5b 100644
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -33,6 +33,7 @@ STRIP_OPT=@STRIP_OPT@
>  TEST_SHELL=@TEST_SHELL@
>  BUILDDIR=@abs_top_builddir@
>  SK_STANDALONE=@SK_STANDALONE@
> +COMPATINCLUDES="$(BUILDDIR)/@COMPATINCLUDES@"
>  
>  PATHS= -DSSHDIR=\"$(sysconfdir)\" \
>  	-D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \
> @@ -50,7 +51,7 @@ CC=@CC@
>  LD=@LD@
>  CFLAGS=@CFLAGS@
>  CFLAGS_NOPIE=@CFLAGS_NOPIE@
> -CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
> +CPPFLAGS=-I. -I$(srcdir) -I$(COMPATINCLUDES) @CPPFLAGS@ $(PATHS) @DEFS@
>  PICFLAG=@PICFLAG@
>  LIBS=@LIBS@
>  CHANNELLIBS=@CHANNELLIBS@
> diff --git a/configure.ac b/configure.ac
> index 819e83689..3eb6d4697 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -526,7 +526,7 @@ AC_CHECK_HEADERS([ \
>  # platform.  Usually these are just empty, but in some cases they'll include
>  # the equivalent file.  This avoids having to wrap those includes in
>  # '#ifdef HAVE_FOO_H'.  If we create any such headers, add the path to includes.
> -compatincludes=no
> +COMPATINCLUDES=""
>  AC_CHECK_HEADERS([ \
>      endian.h \
>      ifaddrs.h \
> @@ -541,8 +541,8 @@ AC_CHECK_HEADERS([ \
>      sys/un.h \
>      time.h \
>      util.h], [], [
> -	compatincludes="`pwd`/openbsd-compat/include"
> -	header="$compatincludes/$ac_header"
> +	COMPATINCLUDES="openbsd-compat/include"
> +	header="$COMPATINCLUDES/$ac_header"
>  	dir=`dirname "$header"`
>  	mkdir -p "$dir"
>  	case "$ac_header" in
> @@ -552,9 +552,7 @@ AC_CHECK_HEADERS([ \
>  	*)      ;;
>  	esac >"$header"
>  ])
> -if test "$compatincludes" != "no"; then
> -    CPPFLAGS="$CPPFLAGS -I$compatincludes"
> -fi
> +AC_SUBST([COMPATINCLUDES])
>  
>  AC_CHECK_DECLS([le32toh, le64toh, htole64], [], [], [
>  #ifdef HAVE_SYS_TYPES_H

The above chunk helps a bit in relationship to the reproducer that OP
provided (I tested on Debian 13): autoreconf && ./configure && make
pass. However, 'make tests' throws this error:

	job at kali:~/openssh/o 2/openssh$ make tests
	Makefile:729: warning: ignoring prerequisites on suffix rule definition
	/usr/bin/mkdir -p `pwd`/regress/unittests/test_helper
	/usr/bin/mkdir -p `pwd`/regress/unittests/authopt
	/usr/bin/mkdir -p `pwd`/regress/unittests/bitmap
	/usr/bin/mkdir -p `pwd`/regress/unittests/conversion
	/usr/bin/mkdir -p `pwd`/regress/unittests/hostkeys
	/usr/bin/mkdir -p `pwd`/regress/unittests/kex
	/usr/bin/mkdir -p `pwd`/regress/unittests/match
	/usr/bin/mkdir -p `pwd`/regress/unittests/misc
	/usr/bin/mkdir -p `pwd`/regress/unittests/sshbuf
	/usr/bin/mkdir -p `pwd`/regress/unittests/sshkey
	/usr/bin/mkdir -p `pwd`/regress/unittests/sshsig
	/usr/bin/mkdir -p `pwd`/regress/unittests/utf8
	/usr/bin/mkdir -p `pwd`/regress/misc/sk-dummy
	/usr/bin/mkdir -p `pwd`/regress/misc/ssh-verify-attestation
	[ -f `pwd`/regress/Makefile ] || \
	    ln -s `cd . && pwd`/regress/Makefile `pwd`/regress/Makefile
	/usr/bin/bash: line 1: [: /home/job/openssh/o: binary operator expected
	ln: target '2/openssh/regress/Makefile': No such file or directory
	make: *** [Makefile:547: regress-prep] Error 1


And the below chunk does not apply cleanly to openssh-SNAP-20251001.tar.gz:

> diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in
> index 1d549954f..5bce2b38b 100644
> --- a/openbsd-compat/Makefile.in
> +++ b/openbsd-compat/Makefile.in
> @@ -120,3 +120,4 @@ clean:
>  
>  distclean: clean
>  	rm -f Makefile *~
> +	rm -rf include


More information about the openssh-unix-dev mailing list