Package: angband
Version: 1:4.2.5+dfsg1-3
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs
X-Debbugs-Cc: [email protected]
angand used to cross build. The ncurses wide character test was guessing
that it would just work and all was fine. Then ncursesw6-config changed.
It now emits -ltinfow. This is unlike ncursesw.pc, which emits -ltinfo
instead. I'm Ccing the ncurses maintainers for a comment on this.
Possibly, this is a regression in ncurses.
Now the native angand build notices this and concludes that wide
characters are not supported. It succeeds. The cross build instead still
guesses that it would work and eventually fails linking -ltinfow.
I'm attaching a patch that restructures the test on the angand side to
correctly handle the situation at hand. Rather than putting the
AC_RUN_IFELSE check first, the AC_LINK_IFELSE goes first. Then the cross
build behaves the same as the native build. Please consider applying the
patch and forwarding it upstream.
Helmut
Index: angband-4.2.5+dfsg1/acinclude.m4
===================================================================
--- angband-4.2.5+dfsg1.orig/acinclude.m4
+++ angband-4.2.5+dfsg1/acinclude.m4
@@ -470,11 +470,22 @@ ncurses_config_progs="ncursesw6-config n
CFLAGS="$CFLAGS $NCURSES_CFLAGS"
LIBS="$LIBS $NCURSES_LIBS"
dnl
-dnl Now check if the installed ncurses is installed OK. (Also sanity
-dnl checks the results of ncursesw6-config/ncursesw5-config to some extent)
+dnl Now check if the installed ncurses is installed OK.
dnl
- rm -f conf.ncursestest
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include "ncurses.h"
+]], [[ return 0; ]])],[],[no_ncurses=yes])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+
+ if test "x$no_ncurses" = x ; then
+dnl Also sanity checks the results of ncursesw6-config/ncursesw5-config to some extent
+ rm -f conf.ncursestest
+ CFLAGS="$CFLAGS $NCURSES_CFLAGS"
+ LIBS="$LIBS $NCURSES_LIBS"
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include "ncurses.h"
@@ -484,53 +495,48 @@ int main (int argc, char *argv[])
return 0;
}
-
-]])],[],[no_ncurses=yes],[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
-
- if test "x$no_ncurses" = x ; then
- AC_MSG_RESULT(yes)
- ifelse([$1], , :, [$1])
+]])],[
+ if test -f conf.ncursestest ; then
+ AC_MSG_RESULT(yes)
+ else
+ no_ncurses=yes
+ fi
+],[no_ncurses=yes],[
+ AC_MSG_RESULT([cross compiling; assumed OK...])
+])
+ if test "x$no_ncurses" != x ; then
+ AC_MSG_RESULT(no)
+ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding ncursesw. If it is not finding"
+ echo "*** ncursesw, you'll need to set your LD_LIBRARY_PATH environment variable,"
+ echo "*** or edit /etc/ld.so.conf to point to the installed location. Also, make"
+ echo "*** sure you have run ldconfig if that is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+ NCURSES_CFLAGS=""
+ NCURSES_LIBS=""
+ ifelse([$2], , :, [$2])
+ else
+ ifelse([$1], , :, [$1])
+ fi
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
else
AC_MSG_RESULT(no)
if test "$NCURSES_CONFIG" = "no" ; then
- echo "*** The ncursesw6-config or ncursesw5-config script installed by"
- echo "*** ncursesw could not be found. If ncursesw was installed in"
- echo "*** PREFIX, make sure PREFIX/bin is in your path, or set the"
- echo "*** NCURSES_CONFIG environment variable to the full path to"
- echo "*** ncursesw6-config or ncursesw5-config."
+ echo "*** The ncursesw6-config or ncursesw5-config script installed by"
+ echo "*** ncursesw could not be found. If ncursesw was installed in"
+ echo "*** PREFIX, make sure PREFIX/bin is in your path, or set the"
+ echo "*** NCURSES_CONFIG environment variable to the full path to"
+ echo "*** ncursesw6-config or ncursesw5-config."
else
- if test -f conf.ncursestest ; then
- :
- else
- echo "*** Could not run ncurses test program, checking why..."
- CFLAGS="$CFLAGS $NCURSES_CFLAGS"
- LIBS="$LIBS $NCURSES_LIBS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include "ncurses.h"
-]], [[ return 0; ]])],[ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding ncursesw. If it is not finding"
- echo "*** ncursesw, you'll need to set your LD_LIBRARY_PATH environment variable,"
- echo "*** or edit /etc/ld.so.conf to point to the installed location. Also, make"
- echo "*** sure you have run ldconfig if that is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],[ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means ncursesw was incorrectly"
- echo "*** installed or that you have moved ncursesw since it was installed. In the"
- echo "*** latter case, you may want to edit the ncursesw6-config or"
- echo "*** ncursesw5-config script: $NCURSES_CONFIG" ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
-
+ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means ncursesw was incorrectly"
+ echo "*** installed or that you have moved ncursesw since it was installed. In the"
+ echo "*** latter case, you may want to edit the ncursesw6-config or"
+ echo "*** ncursesw5-config script: $NCURSES_CONFIG"
fi
- NCURSES_CFLAGS=""
- NCURSES_LIBS=""
- ifelse([$2], , :, [$2])
fi
AC_SUBST(NCURSES_CFLAGS)
AC_SUBST(NCURSES_LIBS)