On Tue, Sep 30, 2025 at 09:28:10PM +0000, Job Snijders wrote:> On Tue, Sep 30, 2025 at 03:02:54PM +0100, Sevan Janiyan wrote: > > On Darwin, if you extract the snapshot archive from the GUI, and there's > > already a directory named openssh present, the system adds a number to the > > directory name to avoid what's in place. e.g "openssh 2" > > When it comes to configuring, the "checking compiler and flags for sanity" > > fails with "clang: error: no such file or directory: > > '2/openbsd-compat/include'" > > I'm not sure that can be fixed. Seems autoconf doesn't work well with > whitespacesWe can't fix it in configure, but we *can* punt the problem to make: Sevan: please try this patch. You will need to run "autoreconf" after applying it to rebuild configure. diff --git a/Makefile.in b/Makefile.in index 769ec17f4..b5f73cd3f 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 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 -- Darren Tucker (dtucker at dtucker.net) GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
On Wed, Oct 01, 2025 at 09:18:47AM +1000, Darren Tucker wrote:> On Tue, Sep 30, 2025 at 09:28:10PM +0000, Job Snijders wrote: > > On Tue, Sep 30, 2025 at 03:02:54PM +0100, Sevan Janiyan wrote: > > > On Darwin, if you extract the snapshot archive from the GUI, and there's > > > already a directory named openssh present, the system adds a number to the > > > directory name to avoid what's in place. e.g "openssh 2" > > > When it comes to configuring, the "checking compiler and flags for sanity" > > > fails with "clang: error: no such file or directory: > > > '2/openbsd-compat/include'" > > > > I'm not sure that can be fixed. Seems autoconf doesn't work well with > > whitespaces > > We can't fix it in configure, but we *can* punt the problem to make: > > Sevan: please try this patch. You will need to run "autoreconf" after > applying it to rebuild configure.Sigh. Didn't wait long enough into the test and it needed another set of quotes. Please try this instead. 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 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 -- Darren Tucker (dtucker at dtucker.net) GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
On 01/10/2025 00:18, Darren Tucker wrote: > We can't fix it in configure, but we*can* punt the problem to make: > > Sevan: please try this patch. You will need to run "autoreconf" after > applying it to rebuild configure. Thanks for the patches, Darren. I cloned the openssh-portable repo which contains your changes just now, and autoconf'd it. configure succeed in a directory with a space in its name. To make sure, I nested the repo inside a subdirectory with a space in its name and it still succeeded in configuring. The diff between the resulting configure script from today with your patch and the initial snapshot I downloaded yesterday is as follows: --- /tmp/openssh/configure 2025-09-30 15:30:20.000000000 +0100 +++ /tmp/openssh 2/openssh-portable/configure 2025-10-01 14:18:34.000000000 +0100 @@ -689,6 +689,7 @@ LDNSCONFIG LIBOBJS TESTLIBS +COMPATINCLUDES LD PATH_PASSWD_PROG STARTUP_SCRIPT_SHELL @@ -11440,7 +11441,7 @@ # 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="" for ac_header in endian.h ifaddrs.h libgen.h paths.h netgroup.h nlist.h poll.h stdint.h sys/stat.h sys/time.h sys/un.h time.h util.h do : as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh` @@ -11453,8 +11454,8 @@ else $as_nop - 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 @@ -11467,9 +11468,7 @@ fi done -if test "$compatincludes" != "no"; then - CPPFLAGS="$CPPFLAGS -I$compatincludes" -fi + ac_fn_check_decl "$LINENO" "le32toh" "ac_cv_have_decl_le32toh" " #ifdef HAVE_SYS_TYPES_H @@ -28248,3 +28247,4 @@ echo "WARNING: BSM audit support is currently considered EXPERIMENTAL." echo "See the Solaris section in README.platform for details." fi + Sincerely, Sevan