Subject: pkg/22601: clisp-2.30 does not build on NetBSD 1.6.1 (i386) + workaround
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <prutflut@m-net.arbornet.org>
List: netbsd-bugs
Date: 08/26/2003 06:50:45
>Number:         22601
>Category:       pkg
>Synopsis:       clisp-2.30 does not build on NetBSD 1.6.1 (i386) + workaround
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 26 06:51:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Philippe Crama
>Release:        1.6.1
>Organization:
>Environment:
Sorry, forgot it at home.
It is a vanilla NetBSD 1.6.1 install
>Description:
Building of clisp-2.30 from source (as fetched with
pkgsrc from Aug, 19th 2003, NetBSD 1.6.1) fails because of a
missing symbol `HZ':
        ...
        time.d: in function `get_run_time':
        time.d:247: `HZ' undeclared (first use in this function)
        *** Error code 1
        ...

There are also a lot of other warnings which I ignored.

>How-To-Repeat:
(with a pkgsrc fetching clisp-2.30, not 2.27 that is available as
binary package on NetBSD.org)
cd /usr/pkgsrc/lang/clisp
make build
>Fix:
The workaround (solution?):
In /usr/pkgsrc/lang/clisp/work/clisp-2.30/src/XXX.d
(as obtained after make extract in /usr/pkgsrc/lang/clisp)
the only file containing the symbol `HZ' are constsym.d
and time.d.  In constsym.d, it is a string.
However, in time.d, it is used as a variable name.  But it
says in this file:
        ... line 238:
      var uintL used_time; # consumed time, measured in 1/HZ seconds
      var struct tms tms;
      begin_system_call();
      if (times(&tms) == (clock_t)(-1))
        used_time = 0; # times() failed -> used_time unknown
      else
        used_time = tms.tms_utime + tms.tms_stime; # user time + system time
      end_system_call();
      # Convert to seconds and microseconds: (use HZ or CLK_TCK ??)
      runtime->tv_sec = floor(used_time,HZ);
      runtime->tv_usec = (used_time % HZ) * floor(2*1000000+HZ,2*HZ);
      #endif
        ...
The comment says that it is not sure which should be used.
I changed manually after `make extract' the occurences of
`HZ' to `CLK_TCK' and then `make build' succeeds.
After `make install && rehash', clisp can be run.  If
desired, I can put up a binary package on the WEB...

I believe that CLK_TCK should be used because in the configure
script, the value of CLK_TCK is tested, but not HZ.  This
observation is only the result of a cursory grep through the
configure file, so it could be wrong.

I have emailed the author to ask if my fix is OK, but he has not
responded yet.
>Release-Note:
>Audit-Trail:
>Unformatted: