Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Mar 2009 17:02:11 +0300
From:      Anonymous <swell.k@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/132579: [patch] sysutils/screen: fix build with externel compiler (gcc42/gcc43/gcc43/llvm)
Message-ID:  <86bps6yh3w.fsf@gmail.com>
Resent-Message-ID: <200903121410.n2CEA4J4098418@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         132579
>Category:       ports
>Synopsis:       [patch] sysutils/screen: fix build with externel compiler (gcc42/gcc43/gcc44/llvm)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 12 14:10:04 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Anonymous
>Release:        FreeBSD 8.0-CURRENT amd64
>Organization:
>Environment:
System: FreeBSD luffy 8.0-CURRENT FreeBSD 8.0-CURRENT #0 r189706M: Wed Mar 11 20:47:32 UTC 2009 root@luffy:/usr/obj/usr/src/sys/PHOENIX amd64

$ make showconfig (all default)
===> The following configuration options are available for screen-4.0.3_6:
     CJK=off "Treat CJK ambiguous characters as full width"
     INFO=on "Build and install info documentation"
     MAN=on "Build and install man pages"
     NETHACK=on "Enable nethack-style messages"
     XTERM_256=off "Enable support for 256 colour xterm"
     HOSTINLOCKED=off "Print user@host in locked message"
     SHOWENC=off "Show encoding on the status line"
>Description:
The port builds only with base compiler if sysutils/libutempter is installed.
>How-To-Repeat:
install lang/gcc43
install sysutils/libutempter

$ make CC=gcc43
===>  Configuring for screen-4.0.3_6
...
checking utempter.h usability... yes
checking utempter.h presence... yes
checking for utempter.h... yes
...
configure: error: Can't run the compiler - internal error. Sorry.

And in config.log there are errors like

configure:5842: gcc43 -o conftest -O2 -pipe -fno-strict-aliasing   conftest.c -ltermcap  -lutil -lutempter -lutil >&5
/usr/bin/ld: cannot find -lutempter
collect2: ld returned 1 exit status

But if you specify LDFLAGS="-L${LOCALBASE}/lib ${LDFLAGS}" then build
fails in another place

gcc43 -c -I. -I.    -O2 -pipe -fno-strict-aliasing utmp.c
utmp.c: In function 'initutmp':
utmp.c:646: error: 'utmpfd' undeclared (first use in this function)
utmp.c:646: error: (Each undeclared identifier is reported only once
utmp.c:646: error: for each function it appears in.)
utmp.c: In function 'setutent':
utmp.c:654: error: 'utmpfd' undeclared (first use in this function)
utmp.c: In function 'endutent':
utmp.c:661: error: 'utmpfd' undeclared (first use in this function)
utmp.c: In function 'getutent':
utmp.c:669: error: 'utmpfd' undeclared (first use in this function)
utmp.c: In function 'getutslot':
utmp.c:680: error: 'utmpfd' undeclared (first use in this function)
utmp.c: In function 'pututslot':
utmp.c:699: error: 'utmpfd' undeclared (first use in this function)
*** Error code 1

>Fix:

Either link with libutempter.so

--- link.diff begins here ---
Index: sysutils/screen/Makefile
===================================================================
RCS file: /home/csup/ports/sysutils/screen/Makefile,v
retrieving revision 1.77
diff -u -p -r1.77 Makefile
--- sysutils/screen/Makefile	23 Feb 2009 21:48:34 -0000	1.77
+++ sysutils/screen/Makefile	12 Mar 2009 13:04:24 -0000
@@ -31,6 +31,7 @@ NO_PACKAGE=	Tends to loop using 100% CPU
 .include <bsd.port.pre.mk>

 GNU_CONFIGURE=	yes
+CONFIGURE_ENV=	LDFLAGS="-L${LOCALBASE}/lib ${LDFLAGS}"
 .if defined(WITH_MAN)
 MAN1=		screen.1
 MAKE_ARGS+=	-DWITH_MAN
Index: sysutils/screen/files/patch-utmp.c
===================================================================
RCS file: /home/csup/ports/sysutils/screen/files/patch-utmp.c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-utmp.c
--- sysutils/screen/files/patch-utmp.c	21 Oct 2005 14:24:02 -0000	1.1
+++ sysutils/screen/files/patch-utmp.c	12 Mar 2009 13:06:37 -0000
@@ -1,5 +1,14 @@
 --- utmp.c.orig	Mon Sep  8 16:27:17 2003
 +++ utmp.c	Wed Oct 19 14:58:40 2005
