Re: Building stdcxx-4.2.2 Using MinGW+MSYS On Windows XP (SP2)

2008-12-04 Thread Martin Sebor

Steve Petrie, P.Eng. wrote:
[...]

I use the following MSYS console shell command, to compile the
test_stdcxx_1.cpp program:

 g++.exe -I./include -nostdinc++ -nostdinc -nostdlib -c -o test_stdcxx_1.o
test_stdcxx_1.cpp


You also need -I./include/ansi. Its also a good idea to avoid
using the g++ command and use gcc instead just to make it 100%
clear that the native C++ Standard Library should not be linked
(unless you know better , I don't think you want -nostdlib as
it normally prevents linking with files you want to link with).



(Note the dot "." between "-I" and "/include". I have an stdcxx "include"
directory, with all its sub-directories, as a sub-directory of the 
directory
where the test_stdcxx_1.cpp source program is located, because I haven't 
yet

been able to figure out how to get g++.exe to respect a "-I" parameter
pointing to a more complex path description. The "include" directory, with
all its sub-directories, is a copy of what is shipped with stdcxx-4.2.2.)

g++.exe displays the following compile errors on the MSYS console:

  In file included from ./include/rw/_traits.h:40,
   from ./include/rw/_strref.h:48,
   from ./include/string:43,
   from ./include/loc/_locale.h:36,
   from ./include/rw/_iosbase.h:36,
   from ./include/streambuf:39,
   from ./include/ostream:39,
   from ./include/istream:38,
   from ./include/iostream:33,
   from test_stdcxx_1.cpp:4:
  ./include/rw/_mbstate.h:195:27: cwchar: No such file or directory


That's because you're missing -Iinlude/ansi -- that's where
our cwchar lives. All the errors after this one should clear
up after you add it.

Martin


Re: Building stdcxx-4.2.2 Using MinGW+MSYS On Windows XP (SP2)

2008-12-04 Thread Steve Petrie, P.Eng.
its.h:353: error: `memcpy' is not a member of `std'
  ./include/rw/_traits.h: At global scope:
  ./include/rw/_traits.h:396: error: expected `;' before "state_type"
  ./include/rw/_traits.h:397: error: `state_type' was not declared in this
scope
  ./include/rw/_traits.h:397: error: template argument 1 is invalid
  ./include/rw/_traits.h: In static member function `static int
std::char_traits::compare(const char*, const char*, unsigned int)':
  ./include/rw/_traits.h:420: error: `memcmp' is not a member of `std'
  ./include/rw/_traits.h: In static member function `static const char*
std::char_traits::find(const char*, unsigned int, const char&)':
  ./include/rw/_traits.h:428: error: `memchr' is not a member of `std'
  ./include/rw/_traits.h: In static member function `static unsigned int
std::char_traits::length(const char*)':
  ./include/rw/_traits.h:434: error: `strlen' is not a member of `std'
  ./include/rw/_traits.h: In static member function `static char*
std::char_traits::move(char*, const char*, unsigned int)':
  ./include/rw/_traits.h:439: error: `memmove' is not a member of `std'
  ./include/rw/_traits.h: In static member function `static char*
std::char_traits::copy(char*, const char*, unsigned int)':
  ./include/rw/_traits.h:445: error: `memcpy' is not a member of `std'
  ./include/rw/_traits.h: In static member function `static char*
std::char_traits::assign(char*, unsigned int, char)':
  ./include/rw/_traits.h:451: error: `memset' is not a member of `std'
  ./include/rw/_traits.h: At global scope:
  ./include/rw/_traits.h:483: error: expected `;' before "state_type"
  ./include/rw/_traits.h:484: error: `state_type' was not declared in this
scope
  ./include/rw/_traits.h:484: error: template argument 1 is invalid
  ./include/rw/_traits.h: In static member function `static int
std::char_traits::compare(const wchar_t*, const wchar_t*, unsigned
int)':
  ./include/rw/_traits.h:504: error: `wmemcmp' was not declared in this
scope
  ./include/rw/_traits.h: In static member function `static unsigned int
std::char_traits::length(const wchar_t*)':
  ./include/rw/_traits.h:509: error: `wcslen' is not a member of `std'
  ./include/rw/_traits.h: In static member function `static const wchar_t*
std::char_traits::find(const wchar_t*, unsigned int, const
wchar_t&)':
  ./include/rw/_traits.h:515: error: `wmemchr' is not a member of `std'
  ./include/rw/_traits.h: In static member function `static wchar_t*
std::char_traits::copy(wchar_t*, const wchar_t*, unsigned int)':
  ./include/rw/_traits.h:522: error: `wmemcpy' is not a member of `std'
  ./include/rw/_traits.h: In static member function `static wchar_t*
std::char_traits::move(wchar_t*, const wchar_t*, unsigned int)':
  ./include/rw/_traits.h:528: error: `wmemmove' is not a member of `std'
  ./include/rw/_traits.h: In static member function `static wchar_t*
std::char_traits::assign(wchar_t*, unsigned int, wchar_t)':
  ./include/rw/_traits.h:534: error: `wmemset' is not a member of `std'
  In file included from ./include/rw/_iosbase.h:36,
   from ./include/streambuf:39,
   from ./include/ostream:39,
   from ./include/istream:38,
   from ./include/iostream:33,
   from test_stdcxx_1.cpp:4:
  ./include/loc/_locale.h: At global scope:
  ./include/loc/_locale.h:403: error: `mbstate_t' is not a member of `std'
  ./include/loc/_locale.h:403: error: `mbstate_t' is not a member of `std'
  ./include/loc/_locale.h:403: error: template argument 3 is invalid
  ./include/loc/_locale.h:470: error: `mbstate_t' is not a member of `std'
  ./include/loc/_locale.h:470: error: `mbstate_t' is not a member of `std'
  ./include/loc/_locale.h:470: error: template argument 3 is invalid
I've tried using a "-Z" parameter with the g++.exe command, but g++.exe
still won't generate an object file.

The first file "cwchar" that g++.exe is complaining that it can't find, does
exist. It's in directory ./include/ansi/ I tried copying file "cwchar" to
./include/ but this didn't fix the first compiler error.

* * *
* * *
.
Any suggestions you could make, would be most appreciated. Or, if you could
compile and link my minimal test program "test_stdcxx_1.cpp" under your
MinGW+MSYS, and tell me how you did it, that would be even better.

Thanks.

Steve

- Original Message - 
From: "Farid Zaripov" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, December 03, 2008 3:51 AM
Subject: Re: Building stdcxx-4.2.2 Using MinGW+MSYS On Windows XP (SP2)



HOWEVER, after the completion of the "ar rv   libstd11s.a ..." command
executed near the very end of the build process, th

Re: Building stdcxx-4.2.2 Using MinGW+MSYS On Windows XP (SP2)

2008-12-03 Thread Farid Zaripov
> HOWEVER, after the completion of the "ar rv   libstd11s.a ..." command
> executed near the very end of the build process, the following was displayed
> on the MSYS console, and the build process stopped:

[...]
>   i:\apps\mingw\bin\ar.exe: creating libstd11s.a
>   gencat rwstderr.cat /stdcxx-4.2.2/src/rwstderr.msg
>   /bin/sh: gencat: command not found
>   make[2]: [rwstderr.cat] Error 127 (ignored)

  It's ok. The rwstderr.cat catalog file is used for overriding standard 
exceptions
what() messages (i.e. to have localized messages). On MinGW (as well as on
entire Windows) stdcxx doesn't using rwstderr.cat, but using rwstderr.dll 
instead.
Actually if you're fine with english messages, you don't need rwstderr.{cat|dll}
because of the english messages are hardcoded in library sources.

> Would please tell me, what do I need to do, to get the gencat.exe utility to
> accept the rwstderr.msg file?

  On Windows gencat.exe acceps rwstderr.rc file and produces rwstderr.dll file.

