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

750
config.guess vendored
View file

@ -1,8 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
#
timestamp='2001-03-30'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@ -30,26 +32,86 @@
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# don't specify an explicit build system type.
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
CC_FOR_BUILD="$HOST_CC"
else
if test x"$CC" != x; then
CC_FOR_BUILD="$CC"
else
CC_FOR_BUILD=cc
fi
fi
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
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.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
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" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int dummy(){}" > $dummy.c
for c in cc gcc c89 ; do
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
if test $? = 0 ; then
CC_FOR_BUILD="$c"; break
fi
done
rm -f $dummy.c $dummy.o $dummy.rel
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@ -58,15 +120,57 @@ fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# Netbsd (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
# Determine the machine/vendor (is the vendor relevant).
case "${UNAME_MACHINE}" in
amiga) machine=m68k-unknown ;;
arm32) machine=arm-unknown ;;
atari*) machine=m68k-atari ;;
sun3*) machine=m68k-sun ;;
mac68k) machine=m68k-apple ;;
macppc) machine=powerpc-apple ;;
hp3[0-9][05]) machine=m68k-hp ;;
ibmrt|romp-ibm) machine=romp-ibm ;;
*) machine=${UNAME_MACHINE}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE}" in
i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@ -76,41 +180,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy
case "$?" in
7)
case `./$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
15)
1-0)
UNAME_MACHINE="alphaev5"
;;
14)
1-1)
UNAME_MACHINE="alphaev56"
;;
10)
1-101)
UNAME_MACHINE="alphapca56"
;;
16)
2-303)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
esac
fi
rm -f $dummy.s $dummy
@ -126,11 +240,8 @@ EOF
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
echo m68k-unknown-sysv4
exit 0;;
amiga:NetBSD:*:*)
echo m68k-cbm-netbsd${UNAME_RELEASE}
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@ -161,7 +272,7 @@ EOF
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
SR2?01:HI-UX/MPP:*:*)
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
@ -217,9 +328,6 @@ EOF
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
atari*:NetBSD:*:*)
echo m68k-atari-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@ -300,7 +408,7 @@ EOF
EOF
$CC_FOR_BUILD $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm $dummy.c $dummy && exit 0
&& rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
@ -319,7 +427,7 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
@ -354,6 +462,14 @@ EOF
i?86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >$dummy.c
@ -367,7 +483,7 @@ EOF
exit(0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
@ -376,9 +492,9 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:4)
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@ -386,7 +502,7 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=4.${UNAME_RELEASE}
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
@ -412,11 +528,31 @@ EOF
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
case "${HPUX_REV}" in
11.[0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
esac ;;
esac
fi ;;
esac
if [ "${HP_ARCH}" = "" ]; then
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
@ -448,11 +584,16 @@ EOF
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy
fi ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
@ -479,7 +620,7 @@ EOF
exit (0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
@ -543,27 +684,28 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
@ -573,50 +715,8 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
if test -x /usr/bin/objformat; then
if test "elf" = "`/usr/bin/objformat`"; then
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
exit 0
fi
fi
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
# Netbsd (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdcoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
# Determine the machine/vendor (is the vendor relevant).
case "${UNAME_MACHINE}" in
amiga) machine=m68k-cbm ;;
arm32) machine=arm-unknown ;;
atari*) machine=m68k-atari ;;
sun3*) machine=m68k-sun ;;
mac68k) machine=m68k-apple ;;
macppc) machine=powerpc-apple ;;
hp3[0-9][05]) machine=m68k-hp ;;
ibmrt|romp-ibm) machine=romp-ibm ;;
*) machine=${UNAME_MACHINE}-unknown ;;
esac
# The Operating System including object format.
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null | grep __ELF__ >/dev/null
then
# Could be a.out (netbsdaout) or COFF (netbsdcoff).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
# The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/./'`
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
@ -626,6 +726,9 @@ EOF
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@ -644,54 +747,41 @@ EOF
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_help_string=`cd /; ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
*ia64)
echo "${UNAME_MACHINE}-unknown-linux"
exit 0
;;
i?86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
sparclinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
armlinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32arm*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
armelf_linux*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
m68klinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32ppc | elf32ppclinux)
# Determine Lib Version
cat >$dummy.c <<EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
mips:Linux:*:*)
cat >$dummy.c <<EOF
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
;;
ppc:Linux:*:*)
# Determine Lib Version
cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
@ -704,111 +794,127 @@ main(argc, argv)
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
printf("unkown\n");
printf("unknown\n");
#endif
return 0;
}
EOF
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then LIBC="libc1" ; fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0 ;;
alpha:Linux:*:*)
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0) UNAME_MACHINE="alpha" ;;
1-0) UNAME_MACHINE="alphaev5" ;;
1-1) UNAME_MACHINE="alphaev56" ;;
1-101) UNAME_MACHINE="alphapca56" ;;
2-303) UNAME_MACHINE="alphaev6" ;;
2-307) UNAME_MACHINE="alphaev67" ;;
esac
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
LIBC="libc1"
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit 0 ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit 0 ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit 0 ;;
i?86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_supported_emulations=`cd /; ld --help 2>&1 \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
i?86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
elf_i?86)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
sed 's/^ //' <<EOF >$dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
15)
UNAME_MACHINE="alphaev5"
;;
14)
UNAME_MACHINE="alphaev56"
;;
10)
UNAME_MACHINE="alphapca56"
;;
16)
UNAME_MACHINE="alphaev6"
;;
esac
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >$dummy.c <<EOF
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >$dummy.c <<EOF
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
@ -832,9 +938,10 @@ EOF
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
fi ;;
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i?86:DYNIX/ptx:4*:*)
@ -911,7 +1018,7 @@ EOF
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@ -922,21 +1029,24 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:*)
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:* | i?86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
@ -970,7 +1080,7 @@ EOF
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:*:6*)
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit 0 ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
@ -1001,8 +1111,63 @@ EOF
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
echo `uname -p`-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
if test "${UNAME_MACHINE}" = "x86pc"; then
UNAME_MACHINE=pc
fi
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
exit 0 ;;
*:QNX:*:4*)
echo i386-qnx-qnx${UNAME_VERSION}
echo i386-pc-qnx
exit 0 ;;
NSR-[KW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
i?86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit 0 ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit 0 ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit 0 ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit 0 ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
esac
@ -1095,11 +1260,24 @@ main ()
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
# if !defined (ultrix)
# include <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
@ -1110,7 +1288,7 @@ main ()
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment.
@ -1143,6 +1321,48 @@ then
esac
fi
#echo '(Unable to guess system type)' 1>&2
cat >&2 <<EOF
$0: unable to guess system type
This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:

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: