Re: [S-mailx] Problem building s-nail: error: 'su_ERR_OVERFLOW' undeclared

2022-02-01 Thread Steffen Nurpmeso
Ross Burton wrote in
 :
 |On Tue, 1 Feb 2022 at 14:53, Ross Burton  wrote:
 |>
 |> When I cross-compile s-nail I get a slew of errors:
 ...
 |OK, found it.
 |
 |My CC has options, as our compiler *needs* a --sysroot argument and we
 |pass that via CC to ensure that it is always used.
 |
 |However, su-make-errors.sh does "${CC}" which means the shell tries to
 |find a binary called 'gcc --sysroot=/foo', which doesn't exist.  The
 |loop has done set -e, so the error is silently absorbed.
 |
 |The easy fix appears to be to simply remove the quotes around ${CC},
 |as they serve no purpose apart from breaking builds where CC has
 |arguments.

Thanks for the report.
This fits fine into the proceeding as via (mk/su-find-command.sh:
clearly define space behaviour, 2021-12-16):

  #@ _However_, in order to support prefilled variables like "awk='busybox awk'"
  #@ spaces in command names found via path search are not supported.
  #@ That is to say that we take user-prefilled variable names with spaces as
  #@ granted, and actively fail to find commands with spaces ourselfs; like this
  #@ users of these functions can simply say: $VAR args, not "$VAR" args.

as well as (mx-test.sh: remove bogus quotation marks, 2021-12-31)
so i happily remove these last occurrances of bogus such.
I am still undecided whether i should / it is possible to pass
$CFLAGS to all invocations of $CC we have.  'Will not forget that
i hope.

Ross Burton wrote in
 :
 |An observation.  This command isn't parallelised:
 |
 |$ make -j build
 |
 |This is because it immediately re-calls $(MAKE) in OBJDIR, but doesn't
 |pass $(MAKEFLAGS) so the -j is lost.

These should come in via the generated "$(OBJDIR)"/mk-config.mk if
i recall correctly :)
gmake produces warnings like

  make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make 
rule.
  make[1]: Entering directory '/tmp/.nail/y'
  make[1]: warning: -j4 forced in makefile: resetting jobserver mode.

however, this has been reported years ago, what can i do?
This project uses the de-facto only possibility to use portable
build parallelization with nothing but POSIX make(1), via
indirection and some "tricks" in the top makefile, that is

  .NOTPARALLEL:
  .WAIT: # Luckily BSD make supports specifying this as target, too
  ...
  all: config .WAIT build

So until now .NOTPARALLEL for GNU make in the top makefile, and
fine control for BSD make via .WAIT.  I hope in the future GNU
make will support that, too.  The parallelization in the recursive
make via picked up flags from mk-config.mk.
(Unfortunately some make maintainers seem to be pretty bold, yes
even to standstill, if i realize some responses.  But i will write
portable makefiles nonetheless.)

Ciao from Germany!

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Re: [S-mailx] Problem building s-nail: error: 'su_ERR_OVERFLOW' undeclared

2022-02-01 Thread Ross Burton
OK, found it.

My CC has options, as our compiler *needs* a --sysroot argument and we
pass that via CC to ensure that it is always used.

However, su-make-errors.sh does "${CC}" which means the shell tries to
find a binary called 'gcc --sysroot=/foo', which doesn't exist.  The
loop has done set -e, so the error is silently absorbed.

The easy fix appears to be to simply remove the quotes around ${CC},
as they serve no purpose apart from breaking builds where CC has
arguments.

Ross

On Tue, 1 Feb 2022 at 14:53, Ross Burton  wrote:
>
> When I cross-compile s-nail I get a slew of errors:
>
> s-nail-14.9.23/src/mx/accmacvar.c:515:25: error: 'su_ERR_OVERFLOW'
> undeclared (first use in this function); did you mean
> 'su_STATE_ERR_OVERFLOW'?
> s-nail-14.9.23/src/mx/accmacvar.c:522:25: error: 'su_ERR_NOENT'
> undeclared (first use in this function); did you mean 'su_ERR_NONE'?
> s-nail-14.9.23/src/mx/accmacvar.c:2982:31: error: 'su_ERR_INVAL'
> undeclared (first use in this function); did you mean 'su_ERR_NONE'?
> s-nail-14.9.23/src/mx/accmacvar.c:3001:25: error: 'su_ERR_OPNOTSUPP'
> undeclared (first use in this function); did you mean 'EOPNOTSUPP'?
> s-nail-14.9.23/src/mx/accmacvar.c:3688:25: error: 'su_ERR_INVAL'
> undeclared (first use in this function); did you mean 'su_ERR_NONE'?
> s-nail-14.9.23/src/mx/accmacvar.c:3789:28: error: 'su_ERR_NOTSUP'
> undeclared (first use in this function); did you mean 'su_ERR_NONE'?
>
> A native build works, and I see that these are defined in mk-config.h.
> In my cross build, that file looks like this:
>
> #define su__ERR_NUMBER_ENUM_C \
> su_ERR_NONE = 0,\
> su_ERR_NOTOBACCO = su__ERR_NUMBER_MAX,\
> su__ERR_NUMBER = 2
>
> Any ideas why this would be happening?
>
> Thanks,
> Ross