Merged 1.0 branch into main.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9548 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2001-04-10 03:27:01 +00:00
parent d2dd19d498
commit ab320f7bb0
42 changed files with 1313 additions and 514 deletions

View file

@ -1,7 +1,7 @@
Announcement
************
The GNUstep Base Library, version 0.9.2, is now available.
The GNUstep Base Library, version 1.0.0, is now available.
What is the GNUstep Base Library?
=================================
@ -22,21 +22,9 @@ portion of the OpenStep standard (the Foundation library).
Where can you get it? How can you compile it?
==============================================
The gstepbase-0.9.2.tar.gz distribution file has been placed on
The gstepbase-1.0.0.tar.gz distribution file has been placed on
`ftp.gnustep.org' in `pub/gnustep/core'.
The library requires gcc 2.8.0 or higher. Significant sections of
the library do not work with the NeXT runtime, so we recommend using
gcc instead of NeXT's cc. See the `GNUstep-HOWTO' file for more
instructions about compiling and installing the library.
The `.tar' file is compressed with GNU gzip. Gzip can be obtained by
anonymous ftp at any of the GNU archive sites.
For info about FTP via email, send email to `ftpmail@decwrl.dec.com'
with no subject line, and two-line body with line one `help' and line
two `quit'.
The most recent (not necessarily tested) snapshots of the library
will be placed on `alpha.gnu.org'.
The library requires gcc 2.8.0 or higher. See the `GNUstep-HOWTO'
file for more instructions about compiling and installing the library.

105
ChangeLog
View file

