Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 1996 13:20:09 GMT
From:      James Raynard <fqueries@jraynard.demon.co.uk>
To:        hasegawa@rdpc1.ahs.kitasato-u.ac.jp
Cc:        questions@freebsd.org, hasegawa@rdpc1.ahs.kitasato-u.ac.jp
Subject:   Re: [Q]cap60 compile error
Message-ID:  <199606191320.NAA20774@jraynard.demon.co.uk>
In-Reply-To: <31C7E127.41C67EA6@rdpc1.ahs.kitasato-u.ac.jp> (message from Tomoyuki Hasegawa on Wed, 19 Jun 1996 11:14:47 %2B0000)

next in thread | previous in thread | raw e-mail | index | archive | help
> I can not compile cap60
> "make install" output the following error message.
> I have read in FAQs that cap60 was running on FreeBSD.

I'm not familiar with that program (it doesn't seem to be in the ports
collection), but here's my thoughts on your make output:-

> mkdir /usr/local/cap /usr/local/cap
> mkdir: /usr/local/cap: File exists
> mkdir: /usr/local/cap: File exists
> *** Error code 1 (ignored)

This looks harmless - it's just making sure the install directory exists.

> cp atis /usr/local/cap
> (cd samples; make install)
> "makefile", line 97: Need an operator
> Fatal errors encountered -- cannot continue
> *** Error code 1 (ignored)

This often happens with Makefiles designed to be used with GNU make -
FreeBSD uses BSD make, which is slightly different. (You can install
GNU make as 'gmake' from the ports or packages distributions).

However, you mention you're using 2.0.5. If I remember rightly, the
make in 2.0.5 was much stricter than in 2.0 and gave this error if the
action line in a Makefile didn't start with a tab character. eg

foobar.o: foobar.c foobar.h
	$(CC) -c -I$(INCLUDE) foobar.c
^
|
\----------- tab character here - no problem

foobar.o: foobar.c foobar.h
        $(CC) -c -I$(INCLUDE) foobar.c
^
|
\----------- 8 space characters here - error!

This is actually more correct, but there are so many broken Makefiles
in the world that it had to be changed back in 2.1.0. If this is the
problem, it can be fixed with a text editor - or by upgrading! 8-)

> (cd contrib; make install)
> strip cvt2apple cvt2cap lwrename printqueue snitch aufsmkusr aufsmkkey
> cp cvt2apple cvt2cap /usr/local/cap
> cp lwrename printqueue snitch aufsmkusr aufsmkkey /usr/local/cap
> (cd applications; make install)
> (cd lwsrv; make install)
> cc -DBYTESWAPPED -DPHASE2 -O  -c lwsrvconfig.c
> lwsrvconfig.c: In function `strdup':
> lwsrvconfig.c:675: argument `str' doesn't match prototype
> /usr/include/string.h:85: prototype declaration
> *** Error code 1

This looks like the program is trying to provide its own version of
strdup() for systems that don't have one and it's using a char *
instead of a const char * for the argument. This can be fixed by
something like

before:-

char *strdup(char *str) {

after:-

char *strdup(const char *str) {

You may then see warnings like "assignment to pointer discards const",
but these can be ignored. Alternatively, there may be a make option
(called something like HAVE_STRDUP, perhaps) you can define to tell it
that you have strdup() so it doesn't need to supply its own.

BTW, if you find you have to make changes to a program to get it to
work on FreeBSD, it's always a good idea to keep a record of them, so
you can ask the author to incorporate the changes into the next
version of the program. And they come in useful if you want to submit
your work as a FreeBSD port 8-)

-- 
James Raynard, Edinburgh, Scotland
james@jraynard.demon.co.uk



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