+@@ -69,7 +69,7 @@
+  *  we have a suid-root helper app that changes the utmp for us
+  *  (won't work for login-slots)
+  */
+-#if (defined(sun) && defined(SVR4) && defined(GETUTENT)) || defined(HAVE_UTEMPTER)
++#if (defined(sun) && defined(SVR4) && defined(GETUTENT))
+ # define UTMP_HELPER
+ #endif
+
 @@ -726,9 +728,12 @@
  char *line, *user;
  int pid;
--- link.diff ends here ---

or remove utempter.h check entirely

--- skip.diff begins here ---
Index: sysutils/screen/files/patch-remove-utempter-check
===================================================================
RCS file: sysutils/screen/files/patch-remove-utempter-check
diff -N sysutils/screen/files/patch-remove-utempter-check
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sysutils/screen/files/patch-remove-utempter-check	12 Mar 2009 13:15:40 -0000
@@ -0,0 +1,168 @@
+--- configure.in.orig	2003-06-03 15:58:24.000000000 +0400
++++ configure.in
+@@ -855,12 +855,6 @@
+ #include <utmp.h>
+ #endif
+ ],[struct utmp u; u.ut_host[0] = 0;], AC_DEFINE(UTHOST))
+-AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no)
+-if test "$have_utempter" = yes; then
+-  AC_DEFINE(HAVE_UTEMPTER)
+-  LIBS="$LIBS -lutempter"
+-fi
+-
+ dnl
+ dnl    ****  loadav  ****
+ dnl
+--- configure.orig	2003-12-05 16:46:53.000000000 +0300
++++ configure
+@@ -5717,150 +5717,6 @@
+
+ fi
+ rm -f conftest.$ac_objext conftest.$ac_ext
+-if test "${ac_cv_header_utempter_h+set}" = set; then
+-  echo "$as_me:$LINENO: checking for utempter.h" >&5
+-echo $ECHO_N "checking for utempter.h... $ECHO_C" >&6
+-if test "${ac_cv_header_utempter_h+set}" = set; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_header_utempter_h" >&5
+-echo "${ECHO_T}$ac_cv_header_utempter_h" >&6
+-else
+-  # Is the header compilable?
+-echo "$as_me:$LINENO: checking utempter.h usability" >&5
+-echo $ECHO_N "checking utempter.h usability... $ECHO_C" >&6
+-cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-$ac_includes_default
+-#include <utempter.h>
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; }; then
+-  ac_header_compiler=yes
+-else
+-  echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-ac_header_compiler=no
+-fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
+-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+-echo "${ECHO_T}$ac_header_compiler" >&6
+-
+-# Is the header present?
+-echo "$as_me:$LINENO: checking utempter.h presence" >&5
+-echo $ECHO_N "checking utempter.h presence... $ECHO_C" >&6
+-cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-#include <utempter.h>
+-_ACEOF
+-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+-  ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } >/dev/null; then
+-  if test -s conftest.err; then
+-    ac_cpp_err=$ac_c_preproc_warn_flag
+-  else
+-    ac_cpp_err=
+-  fi
+-else
+-  ac_cpp_err=yes
+-fi
+-if test -z "$ac_cpp_err"; then
+-  ac_header_preproc=yes
+-else
+-  echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-  ac_header_preproc=no
+-fi
+-rm -f conftest.err conftest.$ac_ext
+-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+-echo "${ECHO_T}$ac_header_preproc" >&6
+-
+-# So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
+-    { echo "$as_me:$LINENO: WARNING: utempter.h: accepted by the compiler, rejected by the preprocessor!" >&5
+-echo "$as_me: WARNING: utempter.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: utempter.h: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: utempter.h: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
+-    ;;
+-  no:yes )
+-    { echo "$as_me:$LINENO: WARNING: utempter.h: present but cannot be compiled" >&5
+-echo "$as_me: WARNING: utempter.h: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: utempter.h: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: utempter.h: check for missing prerequisite headers?" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: utempter.h: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: utempter.h: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
+-    ;;
+-esac
+-echo "$as_me:$LINENO: checking for utempter.h" >&5
+-echo $ECHO_N "checking for utempter.h... $ECHO_C" >&6
+-if test "${ac_cv_header_utempter_h+set}" = set; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-  ac_cv_header_utempter_h=$ac_header_preproc
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_header_utempter_h" >&5
+-echo "${ECHO_T}$ac_cv_header_utempter_h" >&6
+-
+-fi
+-if test $ac_cv_header_utempter_h = yes; then
+-  have_utempter=yes
+-else
+-  have_utempter=no
+-fi
+-
+-
+-if test "$have_utempter" = yes; then
+-  cat >>confdefs.h <<\_ACEOF
+-#define HAVE_UTEMPTER 1
+-_ACEOF
+-
+-  LIBS="$LIBS -lutempter"
+-fi
+-
+ { echo "$as_me:$LINENO: checking for libutil(s)..." >&5
+ echo "$as_me: checking for libutil(s)..." >&6;}
+ test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
--- skip.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86bps6yh3w.fsf>