@ -1,3 +1,7 @@
2001-04-09 Adam Fedor <fedor@gnu.org>
* 1.0 branch merged into main.
2001-04-06 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSString.m (pathSepMember): Made trivial and inlined.
@ -41,6 +45,107 @@
config/objc-sys-dynamic.m4, config/procfs-exe-link.m4: Autoconf
macros used by configure.in.
2001-04-08 Adam Fedor <fedor@gnu.org>
* Version: 1.0.0
* NEWS: Regenerated.
* Source/NSLock.m (-tryLock): Return NO if our thread has
already has the lock (like OpenStep).
(-lockBeforeDate:): block until date if our thread already has
the lock (like OpenStep).
* Source/NSData.m ([NSMutableDataMalloc
-replaceBytesInRange:withBytes:]): Check capacity, not length.
2001-04-04 Adam Fedor <fedor@gnu.org>
* config.guess: Update to latest version
* config.sub: Likewise.
2001-04-01 2001 Nicola Pero <n.pero@mi.flashnet.it>
* Source/GSValue.m ([-description]): Bug fix - was crashing upon
using %@ instead of %s for a char *.
2001-03-31 Adam Fedor <fedor@gnu.org>
* Documentation/announce.texi: Update.
* Documentation/install.texi: Likewise.
* Testing/Makefile.preamble: Set BUNDLE_LIBS on mingw and cygwin.
* Testing/nsbundle.m: add NSProcessInfo's initializeWithArguments:...
2001-03-28 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSProcessInfo.m: ([+load]) Fix in parsing of command line
arguments from /proc filesystem. On newer kernels the command line
arguments are terminated by a nul, on older systems they are separated
by a nul. The old code would add an extra (empty) argument to all
processes on newer kernels. The new code will lose a trailing empty
argument on older kernels :-( I view it as the lesser of two evils
since the extra empty arg confuses/breaks a lot of tools.
2001-03-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileManager.m: Fix file copying for MINGW by using
windows native copy function - fix by Michael Scheibler.
Also tidied to conform to coding standards, and fixed to use
O_BINARY where the system defines it.
2001-03-26 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSObject.h: GS_EXPORT updates for MINGW
* Headers/Foundation/NSObCRuntime.h: ditto
* Headers/Foundation/NSRange.h: ditto
* Source/NSRange.m: ditto
Fixes suggested by Michael Scheibler
2001-03-24 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSData.m: ([-replaceBytesInRange:withBytes:]) bugfix ...
revert to check using '>' rather than '>=' to conform to documentation
and to be consistent with use of ranges in general.
* Documentation/gsdoc/NSMutableData.gsdoc: documented primitive methods.
* Documentation/gsdoc/NSFunctions.gsdoc: Some documentation for NSRange
added.
2001-03-23 Adam Fedor <fedor@gnu.org>
* Source/NSData.m: ([-replaceBytesInRange:withBytes:]) Check location
>= size.
2001-03-23 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSData.m: ([-replaceBytesInRange:withBytes:]) bugfix ...
extend data if range has location in data, but extent beyond data.
2001-03-23 Adam Fedor <fedor@gnu.org>
* Source/NSSerializer.m (serializeToInfo): Use memcpy to serialize
strings on machines that need word alignment.
* Source/NSTimeZone.m (decode): For decoding, likewise.
* Testing/thread-except.m: Use autorelease pools.
2001-03-23 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileManager.m: MINGW fixes by Michael Scheibler.
([_attributesAtPath:traverseLink:forCopy:]) fix 'cos windows lacks
symbolic links. ([-changeFileAttributes:atPath:]) workaround for
windows directories not having modification times.
([-fileSystemAttributesAtPath:]) fix for large volumes (matching
change for unix too ... use unsigned long long).
2001-03-23 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSObject.m: ([-methodSignatureForSelector:]) try to get a
valid method signature any way we can ... check for a valid method
first, use selector types next. Avoid crash when given nul selector
as an argument.
* Source/NSMethodSignature.m: ([+signatureWithObjCTypes:]) don't
crash when given nul pointer as argument.
2001-03-19 Jonathan Gapen <jagapen@home.com>
* Source/NSString.m: Implement ([-localizedStringWithFormat:]).

View file

@ -32,7 +32,7 @@ include ../Version
include ../config.mak
# The documents to be generated
DOCUMENT_NAME = coding-standards
DOCUMENT_NAME = coding-standards gnustep-base
# The text documents to be generated
DOCUMENT_TEXT_NAME = \

View file

@ -40,17 +40,5 @@ been placed on @samp{@value{GNUSTEP-BASE-SNAP-FTP-MACHINE}} in
@end ifclear
The library requires gcc @value{GCC-VERSION} or higher.
Significant sections of the library do not work with the NeXT runtime,
so we recommend using gcc instead of NeXT's cc. See the @samp{GNUstep-HOWTO}
See the @samp{GNUstep-HOWTO}
file for more instructions about compiling and installing the library.
The @samp{.tar} file is compressed with GNU gzip. Gzip can be obtained by
anonymous ftp at any of the GNU archive sites.
For info about FTP via email, send email to
@samp{ftpmail@@decwrl.dec.com} with no subject line, and two-line body
with line one @samp{help} and line two @samp{quit}.
The most recent (not necessarily tested) snapshots of the library will
be placed on @samp{@value{GNUSTEP-BASE-SNAP-FTP-MACHINE}}.

View file

@ -93,15 +93,10 @@ and the MacOS-X Foundation implementation.
@menu
* Overview::
* Configuration::
* Classes::
* Tools::
* Installation::
* Implementation::
* Concept Index::
@end menu
@node Overview, Configuration, Top, Top
@node Overview, Implementation, Top, Top
@chapter Overview
*The GNUstep Base Library (gstep-base) requires the GNUstep Makefile
@ -114,15 +109,13 @@ site @url{http://www.gnustep.org/information}.
Documentation for individual classes is included in gsdoc (and html) format
in the gsdoc directory.
@node Implementation, Concept Index, Installation, Top
@node Implementation, , Overview, Top
@chapter Implementation Details
@menu
* Memory Management::
* Memory Allocation::
* Reference Counting::
* Garbage Collection::
* Time Zone::
@end menu
@node Memory Management, Memory Allocation, Implementation, Implementation
@ -176,7 +169,7 @@ make memory management easy. In addition to this, the GNU Objective-C compiler
and the GNUstep system provide a memory sweeping garbage collection mechanism
(using the Boehm conservative garbage collection library).
@node Reference Counting, Garbage Collection, Memory Allocation, Implementation
@node Reference Counting, , Memory Allocation, Implementation
@section Reference Counting
The reference counting scheme for object allocation/deallocation is quite

View file

@ -179,7 +179,7 @@
</list>
</section>
<section>
<heading>The OpenStep functions</heading>
<heading>The OpenStep functions and types</heading>
<list>
<item><uref url="NSFunctions.html">Functions</uref></item>
</list>

View file

@ -174,7 +174,7 @@
<li><a href ="NSUserDefaults.html">NSUserDefaults</a>
<li><a href ="NSValue.html">NSValue</a>
</ul>
<h3><a name ="cont-6">The OpenStep functions</a></h3>
<h3><a name ="cont-6">The OpenStep functions and types</a></h3>
<ul>
<li><a href ="NSFunctions.html">Functions</a>
</ul>

View file

@ -15,7 +15,7 @@
<p>Date: $Date$</p>
<h2><a name ="cont-0">NSCalendarDate</a></h2>
<h2><a name ="NSCalendarDate">NSCalendarDate</a></h2>
<p><b>Declared in: </b> Foundation/NSDate.h</p>
<p><b>Declared in: </b> Foundation/NSCalendarDate.h</p>
<p><b>Inherits from: </b> NSDate</p>
<p><b>Conforms to: </b> NSCoding
</p>

View file

@ -56,6 +56,12 @@
<h3><a name ="method-1">characterSetWithBitmapRepresentation:</a></h3>
+ (NSCharacterSet*) <b>characterSetWithBitmapRepresentation:</b> (NSData*)data;<br>
<p>
Returns a character set containing characters as encoded in the
<em>data</em> object.
</p>
<hr>
<h3><a name ="method-2">characterSetWithCharactersInString:</a></h3>
@ -81,16 +87,34 @@
<h3><a name ="method-6">decimalDigitCharacterSet</a></h3>
+ (NSCharacterSet*) <b>decimalDigitCharacterSet</b>;<br>
<p>
Returns a character set containing characters that represent
the decimal digits 0 through 9.
</p>
<hr>
<h3><a name ="method-7">decomposableCharacterSet</a></h3>
+ (NSCharacterSet*) <b>decomposableCharacterSet</b>;<br>
<p>
Returns a character set containing individual charactars that
can be represented also by a composed character sequence.
</p>
<hr>
<h3><a name ="method-8">illegalCharacterSet</a></h3>
+ (NSCharacterSet*) <b>illegalCharacterSet</b>;<br>
<p>
Returns a character set containing unassigned (illegal)
character values.
</p>
<hr>
<h3><a name ="method-9">letterCharacterSet</a></h3>
@ -101,6 +125,13 @@
<h3><a name ="method-10">lowercaseLetterCharacterSet</a></h3>
+ (NSCharacterSet*) <b>lowercaseLetterCharacterSet</b>;<br>
<p>
Returns a character set that contains the lowercase characters.
This set does not include caseless characters, only those that
have corresponding characters in uppercase and/or titlecase.
</p>
<hr>
<h3><a name ="method-11">nonBaseCharacterSet</a></h3>
@ -116,32 +147,68 @@
<h3><a name ="method-13">uppercaseLetterCharacterSet</a></h3>
+ (NSCharacterSet*) <b>uppercaseLetterCharacterSet</b>;<br>
<p>
Returns a character set that contains the uppercase characters.
This set does not include caseless characters, only those that
have corresponding characters in lowercase and/or titlecase.
</p>
<hr>
<h3><a name ="method-14">whitespaceAndNewlineCharacterSet</a></h3>
+ (NSCharacterSet*) <b>whitespaceAndNewlineCharacterSet</b>;<br>
<p>
Returns a character set that contains the whitespace characters,
plus the newline characters, values 0x000A and 0x000D.
</p>
<hr>
<h3><a name ="method-15">whitespaceCharacterSet</a></h3>
+ (NSCharacterSet*) <b>whitespaceCharacterSet</b>;<br>
<p>
Returns a character set that contains the whitespace characters.
</p>
<hr>
<hr><h2>Instances Methods </h2>
<h3><a name ="method-16">bitmapRepresentation</a></h3>
- (NSData*) <b>bitmapRepresentation</b>;<br>
<p>
Returns a bitmap representation of the receiver's character set
suitable for archiving or writing to a file, in an NSData object.
</p>
<hr>
<h3><a name ="method-17">characterIsMember:</a></h3>
- (BOOL) <b>characterIsMember:</b> (unichar)aCharacter;<br>
<p>
Returns YES if the receiver contains <em>aCharacter</em>, NO if
it does not.
</p>
<hr>
<h3><a name ="method-18">invertedSet</a></h3>
- (NSCharacterSet*) <b>invertedSet</b>;<br>
<p>
Returns a character set containing only characters that the
receiver does not contain.
</p>
<hr>
</body>

View file

@ -12,7 +12,39 @@
</head>
<body>
<chapter>
<heading>NSFunctions</heading>
<heading>Functions</heading>
</chapter>
<chapter>
<heading>Types</heading>
<type name="NSRange">
<typespec>
struct { unsigned long location; unsigned long length; }
</typespec>
<declared>Foundation/NSRange.h</declared>
<desc>
<p>
The NSRange type is used to specify ranges of locations,
typically items in an array, characters in a string, and bytes
in a data object.
</p>
<p>
As 'boundary' or 'fencepost' errors are a particularly common
problem in programming, it is important that you understand
how an NSRange works.
</p>
<p>
An NSRange consists of a location and a length. The points
that are considered to lie in a range are the integers from
the location to the location plus the length, so the number
of points in a range is the length of the range plus one.<br />
However, if you consider these points like the marks on a
ruler, you can only store information <strong>between</strong>
points. So the number of items that can be stored in a range
is the length of the range.
</p>
</desc>
<standards><OpenStep/><MacOS-X/><GNUstep/></standards>
</type>
</chapter>
</body>
</gsdoc>

View file

@ -11,7 +11,43 @@
</dl>
<p>Version: $Revision$</p>
<p>Date: $Date$</p>
<h2><a name ="cont-0">NSFunctions</a></h2>
<h2><a name ="cont-0">Functions</a></h2>
<h2><a name ="cont-1">Types</a></h2>
<h3><a name ="NSRange">NSRange</a></h3>
<p><b>Declared in: </b> Foundation/NSRange.h</p>
<b>typedef </b>
struct { unsigned long location; unsigned long length; }
NSRange<br>
<p>
The NSRange type is used to specify ranges of locations,
typically items in an array, characters in a string, and bytes
in a data object.
</p>
<p>
As 'boundary' or 'fencepost' errors are a particularly common
problem in programming, it is important that you understand
how an NSRange works.
</p>
<p>
An NSRange consists of a location and a length. The points
that are considered to lie in a range are the integers from
the location to the location plus the length, so the number
of points in a range is the length of the range plus one.<br>
However, if you consider these points like the marks on a
ruler, you can only store information <strong>between</strong>
points. So the number of items that can be stored in a range
is the length of the range.
</p>
<hr>
</body>
</html>

View file

@ -71,6 +71,16 @@
<method type="void*">
<sel>mutableBytes</sel>
<desc>
Returns a pointer to the data storage of the receiver.<br />
Modifications to the memory pointed to by this pointer will
change the contents of the object. It is important that
your code should not try to modify the memory beyond the
number of bytes given by the <code>-length</code> method.<br />
NB. if the object is released, or any method that changes its
size or content is called, then the pointer previously returned
by this method may cease to be valid.<br />
This is a 'primitive' method ... you need to implement it
if you write a subclass of NSMutableData.
</desc>
</method>
<method type="void">
@ -79,6 +89,16 @@
<sel>withBytes:</sel>
<arg type="const void*">bytes</arg>
<desc>
Replaces the bytes of data in the specified range with a
copy of the new bytes supplied.<br />
If the location of the range specified lies beyond the end
of the data (<code>[self length] &lt; range.location</code>)
then a range exception is raised.<br />
Otherwise, if the range specified extends beyond the end
of the data, then the size of the data is increased to
accomodate the new bytes.<br />
This is a 'primitive' method ... you need to implement it
if you write a subclass of NSMutableData.
</desc>
</method>
<method type="void">

View file

@ -91,11 +91,31 @@
<h3><a name ="method-8">mutableBytes</a></h3>
- (void*) <b>mutableBytes</b>;<br>
Returns a pointer to the data storage of the receiver.<br>
Modifications to the memory pointed to by this pointer will
change the contents of the object. It is important that
your code should not try to modify the memory beyond the
number of bytes given by the <code>-length</code> method.<br>
NB. if the object is released, or any method that changes its
size or content is called, then the pointer previously returned
by this method may cease to be valid.<br>
This is a 'primitive' method ... you need to implement it
if you write a subclass of NSMutableData.
<hr>
<h3><a name ="method-9">replaceBytesInRange:withBytes:</a></h3>
- (void) <b>replaceBytesInRange:</b> (NSRange)range <b>withBytes:</b> (const void*)bytes;<br>
Replaces the bytes of data in the specified range with a
copy of the new bytes supplied.<br>
If the location of the range specified lies beyond the end
of the data (<code>[self length] &#60; range.location</code>)
then a range exception is raised.<br>
Otherwise, if the range specified extends beyond the end
of the data, then the size of the data is increased to
accomodate the new bytes.<br>
This is a 'primitive' method ... you need to implement it
if you write a subclass of NSMutableData.
<hr>
<h3><a name ="method-10">resetBytesInRange:</a></h3>

View file

@ -151,6 +151,9 @@ Standards: GNUstep<br>
<h3><a name ="method-12">instanceMethodSignatureForSelector:</a></h3>
+ (NSMethodSignature*) <b>instanceMethodSignatureForSelector:</b> (SEL)aSelector;<br>
Returns a method signature object representing the
method implemented for instsances of this class which
corresponds to the supplied selector.
<hr>
<h3><a name ="method-13">instancesRespondToSelector:</a></h3>
@ -316,6 +319,9 @@ Standards: GNUstep<br>
<h3><a name ="method-38">methodSignatureForSelector:</a></h3>
- (NSMethodSignature*) <b>methodSignatureForSelector:</b> (SEL)aSelector;<br>
Returns a method signature object representing the
method implemented in this object which corresponds to
the supplied selector.
<hr>
<h3><a name ="method-39">mutableCopy</a></h3>

View file

@ -18,10 +18,11 @@
@node Introduction, Configuration, Top, Top
@section Introduction
If you are installing this package as part of the GNUstep core
package, read the file GNUstep-HOWTO for more complete instructions on
how to install the entire GNUstep package (including this library).
GNUstep-HOWTO is located at @url{www.gnustep.org}
If you are installing this package as part of the GNUstep core packages,
read the file GNUstep-HOWTO for more complete instructions on how to
install the entire GNUstep package (including this library).
GNUstep-HOWTO is located in the gnustep-make package or at
@url{http://www.gnustep.org}
If you are installing the GNUstep libraries individually, make sure you
have installed the GNUstep Makefile package (gnustep-make) already.
@ -38,10 +39,10 @@ shell prompt. You may want to use some of the optional arguments to the
for a list of these. It is not likely that you will need to use the
@code{--prefix} option, since gstep-base will automatically install in
the directory specified by the @code{GNUSTEP_SYSTEM_ROOT} environment
variable (specified when you installed gstep-make).
variable (specified when you installed gnustep-make).
Some configuration options for the base library need to be specified
when configuring the gstep-make package. In most cases, it is a good
when configuring the gnustep-make package. In most cases, it is a good
idea to specify the same configuration options when configuring both
packages, just to make sure.

View file

@ -7,11 +7,24 @@
The currently released version of the library is
@samp{@value{GNUSTEP-BASE-VERSION}}.
@section Noteworthy changes in version @samp{1.0.0}
@itemize @bullet
@item Fix parsing of arguments for new linux kernels.
@item File manager and other fixes for mingw
@item Fix alignment issues on CPUs that require it.
@item Update unicode support and fixes
@end itemize
@c ====================================================================
@c Keep the next line just below the list of changes in most recent version.
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.9.1}
@itemize @bullet
@item New MacOSX compatible files for NSCalendarDate, NSTimeZone
@item NSUserDefaults noew uses NSLanguages not Languages
@item NSUserDefaults now uses NSLanguages not Languages
@item Various improvements for Windows platforms
@item NSCharacterSets updated to v3.0.1 of Unicode data.
@item Added some gettext compatible localization macros.
@ -26,10 +39,6 @@ The currently released version of the library is
@item Updated for Makefile package changes.
@end itemize
@c ====================================================================
@c Keep the next line just below the list of changes in most recent version.
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.9.0}
@itemize @bullet

View file

@ -30,12 +30,14 @@
#if BUILD_libgnustep_base_DLL
# define GS_EXPORT __declspec(dllexport)
# define GS_DECLARE __declspec(dllexport)
#elif libgnustep_base_ISDLL
# define GS_EXPORT extern __declspec(dllimport)
# define GS_DECLARE __declspec(dllimport)
#else
# define GS_EXPORT extern
# define GS_DECLARE
#endif
#define GS_DECLARE
@class NSObject;
@class NSString;

View file

@ -140,14 +140,21 @@
@end
NSObject *NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone);
void NSDeallocateObject(NSObject *anObject);
NSObject *NSCopyObject(NSObject *anObject, unsigned extraBytes, NSZone *zone);
GS_EXPORT NSObject *
NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone);
GS_EXPORT void
NSDeallocateObject(NSObject *anObject);
GS_EXPORT NSObject *
NSCopyObject(NSObject *anObject, unsigned extraBytes, NSZone *zone);
BOOL NSShouldRetainWithZone(NSObject *anObject, NSZone *requestedZone);
unsigned NSExtraRefCount(id anObject);
void NSIncrementExtraRefCount(id anObject);
BOOL NSDecrementExtraRefCountWasZero(id anObject);
GS_EXPORT BOOL
NSShouldRetainWithZone(NSObject *anObject, NSZone *requestedZone);
GS_EXPORT unsigned
NSExtraRefCount(id anObject);
GS_EXPORT void
NSIncrementExtraRefCount(id anObject);
GS_EXPORT BOOL
NSDecrementExtraRefCountWasZero(id anObject);
typedef enum _NSComparisonResult
{

View file

@ -99,7 +99,7 @@ NSMakeRange(unsigned int location, unsigned int length)
if (end < location || end < length)
{
extern void _NSRangeExceptionRaise ();
GS_EXPORT void _NSRangeExceptionRaise ();
/* NB: The implementation of _NSRangeExceptionRaise is:
[NSException raise: NSRangeException
format: @"Range location + length too great"]; */

View file

@ -2,9 +2,10 @@ Introduction
============
If you are installing this package as part of the GNUstep core
package, read the file GNUstep-HOWTO for more complete instructions on
packages, read the file GNUstep-HOWTO for more complete instructions on
how to install the entire GNUstep package (including this library).
GNUstep-HOWTO is located at <www.gnustep.org>
GNUstep-HOWTO is located in the gnustep-make package or at
<http://www.gnustep.org>
If you are installing the GNUstep libraries individually, make sure
you have installed the GNUstep Makefile package (gnustep-make) already.
@ -21,10 +22,10 @@ shell prompt. You may want to use some of the optional arguments to the
not likely that you will need to use the `--prefix' option, since
gstep-base will automatically install in the directory specified by the
`GNUSTEP_SYSTEM_ROOT' environment variable (specified when you
installed gstep-make).
installed gnustep-make).
Some configuration options for the base library need to be specified
when configuring the gstep-make package. In most cases, it is a good
when configuring the gnustep-make package. In most cases, it is a good
idea to specify the same configuration options when configuring both
packages, just to make sure.

