From: Richard Dawe Newsgroups: gnu.gcc.help,gnu.g++.help,comp.os.msdos.djgpp Subject: Re: Is it possible to force the compiler to generate code for particular host ? Date: Thu, 13 Jun 2002 11:54:56 +0100 Lines: 80 Message-ID: <3D087A00.1CEBFF1@phekda.freeserve.co.uk> References: <1ba5202b DOT 0206110921 DOT 46fd0b4d AT posting DOT google DOT com> <3d0862b7 DOT 11357300 AT news DOT yhteys DOT mtv3 DOT fi> NNTP-Posting-Host: modem-241.xenon.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news6.svr.pol.co.uk 1023969100 20756 62.136.45.241 (13 Jun 2002 11:51:40 GMT) NNTP-Posting-Date: 13 Jun 2002 11:51:40 GMT X-Complaints-To: abuse AT theplanet DOT net X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586) X-Accept-Language: de,fr To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello. [Cross-posting to comp.os.msdos.djgpp too.] Kai Ruottu wrote: [snip] > My opinion is that if one has a new 32-bit Windows, running DOS- > hosted tools there is not sane. I have a Mingw-x-Djgpp2 cross-compiler > on Win32 and a native Djgpp2 (not from the DJGPP2 distribution on the > net but made by myself) on DOS, and they cannot even use the same names > for the C++ headers... For instance the following files in the standard > > $prefix/include/g++-v3/bits > > (in gcc-3.x) should be renamed on DOS to be separate names in its 8+3 > naming convention : > > concept_check.h and concept_checks.h > exception_defines.h and exception_support.h > std_cstdarg.h, std_cstddef.h, std_cstdio.h and std_cstdlib.h > stl_algo.h and stl_algobase.h > stl_iterator.h, stl_iterator_base.h, stl_iterator_base_funcs.h and > stl_iterator_base_types.h > stl_multimap.h and stl_multiset.h > valarray_array.h and valarray_meta.h > > (DOS-hosted tools seem to approve 'clipped' names, but clipping the > 'name'-part causes these being same like 'concept_.h' for the first > name pair) The header files are renamed in the DJGPP port. The filenames are unique in the first eight characters in the name and first three characters in the extension, so that there is no clash, when the long filename is shortened into the 8+3 convention. I think there is some DOS-/DJGPP-specific mapping table in the DJGPP port that maps the renamed version of the name to the "real" name of the header file. So the user is unaffected by the rename. Take the iterators, for instance. In gpp31b.zip (the g++ 3.1 binaries distribution for DJGPP) we have: lang/cxx-v31/bits/stl_itbf.h lang/cxx-v31/bits/stl_itbt.h lang/cxx-v31/bits/stl_iterator.h which map to stl_iterator.h stl_iterator_base_funcs.h and stl_iterator_base_types.h. (I admit I'm not sure where stl_iterator_base.h is.) OK, try: lang/cxx-v31/bits/stl_algo.h lang/cxx-v31/bits/stlalgobase.h which map to stl_algo.h and stl_algobase.h. > While all the tools on other hosts approve these long names, the DOS- > hosted tools cannot. So it may be better to generate the C++ executables > for DOS somewhere else, on Win32, Linux,... where one can use these > long standard header names. No need to modify the sources to use different > '#include
' lines. That's totally bogus. You do not need to modify your C++ code at all. The DJGPP port handles mapping the name in the C++ sources to the actual filename on disk. If you need to modify the C++ code, then it's a bug in the DJGPP port. [snip] > The important question is why someone would use DOS as the compile platform > for C++ if owning a Win9x, ME, NT, 2k or XP system too. Or Linux, FreeBSD > etc. which all approve the long header names. I guess that's up to the user. I prefer DJGPP over Cygwin, because DJGPP integrates more nicely IMHO. But I haven't used Cygwin as much as DJGPP, so I'm bound to be biased. 8) Regards, -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]