Farid.


Re: Building stdcxx-4.2.2 Using MinGW+MSYS On Windows XP (SP2)

2008-11-30 Thread Steve Petrie, P.Eng.

[FZ]
I have MSYS 1.0.11.0(0.46/3/2) and "ln --version" reports version 5.97

[SP]
The "ln" in MSYS 1.0.10 was pre-5.97, so I downloaded and installed:

  msysCORE-1.0.11-20080826.tar.gz.

In this version of MSYS, the "ln" version is 5.97.

I reverted to the GNUmakefile shipped with stdcxx-4.2.2, and ran the
stdcxx-4.2.2 build under MSYS with the following command (following the
instructions in your earlier email, except: changing the BUILDTYPE to 11s
from 15D, and explicitly specifying the CONFIG=gcc.config):

  make BUILDDIR=/stdcxx-4.2.2/build_11s \
 BUILDTYPE=11s \
 CONFIG=gcc.config \
 config lib

The "ln" command worked ok, and the build created a "libstd11s.a" file of 
12.4 MB size.


HOWEVER, after the completion of the "ar rv   libstd11s.a ..." command
executed near the very end of the build process, the following was displayed
on the MSYS console, and the build process stopped:

  ar rv   libstd11s.a
  [...]
  a - valarray.o
  a - vecbool.o
  a - version.o
  a - wcodecvt.o
  a - wctype.o
  i:\apps\mingw\bin\ar.exe: creating libstd11s.a
  gencat rwstderr.cat /stdcxx-4.2.2/src/rwstderr.msg
  /bin/sh: gencat: command not found
  make[2]: [rwstderr.cat] Error 127 (ignored)
  make[2]: Leaving directory `/stdcxx-4.2.2/build_11s/lib'
  make[1]: Leaving directory `/stdcxx-4.2.2/build_11s'
  make: Nothing to be done for `lib'.

  [EMAIL PROTECTED] /stdcxx-4.2.2

It looked to me like the (line 10) message:

  "/bin/sh: gencat: command not found"

happened because the stdcxx-4.2.2 utilities had not been built, so no
"gencat.exe" utility program existed..

So I deleted the "build_11s" build, and ran the stdcxx-4.2.2 build under
MSYS, using the following command:

  make BUILDDIR=/stdcxx-4.2.2/build_11s \
 BUILDTYPE=11s \
 CONFIG=gcc.config \
 builddir config util lib locales

Again, the build ended, with a "/bin/sh: gencat: command not found" error.

However, there was now a "gencat.exe" in /stdcxx-4.2.2/build_11s/bin".

It looked like the "/bin/sh: gencat: command not found" error was caused
because "gencat.exe" was not reachable via any path definition.

So I copied "gencat.exe" into the /msys/1.0.11/bin/" directory, and tried to
install the library, using the following command, with MSYS in the
/stdcxx-4.2.2/build_11s directory:

  make install PREFIX=install_11s

The install displayed the following on the MSYS console:

  $ make install PREFIX=install_11s
  mkdir -p install_11s
  make -Clib install
  make[1]: Entering directory `/stdcxx-4.2.2/build_11s/lib'
  gencat rwstderr.cat /stdcxx-4.2.2/src/rwstderr.msg
  windres: i:/apps/stdcxx-4.2.2/src/rwstderr.msg:1: syntax error
  make[1]: [rwstderr.cat] Error 1 (ignored)
  mkdir -p install_11s/lib
  cp libstd11s.a install_11s/lib
  if [ libstd11s.a != libstd11s.a ]; then  \
  rm install_11s/lib/libstd11s.a;   \
  ln -s libstd11s.a install_11s/lib/libstd11s.a; \
  fi
  mkdir -p install_11s/etc
  cp rwstderr.cat install_11s/etc
  cp: cannot stat `rwstderr.cat': No such file or directory
  make[1]: *** [install] Error 1
  make[1]: Leaving directory `/stdcxx-4.2.2/build_11s/lib'
  make: *** [install] Error 2

  [EMAIL PROTECTED] /stdcxx-4.2.2/build_11s