15
NEWS
View file

@ -1,14 +1,25 @@
News
****
The currently released version of the library is `0.9.2'.
The currently released version of the library is `1.0.0'.
Noteworthy changes in version `1.0.0'
=====================================
* Fix parsing of arguments for new linux kernels.
* File manager and other fixes for mingw
* Fix alignment issues on CPUs that require it.
* Update unicode support and fixes
Noteworthy changes in version `0.9.1'
=====================================
* New MacOSX compatible files for NSCalendarDate, NSTimeZone
* NSUserDefaults noew uses NSLanguages not Languages
* NSUserDefaults now uses NSLanguages not Languages
* Various improvements for Windows platforms

View file

@ -1063,7 +1063,7 @@ static Class runLoopClass;
}
else
{
NSLog(@"No messages to write on 0x%x.", self);
// NSLog(@"No messages to write on 0x%x.", self);
return;
}
}

View file

@ -165,7 +165,7 @@
size = objc_sizeof_type(objctype);
rep = [NSData dataWithBytes: data length: size];
return [NSString stringWithFormat: @"(%@) %@", objctype, [rep description]];
return [NSString stringWithFormat: @"(%s) %@", objctype, [rep description]];
}
// NSCoding

View file

@ -1534,9 +1534,21 @@ failure:
withBytes: (const void*)bytes
{
unsigned size = [self length];
unsigned need = NSMaxRange(aRange);
GS_RANGE_CHECK(aRange, size);
memcpy([self mutableBytes] + aRange.location, bytes, aRange.length);
if (aRange.location > size)
{
[NSException raise: NSRangeException
format: @"location bad in replaceByteInRange:withBytes:"];
}
if (aRange.length > 0)
{
if (need > size)
{
[self setLength: need];
}
memcpy([self mutableBytes] + aRange.location, bytes, aRange.length);
}
}
- (void) resetBytesInRange: (NSRange)aRange
@ -1551,7 +1563,7 @@ failure:
{
NSRange r = NSMakeRange(0, [data length]);
[self setCapacity: [data length]];
[self setCapacity: r.length];
[self replaceBytesInRange: r withBytes: [data bytes]];
}
@ -2691,8 +2703,22 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
- (void) replaceBytesInRange: (NSRange)aRange
withBytes: (const void*)moreBytes
{
GS_RANGE_CHECK(aRange, length);
memcpy(bytes + aRange.location, moreBytes, aRange.length);
unsigned need = NSMaxRange(aRange);
if (aRange.location > capacity)
{
[NSException raise: NSRangeException
format: @"location bad in replaceByteInRange:withBytes:"];
}
if (aRange.length > 0)
{
if (need > length)
{
[self setCapacity: need];
length = need;
}
memcpy(bytes + aRange.location, moreBytes, aRange.length);
}
}
- (void) serializeDataAt: (const void*)data
@ -3017,15 +3043,26 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
return self;
}
- (void) setData: (NSData*)data
{
unsigned l = [data length];
[self setCapacity: l];
length = l;
memcpy(bytes, [data bytes], length);
}
- (void) setLength: (unsigned)size
{
if (size > capacity) {
[self setCapacity: size];
if (size > capacity)
{
[self setCapacity: size];
}
if (size > length) {
memset(bytes + length, '\0', size - length);
if (size > length)
{
memset(bytes + length, '\0', size - length);
}
length = size;
length = size;
}
@end

View file

@ -135,6 +135,15 @@
# include <utime.h>
#endif
/*
* On systems that have the O_BINARY flag, use it for a binary copy.
*/
#if defined(O_BINARY)
#define GSBINIO O_BINARY
#else
#define GSBINIO 0
#endif
/* include usual headers */
#include <Foundation/NSArray.h>
@ -658,7 +667,7 @@ static NSFileManager* defaultManager = nil;
int len;
int written;
fd = open (cpath, O_WRONLY|O_TRUNC|O_CREAT, 0644);
fd = open(cpath, GSBINIO|O_WRONLY|O_TRUNC|O_CREAT, 0644);
if (fd < 0)
{
return NO;
@ -920,7 +929,7 @@ static NSFileManager* defaultManager = nil;
- (NSDictionary*) fileSystemAttributesAtPath: (NSString*)path
{
#if defined(__MINGW__)
long long totalsize, freesize;
unsigned long long totalsize, freesize;
id values[5];
id keys[5] = {
NSFileSystemSize,
@ -937,11 +946,15 @@ static NSFileManager* defaultManager = nil;
&BytesPerSector, &NumberFreeClusters, &TotalNumberClusters))
return nil;
totalsize = TotalNumberClusters * SectorsPerCluster * BytesPerSector;
freesize = NumberFreeClusters * SectorsPerCluster * BytesPerSector;
totalsize = (unsigned long long)TotalNumberClusters
* (unsigned long long)SectorsPerCluster
* (unsigned long long)BytesPerSector;
freesize = (unsigned long long)NumberFreeClusters
* (unsigned long long)SectorsPerCluster
* (unsigned long long)BytesPerSector;
values[0] = [NSNumber numberWithLongLong: totalsize];
values[1] = [NSNumber numberWithLongLong: freesize];
values[0] = [NSNumber numberWithUnsignedLongLong: totalsize];
values[1] = [NSNumber numberWithUnsignedLongLong: freesize];
values[2] = [NSNumber numberWithLong: LONG_MAX];
values[3] = [NSNumber numberWithLong: LONG_MAX];
values[4] = [NSNumber numberWithUnsignedInt: 0];
@ -956,7 +969,7 @@ static NSFileManager* defaultManager = nil;
#else
struct statfs statfsbuf;
#endif
long long totalsize, freesize;
unsigned long long totalsize, freesize;
const char* cpath = [self fileSystemRepresentationWithPath: path];
id values[5];
@ -979,11 +992,13 @@ static NSFileManager* defaultManager = nil;
return nil;
#endif
totalsize = statfsbuf.f_bsize * statfsbuf.f_blocks;
freesize = statfsbuf.f_bsize * statfsbuf.f_bavail;
totalsize = (unsigned long long) statfsbuf.f_bsize
* (unsigned long long) statfsbuf.f_blocks;
freesize = (unsigned long long) statfsbuf.f_bsize
* (unsigned long long) statfsbuf.f_bavail;
values[0] = [NSNumber numberWithLongLong: totalsize];
values[1] = [NSNumber numberWithLongLong: freesize];
values[0] = [NSNumber numberWithUnsignedLongLong: totalsize];
values[1] = [NSNumber numberWithUnsignedLongLong: freesize];
values[2] = [NSNumber numberWithLong: statfsbuf.f_files];
values[3] = [NSNumber numberWithLong: statfsbuf.f_ffree];
values[4] = [NSNumber numberWithUnsignedLong: statbuf.st_dev];
@ -1096,7 +1111,15 @@ static NSFileManager* defaultManager = nil;
#endif
if (stat(cpath, &sb) != 0)
ok = NO;
{
ok = NO;
}
#if defined(__WIN32__)
else if (sb.st_mode & _S_IFDIR)
{
ok = YES; // Directories don't have modification times.
}
#endif
else
{
#if defined(__WIN32__) || defined(_POSIX_VERSION)
@ -1545,84 +1568,127 @@ static NSFileManager* defaultManager = nil;
- (BOOL) _copyFile: (NSString*)source
toFile: (NSString*)destination
handler: handler
handler: (id)handler
{
NSDictionary* attributes;
int i, bufsize = 8096;
int sourceFd, destFd, fileSize, fileMode;
int rbytes, wbytes;
char buffer[bufsize];
#if defined(__MINGW__)
if (CopyFile([self fileSystemRepresentationWithPath: source],
[self fileSystemRepresentationWithPath: destination], NO))
{
return YES;
}
if (handler != nil)
{
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
source, @"Path",
@"cannot copy file", @"Error",
destination, @"ToPath",
nil];
return [handler fileManager: self
shouldProceedAfterError: errorInfo];
}
else
{
return NO;
}
#else
NSDictionary *attributes;
int i;
int bufsize = 8096;
int sourceFd;
int destFd;
int fileSize;
int fileMode;
int rbytes;
int wbytes;
char buffer[bufsize];
/* Assumes source is a file and exists! */
NSAssert1 ([self fileExistsAtPath: source],
@"source file '%@' does not exist!", source);
@"source file '%@' does not exist!", source);
attributes = [self _attributesAtPath: source traverseLink: NO forCopy: YES];
NSAssert1 (attributes, @"could not get the attributes for file '%@'",
source);
source);
fileSize = [[attributes objectForKey: NSFileSize] intValue];
fileMode = [[attributes objectForKey: NSFilePosixPermissions] intValue];
/* Open the source file. In case of error call the handler. */
sourceFd = open ([self fileSystemRepresentationWithPath: source], O_RDONLY);
if (sourceFd < 0) {
if (handler) {
NSDictionary* errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
sourceFd = open([self fileSystemRepresentationWithPath: source],
GSBINIO|O_RDONLY);
if (sourceFd < 0)
{
if (handler != nil)
{
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
source, @"Path",
@"cannot open file for reading", @"Error",
nil];
return [handler fileManager: self
shouldProceedAfterError: errorInfo];
}
shouldProceedAfterError: errorInfo];
}
else
{
return NO;
}
}
}
/* Open the destination file. In case of error call the handler. */
destFd = open ([self fileSystemRepresentationWithPath: destination],
O_WRONLY|O_CREAT|O_TRUNC, fileMode);
if (destFd < 0) {
if (handler) {
NSDictionary* errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
destFd = open([self fileSystemRepresentationWithPath: destination],
GSBINIO|O_WRONLY|O_CREAT|O_TRUNC, fileMode);
if (destFd < 0)
{
if (handler != nil)
{
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
destination, @"ToPath",
@"cannot open file for writing", @"Error",
nil];
close (sourceFd);
return [handler fileManager: self
shouldProceedAfterError: errorInfo];
}
shouldProceedAfterError: errorInfo];
}
else
{
return NO;
}
}
}
/* Read bufsize bytes from source file and write them into the destination
file. In case of errors call the handler and abort the operation. */
for (i = 0; i < fileSize; i += rbytes) {
for (i = 0; i < fileSize; i += rbytes)
{
rbytes = read (sourceFd, buffer, bufsize);
if (rbytes < 0) {
if (handler) {
NSDictionary* errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
if (rbytes < 0)
{
if (handler != nil)
{
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
source, @"Path",
@"cannot read from file", @"Error",
nil];
close (sourceFd);
close (destFd);
return [handler fileManager: self
shouldProceedAfterError: errorInfo];
}
shouldProceedAfterError: errorInfo];
}
else
{
return NO;
}
}
}
wbytes = write (destFd, buffer, rbytes);
if (wbytes != rbytes) {
if (handler) {
NSDictionary* errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
if (wbytes != rbytes)
{
if (handler != nil)
{
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
source, @"Path",
destination, @"ToPath",
@"cannot write to file", @"Error",
@ -1630,16 +1696,19 @@ static NSFileManager* defaultManager = nil;
close (sourceFd);
close (destFd);
return [handler fileManager: self
shouldProceedAfterError: errorInfo];
}
shouldProceedAfterError: errorInfo];
}
else
{
return NO;
}
}
}
}
}
close (sourceFd);
close (destFd);
return YES;
#endif
}
- (BOOL) _copyPath: (NSString*)source
@ -1762,18 +1831,29 @@ static NSFileManager* defaultManager = nil;
NSFileGroupOwnerAccountNumber
};
#if defined(__MINGW__)
if (stat(cpath, &statbuf) != 0)
{
return nil;
}
#else /* !(__MINGW__) */
if (traverse)
{
if (stat(cpath, &statbuf) != 0)
return nil;
{
return nil;
}
}
#ifdef S_IFLNK
else
{
if (lstat(cpath, &statbuf) != 0)
return nil;
{
return nil;
}
}
#endif
#endif /* (S_IFLNK) */
#endif /* (__MINGW__) */
values[0] = [NSNumber numberWithUnsignedLongLong: statbuf.st_size];
values[1] = [NSDate dateWithTimeIntervalSince1970: statbuf.st_mtime];

