Skip to content

Commit

Permalink
configure: Fix flags handling for pb little-endian targets
Browse files Browse the repository at this point in the history
While upgrading the Alpine Linux ChezScheme package to 0.10.0, I
encountered a weird build failure on ppc64le (`--machine=tpb64l`)
were it fails to link against ncurses.

Further debugging revealed that this is due to the fact that the
`configure` script does not add `-lncurses` to the linker flags
if the machine type does not end in `*le`. Since 0.10.0 introduced
little-endian targets (such as `tpb64l`) which do not end in `*le`
I believe the `configure` script needs to be adjusted accordingly.

This patch fixes the described build failure on Alpine Linux.
  • Loading branch information
nmeum committed Apr 20, 2024
1 parent 08a45e5 commit 4df234b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ fi

# Infer flags needed for threads:
case "${flagsm}" in
t*le|t*gnu|t*fb|t*ob|t*nb)
t*le|*l|t*gnu|t*fb|t*ob|t*nb)
threadFlags="-D_REENTRANT -pthread"
threadLibs="-lpthread"
;;
Expand Down Expand Up @@ -840,7 +840,7 @@ fi
# Add automatic linking flags, unless suppressed by --disable-auto-flags
if [ "$addflags" = "yes" ] ; then
case "${flagsm}" in
*le|*gnu)
*le|*l|*gnu)
LDFLAGS="${LDFLAGS} -rdynamic"
;;
*fb|*nb)
Expand All @@ -854,7 +854,7 @@ if [ "$addflags" = "yes" ] ; then
esac

case "${flagsm}" in
*le|*gnu)
*le|*l|*gnu)
LIBS="${LIBS} -lm -ldl ${ncursesLib} -lrt"
;;
*fb|*ob)
Expand Down Expand Up @@ -950,7 +950,7 @@ exeSuffix=

# compile flags for c/Mf-unix and mats/Mf-unix
case "${flagsmuni}" in
*le|*gnu)
*le|*l|*gnu)
mdcflags="-fPIC -shared"
;;
*fb|*ob)
Expand Down Expand Up @@ -984,7 +984,7 @@ case "${flagsmuni}" in
i3le)
mdldflags="-melf_i386"
;;
*le|*gnu)
*le|*l|*gnu)
;;
i3nb)
mdldflags="-m elf_i386"
Expand Down

0 comments on commit 4df234b

Please sign in to comment.