all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: "Nelson H. F. Beebe" <beebe@math.utah.edu>
Cc: enami tsugutomo <tsugutomo.enami@jp.sony.com>,
	7642@debbugs.gnu.org, 6190@debbugs.gnu.org
Subject: bug#7642: Build failure on NetBSD 5.0.2 on IA-32
Date: Fri, 17 Dec 2010 22:32:17 +0800	[thread overview]
Message-ID: <87ipys1nda.fsf@stupidchicken.com> (raw)
In-Reply-To: <CMM.0.95.0.1292519036.beebe@psi.math.utah.edu> (Nelson H. F. Beebe's message of "Thu, 16 Dec 2010 10:03:57 -0700 (MST)")

"Nelson H. F. Beebe" <beebe@math.utah.edu> writes:

> % make distclean
> % env LDFLAGS='-Wl,-rpath,/usr/X11R7/lib -L/usr/X11R7/lib' ./configure
> --without-xaw3d
> % make
> ...
> ld: cannot find -lterminfo
> % ls /usr/lib/libterm*
> /usr/lib/libtermcap.a                   /usr/lib/libtermlib.a
> ...
>
> That is another error: -lterminfo is hard-coded into src/Makefile.

The problem here is that in src/s/netbsd.h, we define

#ifdef HAVE_TERM_H
#define TERMINFO
#define LIBS_TERMCAP -lterminfo
#else
#define LIBS_TERMCAP -ltermcap
#endif

Judging by this report, the existence of term.h does not imply that
terminfo is available.

So, we should go back to the prescription originally given in Bug#6190.
Something like the following patch---Nelson, does it fix this problem?

=== modified file 'configure.in'
*** configure.in	2010-12-10 17:46:40 +0000
--- configure.in	2010-12-17 14:29:37 +0000
***************
*** 2372,2377 ****
--- 2372,2386 ----
  # than to expect to find it in ncurses.
  AC_CHECK_LIB(ncurses, tparm)
  
+ case "$opsys" in
+   netbsd)
+     AC_SEARCH_LIBS(tputs, [ncurses terminfo termcap]);
+     if test $ac_cv_search_tputs = -lterminfo; then
+       AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.]);
+     fi
+     ;;
+ esac
+ 
  # Do we have res_init, for detecting changes in /etc/resolv.conf?
  
  resolv=no

=== modified file 'src/s/netbsd.h'
*** src/s/netbsd.h	2010-05-21 04:06:34 +0000
--- src/s/netbsd.h	2010-12-17 14:29:31 +0000
***************
*** 45,52 ****
  #define LIBS_DEBUG
  /* -lutil is not needed for NetBSD >0.9.  */
  /* #define LIBS_SYSTEM -lutil */
! #ifdef HAVE_TERM_H
! #define TERMINFO
  #define LIBS_TERMCAP -lterminfo
  #else
  #define LIBS_TERMCAP -ltermcap
--- 45,51 ----
  #define LIBS_DEBUG
  /* -lutil is not needed for NetBSD >0.9.  */
  /* #define LIBS_SYSTEM -lutil */
! #ifdef TERMINFO
  #define LIBS_TERMCAP -lterminfo
  #else
  #define LIBS_TERMCAP -ltermcap

=== modified file 'configure'
*** configure	2010-12-10 17:46:40 +0000
--- configure	2010-12-17 14:30:05 +0000
***************
*** 11833,11838 ****
--- 11833,11904 ----
  fi
  
  
+ case "$opsys" in
+   netbsd)
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tputs" >&5
+ $as_echo_n "checking for library containing tputs... " >&6; }
+ if test "${ac_cv_search_tputs+set}" = set; then :
+   $as_echo_n "(cached) " >&6
+ else
+   ac_func_search_save_LIBS=$LIBS
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ /* Override any GCC internal prototype to avoid an error.
+    Use char because int might match the return type of a GCC
+    builtin and then its argument prototype would still apply.  */
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+ char tputs ();
+ int
+ main ()
+ {
+ return tputs ();
+   ;
+   return 0;
+ }
+ _ACEOF
+ for ac_lib in '' ncurses terminfo termcap; do
+   if test -z "$ac_lib"; then
+     ac_res="none required"
+   else
+     ac_res=-l$ac_lib
+     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+   fi
+   if ac_fn_c_try_link "$LINENO"; then :
+   ac_cv_search_tputs=$ac_res
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext
+   if test "${ac_cv_search_tputs+set}" = set; then :
+   break
+ fi
+ done
+ if test "${ac_cv_search_tputs+set}" = set; then :
+ 
+ else
+   ac_cv_search_tputs=no
+ fi
+ rm conftest.$ac_ext
+ LIBS=$ac_func_search_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tputs" >&5
+ $as_echo "$ac_cv_search_tputs" >&6; }
+ ac_res=$ac_cv_search_tputs
+ if test "$ac_res" != no; then :
+   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+ 
+ fi
+ ;
+     if test $ac_cv_search_tputs = -lterminfo; then
+ 
+ $as_echo "#define TERMINFO 1" >>confdefs.h
+ ;
+     fi
+     ;;
+ esac
+ 
  # Do we have res_init, for detecting changes in /etc/resolv.conf?
  
  resolv=no







  reply	other threads:[~2010-12-17 14:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CMM.0.95.0.1292278169.beebe@psi.math.utah.edu>
2010-12-15  1:39 ` bug#7642: Build failure on NetBSD 5.0.2 on IA-32 Chong Yidong
2010-12-15  8:29   ` Glenn Morris
2010-12-16  1:38     ` Chong Yidong
2010-12-16 17:03   ` Nelson H. F. Beebe
2010-12-17 14:32     ` Chong Yidong [this message]
2011-01-16  3:23     ` Glenn Morris
2011-01-16  3:25     ` Glenn Morris
2011-01-27 20:51   ` Chong Yidong
2011-01-28 18:15     ` Glenn Morris
2010-12-15  1:41 ` bug#7643: Build failure for SGI IRIX MIPS Chong Yidong
2011-01-08 20:43   ` Chong Yidong
2011-10-10 17:54     ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ipys1nda.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=6190@debbugs.gnu.org \
    --cc=7642@debbugs.gnu.org \
    --cc=beebe@math.utah.edu \
    --cc=tsugutomo.enami@jp.sony.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.