Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 1999 04:13:49 +0200 (CEST)
From:      Martin Kammerhofer <dada@balu.kfunigraz.ac.at>
To:        Josh Gilliam <josh@quick.net>
Cc:        Jun-ichiro Itoh <itojun@itojun.org>, Yoshishige Arai <ryo2@on.rim.or.jp>, ports@freebsd.org
Subject:   Usage of ${OSREL} vs. ${OSVERSION} in FreeBSD port Makefiles
Message-ID:  <Pine.BSF.3.96.990810031700.8734A-100000@localhost.kfunigraz.ac.at>

next in thread | raw e-mail | index | archive | help
Hello Josh!

Your port textproc/aspell is the latest one in a long list of ports
that are broken on FreeBSD 2.2.x.
The problem is caused by the incorrect usage of ${OSREL} for
numerical comparisons in make(1) if-statements. E.g. in your port
the line
  .if ${OSREL} < 4
is expanded by make to
  .if 2.2.8 < 4
on my FreeBSD 2.2.8 system. This is considered a syntax error by make
and make(1) therefore rejects the whole Makefile.
I don't know who started this bug but now it seems to appear every week
in another port. :(
A robust way to check the OS Release is to use ${OSVERSION}. In the case
of aspell replace
  .if ${OSREL} < 4
with
  .if ${OSVERSION} < 400000
and everything is fine for FreeBSD x.y.z sytems too.

I cc'd this message to the authors of 'portlint' and ports@freebsd.org
because I suggest this frequent bug should
	1. be documented in the Handbook (a hint should be added to
		section 4.7.8.5 "Differentiating OS versions")
	2. a check for incorrect usage of ${OSREL} in if-statements
		should be added to 'portlint'.

Some make-targets ('make readmes', 'make index') traverse the whole port
tree. This cannot work if ANY Makefile has a syntax error, even if
you never intend to build that ports. That's why I spot these errors,
because I cvsup the ports collection and rebuild the README.html files
weekly.
Even if 2.2.x is considered 'unsupported' this is still a concern,
because 3.x.y and 4.x.y systems are likely to emerge.

HTH,
  Martin
--
Kommunikation läßt sich durch nichts ersetzen.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990810031700.8734A-100000>