Subject: pkg/30789: emulators/aliados build failures on MacOS X 10.3.9
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <jdbaker@mylinuxisp.com>
List: pkgsrc-bugs
Date: 07/20/2005 04:37:01
>Number:         30789
>Category:       pkg
>Synopsis:       emulators/aliados build failures on MacOS X 10.3.9
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 20 04:37:01 +0000 2005
>Originator:     John D. Baker
>Release:        MacOS X 10.3.9
>Organization:
>Environment:
Darwin pm8500.technoskunk.fur 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC  Power Macintosh powerpc

>Description:
Building emulators/aliados on MacOS X 10.3.9 fails as follows:

First:

[...]
g++ -no-cpp-precomp -I/usr/pkg/include -O2 -I/usr/pkg/include  -c realconsole.cpp
realconsole.cpp: In member function `void RealConsole::In::activate()':
realconsole.cpp:693: error: `OCRNL' undeclared (first use this function)
realconsole.cpp:693: error: (Each undeclared identifier is reported only once 
   for each function it appears in.)
realconsole.cpp:693: error: `ONOCR' undeclared (first use this function)
realconsole.cpp:693: error: `ONLRET' undeclared (first use this function)
*** Error code 1

Stop.
bmake: stopped in /Volumes/NetBSD/tmp/pkgsrc/emulators/aliados/work/aliados-0.1.1
[...]


Second:

[...]
g++ -no-cpp-precomp -I/usr/pkg/include -O2 -I/usr/pkg/include -c directory.cpp
directory.cpp: In member function `std::string 
   FindFile::Internal::findfirst(const std::string&)':
directory.cpp:140: error: `GLOB_NOMATCH' undeclared (first use this function)
directory.cpp:140: error: (Each undeclared identifier is reported only once for 
   each function it appears in.)
*** Error code 1

Stop.
bmake: stopped in /Volumes/NetBSD/tmp/pkgsrc/emulators/aliados/work/aliados-0.1.1
[...]


>How-To-Repeat:
On MacOS X 10.3.9:

cd .../emulators/aliados
bmake

(apply first workaround below)

bmake

>Fix:
Workarounds to the above problems.

MacOS X 10.3.9 /usr/include/sys/termios.h does not define the macro
constants OCRNL, ONOCR, and ONLRET.  While one might be tempted to
define them locally using NetBSD termios.h as a template, it's not
clear whether the MacOS X terminal driver actually implements their
handling.

So, to be on the safe side, 'work/aliados-0.1.1/realconsole.cpp' is
modified as follows:

--- work/aliados-0.1.1/realconsole.cpp.orig     Tue Jul 19 23:21:41 2005
+++ work/aliados-0.1.1/realconsole.cpp  Tue Jul 19 23:21:58 2005
@@ -690,7 +690,7 @@
        // No traducir CR y LF en la entrada.
        term.c_iflag&= ~ (INLCR | ICRNL);
        // No traducir CR y LF en la salida.
-       term.c_oflag&= ~ (ONLCR | OCRNL | ONOCR | ONLRET);
+       term.c_oflag&= ~ (ONLCR);
        // Sin echo, modo no canŪnico, sin interrupciones.
        term.c_lflag&= ~ (ECHO | ICANON | ISIG);
        // Esperar sŪlo por un caracter.


MacOS X 10.3.9 /usr/include/glob.h does not define the macro
GLOB_NOMATCH.  While it may be tempting to define it locally using
a NetBSD glob.h as a template, it is unclear whether the underlying
MacOS X 10.3.9 system actually implements its handling.  Thus,
'work/aliados-0.1.1/directory.cpp' is modified as follows:

--- work/aliados-0.1.1/directory.cpp.orig       Tue Jul 19 23:33:41 2005
+++ work/aliados-0.1.1/directory.cpp    Tue Jul 19 23:33:29 2005
@@ -137,7 +137,6 @@
        switch ( (r= glob (s.c_str (), flag, NULL, & g) ) )
        {
        case 0:
-       case GLOB_NOMATCH:
                break;
        default:
                return std::string ();