On line 6 of the above, the gencat command failed, and displayed:

  "windres: i:/apps/stdcxx-4.2.2/src/rwstderr.msg:1: syntax error".

On line 16 of the above, the cp command failed (due to the earlier failure
of the gencat command), and displayed:

  "cp: cannot stat `rwstderr.cat': No such file or directory".

I tried changing the format of file "rwstderr.msg" from DOS to UNIX format
(i.e from 0D0A line ends, to 0A line ends) but got the same error from
"gencat.exe".

So now I'm stuck at the install step.

Would please tell me, what do I need to do, to get the gencat.exe utility to
accept the rwstderr.msg file?

Thanks,

Steve

- Original Message - 
From: "Farid Zaripov" <[EMAIL PROTECTED]>

To: 
Sent: Friday, November 28, 2008 8:09 AM
Subject: Re: Building stdcxx-4.2.1 Using MinGW+MSYS On Windows XP (SP2)



But I definitely DO have the problem with "ln" on my MSYS :(


[...]


I'm using Windows XP (SP2) and MinGW (5.1.4) and MSYS (1.0.10). Perhaps we
have a difference in our operating environments?


 I have MSYS 1.0.11.0(0.46/3/2) and "ln --version" reports version 5.97


Then I created a documented test case shell script "test.mingw.ln"
(attached), that replicates the problem on my MinGW+MSYS system.
Would you like to run the script in an MSYS console on your system, and
let
me know the result?


 Unfortunately, I don't see any file attached :(


Here are a couple of interesting quotes related to MinGW+MSYS and ln, that
I
found through a Google search:



There is no way to create a "file symlink" in MSYS in a way similar to a
"directory symlink" (that is, a mount point).
The command ln for creating links works, but it actually makes a copy of
the
original file, not a symlink to it.




 Right, the ln just copying file on my 

RE: Building stdcxx-4.2.2 Using MinGW+MSYS On Windows XP (SP2)

2008-11-26 Thread Steve Petrie

Hi Farid,

I got stdcxx-4.2.2 from svn and applied the mingw.patch you provided.

I assume that you are building stdcxx-4.2.2 using Cygwin, and targeting
MinGW. My objective is to build stdcxx-4.2.2 using MinGW. I don't use Cygwin
and I don't plan to use it.

There were two fixes I had to make, to get the build of the patched
stdcxx-4.2.2 to run:

Fix #1 -- /stdcxx-4.2.2/CNUmakefile:

On lines 583, 591 and 592 of /stdcxx-4.2.2/GNUmakefile:

ln -sf $(TOPDIR)/GNUmakefile $(buildpath)/GNUmakefile;  
\ **
ln -sf $(ETCDIR)/GNUmakefile.cfg $(buildpath)/include/GNUmakefile;  
\
ln -sf $(ETCDIR)/GNUmakefile.lib $(LIBDIR)/GNUmakefile; 
\
ln -sf $(ETCDIR)/GNUmakefile.rwt $(buildpath)/rwtest/GNUmakefile;   
\
ln -sf $(ETCDIR)/GNUmakefile.exm $(EXMDIR)/GNUmakefile; 
\
ln -sf $(ETCDIR)/GNUmakefile.tst $(TSTDIR)/GNUmakefile; 
\
ln -sf $(ETCDIR)/GNUmakefile.ph  $(PHTSTDIR)/GNUmakefile;   
\
ln -sf $(ETCDIR)/GNUmakefile.bin $(BINDIR)/GNUmakefile; 
\
ln -sf $(ETCDIR)/makefile.common $(buildpath)/makefile.common;  
\ **
ln -sf $(ETCDIR)/makefile.rules  $(buildpath)/makefile.rules;   
\ **
ln -sf $(ETCDIR)/configure.sh$(buildpath)/include/configure;
\
ln -sf $(BINDIR)/exec$(buildpath)/run;  
\
ln -sf $(BINDIR)/exec$(BINDIR)/run; 
\
ln -sf $(ETCDIR)/run_locale_utils.sh $(BINDIR)/run_utils;   
\
ln -sf $(BINDIR)/exec$(TSTDIR)/run; 
\
ln -sf $(BINDIR)/exec$(PHTSTDIR)/run;   
\
ln -sf $(BINDIR)/exec$(EXMDIR)/run

On the three lines marked ** above, I added an explicit file name after the
$(buildpath) because the MinGW  command, was REPLACING the
/stdcxx-4.2.1/build/ directory name, with a link (named /stdcxx-4.2.1/build)
to the file, instead of creating a link to the file (with the name of the
file), IN the /stdcxx-4.2.1/build/ directory.


Fix #2 -- Your /stdcxx-4.2.2/build file:

I renamed the /stdcxx-4.2.2/build file that came with the svn download, to
/stdcxx-4.2.1/build_faridz, because the presence of the build FILE was
preventing the GNUmakefile from creating the /stdcxx-4.2.2/build/ DIRECTORY.

* * *
* * *

The build go a LOT further with the patched stdcxx-4.2.2 than it did with
the stdcxx-4.2.1.

According to Windows XP, the final size of the /stdcxx-4.2.1/build/
directory (including sub-directories) is 126 MB.

There is an /stdcxx-4.2.2/build/liblibstd.a file of size 2.33 MB.

HOWEVER, the build ended with the following displayed on the MSYS console:


[...]
generating dependencies for $(TOPDIR)/tests/self/0.alloc.cpp
gcc -M -I/stdcxx-4.2.2/include/ansi   -I/stdcxx-4.2.2/include
-I/stdcxx-4.2.2/build/include -I/stdcxx-4.2.2/tests/include  -pedantic
-nostdinc++ -mno-cygwin  -W -Wall -Wcast-qual -Winline -Wshadow
-Wwrite-strings -Wno-long-long -Wcast-align 
/stdcxx-4.2.2/tests/self/0.alloc.cpp
make[2]: Leaving directory `/stdcxx-4.2.2/build/tests'
make[2]: Entering directory `/stdcxx-4.2.2/build/tests'
[...]
gcc -c -I/stdcxx-4.2.2/include/ansi   -I/stdcxx-4.2.2/include
-I/stdcxx-4.2.2/build/include -I/stdcxx-4.2.2/tests/include  -pedantic
-nostdinc++ -mno-cygwin  -W -Wall -Wcast-qual -Winline -Wshadow
-Wwrite-strings -Wno-long-long -Wcast-align  
/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp
i:/apps/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp: In function
`int main()':
i:/apps/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp:144: error:
`LONG_BIT' was not declared in this scope
i:/apps/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp:145: error:
`_POSIX_SSIZE_MAX' was not declared in this scope
i:/apps/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp:146: error:
`WORD_BIT' was not declared in this scope
i:/apps/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp:151: warning:
this decimal constant is unsigned only in ISO C90
i:/apps/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp:152: warning:
this decimal constant is unsigned only in ISO C90
i:/apps/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp:144: warning:
unused variable 'LONG_BIT'
i:/apps/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp:145: warning:
unused variable '_POSIX_SSIZE_MAX'
i:/apps/stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp:146: warning:
unused variable 'WORD_BIT'
make[2]: *** [18.c.limits.stdcxx-988.o] Error 1
make[2]: Leaving directory `/stdcxx-4.2.2/build/tests'
make[1]: [tests] Error 2 (ignored)
make[1]: Leaving directory `/stdcxx-4.2.2/build'
[EMAIL PROTECTED] /stdcxx-4.2.2
$ 


In the line "make[1]: [tests] Error 2 (ignored)", does the "(ignored)" mean
that  did not terminate prematurely, and that file:

  /stdcxx-4.2.2/tests/regress/18.c.limits.stdcxx-988.cpp
 
is the last test source file to be compiled?
 
According to the