aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2021-01-03 11:19:48 -0800
committerGlenn Morris2021-01-04 09:02:40 -0800
commitfa574e68dec8255e211fbca95e187083ec6eabb4 (patch)
treed7bf9a146aedb12d4c1691ec9cf2837f008266f7
parent2c847902522ae74c9b25b2a3fa60565e0187fd0a (diff)
downloademacs-fa574e68dec8255e211fbca95e187083ec6eabb4.tar.gz
emacs-fa574e68dec8255e211fbca95e187083ec6eabb4.zip
Fix broken build on AIX 7.2
Without this fix, the build on AIX 7.2 with xlc fails in the ‘CCLD temacs’ step with the diagnostic ‘ld: 0711-317 ERROR: Undefined symbol: BC’. This is because -lcurses does not define BC etc. * configure.ac: When building terminfo.o, define TERMINFO_DEFINES_BC if the library defines BC etc. * src/terminfo.c (UP, BC, PC): Define depending on TERMINFO_DEFINES_BC, not on TERMINFO. (cherry picked from commit 632917461a7c1893a83979a3873b51d4da3b8a42)
-rw-r--r--configure.ac12
-rw-r--r--src/terminfo.c6
2 files changed, 15 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index bcc0be7de03..66c660696b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4393,6 +4393,18 @@ TERMCAP_OBJ=tparam.o
4393if test $TERMINFO = yes; then 4393if test $TERMINFO = yes; then
4394 AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.]) 4394 AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.])
4395 TERMCAP_OBJ=terminfo.o 4395 TERMCAP_OBJ=terminfo.o
4396 AC_CACHE_CHECK([whether $LIBS_TERMCAP library defines BC],
4397 [emacs_cv_terminfo_defines_BC],
4398 [OLD_LIBS=$LIBS
4399 LIBS="$LIBS $LIBS_TERMCAP"
4400 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern char *BC;]], [[return !*BC;]])],
4401 [emacs_cv_terminfo_defines_BC=yes],
4402 [emacs_cv_terminfo_defines_BC=no])
4403 LIBS=$OLD_LIBS])
4404 if test "$emacs_cv_terminfo_defines_BC" = yes; then
4405 AC_DEFINE([TERMINFO_DEFINES_BC], 1, [Define to 1 if the
4406 terminfo library defines the variables BC, PC, and UP.])
4407 fi
4396fi 4408fi
4397if test "X$LIBS_TERMCAP" = "X-lncurses"; then 4409if test "X$LIBS_TERMCAP" = "X-lncurses"; then
4398 AC_DEFINE(USE_NCURSES, 1, [Define to 1 if you use ncurses.]) 4410 AC_DEFINE(USE_NCURSES, 1, [Define to 1 if you use ncurses.])
diff --git a/src/terminfo.c b/src/terminfo.c
index 15aff317f15..a9c9572bbb2 100644
--- a/src/terminfo.c
+++ b/src/terminfo.c
@@ -23,10 +23,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
23 23
24/* Define these variables that serve as global parameters to termcap, 24/* Define these variables that serve as global parameters to termcap,
25 so that we do not need to conditionalize the places in Emacs 25 so that we do not need to conditionalize the places in Emacs
26 that set them. But don't do that for terminfo, as that could 26 that set them. But don't do that if terminfo defines them, as that
27 cause link errors when using -fno-common. */ 27 could cause link errors when using -fno-common. */
28 28
29#if !TERMINFO 29#ifndef TERMINFO_DEFINES_BC
30char *UP, *BC, PC; 30char *UP, *BC, PC;
31#endif 31#endif
32 32