Subject: pkg/14897: graphics/tcm fails to compile (with gcc 2.95.3)
To: None <>
From: None <kre@munnari.OZ.AU>
List: netbsd-bugs
Date: 12/10/2001 18:15:04
>Number:         14897
>Category:       pkg
>Synopsis:       graphics/tcm fails to compile (with gcc 2.95.3)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 10 07:37:03 PST 2001
>Originator:     Robert Elz
>Release:        NetBSD-current 20011126 (pkgsrc of 20011207)
	Prince of Songkla University
System: NetBSD fuchsia 1.5Y NetBSD 1.5Y (FUCHSIA) #2: Mon Nov 26 13:41:27 ICT 2001 kre@fuchsia:/usr/obj/sys/FUCHSIA i386
Architecture: i386
Machine: i386

	Several small problems with graphics/tcm using gcc 2.95.3

	Have the new toolchain installed
	cd pkgsrc/graphics/tcm

	Fix the errors as they arise, so you can go on to
	the next one...
	In graphics/tcm unpack the appended shar file.
	It will overwrite patch-ad and patch-al, and create
	new patches patch-be patch-bf and patch-bg

	patch-ad is trivial, adds a missing const
	patch-be patch-bf and patch-bg are almost as trivial,
	add a #include of <stdio.h> (though depending upon the
	resolution to the final change, those might need to change

		#ifdef LESSTIF
		#include <iostdio.h>
		#include <stdio.h>

	Or perhaps alwats inclyde stdio.h and just conditionally
	include iostdio.h - or soething.   The patches below appear
	to work (with not a lot of testing).

	The final change - that in patch-al is most problematic.
	Whether that one is wanted or not will depend upon the
	resolution of a toolchain PR I just submitted (but I'm off
	line, so it is still in my mqueue, and I don't know its number,
	it will be one or two either side of this one though most likely).

	That is, if the resolution of that PR is to remove the sprintf
	related #defines from <iostdio.h> then the patch-al included
	in this shar file is needed (and patch-be -bf and -bg will be
	wanted exactly as included, no changes).   On the other hand,
	if the resolution of the toolchain PR is to supply the missing
	functions from libstdc++, then you should ignore the patch-al
	included here, and keep the one that currently exists, and
	the patch-b* files included here may need modification as
	indicated above (beats me).   In that case, patch-al will need
	the #else case above added (just in case LESSTIF is not in use).

	I will send a reply to this PR once it appears with the number
	of the other PR in it, so doing a query of this one in the
	database (once it gets there) should eventually show the
	toolchain PR number.

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
# This archive contains:
#	patches
#	patches/patch-bg
#	patches/patch-bf
#	patches/patch-be
#	patches/patch-ad
#	patches/patch-al
echo c - patches
mkdir -p patches > /dev/null 2>&1
echo x - patches/patch-bg
sed 's/^X//' >patches/patch-bg << 'END-of-patches/patch-bg'
X+++ ed/startupwindow.c	Mon Dec 10 16:14:28 2001
X@@ -40,6 +40,7 @@
X #include "Teapot2a.xbm"
X #include <stdlib.h>
X #include <Xm/XmAll.h>
X+#include <stdio.h>
X const int StartupWindow::MIN_DRAWING_SIZE = 200;
echo x - patches/patch-bf
sed 's/^X//' >patches/patch-bf << 'END-of-patches/patch-bf'
X+++ ui/textviewdialog.c	Mon Dec 10 16:04:07 2001
X@@ -33,6 +33,7 @@
X #include <stdlib.h>
X #include <unistd.h>
X #include <ctype.h>
X+#include <stdio.h>
X TextViewDialog::TextViewDialog(Widget w): Dialog(w) {
X 	fileItems = 0;
echo x - patches/patch-be
sed 's/^X//' >patches/patch-be << 'END-of-patches/patch-be'
X+++ ui/colorchooserdialog.c	Mon Dec 10 15:58:41 2001
X@@ -24,6 +24,7 @@
X #include "mstring.h"
X #include <Xm/XmAll.h>
X #include <stdlib.h>
X+#include <stdio.h>
X ColorChooserDialog::ColorChooserDialog(Widget w): SelectionDialog(w) {
X 	colors = new List<Color *>;
echo x - patches/patch-ad
sed 's/^X//' >patches/patch-ad << 'END-of-patches/patch-ad'
X+++ gl/system.c	Mon Dec 10 15:50:08 2001
X@@ -47,7 +47,7 @@
X const char System::TOOLKIT_HOME_VAR_NAME[] = "TCM_HOME";
X+const char System::TOOLKIT_HOME_DEFAULT[] = "@PREFIX@";
X bool System::sendBugEmail = True;
X char System::emailAddress[MAXNAME] = "";
X@@ -63,13 +63,11 @@
X // most common Unix directories for system wide available binaries.
X const char *System::STD_SEARCH_DIRS[] =
X 	{"./", "/bin/", "/usr/bin/", "/usr/local/bin/", 
X-	 "/usr/local/tcm/bin", "/home/tcm/bin", "/usr/bin/X11/", 
X-	 "/usr/ucb/", "/usr/sbin/", "/usr/X11/bin/", "/usr/openwin/bin/", 
X-	 "/opt/tcm/bin", "/usr/local/X11/bin", "/usr/local/bin/X11/",
X-	 "/usr/openwin/contrib/bin", "/Window/X11/bin",
X-	 "/Window/X11/contrib/bin", 0};
X+	 "@PREFIX@/bin/", "@X11BASE@/bin/", "@LOCALBASE@/bin/",
X+	 "/usr/openwin/bin", "/usr/sbin/", "/usr/X11/bin/",
X+	 "/opt/tcm/bin", "/usr/local/X11/bin", "/usr/local/bin/X11/", 0};
X-#if defined(LINUX) || defined(AIX) || defined(HPUX) || defined(OSF1)
X+#if defined(LINUX) || defined(AIX) || defined(HPUX) || defined(OSF1) || defined(__NetBSD__)
X typedef void (*SIG_PF)(int);
X #endif
X@@ -177,11 +175,14 @@
X 			return;
X 		}
X 		else {
X-				<< " environment variable is not set" << endl;
X-			cerr << "please set this variable to the"
X-				" directory where the software is installed "
X-				"and try it again" << endl;
X+		  const char *p2 = TOOLKIT_HOME_DEFAULT;
X+		  strncpy(home, p2, MAXNAME-1);
X+		  return;
X+		  //			cerr << "Error: " << TOOLKIT_HOME_VAR_NAME
X+		  //	<< " environment variable is not set" << endl;
X+		  //cerr << "please set this variable to the"
X+		  //	" directory where the software is installed "
X+		  //	"and try it again" << endl;
X 		}
X 		exit(1);
X 	}
echo x - patches/patch-al
sed 's/^X//' >patches/patch-al << 'END-of-patches/patch-al'
X+++ ui/error.c	Mon Dec 10 17:15:06 2001
X@@ -23,6 +23,7 @@
X #include "application.h"
X #include "messagelogdialog.h"
X #include <stdarg.h>
X+#include <stdio.h>
X void error(const char *fmt ...) {
X 	// we're not getting huge strings