Subject: pkg/16408: editors/ted - header file redefines PKGDIR
To: None <firstname.lastname@example.org>
From: None <kre@munnari.OZ.AU>
Date: 04/19/2002 14:05:09
>Synopsis: editors/ted - header file redefines PKGDIR
>Arrival-Date: Fri Apr 19 00:05:01 PDT 2002
>Originator: Robert Elz
>Release: NetBSD 1.5ZC - 2002-04-18 (pkgsrc of same date)
Prince of Songkla University
<The following information is extracted from your kernel. Please>
<append output of "ldd", "ident" where relevant (multiple lines).>
System: NetBSD fuchsia.cs.mu.OZ.AU 1.5ZC NetBSD 1.5ZC (FUCHSIA) #10: Sat Apr 6 11:36:35 ICT 2002 email@example.com.OZ.AU:/usr/obj/sys/FUCHSIA i386
When compiling editors/ted, ie:
gcc -I/usr/obj/pkg/editors/ted/work.i386/.buildlink/include -O2 -I/usr/X11R6/include -I/usr/pkg/include -I../appFrame -I../appUtil -I../bitmap -I../ind -I../include -DPKGDIR=\"/usr/pkg\" -DAFMDIR=\"/usr/pkg/share/Ted/afm\" -DINDDIR=\"/usr/pkg/share/Ted/ind\" -I/usr/obj/pkg/editors/ted/work.i386/.buildlink/include -c appMailDialog.c
In file included from appMailDialog.c:7:
appFrameConfig.h:36: warning: `PKGDIR' redefined
*Initialization*:1: warning: this is the location of the previous definition
warnings fly past for almost every file compiled.
Investigate, and observe ...
# define PREFIX "/usr/local"
# ifdef PREFIX
# define PKGDIR PREFIX
# ifndef PKGDIR
# define PKGDIR "/usr/local"
which has to be one of the weirdest sets of definitions and
conditionals I've ever seen ... the first #define guarantees
that the #ifdef is true (wasting cpp effort), the second
define (the one that overridesthe PKGDIR carefully passed in by
the NetBSD pkgsrc build system) guarantees that the ifndef is
false (more wasted effort).
All this is how the files are extracted, no pkgsrc patch-xx file
I didn't bother to determine whether this actually affects
operation in any way, the whole thing was so absurd that I
simply aborted the compilation (if it has insanities this
blatant in it, I don't want to imagine what more subtle problems
exist). That's why the non-critical/low prioritiy of this PR.
Check whether PREFIX is actually used anywhere in the code, if not
delete (via a patch) the whole segment of preprocessor statements
I included above. If it is, instead of deleting them, replace them
with #define PREFIX PKGDIR (or delete them and -DPREFIX on the cc
<Please check that the above is correct for the bug being reported,>
<and append source date of snapshot, if applicable (one line).>