On 8/26/24 16:29, Chet Ramey wrote:
On 8/24/24 11:53 PM, Dennis Clarke via Bug reports for the GNU Bourne
Again SHell wrote:
This seemed to happen over and over and only during "make install".
There are a number of loadable builtins that require arrays and don't build
without them.
It's annoying, but everything else is already installed before the process
gets to this point, so you're not really missing anything except the
example loadables.
Firstly, an apology :
Sorry to drag this old thing up again.
So here I am digging around in a weird bug on FreeBSD that just
seems very hard to track down. The default bourne shell on FreeBSD
machines seems to totally wreck havok on the stty terminal setting we
call "echoctl". So I figure the best way to file a bug report and to
demonstrate that something is borked was to build the bash shell with
a really limited config. I mean really lean mean and no fancy anything
for the user. What I got from this was a bash shell that feels like I
am using a dumb paper terminal from 1977. Perfect. It works like a charm
and does exactly what it should. Nothing more.
I used the following configure options on a RHEL machine and on an
old Fujitsu SPARC64 Solaris 10 server :
$ ./configure --prefix=$HOME/local --enable-threads=posix \
--enable-xpg-echo-default --enable-minimal-config \
--enable-strict-posix-default
Everything goes wonderful. No problems in the compile with some really
trivial CFLAGS and nothing special anywhere. Until we hit that install
stage of things and realpath.c blows up due to ARRAY_VARS not being
defined. In my config.h I see :
/* Define ARRAY_VARS if you want ksh-style one-dimensional array
variables. */
/* #undef ARRAY_VARS */
That is the only thing that causes a problem with realpath.c in the
examples. I isolated the code into another directory and sure enough one
may compile realpath.c just fine so long as we have -DARRAY_VARS=1 on
the command line.
There must be a trivial way around this just to allow install to work?
hubble$ diff -u realpath.c.orig realpath.c
--- realpath.c.orig Sat Jan 25 14:30:01 2025
+++ realpath.c Sat Jan 25 15:37:07 2025
@@ -69,12 +69,12 @@
int opt, cflag, vflag, qflag, sflag, aflag, es;
char *r, realbuf[PATH_MAX], *p, *newpath;
struct stat sb;
-#if defined (ARRAY_VARS)
+
arrayind_t ind;
char *aname;
SHELL_VAR *v;
-#endif
+
if (list == 0) {
builtin_usage();
return (EX_USAGE);
@@ -81,11 +81,11 @@
}
vflag = cflag = qflag = aflag = sflag = 0;
-#if defined (ARRAY_VARS)
+
+ ind = 0;
aname = NULL;
v = NULL;
- ind = 0;
-#endif
+
reset_internal_getopt();
while ((opt = internal_getopt (list, "a:cqsv")) != -1) {
switch (opt) {
hubble$
That leaves me with just this :
hubble$
hubble$ $CC $CFLAGS -I. $CPPFLAGS -c -o realpath.o realpath.c
"realpath.c", line 169: warning: implicit function declaration:
bind_array_element (E_NO_IMPLICIT_DECL_ALLOWED)
hubble$
However this works like a charm :
hubble$ $CC $CFLAGS -I. $CPPFLAGS -DARRAY_VARS=1 -c -o realpath.o
realpath.c
Or perhaps toss the realpath example out the window somewhere?
--
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken