Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Apr 2011 22:09:47 GMT
From:      Matthew Cashdollar <matthew@cashdollar.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/156263: zsh fails to compile watch.c due to wtmpx.h inclusion
Message-ID:  <201104072209.p37M9ldH026465@red.freebsd.org>
Resent-Message-ID: <201104072210.p37MABKW048988@freefall.freebsd.org>

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

>Number:         156263
>Category:       ports
>Synopsis:       zsh fails to compile watch.c due to wtmpx.h inclusion
>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 Apr 07 22:10:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Matthew Cashdollar
>Release:        9.0-CURRENT from March 25th 2011
>Organization:
N/A
>Environment:
FreeBSD freebsd-vm.internal 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Sat Mar 26 18:33:34 CDT 2011     root@freebsd-vm.internal:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
When I attempt to compile the zsh 4.3.11 port on CURRENT, I receive the following error:

cc -c -I. -I/usr/local/include -DHAVE_CONFIG_H -O2 -fno-strict-aliasing -pipe -march=core2  -o watch.o watch.c
watch.c: In function 'readwtab':
watch.c:465: error: 'struct utmp' has no member named 'ut_type'
watch.c: In function 'dowatch':
watch.c:519: error: 'struct utmp' has no member named 'ut_type'
*** Error code 1

Researching this a bit, I found that utmpx.h is a new /usr/include header introduced with FreeBSD 9.
(http://svn.FreeBSD.org/viewvc/base/head/include/utmpx.h?view=log)

However, as you can see in the compile output, zsh is still using struct utmp instead of struct utmpx.  I believe this is caused by some configure macros in zsh which look for a utmpx / wtmpx but aren't able to find it... I'm not an expert on GNU Autoconf though:
checking for utmp file... no
checking for wtmp file... /var/log/wtmp
checking for utmpx file... no
checking for wtmpx file... no

Anyway, to get back to the underlying problem.. if you look at the erroring lines in watch.c, they are pulled in due to a #define USER_PROCESS.  Where is this coming from?  I found it in /usr/include/utmpx.h.  Zsh is including that file even when it is using utmp.h instead, due to GNU Configure defining HAVE_UTMPX_H.

>From zsh watch.c:
#ifdef HAVE_UTMPX_H
# include <utmpx.h>
#endif

>How-To-Repeat:
Attempt to install the zsh port on FreeBSD-current.
>Fix:
If you comment out the utmpx.h include at the top of watch.c, it compiles.

I am now using zsh as my login shell on -CURRENT.  I am not sure if the 'watch' functionality actually works - I am still testing that.  (I doesn't seem to be working but I need to make some changes to my shell configs to test it further.)

>Release-Note:
>Audit-Trail:
>Unformatted:



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