View file

@ -105,30 +105,28 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
// Does not block
- (BOOL) tryLock
{
/* Return NO if we're already locked */
if (_mutex->owner == objc_thread_id())
{
return NO;
}
// Ask the runtime to acquire a lock on the mutex
if (objc_mutex_trylock(_mutex) == -1)
{
return NO;
}
else
{
/*
* The recursive lock check goes here to support openstep's
* implementation. In openstep you can lock in one thread trylock in the
* same thread and have another thread release the lock.
*
* This is dangerous and broken IMHO.
*/
CHECK_RECURSIVE_LOCK(_mutex);
return YES;
}
return YES;
}
- (BOOL) lockBeforeDate: (NSDate *)limit
{
int x;
while ((x = objc_mutex_trylock(_mutex)) == -1)
/* This is really the behavior of OpenStep, if the current thread has
the lock, we just block until the time limit is up. Very odd */
while (_mutex->owner == objc_thread_id()
|| (x = objc_mutex_trylock(_mutex)) == -1)
{
NSDate *current = [NSDate date];
NSComparisonResult compare;
@ -144,14 +142,6 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
*/
sleep(1);
}
/*
* The recursive lock check goes here to support openstep's implementation.
* In openstep you can lock in one thread trylock in the same thread and have
* another thread release the lock.
*
* This is dangerous and broken IMHO.
*/
CHECK_RECURSIVE_LOCK(_mutex);
return YES;
}

View file

@ -36,8 +36,13 @@
+ (NSMethodSignature*) signatureWithObjCTypes: (const char*)t
{
NSMethodSignature *newMs = [[NSMethodSignature alloc] autorelease];
NSMethodSignature *newMs;
if (t == 0 || *t == '\0')
{
return nil;
}
newMs = AUTORELEASE([NSMethodSignature alloc]);
newMs->_methodTypes = mframe_build_signature(t, &newMs->_argFrameLength,
&newMs->_numArgs, 0);

View file

@ -756,14 +756,29 @@ static BOOL deallocNotifications = NO;
const char *types;
struct objc_method *mth;
if (aSelector == 0)
{
return nil;
}
mth = (GSObjCIsInstance(self)
? class_get_instance_method(GSObjCClass(self), aSelector)
: class_get_class_method(GSObjCClass(self), aSelector));
if (mth == 0)
{
types = 0;
}
else
{
types = mth->method_types;
}
if (types == 0)
{
types = aSelector->sel_types;
}
if (types == 0)
{
return nil;
}
types = mth->method_types;
return [NSMethodSignature signatureWithObjCTypes: types];
}

View file

@ -268,6 +268,7 @@ static char **_gnu_noobjc_env;
char *proc_file_name = NULL;
FILE *ifp;
int c;
int last;
int argument;
int length;
int position;
@ -323,6 +324,7 @@ static char **_gnu_noobjc_env;
ifp = fopen(proc_file_name, "r");
if (ifp == NULL)
goto proc_fs_error;
last = 0;
while (1)
{
c = getc(ifp);
@ -330,9 +332,11 @@ static char **_gnu_noobjc_env;
_gnu_noobjc_argc++;
else if (c == EOF)
break;
last = c;
}
#ifndef __FreeBSD__
_gnu_noobjc_argc++;
if (last != 0)
_gnu_noobjc_argc++;
#endif
/*
* Now _gnu_noobcj_argc is the number of arguments;
@ -352,7 +356,7 @@ static char **_gnu_noobjc_env;
}
argument = 0;
length = 0;
while (1)
while (argument < _gnu_noobjc_argc)
{
c = getc(ifp);
length++;
@ -362,7 +366,7 @@ static char **_gnu_noobjc_env;
if (_gnu_noobjc_argv[argument] == NULL)
goto malloc_error;
argument++;
if (c == EOF) // End of command line
if (argument == _gnu_noobjc_argc || c == EOF) // End of command line
break;
length = 0;
}

View file

@ -70,7 +70,7 @@ NSStringFromRange(NSRange range)
range.location, range.length];
}
void _NSRangeExceptionRaise ()
GS_EXPORT void _NSRangeExceptionRaise ()
{
[NSException raise: NSRangeException
format: @"Range location + length too great"];

View file

@ -210,6 +210,21 @@ serializeToInfo(id object, _NSSerializerInfo* info)
(*info->serImp)(info->data, serSel, slen);
dlen = (*info->lenImp)(info->data, lenSel);
(*info->setImp)(info->data, setSel, dlen + slen*sizeof(unichar));
#if NEED_WORD_ALIGNMENT
/*
* When packing data, an item may not be aligned on a
* word boundary, so we work with an aligned buffer
* and use memcmpy()
*/
if ((dlen % __alignof__(gsu32)) != 0)
{
unichar buffer[slen];
[object getCharacters: buffer];
memcpy((*info->datImp)(info->data, datSel) + dlen, buffer,
slen*sizeof(unichar));
}
else
#endif
[object getCharacters: (*info->datImp)(info->data, datSel) + dlen];
if (info->shouldUnique)
GSIMapAddPair(&info->map,

View file

@ -142,7 +142,13 @@ static inline int
decode (const void *ptr)
{
#if defined(WORDS_BIGENDIAN) && SIZEOF_INT == 4
#if NEED_WORD_ALIGNMENT
int value;
memcpy(&value, ptr, sizeof(int));
return value;
#else
return *(const int *) ptr;
#endif
#else /* defined(WORDS_BIGENDIAN) && SIZEOF_INT == 4 */
const unsigned char *p = ptr;
int result = *p & (1 << (CHAR_BIT - 1)) ? ~0 : 0;

View file

@ -54,6 +54,14 @@ ADDITIONAL_LDFLAGS =
# Additional library directories the linker should search
ADDITIONAL_LIB_DIRS = -L../Source/$(GNUSTEP_OBJ_DIR)
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
BUNDLE_LIBS += -lgnustep-base -lobjc
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
BUNDLE_LIBS += -lgnustep-base -lobjc
endif
#
# Flags dealing with installing and uninstalling
#

View file

@ -2,9 +2,10 @@
#include <stdio.h>
#if 0
#if 1
int main ()
{
id pool = [NSAutoreleasePool new];
id o = [NSObject new];
printf ("Hello from object at 0x%x\n", (unsigned)[o self]);
exit (0);

View file

@ -14,7 +14,7 @@ main()
id o1, o2, o3;
unsigned int p;
behavior_set_debug(0);
//behavior_set_debug(0);
[NSAutoreleasePool enableDoubleReleaseCheck:YES];
pool = [[NSAutoreleasePool alloc] init];

View file

@ -14,18 +14,24 @@
#include "Foundation/NSException.h"
#include "Foundation/NSString.h"
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSProcessInfo.h>
#include "LoadMe.h"
#include "SecondClass.h"
#include "MyCategory.h"
int
main(int ac, char *av[])
main(int argc, char *argv[], char **env)
{
NSBundle *main;
NSBundle *bundle;
NSString *path;
id object;
NSAutoreleasePool *arp = [NSAutoreleasePool new];
NSAutoreleasePool *arp;
#if LIB_FOUNDATION_LIBRARY || defined(GS_PASS_ARGUMENTS)
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
#endif
arp = [NSAutoreleasePool new];
main = [NSBundle mainBundle];
printf("Looking for main bundle...\n");

View file

@ -21,7 +21,7 @@ main()
id a, b, c, e; /* dates */
id pool;
behavior_set_debug(0);
//behavior_set_debug(0);
pool = [[NSAutoreleasePool alloc] init];

View file

@ -47,7 +47,7 @@ main(int argc, char** argv, char** envp)
printf("%s ", [b cString]);
printf("\n");
behavior_set_debug(0);
//behavior_set_debug(0);
objects = [NSArray arrayWithObjects:
@"vache", @"poisson", @"cheval", @"poulet", nil];

View file

@ -9,6 +9,7 @@
#include <Foundation/NSException.h>
#include <Foundation/NSString.h>
#include <Foundation/NSThread.h>
#include <Foundation/NSAutoreleasePool.h>
#define N 10 /* Number of threads */
#define MAX_ITER 10000.0 /* Max number of iterations. */
@ -36,19 +37,23 @@ FILE *file;
- (void)runWith: (id)thing
{
int i, n;
CREATE_AUTORELEASE_POOL(pool);
NS_DURING
n = 1+(int)((MAX_ITER*rand())/(RAND_MAX+1.0));
fflush(stdout);
for (i = 0; i < n; i++)
{
fprintf(file, "%d ", i);
fflush(file);
}
fflush(stdout);
[NSException raise: @"Some exception" format: @"thread %d", ident];
NS_HANDLER
printf("%s: %s for thread %d\n", [[localException name] cString],
[[localException reason] cString], ident);
NS_ENDHANDLER
DESTROY(pool);
[NSThread exit];
}
@ -58,6 +63,7 @@ int main()
{
int i;
SingleThread *threads[N];
CREATE_AUTORELEASE_POOL(pool);
printf("We run %d threads.\n", N);
printf("Some of them might not raise exceptions,\n");
@ -81,5 +87,6 @@ int main()
printf("There's a runaway exception! Something is wrong!\n");
NS_ENDHANDLER
fclose(file);
DESTROY(pool);
return 0;
}

10
Version
View file

@ -5,14 +5,14 @@
GCC_VERSION=2.8.0
# The version number of this release.
MAJOR_VERSION=0
MINOR_VERSION=9
SUBMINOR_VERSION=3
MAJOR_VERSION=1
MINOR_VERSION=0
SUBMINOR_VERSION=0
GNUSTEP_BASE_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION}
VERSION=${GNUSTEP_BASE_VERSION}
GNUSTEP_BASE_FTP_MACHINE=ftp.gnustep.org
GNUSTEP_BASE_FTP_DIRECTORY=pub/gnustep/core
GNUSTEP_BASE_SNAP_FTP_MACHINE=alpha.gnu.org
GNUSTEP_BASE_SNAP_FTP_DIRECTORY=gnu/gnustep
GNUSTEP_BASE_SNAP_FTP_MACHINE=ftp.gnustep.org
GNUSTEP_BASE_SNAP_FTP_DIRECTORY=pub/daily-snapshots

756
config.guess vendored

File diff suppressed because it is too large Load diff

257
config.sub vendored
View file

@ -1,8 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
#
timestamp='2001-03-30'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@ -27,7 +29,6 @@
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
@ -50,30 +51,73 @@
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
if [ x$1 = x ]
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
me=`echo "$0" | sed -e 's,.*/,,'`
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
linux-gnu*)
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@ -99,7 +143,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple)
-apple | -axis)
os=
basic_machine=$1
;;
@ -171,27 +215,39 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
| pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| hppa64 \
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
| alphaev6[78] \
| we32k | ns16k | clipper | i370 | sh | sh[34] \
| powerpc | powerpcle \
| 1750a | dsp16xx | pdp10 | pdp11 \
| mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \
| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | fr30)
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
| pj | pjl | h8500)
basic_machine=$basic_machine-unknown
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i[34567]86)
i[234567]86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
@ -201,23 +257,29 @@ case $basic_machine in
;;
# Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here.
vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
| hppa2.0n-* | hppa64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
| alphaev6[78]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
| f301-* | armv*-* | t3e-* \
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
| [cjt]90-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@ -254,14 +316,14 @@ case $basic_machine in
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-cbm
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-cbm
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-cbm
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
@ -308,13 +370,16 @@ case $basic_machine in
basic_machine=cray2-cray
os=-unicos
;;
[ctj]90-cray)
basic_machine=c90-cray
[cjt]90)
basic_machine=${basic_machine}-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@ -362,6 +427,10 @@ case $basic_machine in
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@ -461,17 +530,6 @@ case $basic_machine in
basic_machine=i386-unknown
os=-vsta
;;
i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
i386-mingw32 | mingw32)
basic_machine=i386-unknown
os=-mingw32
;;
i386-qnx | qnx)
basic_machine=i386-qnx
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@ -497,6 +555,10 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
miniframe)
basic_machine=m68000-convergent
;;
@ -527,7 +589,7 @@ case $basic_machine in
os=-coff
;;
msdos)
basic_machine=i386-unknown
basic_machine=i386-pc
os=-msdos
;;
mvs)
@ -591,9 +653,16 @@ case $basic_machine in
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
@ -623,28 +692,28 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexen)
pentium | p5 | k5 | k6 | nexgen)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86)
pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i786-pc
basic_machine=i686-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexen-*)
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-*)
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=rs6000-ibm
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
@ -659,6 +728,10 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@ -738,6 +811,10 @@ case $basic_machine in
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
@ -746,6 +823,10 @@ case $basic_machine in
basic_machine=t3e-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
@ -841,12 +922,19 @@ case $basic_machine in
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh3 | sh4)
basic_machine=sh-unknown
;;
sparc | sparcv9)
basic_machine=sparc-sun
;;
@ -869,6 +957,9 @@ case $basic_machine in
basic_machine=c4x-none
os=-coff
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@ -927,9 +1018,23 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i[34567]86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto*)
os=-nto-qnx
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
@ -949,6 +1054,9 @@ case $os in
-opened*)
os=-openedition
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
@ -973,6 +1081,9 @@ case $os in
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
@ -986,9 +1097,6 @@ case $os in
-oss*)
os=-sysv3
;;
-qnx)
os=-qnx4
;;
-svr4)
os=-sysv4
;;
@ -1010,7 +1118,7 @@ case $os in
-xenix)
os=-xenix
;;
-*mint | -*MiNT)
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-none)
@ -1044,6 +1152,9 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
@ -1152,7 +1263,7 @@ case $basic_machine in
*-masscomp)
os=-rtu
;;
f301-fujitsu)
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
@ -1230,7 +1341,7 @@ case $basic_machine in
-mpw* | -macos*)
vendor=apple
;;
-*mint | -*MiNT)
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
esac
@ -1239,3 +1350,11 @@ case $basic_machine in
esac
echo $basic_machine$os
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End: