Codebase list geos / 331bf19
Update upstream source from tag 'upstream/3.9.1' Update to upstream version '3.9.1' with Debian dir b971ab0bd3c4737519049285422e0c7f27e9ff67 Bas Couwenberg 3 years ago
38 changed file(s) with 3185 addition(s) and 2537 deletion(s). Raw diff Collapse all Expand all
4747 set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard version to use (default is 11)")
4848
4949 ## GEOS custom variables
50 option(BUILD_BENCHMARKS "Build GEOS benchmarks" ON)
5051 cmake_dependent_option(GEOS_BUILD_DEVELOPER
5152 "Build with compilation flags useful for development" ON
5253 "GEOS_BUILD_FROM_GIT" OFF)
154155
155156 #-----------------------------------------------------------------------------
156157 # Add flags to prevent 'fused multiply-add' operations on targets (ARM64)
157 # that allow it, as it breaks calculations in DD.cpp.
158 # that allow it, as it breaks calculations in DD.cpp.
158159 # TODO: Replace DD calculations with 'long float' where target supports
159160 # true long float, and remove other cases where FMA causes regression
160161 # failures.
161162 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98207
162163 #-----------------------------------------------------------------------------
163164
164 target_compile_options(geos_cxx_flags INTERFACE
165 target_compile_options(geos_cxx_flags INTERFACE
165166 "$<$<CXX_COMPILER_ID:Clang>:-ffp-contract=off>"
166167 "$<$<CXX_COMPILER_ID:GNU>:-ffp-contract=off>"
167168 "$<$<CXX_COMPILER_ID:MSVC>:/fp:precise>"
168169 )
169
170
170171 #-----------------------------------------------------------------------------
171172 # Target geos_cxx_flags: common compilation flags
172173 #-----------------------------------------------------------------------------
173174 option(DISABLE_GEOS_INLINE "Disable inlining" OFF)
174175 if(NOT DISABLE_GEOS_INLINE)
175176 target_compile_definitions(geos_cxx_flags INTERFACE GEOS_INLINE)
177 message(STATUS
178 "GEOS: Function inlining ENABLED")
176179 else()
177180 message(STATUS
178 "GEOS: DISABLING inlining of small functions")
181 "GEOS: Function inlining DISABLED")
179182 endif()
180183
181184 #-----------------------------------------------------------------------------
182185 # Target geos_cxx_flags: overlayng code
183186 #-----------------------------------------------------------------------------
184 option(DISABLE_OVERLAYNG "Disable overlayng algorithms" OFF)
185 if(DISABLE_OVERLAYNG)
186 target_compile_definitions(geos_cxx_flags INTERFACE DISABLE_OVERLAYNG)
187 message(STATUS
188 "GEOS: DISABLING overlayng algorithms")
189 endif()
187 #option(DISABLE_OVERLAYNG "Disable overlayng algorithms" OFF)
188 #if(DISABLE_OVERLAYNG)
189 # target_compile_definitions(geos_cxx_flags INTERFACE DISABLE_OVERLAYNG)
190 # message(STATUS
191 # "GEOS: OverlayNG DISABLED")
192 #else()
193 # message(STATUS
194 # "GEOS: OverlayNG ENABLED")
195 #endif()
190196
191197 #-----------------------------------------------------------------------------
192198 # Target geos_developer_cxx_flags: developer mode compilation flags
195201 add_library(geos_developer_cxx_flags INTERFACE)
196202
197203 if(GEOS_BUILD_DEVELOPER)
198 message(STATUS "GEOS: Developer mode enabled")
204 message(STATUS "GEOS: Developer mode ENABLED")
199205 endif()
200206
201207 # geos_cxx_flags inherits properties from geos_developer_cxx_flags when
276282 #-----------------------------------------------------------------------------
277283 # Benchmarks
278284 #-----------------------------------------------------------------------------
279 add_subdirectory(benchmarks)
285 if(BUILD_BENCHMARKS)
286 add_subdirectory(benchmarks)
287 endif()
280288
281289 #-----------------------------------------------------------------------------
282290 # Documentation/Examples
0 2021-02-10 Paul Ramsey <pramsey@cleverelephant.ca>
1
2 * NEWS: Update NEWS for 3.9.1
3
4 2021-02-09 Paul Ramsey <pramsey@cleverelephant.ca>
5
6 Merge branch '3.9' of https://git.osgeo.org/gitea/geos/geos into
7 3.9
8
9 2021-02-09 Paul Ramsey <pramsey@cleverelephant.ca>
10
11 * NEWS: Add NEWS entry for NG overlay fix
12
13 2021-02-08 mdavis <mtnclimb@gmail.com>
14
15 * NEWS: Update 'NEWS'
16
17 2021-02-08 Martin Davis <mtnclimb@gmail.com>
18
19 * src/operation/overlayng/OverlayUtil.cpp,
20 tests/unit/operation/overlayng/OverlayNGTest.cpp,
21 tests/xmltester/tests/general/TestNGOverlayL.xml: Fix OverlayNG
22 handling of flat interior line
23
24 2021-02-01 mdavis <mtnclimb@gmail.com>
25
26 * README.md: Update 'README.md'
27
28 2021-01-30 Fabrice Fontaine <fontaine.fabrice@gmail.com>
29
30 * CMakeLists.txt: CMakeLists.txt: add BUILD_BENCHMARKS
31 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
32 References https://github.com/libgeos/geos/pull/395
33
34 2021-01-27 mdavis <mtnclimb@gmail.com>
35
36 * NEWS: Update NEWS for OverlayNG line ordering
37
38 2021-01-25 Martin Davis <mtnclimb@gmail.com>
39
40 * include/geos/operation/overlayng/EdgeMerger.h,
41 src/operation/overlayng/EdgeMerger.cpp,
42 tests/unit/index/chain/MonotoneChainBuilderTest.cpp,
43 tests/unit/operation/overlayng/OverlayNGTest.cpp,
44 tests/unit/utility.h, tests/xmltester/XMLTester.cpp: Fix OverlayNG
45 line ordering
46
47 2020-12-30 Paul Ramsey <pramsey@cleverelephant.ca>
48
49 * NEWS, include/geos/algorithm/Orientation.h,
50 src/algorithm/Orientation.cpp,
51 src/operation/buffer/OffsetCurveSetBuilder.cpp,
52 tests/unit/Makefile.am,
53 tests/unit/algorithm/CGAlgorithms/{isCCWTest.cpp =>
54 OrientationIsCCWTest.cpp},
55 tests/unit/operation/buffer/BufferOpTest.cpp,
56 tests/unit/simplify/DouglasPeuckerSimplifierTest.cpp: Port JTS
57 https://github.com/locationtech/jts/pull/655, Fix buffer to use
58 largest enclosed area for invalid rings
59
60 2020-12-21 Paul Ramsey <pramsey@cleverelephant.ca>
61
62 * NEWS: Add news item for Apple ARM support
63
64 2020-12-15 Taras Zakharko <taras.zakharko@gmail.com>
65
66 * src/inlines.cpp: Disable additional inlining definitions when
67 building for Apple ARM64 targets as they result in linker errors
68
69 2020-12-19 Paul Ramsey <pramsey@cleverelephant.ca>
70
71 * NEWS: Add note on #1050
72
73 2020-12-19 Paul Ramsey <pramsey@cleverelephant.ca>
74
75 * capi/geos_ts_c.cpp, tests/unit/Makefile.am,
76 tests/unit/capi/GEOSGeom_createPolygonTest.cpp: Clean up Win32
77 memory issue, references #1050
78
79 2020-12-15 Paul Ramsey <pramsey@cleverelephant.ca>
80
81 * NEWS, Version.txt: Bump forward again for 3.9.1 dev
82
83 2020-12-15 Paul Ramsey <pramsey@cleverelephant.ca>
84
85 * NEWS, Version.txt: Commit 3.9.0 and tag
86
87 2020-12-14 Paul Ramsey <pramsey@cleverelephant.ca>
88
89 * NEWS, Version.txt: Bump for 3.9.1dev
90
91 2020-12-11 Sandro Santilli <strk@kbt.io>
92
93 * Version.txt: Set CAPI current/rev/age to 15/0/14
94
95 2020-12-11 Sandro Santilli <strk@kbt.io>
96
97 * HOWTO_RELEASE, Version.txt: Document versioning where it is set
98
99 2020-12-10 Paul Ramsey <pramsey@cleverelephant.ca>
100
101 Merge branch '3.9' of https://git.osgeo.org/gitea/geos/geos into
102 3.9
103
104 2020-12-09 Mike Taves <mwtoews@gmail.com>
105
106 * tests/unit/simplify/TopologyPreservingSimplifierTest.cpp:
107 Temporarily disable component of TopologyPreservingSimplifier test
108
109 2020-12-10 Sandro Santilli <strk@kbt.io>
110
111 * .gitignore: Ignore build tests
112
113 2020-12-10 Sandro Santilli <strk@kbt.io>
114
115 * tests/unit/Makefile.am: Enable MakeValid unit test with autotools
116
117
118 2020-12-10 Paul Ramsey <pramsey@cleverelephant.ca>
119
120 * NEWS, Version.txt: Prep RC1
121
122 2020-12-10 Paul Ramsey <pramsey@cleverelephant.ca>
123
124 * CMakeLists.txt, configure.ac: Remove compile-time switches to
125 disable OverlayNG, leaving the defines in place in case developers
126 have a need to flip the switch
127
128 2020-12-10 Sandro Santilli <strk@kbt.io>
129
130 * tests/xmltester/Makefile.am,
131 tests/xmltester/tests/issue/issue-geos-1085.xml: Add tests for
132 relate with empty components (#1085)
133
134 2020-12-09 Paul Ramsey <pramsey@cleverelephant.ca>
135
136 * NEWS, Version.txt: Bump versions for 3.9 branch
137
138 2020-12-09 Paul Ramsey <pramsey@cleverelephant.ca>
139
140 * NEWS, Version.txt: 3.9.0 Release
141
0142 2020-12-09 Paul Ramsey <pramsey@cleverelephant.ca>
1143
2144 * tests/unit/util/NodingTestUtil.cpp: remove leak in noding test?
203203 CSCOPE = cscope
204204 DIST_SUBDIRS = $(SUBDIRS)
205205 am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS COPYING INSTALL NEWS \
206 compile config.guess config.sub install-sh ltmain.sh missing \
207 py-compile
206 compile config.guess config.sub install-sh ltmain.sh missing
208207 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
209208 distdir = $(PACKAGE)-$(VERSION)
210209 top_distdir = $(distdir)
0
1 Changes in 3.9.1
2 2021-02-10
3
4 - Bug fixes / improvements:
5 - Windows memory management quirk in createPolygon CAPI (#1050, Paul Ramsey)
6 - Allow build on Apple ARM64 (Taras Zakharko)
7 - Fix buffer to use largest enclosed area for invalid rings (#732, Paul Ramsey)
8 - Preserve ordering of lines in overlay results (Martin Davis)
9 - Fix overlay handling of flat interior lines (JTS-685, Martin Davis)
10
11
012 Changes in 3.9.0
113 2020-12-09
214
1414 | branch / CI | Debbie | Winnie | Dronie | Travis CI | GitLab CI | AppVeyor | GitHub | Bessie | Bessie32 |
1515 |:--- |:--- |:--- |:--- |:--- |:--- |:--- |:--- |:--- |:--- |
1616 | master | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Master/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Master/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Master/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?branch=master)](https://dronie.osgeo.org/geos/geos?branch=master) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=master)](https://travis-ci.com/libgeos/geos?branch=master) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/master/pipeline.svg)](https://gitlab.com/geos/libgeos/commits/master) | [![appveyor](https://ci.appveyor.com/api/projects/status/62aplwst722b89au/branch/master?svg=true)](https://ci.appveyor.com/project/dbaston/geos/branch/master) | [![github](https://github.com/libgeos/geos/workflows/CI/badge.svg?branch=master)](https://github.com/libgeos/geos/actions?query=workflow%3ACI) | [![bessie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie&BRANCH=master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie) | [![bessie32](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Worker_Run/label=bessie32&BRANCH=master)](https://debbie.postgis.net/view/GEOS/job/GEOS_Worker_Run/label=bessie32)
17 | 3.9 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Branch_3.9)](https://debbie.postgis.net/view/GEOS/job/GEOS_Branch_3.9/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.9/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.9/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?branch=3.9)](https://dronie.osgeo.org/geos/geos?branch=3.9) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=3.9)](https://travis-ci.com/libgeos/geos?branch=3.9) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/3.9/pipeline.svg)](https://gitlab.com/geos/libgeos/commits/3.9) | [![appveyor](https://ci.appveyor.com/api/projects/status/62aplwst722b89au/branch/3.9?svg=true)](https://ci.appveyor.com/project/dbaston/geos/branch/3.9) | [![github](https://github.com/libgeos/geos/workflows/CI/badge.svg?branch=3.9)](https://github.com/libgeos/geos/actions?query=workflow%3ACI) |
1718 | 3.8 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Branch_3.8)](https://debbie.postgis.net/view/GEOS/job/GEOS_Branch_3.8/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.8/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.8/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?branch=3.8)](https://dronie.osgeo.org/geos/geos?branch=3.8) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=3.8)](https://travis-ci.com/libgeos/geos?branch=3.8) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/3.8/pipeline.svg)](https://gitlab.com/geos/libgeos/commits/3.8) | [![appveyor](https://ci.appveyor.com/api/projects/status/62aplwst722b89au/branch/3.8?svg=true)](https://ci.appveyor.com/project/dbaston/geos/branch/3.8) | [![github](https://github.com/libgeos/geos/workflows/CI/badge.svg?branch=3.8)](https://github.com/libgeos/geos/actions?query=workflow%3ACI) |
1819 | 3.7 | [![debbie](https://debbie.postgis.net/buildStatus/icon?job=GEOS_Branch_3.7)](https://debbie.postgis.net/view/GEOS/job/GEOS_Branch_3.7/) | [![winnie](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.7/badge/icon)](https://winnie.postgis.net:444/view/GEOS/job/GEOS_Branch_3.7/) | [![dronie](https://dronie.osgeo.org/api/badges/geos/geos/status.svg?branch=3.7)](https://dronie.osgeo.org/geos/geos?branch=3.7) | [![travis](https://travis-ci.com/libgeos/geos.svg?branch=3.7)](https://travis-ci.com/libgeos/geos?branch=3.7) | [![gitlab-ci](https://gitlab.com/geos/libgeos/badges/3.7/pipeline.svg)](https://gitlab.com/geos/libgeos/commits/3.7) | [![appveyor](https://ci.appveyor.com/api/projects/status/62aplwst722b89au/branch/3.7?svg=true)](https://ci.appveyor.com/project/dbaston/geos/branch/3.7) | [![github](https://github.com/libgeos/geos/workflows/CI/badge.svg?branch=3.7)](https://github.com/libgeos/geos/actions?query=workflow%3ACI) |
1920
11 # GEOS Versions
22 GEOS_VERSION_MAJOR=3
33 GEOS_VERSION_MINOR=9
4 GEOS_VERSION_PATCH=0
4 GEOS_VERSION_PATCH=1
55
66 # OPTIONS: "", "dev", "rc1" etc.
77 GEOS_PATCH_WORD=
88
99 # GEOS CAPI Versions
1010 #
11 # Always increase the revision value.
12 # Increase the current value whenever an interface has been
13 # added, removed or changed.
14 # Increase the age value only if the changes made to the ABI
15 # are backward compatible.
16 CAPI_INTERFACE_CURRENT=17
11 # - For a release with no interface changes just bump REVISION.
12 # ( Even if *nothing* changed in CAPI )
13 # - Adding interfaces, bump CURRENT/AGE, set REVISION to 0.
14 # - Deleting interfaces / compatibility issues - bump CURRENT, others to zero
15 # ( THIS MUST BE CAREFULLY AVOIDED )
16 #
17 CAPI_INTERFACE_CURRENT=15
1718 CAPI_INTERFACE_REVISION=2
18 CAPI_INTERFACE_AGE=16
19 CAPI_INTERFACE_AGE=14
1920
2021 # JTS Port
2122 JTS_PORT=1.17.0
24072407 //assert(0 != holes);
24082408
24092409 return execute(extHandle, [&]() {
2410 auto vholes = geos::detail::make_unique<std::vector<LinearRing*>>(nholes);
2411
2410
2411 std::vector<LinearRing*> tmpholes(nholes);
24122412 for (size_t i = 0; i < nholes; i++) {
2413 (*vholes)[i] = dynamic_cast<LinearRing*>(holes[i]);
2414 if ((*vholes)[i] == nullptr) {
2413 LinearRing* lr = dynamic_cast<LinearRing*>(holes[i]);
2414 if (! lr) {
24152415 throw IllegalArgumentException("Hole is not a LinearRing");
24162416 }
2417 }
2418
2417 tmpholes[i] = lr;
2418 }
24192419 LinearRing* nshell = dynamic_cast<LinearRing*>(shell);
24202420 if(! nshell) {
24212421 throw IllegalArgumentException("Shell is not a LinearRing");
24222422 }
2423 const GeometryFactory* gf = shell->getFactory();
2424
2425 return gf->createPolygon(nshell, vholes.release());
2423 GEOSContextHandleInternal_t* handle = reinterpret_cast<GEOSContextHandleInternal_t*>(extHandle);
2424 const GeometryFactory* gf = handle->geomFactory;
2425
2426 /* Create unique_ptr version for constructor */
2427 std::vector<std::unique_ptr<LinearRing>> vholes;
2428 vholes.reserve(nholes);
2429 for (LinearRing* lr: tmpholes) {
2430 vholes.emplace_back(lr);
2431 }
2432 std::unique_ptr<LinearRing> shell(nshell);
2433
2434 return gf->createPolygon(std::move(shell), std::move(vholes)).release();
24262435 });
24272436 }
24282437
00 #! /bin/sh
11 # Attempt to guess a canonical system name.
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-11-04'
2 # Copyright 1992-2020 Free Software Foundation, Inc.
3
4 timestamp='2020-07-12'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
1414 # General Public License for more details.
1515 #
1616 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
1818 #
1919 # As a special exception to the GNU General Public License, if you
2020 # distribute this file as part of a program that contains a
2626 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
2727 #
2828 # You can get the latest version of this script from:
29 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
29 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
3030 #
3131 # Please send patches to <config-patches@gnu.org>.
3232
3838
3939 Output the configuration name of the system \`$me' is run on.
4040
41 Operation modes:
41 Options:
4242 -h, --help print this help, then exit
4343 -t, --time-stamp print date of last modification, then exit
4444 -v, --version print version number, then exit
4949 GNU config.guess ($timestamp)
5050
5151 Originally written by Per Bothner.
52 Copyright 1992-2014 Free Software Foundation, Inc.
52 Copyright 1992-2020 Free Software Foundation, Inc.
5353
5454 This is free software; see the source for copying conditions. There is NO
5555 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
8383 exit 1
8484 fi
8585
86 trap 'exit 1' 1 2 15
87
8886 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
8987 # compiler to aid in system detection is discouraged as it requires
9088 # temporary files to be created and, as you can see below, it is a
9593
9694 # Portable tmp directory creation inspired by the Autoconf team.
9795
98 set_cc_for_build='
99 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
100 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
101 : ${TMPDIR=/tmp} ;
102 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
103 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
104 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
105 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
106 dummy=$tmp/dummy ;
107 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
108 case $CC_FOR_BUILD,$HOST_CC,$CC in
109 ,,) echo "int x;" > $dummy.c ;
110 for c in cc gcc c89 c99 ; do
111 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
112 CC_FOR_BUILD="$c"; break ;
113 fi ;
114 done ;
115 if test x"$CC_FOR_BUILD" = x ; then
116 CC_FOR_BUILD=no_compiler_found ;
117 fi
118 ;;
119 ,,*) CC_FOR_BUILD=$CC ;;
120 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
121 esac ; set_cc_for_build= ;'
96 tmp=
97 # shellcheck disable=SC2172
98 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
99
100 set_cc_for_build() {
101 # prevent multiple calls if $tmp is already set
102 test "$tmp" && return 0
103 : "${TMPDIR=/tmp}"
104 # shellcheck disable=SC2039
105 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
106 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
107 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
108 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
109 dummy=$tmp/dummy
110 case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
111 ,,) echo "int x;" > "$dummy.c"
112 for driver in cc gcc c89 c99 ; do
113 if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
114 CC_FOR_BUILD="$driver"
115 break
116 fi
117 done
118 if test x"$CC_FOR_BUILD" = x ; then
119 CC_FOR_BUILD=no_compiler_found
120 fi
121 ;;
122 ,,*) CC_FOR_BUILD=$CC ;;
123 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
124 esac
125 }
122126
123127 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
124128 # (ghazi@noc.rutgers.edu 1994-08-24)
125 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
129 if test -f /.attbin/uname ; then
126130 PATH=$PATH:/.attbin ; export PATH
127131 fi
128132
131135 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
132136 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133137
134 case "${UNAME_SYSTEM}" in
138 case "$UNAME_SYSTEM" in
135139 Linux|GNU|GNU/*)
136140 # If the system lacks a compiler, then just pick glibc.
137141 # We could probably try harder.
138142 LIBC=gnu
139143
140 eval $set_cc_for_build
141 cat <<-EOF > $dummy.c
144 set_cc_for_build
145 cat <<-EOF > "$dummy.c"
142146 #include <features.h>
143147 #if defined(__UCLIBC__)
144148 LIBC=uclibc
148152 LIBC=gnu
149153 #endif
150154 EOF
151 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
155 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
156
157 # If ldd exists, use it to detect musl libc.
158 if command -v ldd >/dev/null && \
159 ldd --version 2>&1 | grep -q ^musl
160 then
161 LIBC=musl
162 fi
152163 ;;
153164 esac
154165
155166 # Note: order is significant - the case branches are not exclusive.
156167
157 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
168 case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
158169 *:NetBSD:*:*)
159170 # NetBSD (nbsd) targets should (where applicable) match one or
160171 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
167178 # Note: NetBSD doesn't particularly care about the vendor
168179 # portion of the name. We always set it to "unknown".
169180 sysctl="sysctl -n hw.machine_arch"
170 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
171 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
172 case "${UNAME_MACHINE_ARCH}" in
181 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
182 "/sbin/$sysctl" 2>/dev/null || \
183 "/usr/sbin/$sysctl" 2>/dev/null || \
184 echo unknown)`
185 case "$UNAME_MACHINE_ARCH" in
173186 armeb) machine=armeb-unknown ;;
174187 arm*) machine=arm-unknown ;;
175188 sh3el) machine=shl-unknown ;;
176189 sh3eb) machine=sh-unknown ;;
177190 sh5el) machine=sh5le-unknown ;;
178 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
191 earmv*)
192 arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
193 endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
194 machine="${arch}${endian}"-unknown
195 ;;
196 *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
179197 esac
180198 # The Operating System including object format, if it has switched
181 # to ELF recently, or will in the future.
182 case "${UNAME_MACHINE_ARCH}" in
199 # to ELF recently (or will in the future) and ABI.
200 case "$UNAME_MACHINE_ARCH" in
201 earm*)
202 os=netbsdelf
203 ;;
183204 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
184 eval $set_cc_for_build
205 set_cc_for_build
185206 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
186207 | grep -q __ELF__
187208 then
196217 os=netbsd
197218 ;;
198219 esac
220 # Determine ABI tags.
221 case "$UNAME_MACHINE_ARCH" in
222 earm*)
223 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
224 abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
225 ;;
226 esac
199227 # The OS release
200228 # Debian GNU/NetBSD machines have a different userland, and
201229 # thus, need a distinct triplet. However, they do not need
202230 # kernel version information, so it can be replaced with a
203231 # suitable tag, in the style of linux-gnu.
204 case "${UNAME_VERSION}" in
232 case "$UNAME_VERSION" in
205233 Debian*)
206234 release='-gnu'
207235 ;;
208236 *)
209 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
237 release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
210238 ;;
211239 esac
212240 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
213241 # contains redundant information, the shorter form:
214242 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
215 echo "${machine}-${os}${release}"
243 echo "$machine-${os}${release}${abi-}"
216244 exit ;;
217245 *:Bitrig:*:*)
218246 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
219 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
247 echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
220248 exit ;;
221249 *:OpenBSD:*:*)
222250 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
223 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
251 echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
252 exit ;;
253 *:LibertyBSD:*:*)
254 UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
255 echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
256 exit ;;
257 *:MidnightBSD:*:*)
258 echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
224259 exit ;;
225260 *:ekkoBSD:*:*)
226 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
261 echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
227262 exit ;;
228263 *:SolidBSD:*:*)
229 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
264 echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
265 exit ;;
266 *:OS108:*:*)
267 echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
230268 exit ;;
231269 macppc:MirBSD:*:*)
232 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
270 echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
233271 exit ;;
234272 *:MirBSD:*:*)
235 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
273 echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
274 exit ;;
275 *:Sortix:*:*)
276 echo "$UNAME_MACHINE"-unknown-sortix
277 exit ;;
278 *:Twizzler:*:*)
279 echo "$UNAME_MACHINE"-unknown-twizzler
280 exit ;;
281 *:Redox:*:*)
282 echo "$UNAME_MACHINE"-unknown-redox
283 exit ;;
284 mips:OSF1:*.*)
285 echo mips-dec-osf1
236286 exit ;;
237287 alpha:OSF1:*:*)
238288 case $UNAME_RELEASE in
250300 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
251301 case "$ALPHA_CPU_TYPE" in
252302 "EV4 (21064)")
253 UNAME_MACHINE="alpha" ;;
303 UNAME_MACHINE=alpha ;;
254304 "EV4.5 (21064)")
255 UNAME_MACHINE="alpha" ;;
305 UNAME_MACHINE=alpha ;;
256306 "LCA4 (21066/21068)")
257 UNAME_MACHINE="alpha" ;;
307 UNAME_MACHINE=alpha ;;
258308 "EV5 (21164)")
259 UNAME_MACHINE="alphaev5" ;;
309 UNAME_MACHINE=alphaev5 ;;
260310 "EV5.6 (21164A)")
261 UNAME_MACHINE="alphaev56" ;;
311 UNAME_MACHINE=alphaev56 ;;
262312 "EV5.6 (21164PC)")
263 UNAME_MACHINE="alphapca56" ;;
313 UNAME_MACHINE=alphapca56 ;;
264314 "EV5.7 (21164PC)")
265 UNAME_MACHINE="alphapca57" ;;
315 UNAME_MACHINE=alphapca57 ;;
266316 "EV6 (21264)")
267 UNAME_MACHINE="alphaev6" ;;
317 UNAME_MACHINE=alphaev6 ;;
268318 "EV6.7 (21264A)")
269 UNAME_MACHINE="alphaev67" ;;
319 UNAME_MACHINE=alphaev67 ;;
270320 "EV6.8CB (21264C)")
271 UNAME_MACHINE="alphaev68" ;;
321 UNAME_MACHINE=alphaev68 ;;
272322 "EV6.8AL (21264B)")
273 UNAME_MACHINE="alphaev68" ;;
323 UNAME_MACHINE=alphaev68 ;;
274324 "EV6.8CX (21264D)")
275 UNAME_MACHINE="alphaev68" ;;
325 UNAME_MACHINE=alphaev68 ;;
276326 "EV6.9A (21264/EV69A)")
277 UNAME_MACHINE="alphaev69" ;;
327 UNAME_MACHINE=alphaev69 ;;
278328 "EV7 (21364)")
279 UNAME_MACHINE="alphaev7" ;;
329 UNAME_MACHINE=alphaev7 ;;
280330 "EV7.9 (21364A)")
281 UNAME_MACHINE="alphaev79" ;;
331 UNAME_MACHINE=alphaev79 ;;
282332 esac
283333 # A Pn.n version is a patched version.
284334 # A Vn.n version is a released version.
285335 # A Tn.n version is a released field test version.
286336 # A Xn.n version is an unreleased experimental baselevel.
287337 # 1.2 uses "1.2" for uname -r.
288 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
338 echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
289339 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
290340 exitcode=$?
291341 trap '' 0
292342 exit $exitcode ;;
293 Alpha\ *:Windows_NT*:*)
294 # How do we know it's Interix rather than the generic POSIX subsystem?
295 # Should we change UNAME_MACHINE based on the output of uname instead
296 # of the specific Alpha model?
297 echo alpha-pc-interix
298 exit ;;
299 21064:Windows_NT:50:3)
300 echo alpha-dec-winnt3.5
301 exit ;;
302343 Amiga*:UNIX_System_V:4.0:*)
303344 echo m68k-unknown-sysv4
304345 exit ;;
305346 *:[Aa]miga[Oo][Ss]:*:*)
306 echo ${UNAME_MACHINE}-unknown-amigaos
347 echo "$UNAME_MACHINE"-unknown-amigaos
307348 exit ;;
308349 *:[Mm]orph[Oo][Ss]:*:*)
309 echo ${UNAME_MACHINE}-unknown-morphos
350 echo "$UNAME_MACHINE"-unknown-morphos
310351 exit ;;
311352 *:OS/390:*:*)
312353 echo i370-ibm-openedition
318359 echo powerpc-ibm-os400
319360 exit ;;
320361 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
321 echo arm-acorn-riscix${UNAME_RELEASE}
362 echo arm-acorn-riscix"$UNAME_RELEASE"
322363 exit ;;
323364 arm*:riscos:*:*|arm*:RISCOS:*:*)
324365 echo arm-unknown-riscos
345386 sparc) echo sparc-icl-nx7; exit ;;
346387 esac ;;
347388 s390x:SunOS:*:*)
348 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
389 echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
349390 exit ;;
350391 sun4H:SunOS:5.*:*)
351 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
392 echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
352393 exit ;;
353394 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
354 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
395 echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
355396 exit ;;
356397 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
357 echo i386-pc-auroraux${UNAME_RELEASE}
398 echo i386-pc-auroraux"$UNAME_RELEASE"
358399 exit ;;
359400 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
360 eval $set_cc_for_build
361 SUN_ARCH="i386"
401 set_cc_for_build
402 SUN_ARCH=i386
362403 # If there is a compiler, see if it is configured for 64-bit objects.
363404 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
364405 # This test works for both compilers.
365 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
406 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
366407 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
367 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
408 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
368409 grep IS_64BIT_ARCH >/dev/null
369410 then
370 SUN_ARCH="x86_64"
411 SUN_ARCH=x86_64
371412 fi
372413 fi
373 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
414 echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
374415 exit ;;
375416 sun4*:SunOS:6*:*)
376417 # According to config.sub, this is the proper way to canonicalize
377418 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
378419 # it's likely to be more like Solaris than SunOS4.
379 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
420 echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
380421 exit ;;
381422 sun4*:SunOS:*:*)
382423 case "`/usr/bin/arch -k`" in
385426 ;;
386427 esac
387428 # Japanese Language versions have a version number like `4.1.3-JL'.
388 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
429 echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
389430 exit ;;
390431 sun3*:SunOS:*:*)
391 echo m68k-sun-sunos${UNAME_RELEASE}
432 echo m68k-sun-sunos"$UNAME_RELEASE"
392433 exit ;;
393434 sun*:*:4.2BSD:*)
394435 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
395 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
436 test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
396437 case "`/bin/arch`" in
397438 sun3)
398 echo m68k-sun-sunos${UNAME_RELEASE}
439 echo m68k-sun-sunos"$UNAME_RELEASE"
399440 ;;
400441 sun4)
401 echo sparc-sun-sunos${UNAME_RELEASE}
442 echo sparc-sun-sunos"$UNAME_RELEASE"
402443 ;;
403444 esac
404445 exit ;;
405446 aushp:SunOS:*:*)
406 echo sparc-auspex-sunos${UNAME_RELEASE}
447 echo sparc-auspex-sunos"$UNAME_RELEASE"
407448 exit ;;
408449 # The situation for MiNT is a little confusing. The machine name
409450 # can be virtually everything (everything which is not
414455 # MiNT. But MiNT is downward compatible to TOS, so this should
415456 # be no problem.
416457 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
417 echo m68k-atari-mint${UNAME_RELEASE}
458 echo m68k-atari-mint"$UNAME_RELEASE"
418459 exit ;;
419460 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
420 echo m68k-atari-mint${UNAME_RELEASE}
461 echo m68k-atari-mint"$UNAME_RELEASE"
421462 exit ;;
422463 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
423 echo m68k-atari-mint${UNAME_RELEASE}
464 echo m68k-atari-mint"$UNAME_RELEASE"
424465 exit ;;
425466 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
426 echo m68k-milan-mint${UNAME_RELEASE}
467 echo m68k-milan-mint"$UNAME_RELEASE"
427468 exit ;;
428469 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
429 echo m68k-hades-mint${UNAME_RELEASE}
470 echo m68k-hades-mint"$UNAME_RELEASE"
430471 exit ;;
431472 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
432 echo m68k-unknown-mint${UNAME_RELEASE}
473 echo m68k-unknown-mint"$UNAME_RELEASE"
433474 exit ;;
434475 m68k:machten:*:*)
435 echo m68k-apple-machten${UNAME_RELEASE}
476 echo m68k-apple-machten"$UNAME_RELEASE"
436477 exit ;;
437478 powerpc:machten:*:*)
438 echo powerpc-apple-machten${UNAME_RELEASE}
479 echo powerpc-apple-machten"$UNAME_RELEASE"
439480 exit ;;
440481 RISC*:Mach:*:*)
441482 echo mips-dec-mach_bsd4.3
442483 exit ;;
443484 RISC*:ULTRIX:*:*)
444 echo mips-dec-ultrix${UNAME_RELEASE}
485 echo mips-dec-ultrix"$UNAME_RELEASE"
445486 exit ;;
446487 VAX*:ULTRIX*:*:*)
447 echo vax-dec-ultrix${UNAME_RELEASE}
488 echo vax-dec-ultrix"$UNAME_RELEASE"
448489 exit ;;
449490 2020:CLIX:*:* | 2430:CLIX:*:*)
450 echo clipper-intergraph-clix${UNAME_RELEASE}
491 echo clipper-intergraph-clix"$UNAME_RELEASE"
451492 exit ;;
452493 mips:*:*:UMIPS | mips:*:*:RISCos)
453 eval $set_cc_for_build
454 sed 's/^ //' << EOF >$dummy.c
494 set_cc_for_build
495 sed 's/^ //' << EOF > "$dummy.c"
455496 #ifdef __cplusplus
456497 #include <stdio.h> /* for printf() prototype */
457498 int main (int argc, char *argv[]) {
460501 #endif
461502 #if defined (host_mips) && defined (MIPSEB)
462503 #if defined (SYSTYPE_SYSV)
463 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
504 printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
464505 #endif
465506 #if defined (SYSTYPE_SVR4)
466 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
507 printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
467508 #endif
468509 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
469 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
510 printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
470511 #endif
471512 #endif
472513 exit (-1);
473514 }
474515 EOF
475 $CC_FOR_BUILD -o $dummy $dummy.c &&
476 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
477 SYSTEM_NAME=`$dummy $dummyarg` &&
516 $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
517 dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
518 SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
478519 { echo "$SYSTEM_NAME"; exit; }
479 echo mips-mips-riscos${UNAME_RELEASE}
520 echo mips-mips-riscos"$UNAME_RELEASE"
480521 exit ;;
481522 Motorola:PowerMAX_OS:*:*)
482523 echo powerpc-motorola-powermax
502543 AViiON:dgux:*:*)
503544 # DG/UX returns AViiON for all architectures
504545 UNAME_PROCESSOR=`/usr/bin/uname -p`
505 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
546 if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
506547 then
507 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
508 [ ${TARGET_BINARY_INTERFACE}x = x ]
548 if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
549 [ "$TARGET_BINARY_INTERFACE"x = x ]
509550 then
510 echo m88k-dg-dgux${UNAME_RELEASE}
551 echo m88k-dg-dgux"$UNAME_RELEASE"
511552 else
512 echo m88k-dg-dguxbcs${UNAME_RELEASE}
553 echo m88k-dg-dguxbcs"$UNAME_RELEASE"
513554 fi
514555 else
515 echo i586-dg-dgux${UNAME_RELEASE}
556 echo i586-dg-dgux"$UNAME_RELEASE"
516557 fi
517558 exit ;;
518559 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
529570 echo m68k-tektronix-bsd
530571 exit ;;
531572 *:IRIX*:*:*)
532 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
573 echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
533574 exit ;;
534575 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
535576 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
541582 if [ -x /usr/bin/oslevel ] ; then
542583 IBM_REV=`/usr/bin/oslevel`
543584 else
544 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
545 fi
546 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
585 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
586 fi
587 echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
547588 exit ;;
548589 *:AIX:2:3)
549590 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
550 eval $set_cc_for_build
551 sed 's/^ //' << EOF >$dummy.c
591 set_cc_for_build
592 sed 's/^ //' << EOF > "$dummy.c"
552593 #include <sys/systemcfg.h>
553594
554595 main()
559600 exit(0);
560601 }
561602 EOF
562 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
603 if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
563604 then
564605 echo "$SYSTEM_NAME"
565606 else
573614 exit ;;
574615 *:AIX:*:[4567])
575616 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
576 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
617 if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
577618 IBM_ARCH=rs6000
578619 else
579620 IBM_ARCH=powerpc
582623 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
583624 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
584625 else
585 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
586 fi
587 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
626 IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
627 fi
628 echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
588629 exit ;;
589630 *:AIX:*:*)
590631 echo rs6000-ibm-aix
591632 exit ;;
592 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
633 ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
593634 echo romp-ibm-bsd4.4
594635 exit ;;
595636 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
596 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
637 echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
597638 exit ;; # report: romp-ibm BSD 4.3
598639 *:BOSX:*:*)
599640 echo rs6000-bull-bosx
608649 echo m68k-hp-bsd4.4
609650 exit ;;
610651 9000/[34678]??:HP-UX:*:*)
611 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
612 case "${UNAME_MACHINE}" in
613 9000/31? ) HP_ARCH=m68000 ;;
614 9000/[34]?? ) HP_ARCH=m68k ;;
652 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
653 case "$UNAME_MACHINE" in
654 9000/31?) HP_ARCH=m68000 ;;
655 9000/[34]??) HP_ARCH=m68k ;;
615656 9000/[678][0-9][0-9])
616657 if [ -x /usr/bin/getconf ]; then
617658 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
618659 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
619 case "${sc_cpu_version}" in
620 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
621 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
660 case "$sc_cpu_version" in
661 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
662 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
622663 532) # CPU_PA_RISC2_0
623 case "${sc_kernel_bits}" in
624 32) HP_ARCH="hppa2.0n" ;;
625 64) HP_ARCH="hppa2.0w" ;;
626 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
664 case "$sc_kernel_bits" in
665 32) HP_ARCH=hppa2.0n ;;
666 64) HP_ARCH=hppa2.0w ;;
667 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
627668 esac ;;
628669 esac
629670 fi
630 if [ "${HP_ARCH}" = "" ]; then
631 eval $set_cc_for_build
632 sed 's/^ //' << EOF >$dummy.c
671 if [ "$HP_ARCH" = "" ]; then
672 set_cc_for_build
673 sed 's/^ //' << EOF > "$dummy.c"
633674
634675 #define _HPUX_SOURCE
635676 #include <stdlib.h>
662703 exit (0);
663704 }
664705 EOF
665 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
706 (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
666707 test -z "$HP_ARCH" && HP_ARCH=hppa
667708 fi ;;
668709 esac
669 if [ ${HP_ARCH} = "hppa2.0w" ]
710 if [ "$HP_ARCH" = hppa2.0w ]
670711 then
671 eval $set_cc_for_build
712 set_cc_for_build
672713
673714 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
674715 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
679720 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
680721 # => hppa64-hp-hpux11.23
681722
682 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
723 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
683724 grep -q __LP64__
684725 then
685 HP_ARCH="hppa2.0w"
726 HP_ARCH=hppa2.0w
686727 else
687 HP_ARCH="hppa64"
728 HP_ARCH=hppa64
688729 fi
689730 fi
690 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
731 echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
691732 exit ;;
692733 ia64:HP-UX:*:*)
693 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
694 echo ia64-hp-hpux${HPUX_REV}
734 HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
735 echo ia64-hp-hpux"$HPUX_REV"
695736 exit ;;
696737 3050*:HI-UX:*:*)
697 eval $set_cc_for_build
698 sed 's/^ //' << EOF >$dummy.c
738 set_cc_for_build
739 sed 's/^ //' << EOF > "$dummy.c"
699740 #include <unistd.h>
700741 int
701742 main ()
720761 exit (0);
721762 }
722763 EOF
723 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
764 $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
724765 { echo "$SYSTEM_NAME"; exit; }
725766 echo unknown-hitachi-hiuxwe2
726767 exit ;;
727 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
768 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
728769 echo hppa1.1-hp-bsd
729770 exit ;;
730771 9000/8??:4.3bsd:*:*)
733774 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
734775 echo hppa1.0-hp-mpeix
735776 exit ;;
736 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
777 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
737778 echo hppa1.1-hp-osf
738779 exit ;;
739780 hp8??:OSF1:*:*)
741782 exit ;;
742783 i*86:OSF1:*:*)
743784 if [ -x /usr/sbin/sysversion ] ; then
744 echo ${UNAME_MACHINE}-unknown-osf1mk
785 echo "$UNAME_MACHINE"-unknown-osf1mk
745786 else
746 echo ${UNAME_MACHINE}-unknown-osf1
787 echo "$UNAME_MACHINE"-unknown-osf1
747788 fi
748789 exit ;;
749790 parisc*:Lites*:*:*)
768809 echo c4-convex-bsd
769810 exit ;;
770811 CRAY*Y-MP:*:*:*)
771 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
812 echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
772813 exit ;;
773814 CRAY*[A-Z]90:*:*:*)
774 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
815 echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
775816 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
776817 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
777818 -e 's/\.[^.]*$/.X/'
778819 exit ;;
779820 CRAY*TS:*:*:*)
780 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
821 echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
781822 exit ;;
782823 CRAY*T3E:*:*:*)
783 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
824 echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
784825 exit ;;
785826 CRAY*SV1:*:*:*)
786 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
827 echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
787828 exit ;;
788829 *:UNICOS/mp:*:*)
789 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
830 echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
790831 exit ;;
791832 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
792 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
793 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
794 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
833 FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
834 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
835 FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
795836 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
796837 exit ;;
797838 5000:UNIX_System_V:4.*:*)
798 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
799 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
839 FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
840 FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
800841 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
801842 exit ;;
802843 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
803 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
844 echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
804845 exit ;;
805846 sparc*:BSD/OS:*:*)
806 echo sparc-unknown-bsdi${UNAME_RELEASE}
847 echo sparc-unknown-bsdi"$UNAME_RELEASE"
807848 exit ;;
808849 *:BSD/OS:*:*)
809 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
850 echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
851 exit ;;
852 arm:FreeBSD:*:*)
853 UNAME_PROCESSOR=`uname -p`
854 set_cc_for_build
855 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
856 | grep -q __ARM_PCS_VFP
857 then
858 echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
859 else
860 echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
861 fi
810862 exit ;;
811863 *:FreeBSD:*:*)
812864 UNAME_PROCESSOR=`/usr/bin/uname -p`
813 case ${UNAME_PROCESSOR} in
865 case "$UNAME_PROCESSOR" in
814866 amd64)
815 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
816 *)
817 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
867 UNAME_PROCESSOR=x86_64 ;;
868 i386)
869 UNAME_PROCESSOR=i586 ;;
818870 esac
871 echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
819872 exit ;;
820873 i*:CYGWIN*:*)
821 echo ${UNAME_MACHINE}-pc-cygwin
874 echo "$UNAME_MACHINE"-pc-cygwin
822875 exit ;;
823876 *:MINGW64*:*)
824 echo ${UNAME_MACHINE}-pc-mingw64
877 echo "$UNAME_MACHINE"-pc-mingw64
825878 exit ;;
826879 *:MINGW*:*)
827 echo ${UNAME_MACHINE}-pc-mingw32
880 echo "$UNAME_MACHINE"-pc-mingw32
828881 exit ;;
829882 *:MSYS*:*)
830 echo ${UNAME_MACHINE}-pc-msys
831 exit ;;
832 i*:windows32*:*)
833 # uname -m includes "-pc" on this system.
834 echo ${UNAME_MACHINE}-mingw32
883 echo "$UNAME_MACHINE"-pc-msys
835884 exit ;;
836885 i*:PW*:*)
837 echo ${UNAME_MACHINE}-pc-pw32
886 echo "$UNAME_MACHINE"-pc-pw32
838887 exit ;;
839888 *:Interix*:*)
840 case ${UNAME_MACHINE} in
889 case "$UNAME_MACHINE" in
841890 x86)
842 echo i586-pc-interix${UNAME_RELEASE}
891 echo i586-pc-interix"$UNAME_RELEASE"
843892 exit ;;
844893 authenticamd | genuineintel | EM64T)
845 echo x86_64-unknown-interix${UNAME_RELEASE}
894 echo x86_64-unknown-interix"$UNAME_RELEASE"
846895 exit ;;
847896 IA64)
848 echo ia64-unknown-interix${UNAME_RELEASE}
897 echo ia64-unknown-interix"$UNAME_RELEASE"
849898 exit ;;
850899 esac ;;
851 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
852 echo i${UNAME_MACHINE}-pc-mks
853 exit ;;
854 8664:Windows_NT:*)
855 echo x86_64-pc-mks
856 exit ;;
857 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
858 # How do we know it's Interix rather than the generic POSIX subsystem?
859 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
860 # UNAME_MACHINE based on the output of uname instead of i386?
861 echo i586-pc-interix
862 exit ;;
863900 i*:UWIN*:*)
864 echo ${UNAME_MACHINE}-pc-uwin
901 echo "$UNAME_MACHINE"-pc-uwin
865902 exit ;;
866903 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
867 echo x86_64-unknown-cygwin
868 exit ;;
869 p*:CYGWIN*:*)
870 echo powerpcle-unknown-cygwin
904 echo x86_64-pc-cygwin
871905 exit ;;
872906 prep*:SunOS:5.*:*)
873 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
907 echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
874908 exit ;;
875909 *:GNU:*:*)
876910 # the GNU system
877 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
911 echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
878912 exit ;;
879913 *:GNU/*:*:*)
880914 # other systems with GNU libc and userland
881 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
882 exit ;;
883 i*86:Minix:*:*)
884 echo ${UNAME_MACHINE}-pc-minix
915 echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
916 exit ;;
917 *:Minix:*:*)
918 echo "$UNAME_MACHINE"-unknown-minix
885919 exit ;;
886920 aarch64:Linux:*:*)
887 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
921 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
888922 exit ;;
889923 aarch64_be:Linux:*:*)
890924 UNAME_MACHINE=aarch64_be
891 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
925 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
892926 exit ;;
893927 alpha:Linux:*:*)
894 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
928 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
895929 EV5) UNAME_MACHINE=alphaev5 ;;
896930 EV56) UNAME_MACHINE=alphaev56 ;;
897931 PCA56) UNAME_MACHINE=alphapca56 ;;
901935 EV68*) UNAME_MACHINE=alphaev68 ;;
902936 esac
903937 objdump --private-headers /bin/sh | grep -q ld.so.1
904 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
905 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
938 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
939 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
906940 exit ;;
907941 arc:Linux:*:* | arceb:Linux:*:*)
908 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
942 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
909943 exit ;;
910944 arm*:Linux:*:*)
911 eval $set_cc_for_build
945 set_cc_for_build
912946 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
913947 | grep -q __ARM_EABI__
914948 then
915 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
949 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
916950 else
917951 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
918952 | grep -q __ARM_PCS_VFP
919953 then
920 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
954 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
921955 else
922 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
956 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
923957 fi
924958 fi
925959 exit ;;
926960 avr32*:Linux:*:*)
927 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
961 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
928962 exit ;;
929963 cris:Linux:*:*)
930 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
964 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
931965 exit ;;
932966 crisv32:Linux:*:*)
933 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
967 echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
968 exit ;;
969 e2k:Linux:*:*)
970 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
934971 exit ;;
935972 frv:Linux:*:*)
936 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
973 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
937974 exit ;;
938975 hexagon:Linux:*:*)
939 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
976 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
940977 exit ;;
941978 i*86:Linux:*:*)
942 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
979 echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
943980 exit ;;
944981 ia64:Linux:*:*)
945 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
982 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
983 exit ;;
984 k1om:Linux:*:*)
985 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
946986 exit ;;
947987 m32r*:Linux:*:*)
948 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
988 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
949989 exit ;;
950990 m68*:Linux:*:*)
951 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
991 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
952992 exit ;;
953993 mips:Linux:*:* | mips64:Linux:*:*)
954 eval $set_cc_for_build
955 sed 's/^ //' << EOF >$dummy.c
994 set_cc_for_build
995 IS_GLIBC=0
996 test x"${LIBC}" = xgnu && IS_GLIBC=1
997 sed 's/^ //' << EOF > "$dummy.c"
956998 #undef CPU
957 #undef ${UNAME_MACHINE}
958 #undef ${UNAME_MACHINE}el
999 #undef mips
1000 #undef mipsel
1001 #undef mips64
1002 #undef mips64el
1003 #if ${IS_GLIBC} && defined(_ABI64)
1004 LIBCABI=gnuabi64
1005 #else
1006 #if ${IS_GLIBC} && defined(_ABIN32)
1007 LIBCABI=gnuabin32
1008 #else
1009 LIBCABI=${LIBC}
1010 #endif
1011 #endif
1012
1013 #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1014 CPU=mipsisa64r6
1015 #else
1016 #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1017 CPU=mipsisa32r6
1018 #else
1019 #if defined(__mips64)
1020 CPU=mips64
1021 #else
1022 CPU=mips
1023 #endif
1024 #endif
1025 #endif
1026
9591027 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
960 CPU=${UNAME_MACHINE}el
1028 MIPS_ENDIAN=el
9611029 #else
9621030 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
963 CPU=${UNAME_MACHINE}
1031 MIPS_ENDIAN=
9641032 #else
965 CPU=
1033 MIPS_ENDIAN=
9661034 #endif
9671035 #endif
9681036 EOF
969 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
970 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
1037 eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
1038 test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
9711039 ;;
1040 mips64el:Linux:*:*)
1041 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1042 exit ;;
9721043 openrisc*:Linux:*:*)
973 echo or1k-unknown-linux-${LIBC}
1044 echo or1k-unknown-linux-"$LIBC"
9741045 exit ;;
9751046 or32:Linux:*:* | or1k*:Linux:*:*)
976 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1047 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9771048 exit ;;
9781049 padre:Linux:*:*)
979 echo sparc-unknown-linux-${LIBC}
1050 echo sparc-unknown-linux-"$LIBC"
9801051 exit ;;
9811052 parisc64:Linux:*:* | hppa64:Linux:*:*)
982 echo hppa64-unknown-linux-${LIBC}
1053 echo hppa64-unknown-linux-"$LIBC"
9831054 exit ;;
9841055 parisc:Linux:*:* | hppa:Linux:*:*)
9851056 # Look for CPU level
9861057 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
987 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
988 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
989 *) echo hppa-unknown-linux-${LIBC} ;;
1058 PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1059 PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1060 *) echo hppa-unknown-linux-"$LIBC" ;;
9901061 esac
9911062 exit ;;
9921063 ppc64:Linux:*:*)
993 echo powerpc64-unknown-linux-${LIBC}
1064 echo powerpc64-unknown-linux-"$LIBC"
9941065 exit ;;
9951066 ppc:Linux:*:*)
996 echo powerpc-unknown-linux-${LIBC}
1067 echo powerpc-unknown-linux-"$LIBC"
9971068 exit ;;
9981069 ppc64le:Linux:*:*)
999 echo powerpc64le-unknown-linux-${LIBC}
1070 echo powerpc64le-unknown-linux-"$LIBC"
10001071 exit ;;
10011072 ppcle:Linux:*:*)
1002 echo powerpcle-unknown-linux-${LIBC}
1073 echo powerpcle-unknown-linux-"$LIBC"
1074 exit ;;
1075 riscv32:Linux:*:* | riscv64:Linux:*:*)
1076 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10031077 exit ;;
10041078 s390:Linux:*:* | s390x:Linux:*:*)
1005 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
1079 echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
10061080 exit ;;
10071081 sh64*:Linux:*:*)
1008 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1082 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10091083 exit ;;
10101084 sh*:Linux:*:*)
1011 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1085 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10121086 exit ;;
10131087 sparc:Linux:*:* | sparc64:Linux:*:*)
1014 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1088 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10151089 exit ;;
10161090 tile*:Linux:*:*)
1017 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1091 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10181092 exit ;;
10191093 vax:Linux:*:*)
1020 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1094 echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
10211095 exit ;;
10221096 x86_64:Linux:*:*)
1023 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1097 set_cc_for_build
1098 LIBCABI=$LIBC
1099 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1100 if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
1101 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1102 grep IS_X32 >/dev/null
1103 then
1104 LIBCABI="$LIBC"x32
1105 fi
1106 fi
1107 echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
10241108 exit ;;
10251109 xtensa*:Linux:*:*)
1026 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1110 echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10271111 exit ;;
10281112 i*86:DYNIX/ptx:4*:*)
10291113 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10371121 # I am not positive that other SVR4 systems won't match this,
10381122 # I just have to hope. -- rms.
10391123 # Use sysv4.2uw... so that sysv4* matches it.
1040 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1124 echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
10411125 exit ;;
10421126 i*86:OS/2:*:*)
10431127 # If we were able to find `uname', then EMX Unix compatibility
10441128 # is probably installed.
1045 echo ${UNAME_MACHINE}-pc-os2-emx
1129 echo "$UNAME_MACHINE"-pc-os2-emx
10461130 exit ;;
10471131 i*86:XTS-300:*:STOP)
1048 echo ${UNAME_MACHINE}-unknown-stop
1132 echo "$UNAME_MACHINE"-unknown-stop
10491133 exit ;;
10501134 i*86:atheos:*:*)
1051 echo ${UNAME_MACHINE}-unknown-atheos
1135 echo "$UNAME_MACHINE"-unknown-atheos
10521136 exit ;;
10531137 i*86:syllable:*:*)
1054 echo ${UNAME_MACHINE}-pc-syllable
1138 echo "$UNAME_MACHINE"-pc-syllable
10551139 exit ;;
10561140 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1057 echo i386-unknown-lynxos${UNAME_RELEASE}
1141 echo i386-unknown-lynxos"$UNAME_RELEASE"
10581142 exit ;;
10591143 i*86:*DOS:*:*)
1060 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1061 exit ;;
1062 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1063 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1144 echo "$UNAME_MACHINE"-pc-msdosdjgpp
1145 exit ;;
1146 i*86:*:4.*:*)
1147 UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
10641148 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1065 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1149 echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
10661150 else
1067 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1151 echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
10681152 fi
10691153 exit ;;
10701154 i*86:*:5:[678]*)
10741158 *Pentium) UNAME_MACHINE=i586 ;;
10751159 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10761160 esac
1077 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1161 echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
10781162 exit ;;
10791163 i*86:*:3.2:*)
10801164 if test -f /usr/options/cb.name; then
10811165 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1082 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1166 echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
10831167 elif /bin/uname -X 2>/dev/null >/dev/null ; then
10841168 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
10851169 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
10891173 && UNAME_MACHINE=i686
10901174 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
10911175 && UNAME_MACHINE=i686
1092 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1176 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
10931177 else
1094 echo ${UNAME_MACHINE}-pc-sysv32
1178 echo "$UNAME_MACHINE"-pc-sysv32
10951179 fi
10961180 exit ;;
10971181 pc:*:*:*)
10991183 # uname -m prints for DJGPP always 'pc', but it prints nothing about
11001184 # the processor, so we play safe by assuming i586.
11011185 # Note: whatever this is, it MUST be the same as what config.sub
1102 # prints for the "djgpp" host, or else GDB configury will decide that
1186 # prints for the "djgpp" host, or else GDB configure will decide that
11031187 # this is a cross-build.
11041188 echo i586-pc-msdosdjgpp
11051189 exit ;;
11111195 exit ;;
11121196 i860:*:4.*:*) # i860-SVR4
11131197 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1114 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1198 echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
11151199 else # Add other i860-SVR4 vendors below as they are discovered.
1116 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1200 echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
11171201 fi
11181202 exit ;;
11191203 mini*:CTIX:SYS*5:*)
11331217 test -r /etc/.relid \
11341218 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11351219 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1136 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1220 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
11371221 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1138 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1222 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11391223 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11401224 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11411225 && { echo i486-ncr-sysv4; exit; } ;;
11441228 test -r /etc/.relid \
11451229 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11461230 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1147 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1231 && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
11481232 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1149 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1233 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
11501234 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1151 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1235 && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11521236 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1153 echo m68k-unknown-lynxos${UNAME_RELEASE}
1237 echo m68k-unknown-lynxos"$UNAME_RELEASE"
11541238 exit ;;
11551239 mc68030:UNIX_System_V:4.*:*)
11561240 echo m68k-atari-sysv4
11571241 exit ;;
11581242 TSUNAMI:LynxOS:2.*:*)
1159 echo sparc-unknown-lynxos${UNAME_RELEASE}
1243 echo sparc-unknown-lynxos"$UNAME_RELEASE"
11601244 exit ;;
11611245 rs6000:LynxOS:2.*:*)
1162 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1246 echo rs6000-unknown-lynxos"$UNAME_RELEASE"
11631247 exit ;;
11641248 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1165 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1249 echo powerpc-unknown-lynxos"$UNAME_RELEASE"
11661250 exit ;;
11671251 SM[BE]S:UNIX_SV:*:*)
1168 echo mips-dde-sysv${UNAME_RELEASE}
1252 echo mips-dde-sysv"$UNAME_RELEASE"
11691253 exit ;;
11701254 RM*:ReliantUNIX-*:*:*)
11711255 echo mips-sni-sysv4
11761260 *:SINIX-*:*:*)
11771261 if uname -p 2>/dev/null >/dev/null ; then
11781262 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1179 echo ${UNAME_MACHINE}-sni-sysv4
1263 echo "$UNAME_MACHINE"-sni-sysv4
11801264 else
11811265 echo ns32k-sni-sysv
11821266 fi
11961280 exit ;;
11971281 i*86:VOS:*:*)
11981282 # From Paul.Green@stratus.com.
1199 echo ${UNAME_MACHINE}-stratus-vos
1283 echo "$UNAME_MACHINE"-stratus-vos
12001284 exit ;;
12011285 *:VOS:*:*)
12021286 # From Paul.Green@stratus.com.
12031287 echo hppa1.1-stratus-vos
12041288 exit ;;
12051289 mc68*:A/UX:*:*)
1206 echo m68k-apple-aux${UNAME_RELEASE}
1290 echo m68k-apple-aux"$UNAME_RELEASE"
12071291 exit ;;
12081292 news*:NEWS-OS:6*:*)
12091293 echo mips-sony-newsos6
12101294 exit ;;
12111295 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12121296 if [ -d /usr/nec ]; then
1213 echo mips-nec-sysv${UNAME_RELEASE}
1297 echo mips-nec-sysv"$UNAME_RELEASE"
12141298 else
1215 echo mips-unknown-sysv${UNAME_RELEASE}
1299 echo mips-unknown-sysv"$UNAME_RELEASE"
12161300 fi
12171301 exit ;;
12181302 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
12311315 echo x86_64-unknown-haiku
12321316 exit ;;
12331317 SX-4:SUPER-UX:*:*)
1234 echo sx4-nec-superux${UNAME_RELEASE}
1318 echo sx4-nec-superux"$UNAME_RELEASE"
12351319 exit ;;
12361320 SX-5:SUPER-UX:*:*)
1237 echo sx5-nec-superux${UNAME_RELEASE}
1321 echo sx5-nec-superux"$UNAME_RELEASE"
12381322 exit ;;
12391323 SX-6:SUPER-UX:*:*)
1240 echo sx6-nec-superux${UNAME_RELEASE}
1324 echo sx6-nec-superux"$UNAME_RELEASE"
12411325 exit ;;
12421326 SX-7:SUPER-UX:*:*)
1243 echo sx7-nec-superux${UNAME_RELEASE}
1327 echo sx7-nec-superux"$UNAME_RELEASE"
12441328 exit ;;
12451329 SX-8:SUPER-UX:*:*)
1246 echo sx8-nec-superux${UNAME_RELEASE}
1330 echo sx8-nec-superux"$UNAME_RELEASE"
12471331 exit ;;
12481332 SX-8R:SUPER-UX:*:*)
1249 echo sx8r-nec-superux${UNAME_RELEASE}
1333 echo sx8r-nec-superux"$UNAME_RELEASE"
1334 exit ;;
1335 SX-ACE:SUPER-UX:*:*)
1336 echo sxace-nec-superux"$UNAME_RELEASE"
12501337 exit ;;
12511338 Power*:Rhapsody:*:*)
1252 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1339 echo powerpc-apple-rhapsody"$UNAME_RELEASE"
12531340 exit ;;
12541341 *:Rhapsody:*:*)
1255 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1342 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1343 exit ;;
1344 arm64:Darwin:*:*)
1345 echo aarch64-apple-darwin"$UNAME_RELEASE"
12561346 exit ;;
12571347 *:Darwin:*:*)
1258 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1259 eval $set_cc_for_build
1260 if test "$UNAME_PROCESSOR" = unknown ; then
1261 UNAME_PROCESSOR=powerpc
1262 fi
1263 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1264 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1265 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1266 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1267 grep IS_64BIT_ARCH >/dev/null
1268 then
1269 case $UNAME_PROCESSOR in
1270 i386) UNAME_PROCESSOR=x86_64 ;;
1271 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1272 esac
1273 fi
1348 UNAME_PROCESSOR=`uname -p`
1349 case $UNAME_PROCESSOR in
1350 unknown) UNAME_PROCESSOR=powerpc ;;
1351 esac
1352 if command -v xcode-select > /dev/null 2> /dev/null && \
1353 ! xcode-select --print-path > /dev/null 2> /dev/null ; then
1354 # Avoid executing cc if there is no toolchain installed as
1355 # cc will be a stub that puts up a graphical alert
1356 # prompting the user to install developer tools.
1357 CC_FOR_BUILD=no_compiler_found
1358 else
1359 set_cc_for_build
1360 fi
1361 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1362 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1363 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1364 grep IS_64BIT_ARCH >/dev/null
1365 then
1366 case $UNAME_PROCESSOR in
1367 i386) UNAME_PROCESSOR=x86_64 ;;
1368 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1369 esac
1370 fi
1371 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1372 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1373 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1374 grep IS_PPC >/dev/null
1375 then
1376 UNAME_PROCESSOR=powerpc
12741377 fi
12751378 elif test "$UNAME_PROCESSOR" = i386 ; then
1276 # Avoid executing cc on OS X 10.9, as it ships with a stub
1277 # that puts up a graphical alert prompting to install
1278 # developer tools. Any system running Mac OS X 10.7 or
1279 # later (Darwin 11 and later) is required to have a 64-bit
1280 # processor. This is not true of the ARM version of Darwin
1281 # that Apple uses in portable devices.
1282 UNAME_PROCESSOR=x86_64
1283 fi
1284 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1379 # uname -m returns i386 or x86_64
1380 UNAME_PROCESSOR=$UNAME_MACHINE
1381 fi
1382 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
12851383 exit ;;
12861384 *:procnto*:*:* | *:QNX:[0123456789]*:*)
12871385 UNAME_PROCESSOR=`uname -p`
1288 if test "$UNAME_PROCESSOR" = "x86"; then
1386 if test "$UNAME_PROCESSOR" = x86; then
12891387 UNAME_PROCESSOR=i386
12901388 UNAME_MACHINE=pc
12911389 fi
1292 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1390 echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
12931391 exit ;;
12941392 *:QNX:*:4*)
12951393 echo i386-pc-qnx
12961394 exit ;;
1297 NEO-?:NONSTOP_KERNEL:*:*)
1298 echo neo-tandem-nsk${UNAME_RELEASE}
1395 NEO-*:NONSTOP_KERNEL:*:*)
1396 echo neo-tandem-nsk"$UNAME_RELEASE"
12991397 exit ;;
13001398 NSE-*:NONSTOP_KERNEL:*:*)
1301 echo nse-tandem-nsk${UNAME_RELEASE}
1302 exit ;;
1303 NSR-?:NONSTOP_KERNEL:*:*)
1304 echo nsr-tandem-nsk${UNAME_RELEASE}
1399 echo nse-tandem-nsk"$UNAME_RELEASE"
1400 exit ;;
1401 NSR-*:NONSTOP_KERNEL:*:*)
1402 echo nsr-tandem-nsk"$UNAME_RELEASE"
1403 exit ;;
1404 NSV-*:NONSTOP_KERNEL:*:*)
1405 echo nsv-tandem-nsk"$UNAME_RELEASE"
1406 exit ;;
1407 NSX-*:NONSTOP_KERNEL:*:*)
1408 echo nsx-tandem-nsk"$UNAME_RELEASE"
13051409 exit ;;
13061410 *:NonStop-UX:*:*)
13071411 echo mips-compaq-nonstopux
13101414 echo bs2000-siemens-sysv
13111415 exit ;;
13121416 DS/*:UNIX_System_V:*:*)
1313 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1417 echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
13141418 exit ;;
13151419 *:Plan9:*:*)
13161420 # "uname -m" is not consistent, so use $cputype instead. 386
13171421 # is converted to i386 for consistency with other x86
13181422 # operating systems.
1319 if test "$cputype" = "386"; then
1423 # shellcheck disable=SC2154
1424 if test "$cputype" = 386; then
13201425 UNAME_MACHINE=i386
13211426 else
13221427 UNAME_MACHINE="$cputype"
13231428 fi
1324 echo ${UNAME_MACHINE}-unknown-plan9
1429 echo "$UNAME_MACHINE"-unknown-plan9
13251430 exit ;;
13261431 *:TOPS-10:*:*)
13271432 echo pdp10-unknown-tops10
13421447 echo pdp10-unknown-its
13431448 exit ;;
13441449 SEI:*:*:SEIUX)
1345 echo mips-sei-seiux${UNAME_RELEASE}
1450 echo mips-sei-seiux"$UNAME_RELEASE"
13461451 exit ;;
13471452 *:DragonFly:*:*)
1348 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1453 echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
13491454 exit ;;
13501455 *:*VMS:*:*)
13511456 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1352 case "${UNAME_MACHINE}" in
1457 case "$UNAME_MACHINE" in
13531458 A*) echo alpha-dec-vms ; exit ;;
13541459 I*) echo ia64-dec-vms ; exit ;;
13551460 V*) echo vax-dec-vms ; exit ;;
13581463 echo i386-pc-xenix
13591464 exit ;;
13601465 i*86:skyos:*:*)
1361 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1466 echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
13621467 exit ;;
13631468 i*86:rdos:*:*)
1364 echo ${UNAME_MACHINE}-pc-rdos
1469 echo "$UNAME_MACHINE"-pc-rdos
13651470 exit ;;
13661471 i*86:AROS:*:*)
1367 echo ${UNAME_MACHINE}-pc-aros
1472 echo "$UNAME_MACHINE"-pc-aros
13681473 exit ;;
13691474 x86_64:VMkernel:*:*)
1370 echo ${UNAME_MACHINE}-unknown-esx
1475 echo "$UNAME_MACHINE"-unknown-esx
1476 exit ;;
1477 amd64:Isilon\ OneFS:*:*)
1478 echo x86_64-unknown-onefs
1479 exit ;;
1480 *:Unleashed:*:*)
1481 echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
13711482 exit ;;
13721483 esac
13731484
1485 # No uname command or uname output not recognized.
1486 set_cc_for_build
1487 cat > "$dummy.c" <<EOF
1488 #ifdef _SEQUENT_
1489 #include <sys/types.h>
1490 #include <sys/utsname.h>
1491 #endif
1492 #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1493 #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1494 #include <signal.h>
1495 #if defined(_SIZE_T_) || defined(SIGLOST)
1496 #include <sys/utsname.h>
1497 #endif
1498 #endif
1499 #endif
1500 main ()
1501 {
1502 #if defined (sony)
1503 #if defined (MIPSEB)
1504 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1505 I don't know.... */
1506 printf ("mips-sony-bsd\n"); exit (0);
1507 #else
1508 #include <sys/param.h>
1509 printf ("m68k-sony-newsos%s\n",
1510 #ifdef NEWSOS4
1511 "4"
1512 #else
1513 ""
1514 #endif
1515 ); exit (0);
1516 #endif
1517 #endif
1518
1519 #if defined (NeXT)
1520 #if !defined (__ARCHITECTURE__)
1521 #define __ARCHITECTURE__ "m68k"
1522 #endif
1523 int version;
1524 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1525 if (version < 4)
1526 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1527 else
1528 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1529 exit (0);
1530 #endif
1531
1532 #if defined (MULTIMAX) || defined (n16)
1533 #if defined (UMAXV)
1534 printf ("ns32k-encore-sysv\n"); exit (0);
1535 #else
1536 #if defined (CMU)
1537 printf ("ns32k-encore-mach\n"); exit (0);
1538 #else
1539 printf ("ns32k-encore-bsd\n"); exit (0);
1540 #endif
1541 #endif
1542 #endif
1543
1544 #if defined (__386BSD__)
1545 printf ("i386-pc-bsd\n"); exit (0);
1546 #endif
1547
1548 #if defined (sequent)
1549 #if defined (i386)
1550 printf ("i386-sequent-dynix\n"); exit (0);
1551 #endif
1552 #if defined (ns32000)
1553 printf ("ns32k-sequent-dynix\n"); exit (0);
1554 #endif
1555 #endif
1556
1557 #if defined (_SEQUENT_)
1558 struct utsname un;
1559
1560 uname(&un);
1561 if (strncmp(un.version, "V2", 2) == 0) {
1562 printf ("i386-sequent-ptx2\n"); exit (0);
1563 }
1564 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1565 printf ("i386-sequent-ptx1\n"); exit (0);
1566 }
1567 printf ("i386-sequent-ptx\n"); exit (0);
1568 #endif
1569
1570 #if defined (vax)
1571 #if !defined (ultrix)
1572 #include <sys/param.h>
1573 #if defined (BSD)
1574 #if BSD == 43
1575 printf ("vax-dec-bsd4.3\n"); exit (0);
1576 #else
1577 #if BSD == 199006
1578 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1579 #else
1580 printf ("vax-dec-bsd\n"); exit (0);
1581 #endif
1582 #endif
1583 #else
1584 printf ("vax-dec-bsd\n"); exit (0);
1585 #endif
1586 #else
1587 #if defined(_SIZE_T_) || defined(SIGLOST)
1588 struct utsname un;
1589 uname (&un);
1590 printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1591 #else
1592 printf ("vax-dec-ultrix\n"); exit (0);
1593 #endif
1594 #endif
1595 #endif
1596 #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1597 #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1598 #if defined(_SIZE_T_) || defined(SIGLOST)
1599 struct utsname *un;
1600 uname (&un);
1601 printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1602 #else
1603 printf ("mips-dec-ultrix\n"); exit (0);
1604 #endif
1605 #endif
1606 #endif
1607
1608 #if defined (alliant) && defined (i860)
1609 printf ("i860-alliant-bsd\n"); exit (0);
1610 #endif
1611
1612 exit (1);
1613 }
1614 EOF
1615
1616 $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1617 { echo "$SYSTEM_NAME"; exit; }
1618
1619 # Apollos put the system type in the environment.
1620 test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1621
1622 echo "$0: unable to guess system type" >&2
1623
1624 case "$UNAME_MACHINE:$UNAME_SYSTEM" in
1625 mips:Linux | mips64:Linux)
1626 # If we got here on MIPS GNU/Linux, output extra information.
1627 cat >&2 <<EOF
1628
1629 NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1630 the system type. Please install a C compiler and try again.
1631 EOF
1632 ;;
1633 esac
1634
13741635 cat >&2 <<EOF
1375 $0: unable to guess system type
1376
1377 This script, last modified $timestamp, has failed to recognize
1378 the operating system you are using. It is advised that you
1379 download the most up to date version of the config scripts from
1380
1381 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1636
1637 This script (version $timestamp), has failed to recognize the
1638 operating system you are using. If your script is old, overwrite *all*
1639 copies of config.guess and config.sub with the latest versions from:
1640
1641 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
13821642 and
1383 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1384
1385 If the version you run ($0) is already up to date, please
1386 send the following data and any information you think might be
1387 pertinent to <config-patches@gnu.org> in order to provide the needed
1388 information to handle your system.
1643 https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1644 EOF
1645
1646 year=`echo $timestamp | sed 's,-.*,,'`
1647 # shellcheck disable=SC2003
1648 if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
1649 cat >&2 <<EOF
1650
1651 If $0 has already been updated, send the following data and any
1652 information you think might be pertinent to config-patches@gnu.org to
1653 provide the necessary information to handle your system.
13891654
13901655 config.guess timestamp = $timestamp
13911656
14041669 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
14051670 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
14061671
1407 UNAME_MACHINE = ${UNAME_MACHINE}
1408 UNAME_RELEASE = ${UNAME_RELEASE}
1409 UNAME_SYSTEM = ${UNAME_SYSTEM}
1410 UNAME_VERSION = ${UNAME_VERSION}
1672 UNAME_MACHINE = "$UNAME_MACHINE"
1673 UNAME_RELEASE = "$UNAME_RELEASE"
1674 UNAME_SYSTEM = "$UNAME_SYSTEM"
1675 UNAME_VERSION = "$UNAME_VERSION"
14111676 EOF
1677 fi
14121678
14131679 exit 1
14141680
14151681 # Local variables:
1416 # eval: (add-hook 'write-file-hooks 'time-stamp)
1682 # eval: (add-hook 'before-save-hook 'time-stamp)
14171683 # time-stamp-start: "timestamp='"
14181684 # time-stamp-format: "%:y-%02m-%02d"
14191685 # time-stamp-end: "'"
+1542
-1498
config.sub less more
00 #! /bin/sh
11 # Configuration validation subroutine script.
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-12-03'
2 # Copyright 1992-2020 Free Software Foundation, Inc.
3
4 timestamp='2020-07-10'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
1414 # General Public License for more details.
1515 #
1616 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17 # along with this program; if not, see <https://www.gnu.org/licenses/>.
1818 #
1919 # As a special exception to the GNU General Public License, if you
2020 # distribute this file as part of a program that contains a
3232 # Otherwise, we print the canonical config type on stdout and succeed.
3333
3434 # You can get the latest version of this script from:
35 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
35 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
3636
3737 # This file is supposed to be the same for all GNU packages
3838 # and recognize all the CPU types, system types and aliases
5252 me=`echo "$0" | sed -e 's,.*/,,'`
5353
5454 usage="\
55 Usage: $0 [OPTION] CPU-MFR-OPSYS
56 $0 [OPTION] ALIAS
55 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
5756
5857 Canonicalize a configuration name.
5958
60 Operation modes:
59 Options:
6160 -h, --help print this help, then exit
6261 -t, --time-stamp print date of last modification, then exit
6362 -v, --version print version number, then exit
6766 version="\
6867 GNU config.sub ($timestamp)
6968
70 Copyright 1992-2014 Free Software Foundation, Inc.
69 Copyright 1992-2020 Free Software Foundation, Inc.
7170
7271 This is free software; see the source for copying conditions. There is NO
7372 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
8988 - ) # Use stdin as input.
9089 break ;;
9190 -* )
92 echo "$me: invalid option $1$help"
91 echo "$me: invalid option $1$help" >&2
9392 exit 1 ;;
9493
9594 *local*)
9695 # First pass through any local machine types.
97 echo $1
96 echo "$1"
9897 exit ;;
9998
10099 * )
110109 exit 1;;
111110 esac
112111
113 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
114 # Here we must recognize all the valid KERNEL-OS combinations.
115 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
116 case $maybe_os in
117 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
118 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
119 knetbsd*-gnu* | netbsd*-gnu* | \
120 kopensolaris*-gnu* | \
121 storm-chaos* | os2-emx* | rtmk-nova*)
122 os=-$maybe_os
123 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
124 ;;
125 android-linux)
126 os=-linux-android
127 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
128 ;;
129 *)
130 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131 if [ $basic_machine != $1 ]
132 then os=`echo $1 | sed 's/.*-/-/'`
133 else os=; fi
134 ;;
112 # Split fields of configuration type
113 # shellcheck disable=SC2162
114 IFS="-" read field1 field2 field3 field4 <<EOF
115 $1
116 EOF
117
118 # Separate into logical components for further validation
119 case $1 in
120 *-*-*-*-*)
121 echo Invalid configuration \`"$1"\': more than four components >&2
122 exit 1
123 ;;
124 *-*-*-*)
125 basic_machine=$field1-$field2
126 basic_os=$field3-$field4
127 ;;
128 *-*-*)
129 # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
130 # parts
131 maybe_os=$field2-$field3
132 case $maybe_os in
133 nto-qnx* | linux-* | uclinux-uclibc* \
134 | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
135 | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
136 | storm-chaos* | os2-emx* | rtmk-nova*)
137 basic_machine=$field1
138 basic_os=$maybe_os
139 ;;
140 android-linux)
141 basic_machine=$field1-unknown
142 basic_os=linux-android
143 ;;
144 *)
145 basic_machine=$field1-$field2
146 basic_os=$field3
147 ;;
148 esac
149 ;;
150 *-*)
151 # A lone config we happen to match not fitting any pattern
152 case $field1-$field2 in
153 decstation-3100)
154 basic_machine=mips-dec
155 basic_os=
156 ;;
157 *-*)
158 # Second component is usually, but not always the OS
159 case $field2 in
160 # Prevent following clause from handling this valid os
161 sun*os*)
162 basic_machine=$field1
163 basic_os=$field2
164 ;;
165 # Manufacturers
166 dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
167 | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
168 | unicom* | ibm* | next | hp | isi* | apollo | altos* \
169 | convergent* | ncr* | news | 32* | 3600* | 3100* \
170 | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
171 | ultra | tti* | harris | dolphin | highlevel | gould \
172 | cbm | ns | masscomp | apple | axis | knuth | cray \
173 | microblaze* | sim | cisco \
174 | oki | wec | wrs | winbond)
175 basic_machine=$field1-$field2
176 basic_os=
177 ;;
178 *)
179 basic_machine=$field1
180 basic_os=$field2
181 ;;
182 esac
183 ;;
184 esac
185 ;;
186 *)
187 # Convert single-component short-hands not valid as part of
188 # multi-component configurations.
189 case $field1 in
190 386bsd)
191 basic_machine=i386-pc
192 basic_os=bsd
193 ;;
194 a29khif)
195 basic_machine=a29k-amd
196 basic_os=udi
197 ;;
198 adobe68k)
199 basic_machine=m68010-adobe
200 basic_os=scout
201 ;;
202 alliant)
203 basic_machine=fx80-alliant
204 basic_os=
205 ;;
206 altos | altos3068)
207 basic_machine=m68k-altos
208 basic_os=
209 ;;
210 am29k)
211 basic_machine=a29k-none
212 basic_os=bsd
213 ;;
214 amdahl)
215 basic_machine=580-amdahl
216 basic_os=sysv
217 ;;
218 amiga)
219 basic_machine=m68k-unknown
220 basic_os=
221 ;;
222 amigaos | amigados)
223 basic_machine=m68k-unknown
224 basic_os=amigaos
225 ;;
226 amigaunix | amix)
227 basic_machine=m68k-unknown
228 basic_os=sysv4
229 ;;
230 apollo68)
231 basic_machine=m68k-apollo
232 basic_os=sysv
233 ;;
234 apollo68bsd)
235 basic_machine=m68k-apollo
236 basic_os=bsd
237 ;;
238 aros)
239 basic_machine=i386-pc
240 basic_os=aros
241 ;;
242 aux)
243 basic_machine=m68k-apple
244 basic_os=aux
245 ;;
246 balance)
247 basic_machine=ns32k-sequent
248 basic_os=dynix
249 ;;
250 blackfin)
251 basic_machine=bfin-unknown
252 basic_os=linux
253 ;;
254 cegcc)
255 basic_machine=arm-unknown
256 basic_os=cegcc
257 ;;
258 convex-c1)
259 basic_machine=c1-convex
260 basic_os=bsd
261 ;;
262 convex-c2)
263 basic_machine=c2-convex
264 basic_os=bsd
265 ;;
266 convex-c32)
267 basic_machine=c32-convex
268 basic_os=bsd
269 ;;
270 convex-c34)
271 basic_machine=c34-convex
272 basic_os=bsd
273 ;;
274 convex-c38)
275 basic_machine=c38-convex
276 basic_os=bsd
277 ;;
278 cray)
279 basic_machine=j90-cray
280 basic_os=unicos
281 ;;
282 crds | unos)
283 basic_machine=m68k-crds
284 basic_os=
285 ;;
286 da30)
287 basic_machine=m68k-da30
288 basic_os=
289 ;;
290 decstation | pmax | pmin | dec3100 | decstatn)
291 basic_machine=mips-dec
292 basic_os=
293 ;;
294 delta88)
295 basic_machine=m88k-motorola
296 basic_os=sysv3
297 ;;
298 dicos)
299 basic_machine=i686-pc
300 basic_os=dicos
301 ;;
302 djgpp)
303 basic_machine=i586-pc
304 basic_os=msdosdjgpp
305 ;;
306 ebmon29k)
307 basic_machine=a29k-amd
308 basic_os=ebmon
309 ;;
310 es1800 | OSE68k | ose68k | ose | OSE)
311 basic_machine=m68k-ericsson
312 basic_os=ose
313 ;;
314 gmicro)
315 basic_machine=tron-gmicro
316 basic_os=sysv
317 ;;
318 go32)
319 basic_machine=i386-pc
320 basic_os=go32
321 ;;
322 h8300hms)
323 basic_machine=h8300-hitachi
324 basic_os=hms
325 ;;
326 h8300xray)
327 basic_machine=h8300-hitachi
328 basic_os=xray
329 ;;
330 h8500hms)
331 basic_machine=h8500-hitachi
332 basic_os=hms
333 ;;
334 harris)
335 basic_machine=m88k-harris
336 basic_os=sysv3
337 ;;
338 hp300 | hp300hpux)
339 basic_machine=m68k-hp
340 basic_os=hpux
341 ;;
342 hp300bsd)
343 basic_machine=m68k-hp
344 basic_os=bsd
345 ;;
346 hppaosf)
347 basic_machine=hppa1.1-hp
348 basic_os=osf
349 ;;
350 hppro)
351 basic_machine=hppa1.1-hp
352 basic_os=proelf
353 ;;
354 i386mach)
355 basic_machine=i386-mach
356 basic_os=mach
357 ;;
358 isi68 | isi)
359 basic_machine=m68k-isi
360 basic_os=sysv
361 ;;
362 m68knommu)
363 basic_machine=m68k-unknown
364 basic_os=linux
365 ;;
366 magnum | m3230)
367 basic_machine=mips-mips
368 basic_os=sysv
369 ;;
370 merlin)
371 basic_machine=ns32k-utek
372 basic_os=sysv
373 ;;
374 mingw64)
375 basic_machine=x86_64-pc
376 basic_os=mingw64
377 ;;
378 mingw32)
379 basic_machine=i686-pc
380 basic_os=mingw32
381 ;;
382 mingw32ce)
383 basic_machine=arm-unknown
384 basic_os=mingw32ce
385 ;;
386 monitor)
387 basic_machine=m68k-rom68k
388 basic_os=coff
389 ;;
390 morphos)
391 basic_machine=powerpc-unknown
392 basic_os=morphos
393 ;;
394 moxiebox)
395 basic_machine=moxie-unknown
396 basic_os=moxiebox
397 ;;
398 msdos)
399 basic_machine=i386-pc
400 basic_os=msdos
401 ;;
402 msys)
403 basic_machine=i686-pc
404 basic_os=msys
405 ;;
406 mvs)
407 basic_machine=i370-ibm
408 basic_os=mvs
409 ;;
410 nacl)
411 basic_machine=le32-unknown
412 basic_os=nacl
413 ;;
414 ncr3000)
415 basic_machine=i486-ncr
416 basic_os=sysv4
417 ;;
418 netbsd386)
419 basic_machine=i386-pc
420 basic_os=netbsd
421 ;;
422 netwinder)
423 basic_machine=armv4l-rebel
424 basic_os=linux
425 ;;
426 news | news700 | news800 | news900)
427 basic_machine=m68k-sony
428 basic_os=newsos
429 ;;
430 news1000)
431 basic_machine=m68030-sony
432 basic_os=newsos
433 ;;
434 necv70)
435 basic_machine=v70-nec
436 basic_os=sysv
437 ;;
438 nh3000)
439 basic_machine=m68k-harris
440 basic_os=cxux
441 ;;
442 nh[45]000)
443 basic_machine=m88k-harris
444 basic_os=cxux
445 ;;
446 nindy960)
447 basic_machine=i960-intel
448 basic_os=nindy
449 ;;
450 mon960)
451 basic_machine=i960-intel
452 basic_os=mon960
453 ;;
454 nonstopux)
455 basic_machine=mips-compaq
456 basic_os=nonstopux
457 ;;
458 os400)
459 basic_machine=powerpc-ibm
460 basic_os=os400
461 ;;
462 OSE68000 | ose68000)
463 basic_machine=m68000-ericsson
464 basic_os=ose
465 ;;
466 os68k)
467 basic_machine=m68k-none
468 basic_os=os68k
469 ;;
470 paragon)
471 basic_machine=i860-intel
472 basic_os=osf
473 ;;
474 parisc)
475 basic_machine=hppa-unknown
476 basic_os=linux
477 ;;
478 psp)
479 basic_machine=mipsallegrexel-sony
480 basic_os=psp
481 ;;
482 pw32)
483 basic_machine=i586-unknown
484 basic_os=pw32
485 ;;
486 rdos | rdos64)
487 basic_machine=x86_64-pc
488 basic_os=rdos
489 ;;
490 rdos32)
491 basic_machine=i386-pc
492 basic_os=rdos
493 ;;
494 rom68k)
495 basic_machine=m68k-rom68k
496 basic_os=coff
497 ;;
498 sa29200)
499 basic_machine=a29k-amd
500 basic_os=udi
501 ;;
502 sei)
503 basic_machine=mips-sei
504 basic_os=seiux
505 ;;
506 sequent)
507 basic_machine=i386-sequent
508 basic_os=
509 ;;
510 sps7)
511 basic_machine=m68k-bull
512 basic_os=sysv2
513 ;;
514 st2000)
515 basic_machine=m68k-tandem
516 basic_os=
517 ;;
518 stratus)
519 basic_machine=i860-stratus
520 basic_os=sysv4
521 ;;
522 sun2)
523 basic_machine=m68000-sun
524 basic_os=
525 ;;
526 sun2os3)
527 basic_machine=m68000-sun
528 basic_os=sunos3
529 ;;
530 sun2os4)
531 basic_machine=m68000-sun
532 basic_os=sunos4
533 ;;
534 sun3)
535 basic_machine=m68k-sun
536 basic_os=
537 ;;
538 sun3os3)
539 basic_machine=m68k-sun
540 basic_os=sunos3
541 ;;
542 sun3os4)
543 basic_machine=m68k-sun
544 basic_os=sunos4
545 ;;
546 sun4)
547 basic_machine=sparc-sun
548 basic_os=
549 ;;
550 sun4os3)
551 basic_machine=sparc-sun
552 basic_os=sunos3
553 ;;
554 sun4os4)
555 basic_machine=sparc-sun
556 basic_os=sunos4
557 ;;
558 sun4sol2)
559 basic_machine=sparc-sun
560 basic_os=solaris2
561 ;;
562 sun386 | sun386i | roadrunner)
563 basic_machine=i386-sun
564 basic_os=
565 ;;
566 sv1)
567 basic_machine=sv1-cray
568 basic_os=unicos
569 ;;
570 symmetry)
571 basic_machine=i386-sequent
572 basic_os=dynix
573 ;;
574 t3e)
575 basic_machine=alphaev5-cray
576 basic_os=unicos
577 ;;
578 t90)
579 basic_machine=t90-cray
580 basic_os=unicos
581 ;;
582 toad1)
583 basic_machine=pdp10-xkl
584 basic_os=tops20
585 ;;
586 tpf)
587 basic_machine=s390x-ibm
588 basic_os=tpf
589 ;;
590 udi29k)
591 basic_machine=a29k-amd
592 basic_os=udi
593 ;;
594 ultra3)
595 basic_machine=a29k-nyu
596 basic_os=sym1
597 ;;
598 v810 | necv810)
599 basic_machine=v810-nec
600 basic_os=none
601 ;;
602 vaxv)
603 basic_machine=vax-dec
604 basic_os=sysv
605 ;;
606 vms)
607 basic_machine=vax-dec
608 basic_os=vms
609 ;;
610 vsta)
611 basic_machine=i386-pc
612 basic_os=vsta
613 ;;
614 vxworks960)
615 basic_machine=i960-wrs
616 basic_os=vxworks
617 ;;
618 vxworks68)
619 basic_machine=m68k-wrs
620 basic_os=vxworks
621 ;;
622 vxworks29k)
623 basic_machine=a29k-wrs
624 basic_os=vxworks
625 ;;
626 xbox)
627 basic_machine=i686-pc
628 basic_os=mingw32
629 ;;
630 ymp)
631 basic_machine=ymp-cray
632 basic_os=unicos
633 ;;
634 *)
635 basic_machine=$1
636 basic_os=
637 ;;
638 esac
639 ;;
135640 esac
136641
137 ### Let's recognize common machines as not being operating systems so
138 ### that things like config.sub decstation-3100 work. We also
139 ### recognize some manufacturers as not being operating systems, so we
140 ### can provide default operating systems below.
141 case $os in
142 -sun*os*)
143 # Prevent following clause from handling this invalid input.
144 ;;
145 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
146 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
147 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
148 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151 -apple | -axis | -knuth | -cray | -microblaze*)
152 os=
153 basic_machine=$1
154 ;;
155 -bluegene*)
156 os=-cnk
157 ;;
158 -sim | -cisco | -oki | -wec | -winbond)
159 os=
160 basic_machine=$1
161 ;;
162 -scout)
163 ;;
164 -wrs)
165 os=-vxworks
166 basic_machine=$1
167 ;;
168 -chorusos*)
169 os=-chorusos
170 basic_machine=$1
171 ;;
172 -chorusrdb)
173 os=-chorusrdb
174 basic_machine=$1
175 ;;
176 -hiux*)
177 os=-hiuxwe2
178 ;;
179 -sco6)
180 os=-sco5v6
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182 ;;
183 -sco5)
184 os=-sco3.2v5
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186 ;;
187 -sco4)
188 os=-sco3.2v4
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190 ;;
191 -sco3.2.[4-9]*)
192 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco3.2v[4-9]*)
196 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198 ;;
199 -sco5v6*)
200 # Don't forget version if it is 3.2v4 or newer.
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202 ;;
203 -sco*)
204 os=-sco3.2v2
205 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206 ;;
207 -udk*)
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -isc)
211 os=-isc2.2
212 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
213 ;;
214 -clix*)
215 basic_machine=clipper-intergraph
216 ;;
217 -isc*)
218 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219 ;;
220 -lynx*178)
221 os=-lynxos178
222 ;;
223 -lynx*5)
224 os=-lynxos5
225 ;;
226 -lynx*)
227 os=-lynxos
228 ;;
229 -ptx*)
230 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
231 ;;
232 -windowsnt*)
233 os=`echo $os | sed -e 's/windowsnt/winnt/'`
234 ;;
235 -psos*)
236 os=-psos
237 ;;
238 -mint | -mint[0-9]*)
239 basic_machine=m68k-atari
240 os=-mint
241 ;;
242 esac
243
244 # Decode aliases for certain CPU-COMPANY combinations.
642 # Decode 1-component or ad-hoc basic machines
245643 case $basic_machine in
246 # Recognize the basic CPU types without company name.
247 # Some are omitted here because they have special meanings below.
248 1750a | 580 \
249 | a29k \
250 | aarch64 | aarch64_be \
251 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
252 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
253 | am33_2.0 \
254 | arc | arceb \
255 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
256 | avr | avr32 \
257 | be32 | be64 \
258 | bfin \
259 | c4x | c8051 | clipper \
260 | d10v | d30v | dlx | dsp16xx \
261 | epiphany \
262 | fido | fr30 | frv \
263 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
264 | hexagon \
265 | i370 | i860 | i960 | ia64 \
266 | ip2k | iq2000 \
267 | k1om \
268 | le32 | le64 \
269 | lm32 \
270 | m32c | m32r | m32rle | m68000 | m68k | m88k \
271 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
272 | mips | mipsbe | mipseb | mipsel | mipsle \
273 | mips16 \
274 | mips64 | mips64el \
275 | mips64octeon | mips64octeonel \
276 | mips64orion | mips64orionel \
277 | mips64r5900 | mips64r5900el \
278 | mips64vr | mips64vrel \
279 | mips64vr4100 | mips64vr4100el \
280 | mips64vr4300 | mips64vr4300el \
281 | mips64vr5000 | mips64vr5000el \
282 | mips64vr5900 | mips64vr5900el \
283 | mipsisa32 | mipsisa32el \
284 | mipsisa32r2 | mipsisa32r2el \
285 | mipsisa32r6 | mipsisa32r6el \
286 | mipsisa64 | mipsisa64el \
287 | mipsisa64r2 | mipsisa64r2el \
288 | mipsisa64r6 | mipsisa64r6el \
289 | mipsisa64sb1 | mipsisa64sb1el \
290 | mipsisa64sr71k | mipsisa64sr71kel \
291 | mipsr5900 | mipsr5900el \
292 | mipstx39 | mipstx39el \
293 | mn10200 | mn10300 \
294 | moxie \
295 | mt \
296 | msp430 \
297 | nds32 | nds32le | nds32be \
298 | nios | nios2 | nios2eb | nios2el \
299 | ns16k | ns32k \
300 | open8 | or1k | or1knd | or32 \
301 | pdp10 | pdp11 | pj | pjl \
302 | powerpc | powerpc64 | powerpc64le | powerpcle \
303 | pyramid \
304 | riscv32 | riscv64 \
305 | rl78 | rx \
306 | score \
307 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
308 | sh64 | sh64le \
309 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
310 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
311 | spu \
312 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
313 | ubicom32 \
314 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
315 | visium \
316 | we32k \
317 | x86 | xc16x | xstormy16 | xtensa \
318 | z8k | z80)
319 basic_machine=$basic_machine-unknown
320 ;;
321 c54x)
322 basic_machine=tic54x-unknown
323 ;;
324 c55x)
325 basic_machine=tic55x-unknown
326 ;;
327 c6x)
328 basic_machine=tic6x-unknown
644 # Here we handle the default manufacturer of certain CPU types. It is in
645 # some cases the only manufacturer, in others, it is the most popular.
646 w89k)
647 cpu=hppa1.1
648 vendor=winbond
649 ;;
650 op50n)
651 cpu=hppa1.1
652 vendor=oki
653 ;;
654 op60c)
655 cpu=hppa1.1
656 vendor=oki
657 ;;
658 ibm*)
659 cpu=i370
660 vendor=ibm
661 ;;
662 orion105)
663 cpu=clipper
664 vendor=highlevel
665 ;;
666 mac | mpw | mac-mpw)
667 cpu=m68k
668 vendor=apple
669 ;;
670 pmac | pmac-mpw)
671 cpu=powerpc
672 vendor=apple
673 ;;
674
675 # Recognize the various machine names and aliases which stand
676 # for a CPU type and a company and sometimes even an OS.
677 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
678 cpu=m68000
679 vendor=att
680 ;;
681 3b*)
682 cpu=we32k
683 vendor=att
684 ;;
685 bluegene*)
686 cpu=powerpc
687 vendor=ibm
688 basic_os=cnk
689 ;;
690 decsystem10* | dec10*)
691 cpu=pdp10
692 vendor=dec
693 basic_os=tops10
694 ;;
695 decsystem20* | dec20*)
696 cpu=pdp10
697 vendor=dec
698 basic_os=tops20
699 ;;
700 delta | 3300 | motorola-3300 | motorola-delta \
701 | 3300-motorola | delta-motorola)
702 cpu=m68k
703 vendor=motorola
704 ;;
705 dpx2*)
706 cpu=m68k
707 vendor=bull
708 basic_os=sysv3
709 ;;
710 encore | umax | mmax)
711 cpu=ns32k
712 vendor=encore
713 ;;
714 elxsi)
715 cpu=elxsi
716 vendor=elxsi
717 basic_os=${basic_os:-bsd}
718 ;;
719 fx2800)
720 cpu=i860
721 vendor=alliant
722 ;;
723 genix)
724 cpu=ns32k
725 vendor=ns
726 ;;
727 h3050r* | hiux*)
728 cpu=hppa1.1
729 vendor=hitachi
730 basic_os=hiuxwe2
731 ;;
732 hp3k9[0-9][0-9] | hp9[0-9][0-9])
733 cpu=hppa1.0
734 vendor=hp
735 ;;
736 hp9k2[0-9][0-9] | hp9k31[0-9])
737 cpu=m68000
738 vendor=hp
739 ;;
740 hp9k3[2-9][0-9])
741 cpu=m68k
742 vendor=hp
743 ;;
744 hp9k6[0-9][0-9] | hp6[0-9][0-9])
745 cpu=hppa1.0
746 vendor=hp
747 ;;
748 hp9k7[0-79][0-9] | hp7[0-79][0-9])
749 cpu=hppa1.1
750 vendor=hp
751 ;;
752 hp9k78[0-9] | hp78[0-9])
753 # FIXME: really hppa2.0-hp
754 cpu=hppa1.1
755 vendor=hp
756 ;;
757 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
758 # FIXME: really hppa2.0-hp
759 cpu=hppa1.1
760 vendor=hp
761 ;;
762 hp9k8[0-9][13679] | hp8[0-9][13679])
763 cpu=hppa1.1
764 vendor=hp
765 ;;
766 hp9k8[0-9][0-9] | hp8[0-9][0-9])
767 cpu=hppa1.0
768 vendor=hp
769 ;;
770 i*86v32)
771 cpu=`echo "$1" | sed -e 's/86.*/86/'`
772 vendor=pc
773 basic_os=sysv32
774 ;;
775 i*86v4*)
776 cpu=`echo "$1" | sed -e 's/86.*/86/'`
777 vendor=pc
778 basic_os=sysv4
779 ;;
780 i*86v)
781 cpu=`echo "$1" | sed -e 's/86.*/86/'`
782 vendor=pc
783 basic_os=sysv
784 ;;
785 i*86sol2)
786 cpu=`echo "$1" | sed -e 's/86.*/86/'`
787 vendor=pc
788 basic_os=solaris2
789 ;;
790 j90 | j90-cray)
791 cpu=j90
792 vendor=cray
793 basic_os=${basic_os:-unicos}
794 ;;
795 iris | iris4d)
796 cpu=mips
797 vendor=sgi
798 case $basic_os in
799 irix*)
800 ;;
801 *)
802 basic_os=irix4
803 ;;
804 esac
805 ;;
806 miniframe)
807 cpu=m68000
808 vendor=convergent
809 ;;
810 *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
811 cpu=m68k
812 vendor=atari
813 basic_os=mint
814 ;;
815 news-3600 | risc-news)
816 cpu=mips
817 vendor=sony
818 basic_os=newsos
819 ;;
820 next | m*-next)
821 cpu=m68k
822 vendor=next
823 case $basic_os in
824 openstep*)
825 ;;
826 nextstep*)
827 ;;
828 ns2*)
829 basic_os=nextstep2
830 ;;
831 *)
832 basic_os=nextstep3
833 ;;
834 esac
835 ;;
836 np1)
837 cpu=np1
838 vendor=gould
839 ;;
840 op50n-* | op60c-*)
841 cpu=hppa1.1
842 vendor=oki
843 basic_os=proelf
844 ;;
845 pa-hitachi)
846 cpu=hppa1.1
847 vendor=hitachi
848 basic_os=hiuxwe2
849 ;;
850 pbd)
851 cpu=sparc
852 vendor=tti
853 ;;
854 pbb)
855 cpu=m68k
856 vendor=tti
857 ;;
858 pc532)
859 cpu=ns32k
860 vendor=pc532
861 ;;
862 pn)
863 cpu=pn
864 vendor=gould
865 ;;
866 power)
867 cpu=power
868 vendor=ibm
869 ;;
870 ps2)
871 cpu=i386
872 vendor=ibm
873 ;;
874 rm[46]00)
875 cpu=mips
876 vendor=siemens
877 ;;
878 rtpc | rtpc-*)
879 cpu=romp
880 vendor=ibm
881 ;;
882 sde)
883 cpu=mipsisa32
884 vendor=sde
885 basic_os=${basic_os:-elf}
886 ;;
887 simso-wrs)
888 cpu=sparclite
889 vendor=wrs
890 basic_os=vxworks
891 ;;
892 tower | tower-32)
893 cpu=m68k
894 vendor=ncr
895 ;;
896 vpp*|vx|vx-*)
897 cpu=f301
898 vendor=fujitsu
899 ;;
900 w65)
901 cpu=w65
902 vendor=wdc
903 ;;
904 w89k-*)
905 cpu=hppa1.1
906 vendor=winbond
907 basic_os=proelf
908 ;;
909 none)
910 cpu=none
911 vendor=none
329912 ;;
330913 leon|leon[3-9])
331 basic_machine=sparc-$basic_machine
332 ;;
333 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
334 basic_machine=$basic_machine-unknown
335 os=-none
336 ;;
337 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
338 ;;
339 ms1)
340 basic_machine=mt-unknown
341 ;;
342
343 strongarm | thumb | xscale)
344 basic_machine=arm-unknown
345 ;;
346 xgate)
347 basic_machine=$basic_machine-unknown
348 os=-none
349 ;;
350 xscaleeb)
351 basic_machine=armeb-unknown
352 ;;
353
354 xscaleel)
355 basic_machine=armel-unknown
356 ;;
357
914 cpu=sparc
915 vendor=$basic_machine
916 ;;
917 leon-*|leon[3-9]-*)
918 cpu=sparc
919 vendor=`echo "$basic_machine" | sed 's/-.*//'`
920 ;;
921
922 *-*)
923 # shellcheck disable=SC2162
924 IFS="-" read cpu vendor <<EOF
925 $basic_machine
926 EOF
927 ;;
358928 # We use `pc' rather than `unknown'
359929 # because (1) that's what they normally are, and
360930 # (2) the word "unknown" tends to confuse beginning users.
361931 i*86 | x86_64)
362 basic_machine=$basic_machine-pc
363 ;;
364 # Object if more than one company name word.
365 *-*-*)
366 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
367 exit 1
368 ;;
369 # Recognize the basic CPU types with company name.
370 580-* \
371 | a29k-* \
372 | aarch64-* | aarch64_be-* \
373 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
374 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
375 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
376 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
377 | avr-* | avr32-* \
378 | be32-* | be64-* \
379 | bfin-* | bs2000-* \
380 | c[123]* | c30-* | [cjt]90-* | c4x-* \
381 | c8051-* | clipper-* | craynv-* | cydra-* \
382 | d10v-* | d30v-* | dlx-* \
383 | elxsi-* \
384 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
385 | h8300-* | h8500-* \
386 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
387 | hexagon-* \
388 | i*86-* | i860-* | i960-* | ia64-* \
389 | ip2k-* | iq2000-* \
390 | k1om-* \
391 | le32-* | le64-* \
392 | lm32-* \
393 | m32c-* | m32r-* | m32rle-* \
394 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
395 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
396 | microblaze-* | microblazeel-* \
397 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
398 | mips16-* \
399 | mips64-* | mips64el-* \
400 | mips64octeon-* | mips64octeonel-* \
401 | mips64orion-* | mips64orionel-* \
402 | mips64r5900-* | mips64r5900el-* \
403 | mips64vr-* | mips64vrel-* \
404 | mips64vr4100-* | mips64vr4100el-* \
405 | mips64vr4300-* | mips64vr4300el-* \
406 | mips64vr5000-* | mips64vr5000el-* \
407 | mips64vr5900-* | mips64vr5900el-* \
408 | mipsisa32-* | mipsisa32el-* \
409 | mipsisa32r2-* | mipsisa32r2el-* \
410 | mipsisa32r6-* | mipsisa32r6el-* \
411 | mipsisa64-* | mipsisa64el-* \
412 | mipsisa64r2-* | mipsisa64r2el-* \
413 | mipsisa64r6-* | mipsisa64r6el-* \
414 | mipsisa64sb1-* | mipsisa64sb1el-* \
415 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
416 | mipsr5900-* | mipsr5900el-* \
417 | mipstx39-* | mipstx39el-* \
418 | mmix-* \
419 | mt-* \
420 | msp430-* \
421 | nds32-* | nds32le-* | nds32be-* \
422 | nios-* | nios2-* | nios2eb-* | nios2el-* \
423 | none-* | np1-* | ns16k-* | ns32k-* \
424 | open8-* \
425 | or1k*-* \
426 | orion-* \
427 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
428 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
429 | pyramid-* \
430 | rl78-* | romp-* | rs6000-* | rx-* \
431 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
432 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
433 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
434 | sparclite-* \
435 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
436 | tahoe-* \
437 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
438 | tile*-* \
439 | tron-* \
440 | ubicom32-* \
441 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
442 | vax-* \
443 | visium-* \
444 | we32k-* \
445 | x86-* | x86_64-* | xc16x-* | xps100-* \
446 | xstormy16-* | xtensa*-* \
447 | ymp-* \
448 | z8k-* | z80-*)
449 ;;
450 # Recognize the basic CPU types without company name, with glob match.
451 xtensa*)
452 basic_machine=$basic_machine-unknown
453 ;;
454 # Recognize the various machine names and aliases which stand
455 # for a CPU type and a company and sometimes even an OS.
456 386bsd)
457 basic_machine=i386-unknown
458 os=-bsd
459 ;;
460 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
461 basic_machine=m68000-att
462 ;;
463 3b*)
464 basic_machine=we32k-att
465 ;;
466 a29khif)
467 basic_machine=a29k-amd
468 os=-udi
469 ;;
470 abacus)
471 basic_machine=abacus-unknown
472 ;;
473 adobe68k)
474 basic_machine=m68010-adobe
475 os=-scout
476 ;;
477 alliant | fx80)
478 basic_machine=fx80-alliant
479 ;;
480 altos | altos3068)
481 basic_machine=m68k-altos
482 ;;
483 am29k)
484 basic_machine=a29k-none
485 os=-bsd
486 ;;
487 amd64)
488 basic_machine=x86_64-pc
489 ;;
932 cpu=$basic_machine
933 vendor=pc
934 ;;
935 # These rules are duplicated from below for sake of the special case above;
936 # i.e. things that normalized to x86 arches should also default to "pc"
937 pc98)
938 cpu=i386
939 vendor=pc
940 ;;
941 x64 | amd64)
942 cpu=x86_64
943 vendor=pc
944 ;;
945 # Recognize the basic CPU types without company name.
946 *)
947 cpu=$basic_machine
948 vendor=unknown
949 ;;
950 esac
951
952 unset -v basic_machine
953
954 # Decode basic machines in the full and proper CPU-Company form.
955 case $cpu-$vendor in
956 # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
957 # some cases the only manufacturer, in others, it is the most popular.
958 craynv-unknown)
959 vendor=cray
960 basic_os=${basic_os:-unicosmp}
961 ;;
962 c90-unknown | c90-cray)
963 vendor=cray
964 basic_os=${Basic_os:-unicos}
965 ;;
966 fx80-unknown)
967 vendor=alliant
968 ;;
969 romp-unknown)
970 vendor=ibm
971 ;;
972 mmix-unknown)
973 vendor=knuth
974 ;;
975 microblaze-unknown | microblazeel-unknown)
976 vendor=xilinx
977 ;;
978 rs6000-unknown)
979 vendor=ibm
980 ;;
981 vax-unknown)
982 vendor=dec
983 ;;
984 pdp11-unknown)
985 vendor=dec
986 ;;
987 we32k-unknown)
988 vendor=att
989 ;;
990 cydra-unknown)
991 vendor=cydrome
992 ;;
993 i370-ibm*)
994 vendor=ibm
995 ;;
996 orion-unknown)
997 vendor=highlevel
998 ;;
999 xps-unknown | xps100-unknown)
1000 cpu=xps100
1001 vendor=honeywell
1002 ;;
1003
1004 # Here we normalize CPU types with a missing or matching vendor
1005 dpx20-unknown | dpx20-bull)
1006 cpu=rs6000
1007 vendor=bull
1008 basic_os=${basic_os:-bosx}
1009 ;;
1010
1011 # Here we normalize CPU types irrespective of the vendor
4901012 amd64-*)
491 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
492 ;;
493 amdahl)
494 basic_machine=580-amdahl
495 os=-sysv
496 ;;
497 amiga | amiga-*)
498 basic_machine=m68k-unknown
499 ;;
500 amigaos | amigados)
501 basic_machine=m68k-unknown
502 os=-amigaos
503 ;;
504 amigaunix | amix)
505 basic_machine=m68k-unknown
506 os=-sysv4
507 ;;
508 apollo68)
509 basic_machine=m68k-apollo
510 os=-sysv
511 ;;
512 apollo68bsd)
513 basic_machine=m68k-apollo
514 os=-bsd
515 ;;
516 aros)
517 basic_machine=i386-pc
518 os=-aros
519 ;;
520 aux)
521 basic_machine=m68k-apple
522 os=-aux
523 ;;
524 balance)
525 basic_machine=ns32k-sequent
526 os=-dynix
527 ;;
528 blackfin)
529 basic_machine=bfin-unknown
530 os=-linux
1013 cpu=x86_64
5311014 ;;
5321015 blackfin-*)
533 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
534 os=-linux
1016 cpu=bfin
1017 basic_os=linux
1018 ;;
1019 c54x-*)
1020 cpu=tic54x
1021 ;;
1022 c55x-*)
1023 cpu=tic55x
1024 ;;
1025 c6x-*)
1026 cpu=tic6x
1027 ;;
1028 e500v[12]-*)
1029 cpu=powerpc
1030 basic_os=${basic_os}"spe"
1031 ;;
1032 mips3*-*)
1033 cpu=mips64
1034 ;;
1035 ms1-*)
1036 cpu=mt
1037 ;;
1038 m68knommu-*)
1039 cpu=m68k
1040 basic_os=linux
1041 ;;
1042 m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
1043 cpu=s12z
1044 ;;
1045 openrisc-*)
1046 cpu=or32
1047 ;;
1048 parisc-*)
1049 cpu=hppa
1050 basic_os=linux
1051 ;;
1052 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1053 cpu=i586
1054 ;;
1055 pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
1056 cpu=i686
1057 ;;
1058 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1059 cpu=i686
1060 ;;
1061 pentium4-*)
1062 cpu=i786
1063 ;;
1064 pc98-*)
1065 cpu=i386
1066 ;;
1067 ppc-* | ppcbe-*)
1068 cpu=powerpc
1069 ;;
1070 ppcle-* | powerpclittle-*)
1071 cpu=powerpcle
1072 ;;
1073 ppc64-*)
1074 cpu=powerpc64
1075 ;;
1076 ppc64le-* | powerpc64little-*)
1077 cpu=powerpc64le
1078 ;;
1079 sb1-*)
1080 cpu=mipsisa64sb1
1081 ;;
1082 sb1el-*)
1083 cpu=mipsisa64sb1el
1084 ;;
1085 sh5e[lb]-*)
1086 cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
1087 ;;
1088 spur-*)
1089 cpu=spur
1090 ;;
1091 strongarm-* | thumb-*)
1092 cpu=arm
1093 ;;
1094 tx39-*)
1095 cpu=mipstx39
1096 ;;
1097 tx39el-*)
1098 cpu=mipstx39el
1099 ;;
1100 x64-*)
1101 cpu=x86_64
1102 ;;
1103 xscale-* | xscalee[bl]-*)
1104 cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
1105 ;;
1106 arm64-*)
1107 cpu=aarch64
1108 ;;
1109
1110 # Recognize the canonical CPU Types that limit and/or modify the
1111 # company names they are paired with.
1112 cr16-*)
1113 basic_os=${basic_os:-elf}
1114 ;;
1115 crisv32-* | etraxfs*-*)
1116 cpu=crisv32
1117 vendor=axis
1118 ;;
1119 cris-* | etrax*-*)
1120 cpu=cris
1121 vendor=axis
1122 ;;
1123 crx-*)
1124 basic_os=${basic_os:-elf}
1125 ;;
1126 neo-tandem)
1127 cpu=neo
1128 vendor=tandem
1129 ;;
1130 nse-tandem)
1131 cpu=nse
1132 vendor=tandem
1133 ;;
1134 nsr-tandem)
1135 cpu=nsr
1136 vendor=tandem
1137 ;;
1138 nsv-tandem)
1139 cpu=nsv
1140 vendor=tandem
1141 ;;
1142 nsx-tandem)
1143 cpu=nsx
1144 vendor=tandem
1145 ;;
1146 mipsallegrexel-sony)
1147 cpu=mipsallegrexel
1148 vendor=sony
1149 ;;
1150 tile*-*)
1151 basic_os=${basic_os:-linux-gnu}
1152 ;;
1153
1154 *)
1155 # Recognize the canonical CPU types that are allowed with any
1156 # company name.
1157 case $cpu in
1158 1750a | 580 \
1159 | a29k \
1160 | aarch64 | aarch64_be \
1161 | abacus \
1162 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
1163 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
1164 | alphapca5[67] | alpha64pca5[67] \
1165 | am33_2.0 \
1166 | amdgcn \
1167 | arc | arceb \
1168 | arm | arm[lb]e | arme[lb] | armv* \
1169 | avr | avr32 \
1170 | asmjs \
1171 | ba \
1172 | be32 | be64 \
1173 | bfin | bpf | bs2000 \
1174 | c[123]* | c30 | [cjt]90 | c4x \
1175 | c8051 | clipper | craynv | csky | cydra \
1176 | d10v | d30v | dlx | dsp16xx \
1177 | e2k | elxsi | epiphany \
1178 | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
1179 | h8300 | h8500 \
1180 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1181 | hexagon \
1182 | i370 | i*86 | i860 | i960 | ia16 | ia64 \
1183 | ip2k | iq2000 \
1184 | k1om \
1185 | le32 | le64 \
1186 | lm32 \
1187 | m32c | m32r | m32rle \
1188 | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
1189 | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
1190 | m88110 | m88k | maxq | mb | mcore | mep | metag \
1191 | microblaze | microblazeel \
1192 | mips | mipsbe | mipseb | mipsel | mipsle \
1193 | mips16 \
1194 | mips64 | mips64eb | mips64el \
1195 | mips64octeon | mips64octeonel \
1196 | mips64orion | mips64orionel \
1197 | mips64r5900 | mips64r5900el \
1198 | mips64vr | mips64vrel \
1199 | mips64vr4100 | mips64vr4100el \
1200 | mips64vr4300 | mips64vr4300el \
1201 | mips64vr5000 | mips64vr5000el \
1202 | mips64vr5900 | mips64vr5900el \
1203 | mipsisa32 | mipsisa32el \
1204 | mipsisa32r2 | mipsisa32r2el \
1205 | mipsisa32r6 | mipsisa32r6el \
1206 | mipsisa64 | mipsisa64el \
1207 | mipsisa64r2 | mipsisa64r2el \
1208 | mipsisa64r6 | mipsisa64r6el \
1209 | mipsisa64sb1 | mipsisa64sb1el \
1210 | mipsisa64sr71k | mipsisa64sr71kel \
1211 | mipsr5900 | mipsr5900el \
1212 | mipstx39 | mipstx39el \
1213 | mmix \
1214 | mn10200 | mn10300 \
1215 | moxie \
1216 | mt \
1217 | msp430 \
1218 | nds32 | nds32le | nds32be \
1219 | nfp \
1220 | nios | nios2 | nios2eb | nios2el \
1221 | none | np1 | ns16k | ns32k | nvptx \
1222 | open8 \
1223 | or1k* \
1224 | or32 \
1225 | orion \
1226 | picochip \
1227 | pdp10 | pdp11 | pj | pjl | pn | power \
1228 | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
1229 | pru \
1230 | pyramid \
1231 | riscv | riscv32 | riscv64 \
1232 | rl78 | romp | rs6000 | rx \
1233 | s390 | s390x \
1234 | score \
1235 | sh | shl \
1236 | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
1237 | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
1238 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
1239 | sparclite \
1240 | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
1241 | spu \
1242 | tahoe \
1243 | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
1244 | tron \
1245 | ubicom32 \
1246 | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
1247 | vax \
1248 | visium \
1249 | w65 \
1250 | wasm32 | wasm64 \
1251 | we32k \
1252 | x86 | x86_64 | xc16x | xgate | xps100 \
1253 | xstormy16 | xtensa* \
1254 | ymp \
1255 | z8k | z80)
1256 ;;
1257
1258 *)
1259 echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
1260 exit 1
1261 ;;
1262 esac
1263 ;;
1264 esac
1265
1266 # Here we canonicalize certain aliases for manufacturers.
1267 case $vendor in
1268 digital*)
1269 vendor=dec
1270 ;;
1271 commodore*)
1272 vendor=cbm
1273 ;;
1274 *)
1275 ;;
1276 esac
1277
1278 # Decode manufacturer-specific aliases for certain operating systems.
1279
1280 if [ x$basic_os != x ]
1281 then
1282
1283 # First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
1284 # set os.
1285 case $basic_os in
1286 gnu/linux*)
1287 kernel=linux
1288 os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'`
1289 ;;
1290 nto-qnx*)
1291 kernel=nto
1292 os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'`
1293 ;;
1294 *-*)
1295 # shellcheck disable=SC2162
1296 IFS="-" read kernel os <<EOF
1297 $basic_os
1298 EOF
1299 ;;
1300 # Default OS when just kernel was specified
1301 nto*)
1302 kernel=nto
1303 os=`echo $basic_os | sed -e 's|nto|qnx|'`
1304 ;;
1305 linux*)
1306 kernel=linux
1307 os=`echo $basic_os | sed -e 's|linux|gnu|'`
1308 ;;
1309 *)
1310 kernel=
1311 os=$basic_os
1312 ;;
1313 esac
1314
1315 # Now, normalize the OS (knowing we just have one component, it's not a kernel,
1316 # etc.)
1317 case $os in
1318 # First match some system type aliases that might get confused
1319 # with valid system types.
1320 # solaris* is a basic system type, with this one exception.
1321 auroraux)
1322 os=auroraux
5351323 ;;
5361324 bluegene*)
537 basic_machine=powerpc-ibm
538 os=-cnk
539 ;;
540 c54x-*)
541 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
542 ;;
543 c55x-*)
544 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
545 ;;
546 c6x-*)
547 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
548 ;;
549 c90)
550 basic_machine=c90-cray
551 os=-unicos
552 ;;
553 cegcc)
554 basic_machine=arm-unknown
555 os=-cegcc
556 ;;
557 convex-c1)
558 basic_machine=c1-convex
559 os=-bsd
560 ;;
561 convex-c2)
562 basic_machine=c2-convex
563 os=-bsd
564 ;;
565 convex-c32)
566 basic_machine=c32-convex
567 os=-bsd
568 ;;
569 convex-c34)
570 basic_machine=c34-convex
571 os=-bsd
572 ;;
573 convex-c38)
574 basic_machine=c38-convex
575 os=-bsd
576 ;;
577 cray | j90)
578 basic_machine=j90-cray
579 os=-unicos
580 ;;
581 craynv)
582 basic_machine=craynv-cray
583 os=-unicosmp
584 ;;
585 cr16 | cr16-*)
586 basic_machine=cr16-unknown
587 os=-elf
588 ;;
589 crds | unos)
590 basic_machine=m68k-crds
591 ;;
592 crisv32 | crisv32-* | etraxfs*)
593 basic_machine=crisv32-axis
594 ;;
595 cris | cris-* | etrax*)
596 basic_machine=cris-axis
597 ;;
598 crx)
599 basic_machine=crx-unknown
600 os=-elf
601 ;;
602 da30 | da30-*)
603 basic_machine=m68k-da30
604 ;;
605 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
606 basic_machine=mips-dec
607 ;;
608 decsystem10* | dec10*)
609 basic_machine=pdp10-dec
610 os=-tops10
611 ;;
612 decsystem20* | dec20*)
613 basic_machine=pdp10-dec
614 os=-tops20
615 ;;
616 delta | 3300 | motorola-3300 | motorola-delta \
617 | 3300-motorola | delta-motorola)
618 basic_machine=m68k-motorola
619 ;;
620 delta88)
621 basic_machine=m88k-motorola
622 os=-sysv3
623 ;;
624 dicos)
625 basic_machine=i686-pc
626 os=-dicos
627 ;;
628 djgpp)
629 basic_machine=i586-pc
630 os=-msdosdjgpp
631 ;;
632 dpx20 | dpx20-*)
633 basic_machine=rs6000-bull
634 os=-bosx
635 ;;
636 dpx2* | dpx2*-bull)
637 basic_machine=m68k-bull
638 os=-sysv3
639 ;;
640 ebmon29k)
641 basic_machine=a29k-amd
642 os=-ebmon
643 ;;
644 elxsi)
645 basic_machine=elxsi-elxsi
646 os=-bsd
647 ;;
648 encore | umax | mmax)
649 basic_machine=ns32k-encore
650 ;;
651 es1800 | OSE68k | ose68k | ose | OSE)
652 basic_machine=m68k-ericsson
653 os=-ose
654 ;;
655 fx2800)
656 basic_machine=i860-alliant
657 ;;
658 genix)
659 basic_machine=ns32k-ns
660 ;;
661 gmicro)
662 basic_machine=tron-gmicro
663 os=-sysv
664 ;;
665 go32)
666 basic_machine=i386-pc
667 os=-go32
668 ;;
669 h3050r* | hiux*)
670 basic_machine=hppa1.1-hitachi
671 os=-hiuxwe2
672 ;;
673 h8300hms)
674 basic_machine=h8300-hitachi
675 os=-hms
676 ;;
677 h8300xray)
678 basic_machine=h8300-hitachi
679 os=-xray
680 ;;
681 h8500hms)
682 basic_machine=h8500-hitachi
683 os=-hms
684 ;;
685 harris)
686 basic_machine=m88k-harris
687 os=-sysv3
688 ;;
689 hp300-*)
690 basic_machine=m68k-hp
691 ;;
692 hp300bsd)
693 basic_machine=m68k-hp
694 os=-bsd
695 ;;
696 hp300hpux)
697 basic_machine=m68k-hp
698 os=-hpux
699 ;;
700 hp3k9[0-9][0-9] | hp9[0-9][0-9])
701 basic_machine=hppa1.0-hp
702 ;;
703 hp9k2[0-9][0-9] | hp9k31[0-9])
704 basic_machine=m68000-hp
705 ;;
706 hp9k3[2-9][0-9])
707 basic_machine=m68k-hp
708 ;;
709 hp9k6[0-9][0-9] | hp6[0-9][0-9])
710 basic_machine=hppa1.0-hp
711 ;;
712 hp9k7[0-79][0-9] | hp7[0-79][0-9])
713 basic_machine=hppa1.1-hp
714 ;;
715 hp9k78[0-9] | hp78[0-9])
716 # FIXME: really hppa2.0-hp
717 basic_machine=hppa1.1-hp
718 ;;
719 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
720 # FIXME: really hppa2.0-hp
721 basic_machine=hppa1.1-hp
722 ;;
723 hp9k8[0-9][13679] | hp8[0-9][13679])
724 basic_machine=hppa1.1-hp
725 ;;
726 hp9k8[0-9][0-9] | hp8[0-9][0-9])
727 basic_machine=hppa1.0-hp
728 ;;
729 hppa-next)
730 os=-nextstep3
731 ;;
732 hppaosf)
733 basic_machine=hppa1.1-hp
734 os=-osf
735 ;;
736 hppro)
737 basic_machine=hppa1.1-hp
738 os=-proelf
739 ;;
740 i370-ibm* | ibm*)
741 basic_machine=i370-ibm
742 ;;
743 i*86v32)
744 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
745 os=-sysv32
746 ;;
747 i*86v4*)
748 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
749 os=-sysv4
750 ;;
751 i*86v)
752 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
753 os=-sysv
754 ;;
755 i*86sol2)
756 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
757 os=-solaris2
758 ;;
759 i386mach)
760 basic_machine=i386-mach
761 os=-mach
762 ;;
763 i386-vsta | vsta)
764 basic_machine=i386-unknown
765 os=-vsta
766 ;;
767 iris | iris4d)
768 basic_machine=mips-sgi
769 case $os in
770 -irix*)
1325 os=cnk
1326 ;;
1327 solaris1 | solaris1.*)
1328 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1329 ;;
1330 solaris)
1331 os=solaris2
1332 ;;
1333 unixware*)
1334 os=sysv4.2uw
1335 ;;
1336 # es1800 is here to avoid being matched by es* (a different OS)
1337 es1800*)
1338 os=ose
1339 ;;
1340 # Some version numbers need modification
1341 chorusos*)
1342 os=chorusos
1343 ;;
1344 isc)
1345 os=isc2.2
1346 ;;
1347 sco6)
1348 os=sco5v6
1349 ;;
1350 sco5)
1351 os=sco3.2v5
1352 ;;
1353 sco4)
1354 os=sco3.2v4
1355 ;;
1356 sco3.2.[4-9]*)
1357 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1358 ;;
1359 sco*v* | scout)
1360 # Don't match below
1361 ;;
1362 sco*)
1363 os=sco3.2v2
1364 ;;
1365 psos*)
1366 os=psos
1367 ;;
1368 qnx*)
1369 case $cpu in
1370 x86 | i*86)
7711371 ;;
7721372 *)
773 os=-irix4
1373 os=nto-$os
7741374 ;;
7751375 esac
7761376 ;;
777 isi68 | isi)
778 basic_machine=m68k-isi
779 os=-sysv
780 ;;
781 leon-*|leon[3-9]-*)
782 basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
783 ;;
784 m68knommu)
785 basic_machine=m68k-unknown
786 os=-linux
787 ;;
788 m68knommu-*)
789 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
790 os=-linux
791 ;;
792 m88k-omron*)
793 basic_machine=m88k-omron
794 ;;
795 magnum | m3230)
796 basic_machine=mips-mips
797 os=-sysv
798 ;;
799 merlin)
800 basic_machine=ns32k-utek
801 os=-sysv
802 ;;
803 microblaze*)
804 basic_machine=microblaze-xilinx
805 ;;
806 mingw64)
807 basic_machine=x86_64-pc
808 os=-mingw64
809 ;;
810 mingw32)
811 basic_machine=i686-pc
812 os=-mingw32
813 ;;
814 mingw32ce)
815 basic_machine=arm-unknown
816 os=-mingw32ce
817 ;;
818 miniframe)
819 basic_machine=m68000-convergent
820 ;;
821 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
822 basic_machine=m68k-atari
823 os=-mint
824 ;;
825 mips3*-*)
826 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
827 ;;
828 mips3*)
829 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
830 ;;
831 monitor)
832 basic_machine=m68k-rom68k
833 os=-coff
834 ;;
835 morphos)
836 basic_machine=powerpc-unknown
837 os=-morphos
838 ;;
839 moxiebox)
840 basic_machine=moxie-unknown
841 os=-moxiebox
842 ;;
843 msdos)
844 basic_machine=i386-pc
845 os=-msdos
846 ;;
847 ms1-*)
848 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
849 ;;
850 msys)
851 basic_machine=i686-pc
852 os=-msys
853 ;;
854 mvs)
855 basic_machine=i370-ibm
856 os=-mvs
857 ;;
858 nacl)
859 basic_machine=le32-unknown
860 os=-nacl
861 ;;
862 ncr3000)
863 basic_machine=i486-ncr
864 os=-sysv4
865 ;;
866 netbsd386)
867 basic_machine=i386-unknown
868 os=-netbsd
869 ;;
870 netwinder)
871 basic_machine=armv4l-rebel
872 os=-linux
873 ;;
874 news | news700 | news800 | news900)
875 basic_machine=m68k-sony
876 os=-newsos
877 ;;
878 news1000)
879 basic_machine=m68030-sony
880 os=-newsos
881 ;;
882 news-3600 | risc-news)
883 basic_machine=mips-sony
884 os=-newsos
885 ;;
886 necv70)
887 basic_machine=v70-nec
888 os=-sysv
889 ;;
890 next | m*-next )
891 basic_machine=m68k-next
892 case $os in
893 -nextstep* )
894 ;;
895 -ns2*)
896 os=-nextstep2
1377 hiux*)
1378 os=hiuxwe2
1379 ;;
1380 lynx*178)
1381 os=lynxos178
1382 ;;
1383 lynx*5)
1384 os=lynxos5
1385 ;;
1386 lynxos*)
1387 # don't get caught up in next wildcard
1388 ;;
1389 lynx*)
1390 os=lynxos
1391 ;;
1392 mac[0-9]*)
1393 os=`echo "$os" | sed -e 's|mac|macos|'`
1394 ;;
1395 opened*)
1396 os=openedition
1397 ;;
1398 os400*)
1399 os=os400
1400 ;;
1401 sunos5*)
1402 os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1403 ;;
1404 sunos6*)
1405 os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1406 ;;
1407 wince*)
1408 os=wince
1409 ;;
1410 utek*)
1411 os=bsd
1412 ;;
1413 dynix*)
1414 os=bsd
1415 ;;
1416 acis*)
1417 os=aos
1418 ;;
1419 atheos*)
1420 os=atheos
1421 ;;
1422 syllable*)
1423 os=syllable
1424 ;;
1425 386bsd)
1426 os=bsd
1427 ;;
1428 ctix* | uts*)
1429 os=sysv
1430 ;;
1431 nova*)
1432 os=rtmk-nova
1433 ;;
1434 ns2)
1435 os=nextstep2
1436 ;;
1437 # Preserve the version number of sinix5.
1438 sinix5.*)
1439 os=`echo $os | sed -e 's|sinix|sysv|'`
1440 ;;
1441 sinix*)
1442 os=sysv4
1443 ;;
1444 tpf*)
1445 os=tpf
1446 ;;
1447 triton*)
1448 os=sysv3
1449 ;;
1450 oss*)
1451 os=sysv3
1452 ;;
1453 svr4*)
1454 os=sysv4
1455 ;;
1456 svr3)
1457 os=sysv3
1458 ;;
1459 sysvr4)
1460 os=sysv4
1461 ;;
1462 ose*)
1463 os=ose
1464 ;;
1465 *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1466 os=mint
1467 ;;
1468 dicos*)
1469 os=dicos
1470 ;;
1471 pikeos*)
1472 # Until real need of OS specific support for
1473 # particular features comes up, bare metal
1474 # configurations are quite functional.
1475 case $cpu in
1476 arm*)
1477 os=eabi
8971478 ;;
8981479 *)
899 os=-nextstep3
1480 os=elf
9001481 ;;
9011482 esac
9021483 ;;
903 nh3000)
904 basic_machine=m68k-harris
905 os=-cxux
906 ;;
907 nh[45]000)
908 basic_machine=m88k-harris
909 os=-cxux
910 ;;
911 nindy960)
912 basic_machine=i960-intel
913 os=-nindy
914 ;;
915 mon960)
916 basic_machine=i960-intel
917 os=-mon960
918 ;;
919 nonstopux)
920 basic_machine=mips-compaq
921 os=-nonstopux
922 ;;
923 np1)
924 basic_machine=np1-gould
925 ;;
926 neo-tandem)
927 basic_machine=neo-tandem
928 ;;
929 nse-tandem)
930 basic_machine=nse-tandem
931 ;;
932 nsr-tandem)
933 basic_machine=nsr-tandem
934 ;;
935 op50n-* | op60c-*)
936 basic_machine=hppa1.1-oki
937 os=-proelf
938 ;;
939 openrisc | openrisc-*)
940 basic_machine=or32-unknown
941 ;;
942 os400)
943 basic_machine=powerpc-ibm
944 os=-os400
945 ;;
946 OSE68000 | ose68000)
947 basic_machine=m68000-ericsson
948 os=-ose
949 ;;
950 os68k)
951 basic_machine=m68k-none
952 os=-os68k
953 ;;
954 pa-hitachi)
955 basic_machine=hppa1.1-hitachi
956 os=-hiuxwe2
957 ;;
958 paragon)
959 basic_machine=i860-intel
960 os=-osf
961 ;;
962 parisc)
963 basic_machine=hppa-unknown
964 os=-linux
965 ;;
966 parisc-*)
967 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
968 os=-linux
969 ;;
970 pbd)
971 basic_machine=sparc-tti
972 ;;
973 pbb)
974 basic_machine=m68k-tti
975 ;;
976 pc532 | pc532-*)
977 basic_machine=ns32k-pc532
978 ;;
979 pc98)
980 basic_machine=i386-pc
981 ;;
982 pc98-*)
983 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
984 ;;
985 pentium | p5 | k5 | k6 | nexgen | viac3)
986 basic_machine=i586-pc
987 ;;
988 pentiumpro | p6 | 6x86 | athlon | athlon_*)
989 basic_machine=i686-pc
990 ;;
991 pentiumii | pentium2 | pentiumiii | pentium3)
992 basic_machine=i686-pc
993 ;;
994 pentium4)
995 basic_machine=i786-pc
996 ;;
997 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
998 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
999 ;;
1000 pentiumpro-* | p6-* | 6x86-* | athlon-*)
1001 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1002 ;;
1003 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1004 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1005 ;;
1006 pentium4-*)
1007 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
1008 ;;
1009 pn)
1010 basic_machine=pn-gould
1011 ;;
1012 power) basic_machine=power-ibm
1013 ;;
1014 ppc | ppcbe) basic_machine=powerpc-unknown
1015 ;;
1016 ppc-* | ppcbe-*)
1017 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
1018 ;;
1019 ppcle | powerpclittle | ppc-le | powerpc-little)
1020 basic_machine=powerpcle-unknown
1021 ;;
1022 ppcle-* | powerpclittle-*)
1023 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
1024 ;;
1025 ppc64) basic_machine=powerpc64-unknown
1026 ;;
1027 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
1028 ;;
1029 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
1030 basic_machine=powerpc64le-unknown
1031 ;;
1032 ppc64le-* | powerpc64little-*)
1033 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
1034 ;;
1035 ps2)
1036 basic_machine=i386-ibm
1037 ;;
1038 pw32)
1039 basic_machine=i586-unknown
1040 os=-pw32
1041 ;;
1042 rdos | rdos64)
1043 basic_machine=x86_64-pc
1044 os=-rdos
1045 ;;
1046 rdos32)
1047 basic_machine=i386-pc
1048 os=-rdos
1049 ;;
1050 rom68k)
1051 basic_machine=m68k-rom68k
1052 os=-coff
1053 ;;
1054 rm[46]00)
1055 basic_machine=mips-siemens
1056 ;;
1057 rtpc | rtpc-*)
1058 basic_machine=romp-ibm
1059 ;;
1060 s390 | s390-*)
1061 basic_machine=s390-ibm
1062 ;;
1063 s390x | s390x-*)
1064 basic_machine=s390x-ibm
1065 ;;
1066 sa29200)
1067 basic_machine=a29k-amd
1068 os=-udi
1069 ;;
1070 sb1)
1071 basic_machine=mipsisa64sb1-unknown
1072 ;;
1073 sb1el)
1074 basic_machine=mipsisa64sb1el-unknown
1075 ;;
1076 sde)
1077 basic_machine=mipsisa32-sde
1078 os=-elf
1079 ;;
1080 sei)
1081 basic_machine=mips-sei
1082 os=-seiux
1083 ;;
1084 sequent)
1085 basic_machine=i386-sequent
1086 ;;
1087 sh)
1088 basic_machine=sh-hitachi
1089 os=-hms
1090 ;;
1091 sh5el)
1092 basic_machine=sh5le-unknown
1093 ;;
1094 sh64)
1095 basic_machine=sh64-unknown
1096 ;;
1097 sparclite-wrs | simso-wrs)
1098 basic_machine=sparclite-wrs
1099 os=-vxworks
1100 ;;
1101 sps7)
1102 basic_machine=m68k-bull
1103 os=-sysv2
1104 ;;
1105 spur)
1106 basic_machine=spur-unknown
1107 ;;
1108 st2000)
1109 basic_machine=m68k-tandem
1110 ;;
1111 stratus)
1112 basic_machine=i860-stratus
1113 os=-sysv4
1114 ;;
1115 strongarm-* | thumb-*)
1116 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1117 ;;
1118 sun2)
1119 basic_machine=m68000-sun
1120 ;;
1121 sun2os3)
1122 basic_machine=m68000-sun
1123 os=-sunos3
1124 ;;
1125 sun2os4)
1126 basic_machine=m68000-sun
1127 os=-sunos4
1128 ;;
1129 sun3os3)
1130 basic_machine=m68k-sun
1131 os=-sunos3
1132 ;;
1133 sun3os4)
1134 basic_machine=m68k-sun
1135 os=-sunos4
1136 ;;
1137 sun4os3)
1138 basic_machine=sparc-sun
1139 os=-sunos3
1140 ;;
1141 sun4os4)
1142 basic_machine=sparc-sun
1143 os=-sunos4
1144 ;;
1145 sun4sol2)
1146 basic_machine=sparc-sun
1147 os=-solaris2
1148 ;;
1149 sun3 | sun3-*)
1150 basic_machine=m68k-sun
1151 ;;
1152 sun4)
1153 basic_machine=sparc-sun
1154 ;;
1155 sun386 | sun386i | roadrunner)
1156 basic_machine=i386-sun
1157 ;;
1158 sv1)
1159 basic_machine=sv1-cray
1160 os=-unicos
1161 ;;
1162 symmetry)
1163 basic_machine=i386-sequent
1164 os=-dynix
1165 ;;
1166 t3e)
1167 basic_machine=alphaev5-cray
1168 os=-unicos
1169 ;;
1170 t90)
1171 basic_machine=t90-cray
1172 os=-unicos
1173 ;;
1174 tile*)
1175 basic_machine=$basic_machine-unknown
1176 os=-linux-gnu
1177 ;;
1178 tx39)
1179 basic_machine=mipstx39-unknown
1180 ;;
1181 tx39el)
1182 basic_machine=mipstx39el-unknown
1183 ;;
1184 toad1)
1185 basic_machine=pdp10-xkl
1186 os=-tops20
1187 ;;
1188 tower | tower-32)
1189 basic_machine=m68k-ncr
1190 ;;
1191 tpf)
1192 basic_machine=s390x-ibm
1193 os=-tpf
1194 ;;
1195 udi29k)
1196 basic_machine=a29k-amd
1197 os=-udi
1198 ;;
1199 ultra3)
1200 basic_machine=a29k-nyu
1201 os=-sym1
1202 ;;
1203 v810 | necv810)
1204 basic_machine=v810-nec
1205 os=-none
1206 ;;
1207 vaxv)
1208 basic_machine=vax-dec
1209 os=-sysv
1210 ;;
1211 vms)
1212 basic_machine=vax-dec
1213 os=-vms
1214 ;;
1215 vpp*|vx|vx-*)
1216 basic_machine=f301-fujitsu
1217 ;;
1218 vxworks960)
1219 basic_machine=i960-wrs
1220 os=-vxworks
1221 ;;
1222 vxworks68)
1223 basic_machine=m68k-wrs
1224 os=-vxworks
1225 ;;
1226 vxworks29k)
1227 basic_machine=a29k-wrs
1228 os=-vxworks
1229 ;;
1230 w65*)
1231 basic_machine=w65-wdc
1232 os=-none
1233 ;;
1234 w89k-*)
1235 basic_machine=hppa1.1-winbond
1236 os=-proelf
1237 ;;
1238 xbox)
1239 basic_machine=i686-pc
1240 os=-mingw32
1241 ;;
1242 xps | xps100)
1243 basic_machine=xps100-honeywell
1244 ;;
1245 xscale-* | xscalee[bl]-*)
1246 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1247 ;;
1248 ymp)
1249 basic_machine=ymp-cray
1250 os=-unicos
1251 ;;
1252 z8k-*-coff)
1253 basic_machine=z8k-unknown
1254 os=-sim
1255 ;;
1256 z80-*-coff)
1257 basic_machine=z80-unknown
1258 os=-sim
1259 ;;
1260 none)
1261 basic_machine=none-none
1262 os=-none
1263 ;;
1264
1265 # Here we handle the default manufacturer of certain CPU types. It is in
1266 # some cases the only manufacturer, in others, it is the most popular.
1267 w89k)
1268 basic_machine=hppa1.1-winbond
1269 ;;
1270 op50n)
1271 basic_machine=hppa1.1-oki
1272 ;;
1273 op60c)
1274 basic_machine=hppa1.1-oki
1275 ;;
1276 romp)
1277 basic_machine=romp-ibm
1278 ;;
1279 mmix)
1280 basic_machine=mmix-knuth
1281 ;;
1282 rs6000)
1283 basic_machine=rs6000-ibm
1284 ;;
1285 vax)
1286 basic_machine=vax-dec
1287 ;;
1288 pdp10)
1289 # there are many clones, so DEC is not a safe bet
1290 basic_machine=pdp10-unknown
1291 ;;
1292 pdp11)
1293 basic_machine=pdp11-dec
1294 ;;
1295 we32k)
1296 basic_machine=we32k-att
1297 ;;
1298 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1299 basic_machine=sh-unknown
1300 ;;
1301 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1302 basic_machine=sparc-sun
1303 ;;
1304 cydra)
1305 basic_machine=cydra-cydrome
1306 ;;
1307 orion)
1308 basic_machine=orion-highlevel
1309 ;;
1310 orion105)
1311 basic_machine=clipper-highlevel
1312 ;;
1313 mac | mpw | mac-mpw)
1314 basic_machine=m68k-apple
1315 ;;
1316 pmac | pmac-mpw)
1317 basic_machine=powerpc-apple
1318 ;;
1319 *-unknown)
1320 # Make sure to match an already-canonicalized machine name.
1321 ;;
13221484 *)
1323 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1324 exit 1
1485 # No normalization, but not necessarily accepted, that comes below.
13251486 ;;
13261487 esac
13271488
1328 # Here we canonicalize certain aliases for manufacturers.
1329 case $basic_machine in
1330 *-digital*)
1331 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1332 ;;
1333 *-commodore*)
1334 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1335 ;;
1336 *)
1337 ;;
1338 esac
1339
1340 # Decode manufacturer-specific aliases for certain operating systems.
1341
1342 if [ x"$os" != x"" ]
1343 then
1344 case $os in
1345 # First match some system type aliases
1346 # that might get confused with valid system types.
1347 # -solaris* is a basic system type, with this one exception.
1348 -auroraux)
1349 os=-auroraux
1350 ;;
1351 -solaris1 | -solaris1.*)
1352 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1353 ;;
1354 -solaris)
1355 os=-solaris2
1356 ;;
1357 -svr4*)
1358 os=-sysv4
1359 ;;
1360 -unixware*)
1361 os=-sysv4.2uw
1362 ;;
1363 -gnu/linux*)
1364 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1365 ;;
1366 # First accept the basic system types.
1367 # The portable systems comes first.
1368 # Each alternative MUST END IN A *, to match a version number.
1369 # -sysv* is not here because it comes later, after sysvr4.
1370 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1371 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1372 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1373 | -sym* | -kopensolaris* | -plan9* \
1374 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1375 | -aos* | -aros* \
1376 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1377 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1378 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1379 | -bitrig* | -openbsd* | -solidbsd* \
1380 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1381 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1382 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1383 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1384 | -chorusos* | -chorusrdb* | -cegcc* \
1385 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1386 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1387 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1388 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
1389 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1390 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1391 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1392 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1393 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1394 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1395 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
1396 # Remember, each alternative MUST END IN *, to match a version number.
1397 ;;
1398 -qnx*)
1399 case $basic_machine in
1400 x86-* | i*86-*)
1401 ;;
1402 *)
1403 os=-nto$os
1404 ;;
1405 esac
1406 ;;
1407 -nto-qnx*)
1408 ;;
1409 -nto*)
1410 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1411 ;;
1412 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1413 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1414 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1415 ;;
1416 -mac*)
1417 os=`echo $os | sed -e 's|mac|macos|'`
1418 ;;
1419 -linux-dietlibc)
1420 os=-linux-dietlibc
1421 ;;
1422 -linux*)
1423 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1424 ;;
1425 -sunos5*)
1426 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1427 ;;
1428 -sunos6*)
1429 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1430 ;;
1431 -opened*)
1432 os=-openedition
1433 ;;
1434 -os400*)
1435 os=-os400
1436 ;;
1437 -wince*)
1438 os=-wince
1439 ;;
1440 -osfrose*)
1441 os=-osfrose
1442 ;;
1443 -osf*)
1444 os=-osf
1445 ;;
1446 -utek*)
1447 os=-bsd
1448 ;;
1449 -dynix*)
1450 os=-bsd
1451 ;;
1452 -acis*)
1453 os=-aos
1454 ;;
1455 -atheos*)
1456 os=-atheos
1457 ;;
1458 -syllable*)
1459 os=-syllable
1460 ;;
1461 -386bsd)
1462 os=-bsd
1463 ;;
1464 -ctix* | -uts*)
1465 os=-sysv
1466 ;;
1467 -nova*)
1468 os=-rtmk-nova
1469 ;;
1470 -ns2 )
1471 os=-nextstep2
1472 ;;
1473 -nsk*)
1474 os=-nsk
1475 ;;
1476 # Preserve the version number of sinix5.
1477 -sinix5.*)
1478 os=`echo $os | sed -e 's|sinix|sysv|'`
1479 ;;
1480 -sinix*)
1481 os=-sysv4
1482 ;;
1483 -tpf*)
1484 os=-tpf
1485 ;;
1486 -triton*)
1487 os=-sysv3
1488 ;;
1489 -oss*)
1490 os=-sysv3
1491 ;;
1492 -svr4)
1493 os=-sysv4
1494 ;;
1495 -svr3)
1496 os=-sysv3
1497 ;;
1498 -sysvr4)
1499 os=-sysv4
1500 ;;
1501 # This must come after -sysvr4.
1502 -sysv*)
1503 ;;
1504 -ose*)
1505 os=-ose
1506 ;;
1507 -es1800*)
1508 os=-ose
1509 ;;
1510 -xenix)
1511 os=-xenix
1512 ;;
1513 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1514 os=-mint
1515 ;;
1516 -aros*)
1517 os=-aros
1518 ;;
1519 -zvmoe)
1520 os=-zvmoe
1521 ;;
1522 -dicos*)
1523 os=-dicos
1524 ;;
1525 -nacl*)
1526 ;;
1527 -none)
1528 ;;
1529 *)
1530 # Get rid of the `-' at the beginning of $os.
1531 os=`echo $os | sed 's/[^-]*-//'`
1532 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1533 exit 1
1534 ;;
1535 esac
15361489 else
15371490
15381491 # Here we handle the default operating systems that come with various machines.
15451498 # will signal an error saying that MANUFACTURER isn't an operating
15461499 # system, and we'll never get to this point.
15471500
1548 case $basic_machine in
1501 kernel=
1502 case $cpu-$vendor in
15491503 score-*)
1550 os=-elf
1504 os=elf
15511505 ;;
15521506 spu-*)
1553 os=-elf
1507 os=elf
15541508 ;;
15551509 *-acorn)
1556 os=-riscix1.2
1510 os=riscix1.2
15571511 ;;
15581512 arm*-rebel)
1559 os=-linux
1513 kernel=linux
1514 os=gnu
15601515 ;;
15611516 arm*-semi)
1562 os=-aout
1517 os=aout
15631518 ;;
15641519 c4x-* | tic4x-*)
1565 os=-coff
1520 os=coff
15661521 ;;
15671522 c8051-*)
1568 os=-elf
1523 os=elf
1524 ;;
1525 clipper-intergraph)
1526 os=clix
15691527 ;;
15701528 hexagon-*)
1571 os=-elf
1529 os=elf
15721530 ;;
15731531 tic54x-*)
1574 os=-coff
1532 os=coff
15751533 ;;
15761534 tic55x-*)
1577 os=-coff
1535 os=coff
15781536 ;;
15791537 tic6x-*)
1580 os=-coff
1538 os=coff
15811539 ;;
15821540 # This must come before the *-dec entry.
15831541 pdp10-*)
1584 os=-tops20
1542 os=tops20
15851543 ;;
15861544 pdp11-*)
1587 os=-none
1545 os=none
15881546 ;;
15891547 *-dec | vax-*)
1590 os=-ultrix4.2
1548 os=ultrix4.2
15911549 ;;
15921550 m68*-apollo)
1593 os=-domain
1551 os=domain
15941552 ;;
15951553 i386-sun)
1596 os=-sunos4.0.2
1554 os=sunos4.0.2
15971555 ;;
15981556 m68000-sun)
1599 os=-sunos3
1557 os=sunos3
16001558 ;;
16011559 m68*-cisco)
1602 os=-aout
1560 os=aout
16031561 ;;
16041562 mep-*)
1605 os=-elf
1563 os=elf
16061564 ;;
16071565 mips*-cisco)
1608 os=-elf
1566 os=elf
16091567 ;;
16101568 mips*-*)
1611 os=-elf
1569 os=elf
16121570 ;;
16131571 or32-*)
1614 os=-coff
1572 os=coff
16151573 ;;
16161574 *-tti) # must be before sparc entry or we get the wrong os.
1617 os=-sysv3
1575 os=sysv3
16181576 ;;
16191577 sparc-* | *-sun)
1620 os=-sunos4.1.1
1578 os=sunos4.1.1
1579 ;;
1580 pru-*)
1581 os=elf
16211582 ;;
16221583 *-be)
1623 os=-beos
1624 ;;
1625 *-haiku)
1626 os=-haiku
1584 os=beos
16271585 ;;
16281586 *-ibm)
1629 os=-aix
1587 os=aix
16301588 ;;
16311589 *-knuth)
1632 os=-mmixware
1590 os=mmixware
16331591 ;;
16341592 *-wec)
1635 os=-proelf
1593 os=proelf
16361594 ;;
16371595 *-winbond)
1638 os=-proelf
1596 os=proelf
16391597 ;;
16401598 *-oki)
1641 os=-proelf
1599 os=proelf
16421600 ;;
16431601 *-hp)
1644 os=-hpux
1602 os=hpux
16451603 ;;
16461604 *-hitachi)
1647 os=-hiux
1605 os=hiux
16481606 ;;
16491607 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1650 os=-sysv
1608 os=sysv
16511609 ;;
16521610 *-cbm)
1653 os=-amigaos
1611 os=amigaos
16541612 ;;
16551613 *-dg)
1656 os=-dgux
1614 os=dgux
16571615 ;;
16581616 *-dolphin)
1659 os=-sysv3
1617 os=sysv3
16601618 ;;
16611619 m68k-ccur)
1662 os=-rtu
1620 os=rtu
16631621 ;;
16641622 m88k-omron*)
1665 os=-luna
1666 ;;
1667 *-next )
1668 os=-nextstep
1623 os=luna
1624 ;;
1625 *-next)
1626 os=nextstep
16691627 ;;
16701628 *-sequent)
1671 os=-ptx
1629 os=ptx
16721630 ;;
16731631 *-crds)
1674 os=-unos
1632 os=unos
16751633 ;;
16761634 *-ns)
1677 os=-genix
1635 os=genix
16781636 ;;
16791637 i370-*)
1680 os=-mvs
1681 ;;
1682 *-next)
1683 os=-nextstep3
1638 os=mvs
16841639 ;;
16851640 *-gould)
1686 os=-sysv
1641 os=sysv
16871642 ;;
16881643 *-highlevel)
1689 os=-bsd
1644 os=bsd
16901645 ;;
16911646 *-encore)
1692 os=-bsd
1647 os=bsd
16931648 ;;
16941649 *-sgi)
1695 os=-irix
1650 os=irix
16961651 ;;
16971652 *-siemens)
1698 os=-sysv4
1653 os=sysv4
16991654 ;;
17001655 *-masscomp)
1701 os=-rtu
1656 os=rtu
17021657 ;;
17031658 f30[01]-fujitsu | f700-fujitsu)
1704 os=-uxpv
1659 os=uxpv
17051660 ;;
17061661 *-rom68k)
1707 os=-coff
1662 os=coff
17081663 ;;
17091664 *-*bug)
1710 os=-coff
1665 os=coff
17111666 ;;
17121667 *-apple)
1713 os=-macos
1668 os=macos
17141669 ;;
17151670 *-atari*)
1716 os=-mint
1671 os=mint
1672 ;;
1673 *-wrs)
1674 os=vxworks
17171675 ;;
17181676 *)
1719 os=-none
1677 os=none
17201678 ;;
17211679 esac
1680
17221681 fi
1682
1683 # Now, validate our (potentially fixed-up) OS.
1684 case $os in
1685 # Sometimes we do "kernel-abi", so those need to count as OSes.
1686 musl* | newlib* | uclibc*)
1687 ;;
1688 # Likewise for "kernel-libc"
1689 eabi | eabihf | gnueabi | gnueabihf)
1690 ;;
1691 # Now accept the basic system types.
1692 # The portable systems comes first.
1693 # Each alternative MUST end in a * to match a version number.
1694 gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
1695 | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
1696 | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1697 | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
1698 | hiux* | abug | nacl* | netware* | windows* \
1699 | os9* | macos* | osx* | ios* \
1700 | mpw* | magic* | mmixware* | mon960* | lnews* \
1701 | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1702 | aos* | aros* | cloudabi* | sortix* | twizzler* \
1703 | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1704 | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
1705 | mirbsd* | netbsd* | dicos* | openedition* | ose* \
1706 | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
1707 | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
1708 | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1709 | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1710 | udi* | lites* | ieee* | go32* | aux* | hcos* \
1711 | chorusrdb* | cegcc* | glidix* \
1712 | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
1713 | midipix* | mingw32* | mingw64* | mint* \
1714 | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1715 | interix* | uwin* | mks* | rhapsody* | darwin* \
1716 | openstep* | oskit* | conix* | pw32* | nonstopux* \
1717 | storm-chaos* | tops10* | tenex* | tops20* | its* \
1718 | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
1719 | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
1720 | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1721 | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1722 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1723 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1724 | nsk* | powerunix* | genode* | zvmoe* )
1725 ;;
1726 # This one is extra strict with allowed versions
1727 sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
1728 # Don't forget version if it is 3.2v4 or newer.
1729 ;;
1730 none)
1731 ;;
1732 *)
1733 echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
1734 exit 1
1735 ;;
1736 esac
1737
1738 # As a final step for OS-related things, validate the OS-kernel combination
1739 # (given a valid OS), if there is a kernel.
1740 case $kernel-$os in
1741 linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* )
1742 ;;
1743 -dietlibc* | -newlib* | -musl* | -uclibc* )
1744 # These are just libc implementations, not actual OSes, and thus
1745 # require a kernel.
1746 echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
1747 exit 1
1748 ;;
1749 kfreebsd*-gnu* | kopensolaris*-gnu*)
1750 ;;
1751 nto-qnx*)
1752 ;;
1753 *-eabi* | *-gnueabi*)
1754 ;;
1755 -*)
1756 # Blank kernel with real OS is always fine.
1757 ;;
1758 *-*)
1759 echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
1760 exit 1
1761 ;;
1762 esac
17231763
17241764 # Here we handle the case where we know the os, and the CPU type, but not the
17251765 # manufacturer. We pick the logical manufacturer.
1726 vendor=unknown
1727 case $basic_machine in
1728 *-unknown)
1729 case $os in
1730 -riscix*)
1766 case $vendor in
1767 unknown)
1768 case $cpu-$os in
1769 *-riscix*)
17311770 vendor=acorn
17321771 ;;
1733 -sunos*)
1772 *-sunos*)
17341773 vendor=sun
17351774 ;;
1736 -cnk*|-aix*)
1775 *-cnk* | *-aix*)
17371776 vendor=ibm
17381777 ;;
1739 -beos*)
1778 *-beos*)
17401779 vendor=be
17411780 ;;
1742 -hpux*)
1781 *-hpux*)
17431782 vendor=hp
17441783 ;;
1745 -mpeix*)
1784 *-mpeix*)
17461785 vendor=hp
17471786 ;;
1748 -hiux*)
1787 *-hiux*)
17491788 vendor=hitachi
17501789 ;;
1751 -unos*)
1790 *-unos*)
17521791 vendor=crds
17531792 ;;
1754 -dgux*)
1793 *-dgux*)
17551794 vendor=dg
17561795 ;;
1757 -luna*)
1796 *-luna*)
17581797 vendor=omron
17591798 ;;
1760 -genix*)
1799 *-genix*)
17611800 vendor=ns
17621801 ;;
1763 -mvs* | -opened*)
1802 *-clix*)
1803 vendor=intergraph
1804 ;;
1805 *-mvs* | *-opened*)
17641806 vendor=ibm
17651807 ;;
1766 -os400*)
1808 *-os400*)
17671809 vendor=ibm
17681810 ;;
1769 -ptx*)
1811 s390-* | s390x-*)
1812 vendor=ibm
1813 ;;
1814 *-ptx*)
17701815 vendor=sequent
17711816 ;;
1772 -tpf*)
1817 *-tpf*)
17731818 vendor=ibm
17741819 ;;
1775 -vxsim* | -vxworks* | -windiss*)
1820 *-vxsim* | *-vxworks* | *-windiss*)
17761821 vendor=wrs
17771822 ;;
1778 -aux*)
1823 *-aux*)
17791824 vendor=apple
17801825 ;;
1781 -hms*)
1826 *-hms*)
17821827 vendor=hitachi
17831828 ;;
1784 -mpw* | -macos*)
1829 *-mpw* | *-macos*)
17851830 vendor=apple
17861831 ;;
1787 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1832 *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
17881833 vendor=atari
17891834 ;;
1790 -vos*)
1835 *-vos*)
17911836 vendor=stratus
17921837 ;;
17931838 esac
1794 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
17951839 ;;
17961840 esac
17971841
1798 echo $basic_machine$os
1842 echo "$cpu-$vendor-${kernel:+$kernel-}$os"
17991843 exit
18001844
18011845 # Local variables:
1802 # eval: (add-hook 'write-file-hooks 'time-stamp)
1846 # eval: (add-hook 'before-save-hook 'time-stamp)
18031847 # time-stamp-start: "timestamp='"
18041848 # time-stamp-format: "%:y-%02m-%02d"
18051849 # time-stamp-end: "'"
795795 enable_inline
796796 enable_cassert
797797 enable_glibcxx_debug
798 enable_overlayng
799798 '
800799 ac_precious_vars='build_alias
801800 host_alias
14451444 --disable-inline Disable inlining
14461445 --disable-cassert Disable assertion checking
14471446 --enable-glibcxx-debug Enable libstdc++ debug mode
1448 --disable-overlayng Disable use of new overlay
14491447
14501448 Optional Packages:
14511449 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1767517673
1767617674
1767717675
17678 # Check whether --enable-overlayng was given.
17679 if test "${enable_overlayng+set}" = set; then :
17680 enableval=$enable_overlayng; case "${enableval}" in
17681 yes) use_overlayng=true ;;
17682 no) use_overlayng=false ;;
17683 *) as_fn_error $? "bad value ${enableval} for --disable-overlayng" "$LINENO" 5 ;;
17684 esac
17685 else
17686 use_overlayng=true
17687
17688 fi
17689
17690
17691 if test x"$use_overlayng" = xtrue; then
17692 OVERLAYNG_FLAGS=""
17693 else
17694 OVERLAYNG_FLAGS="-DDISABLE_OVERLAYNG"
17695 fi
17696
1769717676 ac_ext=cpp
1769817677 ac_cpp='$CXXCPP $CPPFLAGS'
1769917678 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1874118720 NUMERICFLAGS="$NUMERICFLAGS -ffp-contract=off"
1874218721
1874318722 HUSHWARNING="-DUSE_UNSTABLE_GEOS_CPP_API"
18744 DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS} ${HUSHWARNING} ${OVERLAYNG_FLAGS}"
18723 DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS} ${HUSHWARNING}"
1874518724
1874618725 AM_CXXFLAGS="${AM_CXXFLAGS} ${DEFAULTFLAGS}"
1874718726 AM_CFLAGS="${AM_CFLAGS} ${DEFAULTFLAGS}"
1903619015 esac
1903719016 ;;
1903819017 esac
19039
1904019018
1904119019
1904219020
2178021758 fi
2178121759
2178221760
21761
21762
155155 dnl --------------------------------------------------------------------
156156 dnl - check whether user has requested overlayng
157157 dnl --------------------------------------------------------------------
158
159 AC_ARG_ENABLE([overlayng],
160 [ --disable-overlayng Disable use of new overlay],
161 [case "${enableval}" in
162 yes) use_overlayng=true ;;
163 no) use_overlayng=false ;;
164 *) AC_MSG_ERROR(bad value ${enableval} for --disable-overlayng) ;;
165 esac],
166 [use_overlayng=true]
167 )
168
169 if test x"$use_overlayng" = xtrue; then
170 OVERLAYNG_FLAGS=""
171 else
172 OVERLAYNG_FLAGS="-DDISABLE_OVERLAYNG"
173 fi
158 dnl
159 dnl AC_ARG_ENABLE([overlayng],
160 dnl [ --disable-overlayng Disable use of new overlay],
161 dnl [case "${enableval}" in
162 dnl yes) use_overlayng=true ;;
163 dnl no) use_overlayng=false ;;
164 dnl *) AC_MSG_ERROR(bad value ${enableval} for --disable-overlayng) ;;
165 dnl esac],
166 dnl [use_overlayng=true]
167 dnl )
168 dnl
169 dnl if test x"$use_overlayng" = xtrue; then
170 dnl OVERLAYNG_FLAGS=""
171 dnl else
172 dnl OVERLAYNG_FLAGS="-DDISABLE_OVERLAYNG"
173 dnl fi
174174
175175 dnl --------------------------------------------------------------------
176176 dnl - Append default C++ and C flags
222222
223223 dnl -----------------------------------------------------------------------------
224224 HUSHWARNING="-DUSE_UNSTABLE_GEOS_CPP_API"
225 DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS} ${HUSHWARNING} ${OVERLAYNG_FLAGS}"
225 DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS} ${HUSHWARNING}"
226226
227227 AM_CXXFLAGS="${AM_CXXFLAGS} ${DEFAULTFLAGS}"
228228 AM_CFLAGS="${AM_CFLAGS} ${DEFAULTFLAGS}"
282282 ;;
283283 esac
284284
285 dnl --------------------------------------------------------------------
286 dnl - check for boost
287 dnl --------------------------------------------------------------------
288
289 dnl -- AX_BOOST(1.32)
290 dnl -- if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then
291 dnl -- use_boost_utf=yes
292 dnl -- else
293 dnl -- use_boost_utf=no
294 dnl -- fi
295 dnl -- AM_CONDITIONAL(ENABLE_BOOST_UTF, [test "x$use_boost_utf" = "xyes"])
296285
297286 dnl things to substitute in output ----------------------------------------
298287 AC_SUBST(VERSION)
434423 tools/astyle/Makefile
435424 ])
436425
437 dnl -- echo "---------------------------------------"
438 dnl -- echo "Boost UTF: $use_boost_utf"
439 dnl -- echo "OverlayNG: $use_overlayng"
440 dnl -- echo "---------------------------------------"
426 dnl AC_MSG_RESULT([ ------------ GEOS Build ------------ ])
427 dnl AC_MSG_RESULT([ Version: ${VERSION}])
428 dnl AC_MSG_RESULT([ Inlining: ${enable_inline}])
429 dnl AC_MSG_RESULT([ ------------------------------------ ])
430
431
3737 # could be handy for archiving the generated documentation or if some version
3838 # control system is used.
3939
40 PROJECT_NUMBER = 3.9.0
40 PROJECT_NUMBER = 3.9.1
4141
4242 # Using the PROJECT_BRIEF tag one can provide an optional one line description
4343 # for a project that appears at the top of each page and should give viewer a
8888 */
8989 static bool isCCW(const geom::CoordinateSequence* ring);
9090
91 /**
92 * Tests if a ring defined by a CoordinateSequence is
93 * oriented counter-clockwise, using the signed area of the ring.
94 *
95 * * The list of points is assumed to have the first and last points equal.
96 * * This handles coordinate lists which contain repeated points.
97 * * This handles rings which contain collapsed segments
98 * (in particular, along the top of the ring).
99 * * This handles rings which are invalid due to self-intersection
100 *
101 * This algorithm is guaranteed to work with valid rings.
102 * For invalid rings (containing self-intersections),
103 * the algorithm determines the orientation of
104 * the largest enclosed area (including overlaps).
105 * This provides a more useful result in some situations, such as buffering.
106 *
107 * However, this approach may be less accurate in the case of
108 * rings with almost zero area.
109 * (Note that the orientation of rings with zero area is essentially
110 * undefined, and hence non-deterministic.)
111 *
112 * @param ring a CoordinateSequence forming a ring (with first and last point identical)
113 * @return true if the ring is oriented counter-clockwise.
114 */
115 static bool isCCWArea(const geom::CoordinateSequence* ring);
116
91117 };
92118
93119
5858 * This ensures that the overlay output line direction will be as consistent
5959 * as possible with input lines.
6060 *
61 * The merger also preserves the order of the edges in the input.
62 * This means that for polygon-line overlay
63 * the result lines will be in the same order as in the input
64 * (possibly with multiple result lines for a single input line).
65 *
6166 * @author mdavis
6267 *
6368 */
6469 class GEOS_DLL EdgeMerger {
6570
66 private:
67
68
69 // Members
70 std::vector<Edge*>& edges;
71 std::map<EdgeKey, Edge*> edgeMap;
72
7371 public:
7472
75 // Methods
76 EdgeMerger(std::vector<Edge*>& p_edges);
77
7873 static std::vector<Edge*> merge(std::vector<Edge*>& edges);
79
80 std::vector<Edge*> merge();
81
8274
8375 };
8476
8678 } // namespace geos.operation.overlayng
8779 } // namespace geos.operation
8880 } // namespace geos
89
00 #!/bin/sh
11 # install - install a program, script, or datafile
22
3 scriptversion=2013-12-25.23; # UTC
3 scriptversion=2018-03-11.20; # UTC
44
55 # This originates from X11R5 (mit/util/scripts/install.sh), which was
66 # later released in X11R6 (xc/config/util/install.sh) with the
270270 fi
271271 dst=$dst_arg
272272
273 # If destination is a directory, append the input filename; won't work
274 # if double slashes aren't ignored.
273 # If destination is a directory, append the input filename.
275274 if test -d "$dst"; then
276275 if test "$is_target_a_directory" = never; then
277276 echo "$0: $dst_arg: Is a directory" >&2
278277 exit 1
279278 fi
280279 dstdir=$dst
281 dst=$dstdir/`basename "$src"`
280 dstbase=`basename "$src"`
281 case $dst in
282 */) dst=$dst$dstbase;;
283 *) dst=$dst/$dstbase;;
284 esac
282285 dstdir_status=0
283286 else
284287 dstdir=`dirname "$dst"`
286289 dstdir_status=$?
287290 fi
288291 fi
292
293 case $dstdir in
294 */) dstdirslash=$dstdir;;
295 *) dstdirslash=$dstdir/;;
296 esac
289297
290298 obsolete_mkdir_used=false
291299
323331 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
324332 ;;
325333 *)
334 # Note that $RANDOM variable is not portable (e.g. dash); Use it
335 # here however when possible just to lower collision chance.
326336 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
327 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
328
337
338 trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
339
340 # Because "mkdir -p" follows existing symlinks and we likely work
341 # directly in world-writeable /tmp, make sure that the '$tmpdir'
342 # directory is successfully created first before we actually test
343 # 'mkdir -p' feature.
329344 if (umask $mkdir_umask &&
330 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
345 $mkdirprog $mkdir_mode "$tmpdir" &&
346 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
331347 then
332348 if test -z "$dir_arg" || {
333349 # Check for POSIX incompatibilities with -m.
334350 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
335351 # other-writable bit of parent directory when it shouldn't.
336352 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
337 ls_ld_tmpdir=`ls -ld "$tmpdir"`
353 test_tmpdir="$tmpdir/a"
354 ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
338355 case $ls_ld_tmpdir in
339356 d????-?r-*) different_mode=700;;
340357 d????-?--*) different_mode=755;;
341358 *) false;;
342359 esac &&
343 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
344 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
360 $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
361 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
345362 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
346363 }
347364 }
348365 then posix_mkdir=:
349366 fi
350 rmdir "$tmpdir/d" "$tmpdir"
367 rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
351368 else
352369 # Remove any dirs left behind by ancient mkdir implementations.
353 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
370 rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
354371 fi
355372 trap '' 0;;
356373 esac;;
426443 else
427444
428445 # Make a couple of temp file names in the proper directory.
429 dsttmp=$dstdir/_inst.$$_
430 rmtmp=$dstdir/_rm.$$_
446 dsttmp=${dstdirslash}_inst.$$_
447 rmtmp=${dstdirslash}_rm.$$_
431448
432449 # Trap to clean up those temp files at exit.
433450 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
434451
435452 # Copy the file name to the temp name.
436 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
453 (umask $cp_umask &&
454 { test -z "$stripcmd" || {
455 # Create $dsttmp read-write so that cp doesn't create it read-only,
456 # which would cause strip to fail.
457 if test -z "$doit"; then
458 : >"$dsttmp" # No need to fork-exec 'touch'.
459 else
460 $doit touch "$dsttmp"
461 fi
462 }
463 } &&
464 $doit_exec $cpprog "$src" "$dsttmp") &&
437465
438466 # and set any options; do chmod last to preserve setuid bits.
439467 #
492520 done
493521
494522 # Local variables:
495 # eval: (add-hook 'write-file-hooks 'time-stamp)
523 # eval: (add-hook 'before-save-hook 'time-stamp)
496524 # time-stamp-start: "scriptversion="
497525 # time-stamp-format: "%:y-%02m-%02d.%02H"
498 # time-stamp-time-zone: "UTC"
526 # time-stamp-time-zone: "UTC0"
499527 # time-stamp-end: "; # UTC"
500528 # End:
+0
-170
py-compile less more
0 #!/bin/sh
1 # py-compile - Compile a Python program
2
3 scriptversion=2011-06-08.12; # UTC
4
5 # Copyright (C) 2000-2014 Free Software Foundation, Inc.
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that program.
24
25 # This file is maintained in Automake, please report
26 # bugs to <bug-automake@gnu.org> or send patches to
27 # <automake-patches@gnu.org>.
28
29 if [ -z "$PYTHON" ]; then
30 PYTHON=python
31 fi
32
33 me=py-compile
34
35 usage_error ()
36 {
37 echo "$me: $*" >&2
38 echo "Try '$me --help' for more information." >&2
39 exit 1
40 }
41
42 basedir=
43 destdir=
44 while test $# -ne 0; do
45 case "$1" in
46 --basedir)
47 if test $# -lt 2; then
48 usage_error "option '--basedir' requires an argument"
49 else
50 basedir=$2
51 fi
52 shift
53 ;;
54 --destdir)
55 if test $# -lt 2; then
56 usage_error "option '--destdir' requires an argument"
57 else
58 destdir=$2
59 fi
60 shift
61 ;;
62 -h|--help)
63 cat <<\EOF
64 Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..."
65
66 Byte compile some python scripts FILES. Use --destdir to specify any
67 leading directory path to the FILES that you don't want to include in the
68 byte compiled file. Specify --basedir for any additional path information you
69 do want to be shown in the byte compiled file.
70
71 Example:
72 py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py
73
74 Report bugs to <bug-automake@gnu.org>.
75 EOF
76 exit $?
77 ;;
78 -v|--version)
79 echo "$me $scriptversion"
80 exit $?
81 ;;
82 --)
83 shift
84 break
85 ;;
86 -*)
87 usage_error "unrecognized option '$1'"
88 ;;
89 *)
90 break
91 ;;
92 esac
93 shift
94 done
95
96 files=$*
97 if test -z "$files"; then
98 usage_error "no files given"
99 fi
100
101 # if basedir was given, then it should be prepended to filenames before
102 # byte compilation.
103 if [ -z "$basedir" ]; then
104 pathtrans="path = file"
105 else
106 pathtrans="path = os.path.join('$basedir', file)"
107 fi
108
109 # if destdir was given, then it needs to be prepended to the filename to
110 # byte compile but not go into the compiled file.
111 if [ -z "$destdir" ]; then
112 filetrans="filepath = path"
113 else
114 filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)"
115 fi
116
117 $PYTHON -c "
118 import sys, os, py_compile, imp
119
120 files = '''$files'''
121
122 sys.stdout.write('Byte-compiling python modules...\n')
123 for file in files.split():
124 $pathtrans
125 $filetrans
126 if not os.path.exists(filepath) or not (len(filepath) >= 3
127 and filepath[-3:] == '.py'):
128 continue
129 sys.stdout.write(file)
130 sys.stdout.flush()
131 if hasattr(imp, 'get_tag'):
132 py_compile.compile(filepath, imp.cache_from_source(filepath), path)
133 else:
134 py_compile.compile(filepath, filepath + 'c', path)
135 sys.stdout.write('\n')" || exit $?
136
137 # this will fail for python < 1.5, but that doesn't matter ...
138 $PYTHON -O -c "
139 import sys, os, py_compile, imp
140
141 # pypy does not use .pyo optimization
142 if hasattr(sys, 'pypy_translation_info'):
143 sys.exit(0)
144
145 files = '''$files'''
146 sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
147 for file in files.split():
148 $pathtrans
149 $filetrans
150 if not os.path.exists(filepath) or not (len(filepath) >= 3
151 and filepath[-3:] == '.py'):
152 continue
153 sys.stdout.write(file)
154 sys.stdout.flush()
155 if hasattr(imp, 'get_tag'):
156 py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
157 else:
158 py_compile.compile(filepath, filepath + 'o', path)
159 sys.stdout.write('\n')" 2>/dev/null || :
160
161 # Local Variables:
162 # mode: shell-script
163 # sh-indentation: 2
164 # eval: (add-hook 'write-file-hooks 'time-stamp)
165 # time-stamp-start: "scriptversion="
166 # time-stamp-format: "%:y-%02m-%02d.%02H"
167 # time-stamp-time-zone: "UTC"
168 # time-stamp-end: "; # UTC"
169 # End:
1919 #include <cmath>
2020 #include <vector>
2121
22 #include <geos/algorithm/Area.h>
2223 #include <geos/algorithm/Orientation.h>
2324 #include <geos/algorithm/CGAlgorithmsDD.h>
2425 #include <geos/geom/CoordinateSequence.h>
133134 }
134135 }
135136
136 #if 0
137137 /* public static */
138138 bool
139 Orientation::isCCW(const geom::CoordinateSequence* ring)
139 Orientation::isCCWArea(const geom::CoordinateSequence* ring)
140140 {
141 // sanity check
142 if(ring->getSize() < 4) {
143 throw util::IllegalArgumentException("Ring has fewer than 4 points, so orientation cannot be determined");
144 }
145
146 // # of points without closing endpoint
147 const std::size_t nPts = ring->getSize() - 1;
148 assert(nPts >= 3); // This is here for scan-build
149
150 // find highest point
151 const geom::Coordinate* hiPt = &ring->getAt(0);
152 size_t hiIndex = 0;
153 for(std::size_t i = 1; i <= nPts; ++i) {
154 const geom::Coordinate* p = &ring->getAt(i);
155 if(p->y > hiPt->y) {
156 hiPt = p;
157 hiIndex = i;
158 }
159 }
160
161 // find distinct point before highest point
162 auto iPrev = hiIndex;
163 do {
164 if(iPrev == 0) {
165 iPrev = nPts;
166 }
167 iPrev = iPrev - 1;
168 }
169 while(ring->getAt(iPrev) == *hiPt && iPrev != hiIndex);
170
171 // find distinct point after highest point
172 auto iNext = hiIndex;
173 do {
174 iNext = (iNext + 1) % nPts;
175 }
176 while(ring->getAt(iNext) == *hiPt && iNext != hiIndex);
177
178 const geom::Coordinate* prev = &ring->getAt(iPrev);
179 const geom::Coordinate* next = &ring->getAt(iNext);
180
181 /*
182 * This check catches cases where the ring contains an A-B-A
183 * configuration of points.
184 * This can happen if the ring does not contain 3 distinct points
185 * (including the case where the input array has fewer than 4 elements),
186 * or it contains coincident line segments.
187 */
188 if(prev->equals2D(*hiPt) || next->equals2D(*hiPt) ||
189 prev->equals2D(*next)) {
190 return false;
191 // MD - don't bother throwing exception,
192 // since this isn't a complete check for ring validity
193 //throw IllegalArgumentException("degenerate ring (does not contain 3 distinct points)");
194 }
195
196 int disc = Orientation::index(*prev, *hiPt, *next);
197
198 /*
199 * If disc is exactly 0, lines are collinear.
200 * There are two possible cases:
201 * (1) the lines lie along the x axis in opposite directions
202 * (2) the lines lie on top of one another
203 *
204 * (1) is handled by checking if next is left of prev ==> CCW
205 * (2) should never happen, so we're going to ignore it!
206 * (Might want to assert this)
207 */
208 bool isCCW = false;
209
210 if(disc == 0) {
211 // poly is CCW if prev x is right of next x
212 isCCW = (prev->x > next->x);
213 }
214 else {
215 // if area is positive, points are ordered CCW
216 isCCW = (disc > 0);
217 }
218
219 return isCCW;
141 return algorithm::Area::ofRingSigned(ring) < 0;
220142 }
221 #endif
222143
223144
224145 } // namespace geos.algorithm
3434 // the stubs correctly at link time by itself
3535 #if !defined(__CYGWIN__)
3636
37 // Same as above for Apple ARM64 platforms
38 #if !(defined(__APPLE__) && defined(__aarch64__))
39
3740 // Undefine GEOS_INLINE so that .inl files
3841 // will be ready for an implementation file
3942 #undef GEOS_INLINE
6467 #include <geos/noding/BasicSegmentString.inl>
6568 #include <geos/noding/MCIndexNoder.inl>
6669
70 #endif // defined __APPLE__ && defined __aarch64__
71
6772 #endif // defined __CYGWIN__
6873
6974 #endif // defined __MINGW32__ and !defined GEOS_DLL_EXPORT
319319 #if GEOS_DEBUG
320320 std::cerr << "OffsetCurveSetBuilder::addPolygonRing: CCW: " << Orientation::isCCW(coord) << std::endl;
321321 #endif
322 if(coord->size() >= LinearRing::MINIMUM_VALID_SIZE
323 && Orientation::isCCW(coord)) {
322 if(coord->size() >= LinearRing::MINIMUM_VALID_SIZE &&
323 Orientation::isCCWArea(coord))
324 {
324325 leftLoc = cwRightLoc;
325326 rightLoc = cwLeftLoc;
326327 #if GEOS_DEBUG
2222 namespace operation { // geos.operation
2323 namespace overlayng { // geos.operation.overlayng
2424
25 EdgeMerger::EdgeMerger(std::vector<Edge*>& p_edges)
26 : edges(p_edges) {}
27
2825 /*public static */
2926 std::vector<Edge*>
3027 EdgeMerger::merge(std::vector<Edge*>& edges)
3128 {
32 EdgeMerger merger(edges);
33 return merger.merge();
34 }
35
36
37 /*public static */
38 std::vector<Edge*>
39 EdgeMerger::merge()
40 {
4129 std::vector<Edge*> mergedEdges;
30 std::map<EdgeKey, Edge*> edgeMap;
4231
4332 for (Edge* edge : edges) {
4433 EdgeKey edgeKey(edge);
4635 if (it == edgeMap.end()) {
4736 // this is the first (and maybe only) edge for this line
4837 edgeMap[edgeKey] = edge;
38 mergedEdges.push_back(edge);
4939 //Debug.println("edge added: " + edge);
5040 //Debug.println(edge.toLineString());
5141 }
6858 //Debug.println(edge.toLineString());
6959 }
7060 }
71
72 // copy map values into return vector
73 for (auto it: edgeMap) {
74 mergedEdges.push_back(it.second);
75 }
7661 return mergedEdges;
7762 }
7863
4747 if (isFloating(pm)) {
4848 // if PM is FLOAT then there is no scale factor, so add 10%
4949 double minSize = std::min(env->getHeight(), env->getWidth());
50 // heuristic to ensure zero-width envelopes don't cause total clipping
51 if (minSize <= 0.0) {
52 minSize = std::max(env->getHeight(), env->getWidth());
53 }
5054 envExpandDist = SAFE_ENV_BUFFER_FACTOR * minSize;
5155 }
5256 else {
00 #! /bin/sh
11 # test-driver - basic testsuite driver script.
22
3 scriptversion=2013-07-13.22; # UTC
3 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 2011-2014 Free Software Foundation, Inc.
5 # Copyright (C) 2011-2020 Free Software Foundation, Inc.
66 #
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
1515 # GNU General Public License for more details.
1616 #
1717 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
2020 # As a special exception to the GNU General Public License, if you
2121 # distribute this file as part of a program that contains a
139139 # Local Variables:
140140 # mode: shell-script
141141 # sh-indentation: 2
142 # eval: (add-hook 'write-file-hooks 'time-stamp)
142 # eval: (add-hook 'before-save-hook 'time-stamp)
143143 # time-stamp-start: "scriptversion="
144144 # time-stamp-format: "%:y-%02m-%02d.%02H"
145 # time-stamp-time-zone: "UTC"
145 # time-stamp-time-zone: "UTC0"
146146 # time-stamp-end: "; # UTC"
147147 # End:
4343 algorithm/AngleTest.cpp \
4444 algorithm/AreaTest.cpp \
4545 algorithm/CGAlgorithms/computeOrientationTest.cpp \
46 algorithm/CGAlgorithms/isCCWTest.cpp \
46 algorithm/CGAlgorithms/OrientationIsCCWTest.cpp \
4747 algorithm/CGAlgorithms/isPointInRingTest.cpp \
4848 algorithm/CGAlgorithms/signedAreaTest.cpp \
4949 algorithm/ConvexHullTest.cpp \
7777 capi/GEOSEqualsTest.cpp \
7878 capi/GEOSFrechetDistanceTest.cpp \
7979 capi/GEOSGeom_createCollectionTest.cpp \
80 capi/GEOSGeom_createPolygonTest.cpp \
81 capi/GEOSGeom_createLineStringTest.cpp \
8082 capi/GEOSGeom_createTest.cpp \
8183 capi/GEOSGeom_extentTest.cpp \
8284 capi/GEOSGeom_extractUniquePointsTest.cpp \
213215 operation/polygonize/PolygonizeTest.cpp \
214216 operation/sharedpaths/SharedPathsOpTest.cpp \
215217 operation/valid/IsValidOpTest.cpp \
218 operation/valid/MakeValidTest.cpp \
216219 operation/valid/RepeatedPointRemoverTest.cpp \
217220 operation/valid/ValidClosedRingTest.cpp \
218221 operation/valid/ValidSelfTouchingRingFormingHoleTest.cpp \
115115 am_geos_unit_OBJECTS = geos_unit.$(OBJEXT) \
116116 algorithm/AngleTest.$(OBJEXT) algorithm/AreaTest.$(OBJEXT) \
117117 algorithm/CGAlgorithms/computeOrientationTest.$(OBJEXT) \
118 algorithm/CGAlgorithms/isCCWTest.$(OBJEXT) \
118 algorithm/CGAlgorithms/OrientationIsCCWTest.$(OBJEXT) \
119119 algorithm/CGAlgorithms/isPointInRingTest.$(OBJEXT) \
120120 algorithm/CGAlgorithms/signedAreaTest.$(OBJEXT) \
121121 algorithm/ConvexHullTest.$(OBJEXT) \
147147 capi/GEOSDistanceTest.$(OBJEXT) capi/GEOSEqualsTest.$(OBJEXT) \
148148 capi/GEOSFrechetDistanceTest.$(OBJEXT) \
149149 capi/GEOSGeom_createCollectionTest.$(OBJEXT) \
150 capi/GEOSGeom_createPolygonTest.$(OBJEXT) \
151 capi/GEOSGeom_createLineStringTest.$(OBJEXT) \
150152 capi/GEOSGeom_createTest.$(OBJEXT) \
151153 capi/GEOSGeom_extentTest.$(OBJEXT) \
152154 capi/GEOSGeom_extractUniquePointsTest.$(OBJEXT) \
271273 operation/polygonize/PolygonizeTest.$(OBJEXT) \
272274 operation/sharedpaths/SharedPathsOpTest.$(OBJEXT) \
273275 operation/valid/IsValidOpTest.$(OBJEXT) \
276 operation/valid/MakeValidTest.$(OBJEXT) \
274277 operation/valid/RepeatedPointRemoverTest.$(OBJEXT) \
275278 operation/valid/ValidClosedRingTest.$(OBJEXT) \
276279 operation/valid/ValidSelfTouchingRingFormingHoleTest.$(OBJEXT) \
325328 algorithm/$(DEPDIR)/RobustLineIntersectionTest.Po \
326329 algorithm/$(DEPDIR)/RobustLineIntersectorTest.Po \
327330 algorithm/$(DEPDIR)/RobustLineIntersectorZTest.Po \
331 algorithm/CGAlgorithms/$(DEPDIR)/OrientationIsCCWTest.Po \
328332 algorithm/CGAlgorithms/$(DEPDIR)/computeOrientationTest.Po \
329 algorithm/CGAlgorithms/$(DEPDIR)/isCCWTest.Po \
330333 algorithm/CGAlgorithms/$(DEPDIR)/isPointInRingTest.Po \
331334 algorithm/CGAlgorithms/$(DEPDIR)/signedAreaTest.Po \
332335 algorithm/construct/$(DEPDIR)/LargestEmptyCircleTest.Po \
350353 capi/$(DEPDIR)/GEOSGeomFromWKBTest.Po \
351354 capi/$(DEPDIR)/GEOSGeomToWKTTest.Po \
352355 capi/$(DEPDIR)/GEOSGeom_createCollectionTest.Po \
356 capi/$(DEPDIR)/GEOSGeom_createLineStringTest.Po \
357 capi/$(DEPDIR)/GEOSGeom_createPolygonTest.Po \
353358 capi/$(DEPDIR)/GEOSGeom_createTest.Po \
354359 capi/$(DEPDIR)/GEOSGeom_extentTest.Po \
355360 capi/$(DEPDIR)/GEOSGeom_extractUniquePointsTest.Po \
480485 operation/polygonize/$(DEPDIR)/PolygonizeTest.Po \
481486 operation/sharedpaths/$(DEPDIR)/SharedPathsOpTest.Po \
482487 operation/valid/$(DEPDIR)/IsValidOpTest.Po \
488 operation/valid/$(DEPDIR)/MakeValidTest.Po \
483489 operation/valid/$(DEPDIR)/RepeatedPointRemoverTest.Po \
484490 operation/valid/$(DEPDIR)/ValidClosedRingTest.Po \
485491 operation/valid/$(DEPDIR)/ValidSelfTouchingRingFormingHoleTest.Po \
927933 algorithm/AngleTest.cpp \
928934 algorithm/AreaTest.cpp \
929935 algorithm/CGAlgorithms/computeOrientationTest.cpp \
930 algorithm/CGAlgorithms/isCCWTest.cpp \
936 algorithm/CGAlgorithms/OrientationIsCCWTest.cpp \
931937 algorithm/CGAlgorithms/isPointInRingTest.cpp \
932938 algorithm/CGAlgorithms/signedAreaTest.cpp \
933939 algorithm/ConvexHullTest.cpp \
961967 capi/GEOSEqualsTest.cpp \
962968 capi/GEOSFrechetDistanceTest.cpp \
963969 capi/GEOSGeom_createCollectionTest.cpp \
970 capi/GEOSGeom_createPolygonTest.cpp \
971 capi/GEOSGeom_createLineStringTest.cpp \
964972 capi/GEOSGeom_createTest.cpp \
965973 capi/GEOSGeom_extentTest.cpp \
966974 capi/GEOSGeom_extractUniquePointsTest.cpp \
10971105 operation/polygonize/PolygonizeTest.cpp \
10981106 operation/sharedpaths/SharedPathsOpTest.cpp \
10991107 operation/valid/IsValidOpTest.cpp \
1108 operation/valid/MakeValidTest.cpp \
11001109 operation/valid/RepeatedPointRemoverTest.cpp \
11011110 operation/valid/ValidClosedRingTest.cpp \
11021111 operation/valid/ValidSelfTouchingRingFormingHoleTest.cpp \
11791188 algorithm/CGAlgorithms/computeOrientationTest.$(OBJEXT): \
11801189 algorithm/CGAlgorithms/$(am__dirstamp) \
11811190 algorithm/CGAlgorithms/$(DEPDIR)/$(am__dirstamp)
1182 algorithm/CGAlgorithms/isCCWTest.$(OBJEXT): \
1191 algorithm/CGAlgorithms/OrientationIsCCWTest.$(OBJEXT): \
11831192 algorithm/CGAlgorithms/$(am__dirstamp) \
11841193 algorithm/CGAlgorithms/$(DEPDIR)/$(am__dirstamp)
11851194 algorithm/CGAlgorithms/isPointInRingTest.$(OBJEXT): \
12711280 capi/GEOSFrechetDistanceTest.$(OBJEXT): capi/$(am__dirstamp) \
12721281 capi/$(DEPDIR)/$(am__dirstamp)
12731282 capi/GEOSGeom_createCollectionTest.$(OBJEXT): capi/$(am__dirstamp) \
1283 capi/$(DEPDIR)/$(am__dirstamp)
1284 capi/GEOSGeom_createPolygonTest.$(OBJEXT): capi/$(am__dirstamp) \
1285 capi/$(DEPDIR)/$(am__dirstamp)
1286 capi/GEOSGeom_createLineStringTest.$(OBJEXT): capi/$(am__dirstamp) \
12741287 capi/$(DEPDIR)/$(am__dirstamp)
12751288 capi/GEOSGeom_createTest.$(OBJEXT): capi/$(am__dirstamp) \
12761289 capi/$(DEPDIR)/$(am__dirstamp)
17481761 operation/valid/IsValidOpTest.$(OBJEXT): \
17491762 operation/valid/$(am__dirstamp) \
17501763 operation/valid/$(DEPDIR)/$(am__dirstamp)
1764 operation/valid/MakeValidTest.$(OBJEXT): \
1765 operation/valid/$(am__dirstamp) \
1766 operation/valid/$(DEPDIR)/$(am__dirstamp)
17511767 operation/valid/RepeatedPointRemoverTest.$(OBJEXT): \
17521768 operation/valid/$(am__dirstamp) \
17531769 operation/valid/$(DEPDIR)/$(am__dirstamp)
18891905 @AMDEP_TRUE@@am__include@ @am__quote@algorithm/$(DEPDIR)/RobustLineIntersectionTest.Po@am__quote@ # am--include-marker
18901906 @AMDEP_TRUE@@am__include@ @am__quote@algorithm/$(DEPDIR)/RobustLineIntersectorTest.Po@am__quote@ # am--include-marker
18911907 @AMDEP_TRUE@@am__include@ @am__quote@algorithm/$(DEPDIR)/RobustLineIntersectorZTest.Po@am__quote@ # am--include-marker
1908 @AMDEP_TRUE@@am__include@ @am__quote@algorithm/CGAlgorithms/$(DEPDIR)/OrientationIsCCWTest.Po@am__quote@ # am--include-marker
18921909 @AMDEP_TRUE@@am__include@ @am__quote@algorithm/CGAlgorithms/$(DEPDIR)/computeOrientationTest.Po@am__quote@ # am--include-marker
1893 @AMDEP_TRUE@@am__include@ @am__quote@algorithm/CGAlgorithms/$(DEPDIR)/isCCWTest.Po@am__quote@ # am--include-marker
18941910 @AMDEP_TRUE@@am__include@ @am__quote@algorithm/CGAlgorithms/$(DEPDIR)/isPointInRingTest.Po@am__quote@ # am--include-marker
18951911 @AMDEP_TRUE@@am__include@ @am__quote@algorithm/CGAlgorithms/$(DEPDIR)/signedAreaTest.Po@am__quote@ # am--include-marker
18961912 @AMDEP_TRUE@@am__include@ @am__quote@algorithm/construct/$(DEPDIR)/LargestEmptyCircleTest.Po@am__quote@ # am--include-marker
19141930 @AMDEP_TRUE@@am__include@ @am__quote@capi/$(DEPDIR)/GEOSGeomFromWKBTest.Po@am__quote@ # am--include-marker
19151931 @AMDEP_TRUE@@am__include@ @am__quote@capi/$(DEPDIR)/GEOSGeomToWKTTest.Po@am__quote@ # am--include-marker
19161932 @AMDEP_TRUE@@am__include@ @am__quote@capi/$(DEPDIR)/GEOSGeom_createCollectionTest.Po@am__quote@ # am--include-marker
1933 @AMDEP_TRUE@@am__include@ @am__quote@capi/$(DEPDIR)/GEOSGeom_createLineStringTest.Po@am__quote@ # am--include-marker
1934 @AMDEP_TRUE@@am__include@ @am__quote@capi/$(DEPDIR)/GEOSGeom_createPolygonTest.Po@am__quote@ # am--include-marker
19171935 @AMDEP_TRUE@@am__include@ @am__quote@capi/$(DEPDIR)/GEOSGeom_createTest.Po@am__quote@ # am--include-marker
19181936 @AMDEP_TRUE@@am__include@ @am__quote@capi/$(DEPDIR)/GEOSGeom_extentTest.Po@am__quote@ # am--include-marker
19191937 @AMDEP_TRUE@@am__include@ @am__quote@capi/$(DEPDIR)/GEOSGeom_extractUniquePointsTest.Po@am__quote@ # am--include-marker
20482066 @AMDEP_TRUE@@am__include@ @am__quote@operation/polygonize/$(DEPDIR)/PolygonizeTest.Po@am__quote@ # am--include-marker
20492067 @AMDEP_TRUE@@am__include@ @am__quote@operation/sharedpaths/$(DEPDIR)/SharedPathsOpTest.Po@am__quote@ # am--include-marker
20502068 @AMDEP_TRUE@@am__include@ @am__quote@operation/valid/$(DEPDIR)/IsValidOpTest.Po@am__quote@ # am--include-marker
2069 @AMDEP_TRUE@@am__include@ @am__quote@operation/valid/$(DEPDIR)/MakeValidTest.Po@am__quote@ # am--include-marker
20512070 @AMDEP_TRUE@@am__include@ @am__quote@operation/valid/$(DEPDIR)/RepeatedPointRemoverTest.Po@am__quote@ # am--include-marker
20522071 @AMDEP_TRUE@@am__include@ @am__quote@operation/valid/$(DEPDIR)/ValidClosedRingTest.Po@am__quote@ # am--include-marker
20532072 @AMDEP_TRUE@@am__include@ @am__quote@operation/valid/$(DEPDIR)/ValidSelfTouchingRingFormingHoleTest.Po@am__quote@ # am--include-marker
24862505 -rm -f algorithm/$(DEPDIR)/RobustLineIntersectionTest.Po
24872506 -rm -f algorithm/$(DEPDIR)/RobustLineIntersectorTest.Po
24882507 -rm -f algorithm/$(DEPDIR)/RobustLineIntersectorZTest.Po
2508 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/OrientationIsCCWTest.Po
24892509 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/computeOrientationTest.Po
2490 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/isCCWTest.Po
24912510 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/isPointInRingTest.Po
24922511 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/signedAreaTest.Po
24932512 -rm -f algorithm/construct/$(DEPDIR)/LargestEmptyCircleTest.Po
25112530 -rm -f capi/$(DEPDIR)/GEOSGeomFromWKBTest.Po
25122531 -rm -f capi/$(DEPDIR)/GEOSGeomToWKTTest.Po
25132532 -rm -f capi/$(DEPDIR)/GEOSGeom_createCollectionTest.Po
2533 -rm -f capi/$(DEPDIR)/GEOSGeom_createLineStringTest.Po
2534 -rm -f capi/$(DEPDIR)/GEOSGeom_createPolygonTest.Po
25142535 -rm -f capi/$(DEPDIR)/GEOSGeom_createTest.Po
25152536 -rm -f capi/$(DEPDIR)/GEOSGeom_extentTest.Po
25162537 -rm -f capi/$(DEPDIR)/GEOSGeom_extractUniquePointsTest.Po
26452666 -rm -f operation/polygonize/$(DEPDIR)/PolygonizeTest.Po
26462667 -rm -f operation/sharedpaths/$(DEPDIR)/SharedPathsOpTest.Po
26472668 -rm -f operation/valid/$(DEPDIR)/IsValidOpTest.Po
2669 -rm -f operation/valid/$(DEPDIR)/MakeValidTest.Po
26482670 -rm -f operation/valid/$(DEPDIR)/RepeatedPointRemoverTest.Po
26492671 -rm -f operation/valid/$(DEPDIR)/ValidClosedRingTest.Po
26502672 -rm -f operation/valid/$(DEPDIR)/ValidSelfTouchingRingFormingHoleTest.Po
27222744 -rm -f algorithm/$(DEPDIR)/RobustLineIntersectionTest.Po
27232745 -rm -f algorithm/$(DEPDIR)/RobustLineIntersectorTest.Po
27242746 -rm -f algorithm/$(DEPDIR)/RobustLineIntersectorZTest.Po
2747 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/OrientationIsCCWTest.Po
27252748 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/computeOrientationTest.Po
2726 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/isCCWTest.Po
27272749 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/isPointInRingTest.Po
27282750 -rm -f algorithm/CGAlgorithms/$(DEPDIR)/signedAreaTest.Po
27292751 -rm -f algorithm/construct/$(DEPDIR)/LargestEmptyCircleTest.Po
27472769 -rm -f capi/$(DEPDIR)/GEOSGeomFromWKBTest.Po
27482770 -rm -f capi/$(DEPDIR)/GEOSGeomToWKTTest.Po
27492771 -rm -f capi/$(DEPDIR)/GEOSGeom_createCollectionTest.Po
2772 -rm -f capi/$(DEPDIR)/GEOSGeom_createLineStringTest.Po
2773 -rm -f capi/$(DEPDIR)/GEOSGeom_createPolygonTest.Po
27502774 -rm -f capi/$(DEPDIR)/GEOSGeom_createTest.Po
27512775 -rm -f capi/$(DEPDIR)/GEOSGeom_extentTest.Po
27522776 -rm -f capi/$(DEPDIR)/GEOSGeom_extractUniquePointsTest.Po
28812905 -rm -f operation/polygonize/$(DEPDIR)/PolygonizeTest.Po
28822906 -rm -f operation/sharedpaths/$(DEPDIR)/SharedPathsOpTest.Po
28832907 -rm -f operation/valid/$(DEPDIR)/IsValidOpTest.Po
2908 -rm -f operation/valid/$(DEPDIR)/MakeValidTest.Po
28842909 -rm -f operation/valid/$(DEPDIR)/RepeatedPointRemoverTest.Po
28852910 -rm -f operation/valid/$(DEPDIR)/ValidClosedRingTest.Po
28862911 -rm -f operation/valid/$(DEPDIR)/ValidSelfTouchingRingFormingHoleTest.Po
0 //
1 // Test Suite for Orientation::isCCW() function
2 // Ported from JTS junit/algorithm/IsCCWTest.java
3
4 // tut
5 #include <tut/tut.hpp>
6 // geos
7 #include <geos/algorithm/Orientation.h>
8 #include <geos/geom/Polygon.h>
9 #include <geos/geom/Geometry.h>
10 #include <geos/geom/CoordinateSequence.h>
11 #include <geos/geom/Coordinate.h>
12 #include <geos/io/WKTReader.h>
13 #include <geos/io/WKBReader.h>
14 // std
15 #include <string>
16 #include <memory>
17 #include <cassert>
18 #include <sstream>
19
20 using namespace geos::algorithm;
21
22 namespace tut {
23 //
24 // Test Group
25 //
26
27 struct test_isccw_data {
28 typedef std::unique_ptr<geos::geom::Geometry> GeometryPtr;
29
30 geos::io::WKTReader reader_;
31 geos::io::WKBReader breader_;
32
33 test_isccw_data()
34 {
35 }
36
37 ~test_isccw_data()
38 {
39 }
40
41 void
42 checkCCW(bool expectedCCW, const std::string& wkt)
43 {
44 GeometryPtr geom(reader_.read(wkt));
45 geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(geom.get());
46 ensure("WKT must be POLYGON)", poly != nullptr);
47 const geos::geom::CoordinateSequence* cs = poly->getExteriorRing()->getCoordinatesRO();
48 bool actualCCW = Orientation::isCCW(cs);
49 ensure_equals("CoordinateSequence isCCW", expectedCCW, actualCCW);
50 }
51
52 void
53 checkCCWArea(bool expectedCCWArea, const std::string& wkt)
54 {
55 GeometryPtr geom(reader_.read(wkt));
56 geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(geom.get());
57 ensure("WKT must be POLYGON)", poly != nullptr);
58 const geos::geom::CoordinateSequence* cs = poly->getExteriorRing()->getCoordinatesRO();
59 bool actualCCWArea = Orientation::isCCWArea(cs);
60 ensure_equals("CoordinateSequence isCCWArea", expectedCCWArea, actualCCWArea);
61 }
62
63 void
64 checkHexOrientationCCW(bool expectedCCW, std::istringstream& wkt)
65 {
66 GeometryPtr geom(breader_.readHEX(wkt));
67 auto cs = geom->getCoordinates();
68 bool actualCCW = Orientation::isCCW(cs.get());
69 ensure_equals("CoordinateSequence isCCW", expectedCCW, actualCCW);
70 }
71
72 };
73
74 typedef test_group<test_isccw_data> group;
75 typedef group::object object;
76
77 group test_isccw_group("geos::algorithm::CGAlgorithms::OrientationIsCCW");
78
79 //
80 // Test Cases
81 //
82
83 // 1 - Test if coordinates of polygon are counter-clockwise oriented
84 template<>
85 template<>
86 void object::test<1>
87 ()
88 {
89 const std::string wkt("POLYGON ((60 180, 140 240, 140 240, 140 240, 200 180, 120 120, 60 180))");
90 checkCCW(false, wkt);
91 }
92
93 // 2 - Test if coordinates of polygon are counter-clockwise oriented
94 template<>
95 template<>
96 void object::test<2>
97 ()
98 {
99 const std::string wkt("POLYGON ((60 180, 140 120, 100 180, 140 240, 60 180))");
100 checkCCW(true, wkt);
101 }
102
103 // 3 - Test the same polygon as in test No 2 but with duplicated top point
104 template<>
105 template<>
106 void object::test<3>
107 ()
108 {
109 const std::string wkt("POLYGON ((60 180, 140 120, 100 180, 140 240, 140 240, 60 180))");
110 checkCCW(true, wkt);
111 }
112
113 // 4 - Test orientation the narrow (almost collapsed) ring
114 // resulting in GEOS during execution of the union described
115 // in http://trac.osgeo.org/geos/ticket/398
116 template<>
117 template<>
118 void object::test<4>
119 ()
120 {
121 std::istringstream
122 wkt("0102000000040000000000000000000000841D588465963540F56BFB214F0341408F26B714B2971B40F66BFB214F0341408C26B714B2971B400000000000000000841D588465963540");
123 checkHexOrientationCCW(true, wkt);
124 }
125
126 // 5 - Test orientation the narrow (almost collapsed) ring
127 // resulting in JTS during execution of the union described
128 // in http://trac.osgeo.org/geos/ticket/398
129 template<>
130 template<>
131 void object::test<5>
132 ()
133 {
134 std::istringstream
135 wkt("0102000000040000000000000000000000841D588465963540F56BFB214F0341408F26B714B2971B40F66BFB214F0341408E26B714B2971B400000000000000000841D588465963540");
136 checkHexOrientationCCW(true, wkt);
137 }
138
139 // testCCWSmall
140 template<>
141 template<>
142 void object::test<6>
143 ()
144 {
145 const std::string wkt("POLYGON ((1 1, 9 1, 5 9, 1 1))");
146 checkCCW(true, wkt);
147 }
148
149 // testFlatTopSegment
150 template<>
151 template<>
152 void object::test<7>
153 ()
154 {
155 const std::string wkt("POLYGON ((100 200, 200 200, 200 100, 100 100, 100 200))");
156 checkCCW(false, wkt);
157 }
158
159 // testFlatMultipleTopSegment
160 template<>
161 template<>
162 void object::test<8>
163 ()
164 {
165 const std::string wkt("POLYGON ((100 200, 127 200, 151 200, 173 200, 200 200, 100 100, 100 200))");
166 checkCCW(false, wkt);
167 }
168
169 // testDegenerateRingHorizontal
170 template<>
171 template<>
172 void object::test<9>
173 ()
174 {
175 const std::string wkt("POLYGON ((100 200, 100 200, 200 200, 100 200))");
176 checkCCW(false, wkt);
177 }
178
179 // testDegenerateRingAngled
180 template<>
181 template<>
182 void object::test<10>
183 ()
184 {
185 const std::string wkt("POLYGON ((100 100, 100 100, 200 200, 100 100))");
186 checkCCW(false, wkt);
187 }
188
189 // testDegenerateRingVertical
190 template<>
191 template<>
192 void object::test<11>
193 ()
194 {
195 const std::string wkt("POLYGON ((200 100, 200 100, 200 200, 200 100))");
196 checkCCW(false, wkt);
197 }
198
199 /**
200 * This case is an invalid ring, so answer is a default value
201 */
202 // testTopAngledSegmentCollapse
203 template<>
204 template<>
205 void object::test<12>
206 ()
207 {
208 const std::string wkt("POLYGON ((10 20, 61 20, 20 30, 50 60, 10 20))");
209 checkCCW(false, wkt);
210 }
211
212 // testABATopFlatSegmentCollapse
213 template<>
214 template<>
215 void object::test<13>
216 ()
217 {
218 const std::string wkt("POLYGON ((71 0, 40 40, 70 40, 40 40, 20 0, 71 0))");
219 checkCCW(true, wkt);
220 }
221
222 // testABATopFlatSegmentCollapseMiddleStart
223 template<>
224 template<>
225 void object::test<14>
226 ()
227 {
228 const std::string wkt("POLYGON ((90 90, 50 90, 10 10, 90 10, 50 90, 90 90))");
229 checkCCW(true, wkt);
230 }
231
232 // testMultipleTopFlatSegmentCollapseSinglePoint
233 template<>
234 template<>
235 void object::test<15>
236 ()
237 {
238 const std::string wkt("POLYGON ((100 100, 200 100, 150 200, 170 200, 200 200, 100 200, 150 200, 100 100))");
239 checkCCW(true, wkt);
240 }
241
242 // testMultipleTopFlatSegmentCollapseFlatTop
243 template<>
244 template<>
245 void object::test<16>
246 ()
247 {
248 const std::string wkt("POLYGON ((10 10, 90 10, 70 70, 90 70, 10 70, 30 70, 50 70, 10 10))");
249 checkCCW(true, wkt);
250 }
251
252
253
254
255 } // namespace tut
256
+0
-246
tests/unit/algorithm/CGAlgorithms/isCCWTest.cpp less more
0 //
1 // Test Suite for Orientation::isCCW() function
2 // Ported from JTS junit/algorithm/IsCCWTest.java
3
4 // tut
5 #include <tut/tut.hpp>
6 // geos
7 #include <geos/algorithm/Orientation.h>
8 #include <geos/geom/Polygon.h>
9 #include <geos/geom/Geometry.h>
10 #include <geos/geom/CoordinateSequence.h>
11 #include <geos/geom/Coordinate.h>
12 #include <geos/io/WKTReader.h>
13 #include <geos/io/WKBReader.h>
14 // std
15 #include <string>
16 #include <memory>
17 #include <cassert>
18 #include <sstream>
19
20 using namespace geos::algorithm;
21
22 namespace tut {
23 //
24 // Test Group
25 //
26
27 struct test_isccw_data {
28 typedef std::unique_ptr<geos::geom::Geometry> GeometryPtr;
29
30 geos::io::WKTReader reader_;
31 geos::io::WKBReader breader_;
32
33 test_isccw_data()
34 {
35 }
36
37 ~test_isccw_data()
38 {
39 }
40
41 void
42 checkOrientationCCW(bool expectedCCW, const std::string& wkt)
43 {
44 GeometryPtr geom(reader_.read(wkt));
45 geos::geom::Polygon* poly = dynamic_cast<geos::geom::Polygon*>(geom.get());
46 ensure("WKT must be POLYGON)", poly != nullptr);
47 const geos::geom::CoordinateSequence* cs = poly->getExteriorRing()->getCoordinatesRO();
48 bool actualCCW = Orientation::isCCW(cs);
49 ensure_equals("CoordinateSequence isCCW", expectedCCW, actualCCW);
50 }
51
52 void
53 checkHexOrientationCCW(bool expectedCCW, std::istringstream& wkt)
54 {
55 GeometryPtr geom(breader_.readHEX(wkt));
56 auto cs = geom->getCoordinates();
57 bool actualCCW = Orientation::isCCW(cs.get());
58 ensure_equals("CoordinateSequence isCCW", expectedCCW, actualCCW);
59 }
60
61 };
62
63 typedef test_group<test_isccw_data> group;
64 typedef group::object object;
65
66 group test_isccw_group("geos::algorithm::CGAlgorithms::isCCW");
67
68 //
69 // Test Cases
70 //
71
72 // 1 - Test if coordinates of polygon are counter-clockwise oriented
73 template<>
74 template<>
75 void object::test<1>
76 ()
77 {
78 const std::string wkt("POLYGON ((60 180, 140 240, 140 240, 140 240, 200 180, 120 120, 60 180))");
79 checkOrientationCCW(false, wkt);
80 }
81
82 // 2 - Test if coordinates of polygon are counter-clockwise oriented
83 template<>
84 template<>
85 void object::test<2>
86 ()
87 {
88 const std::string wkt("POLYGON ((60 180, 140 120, 100 180, 140 240, 60 180))");
89 checkOrientationCCW(true, wkt);
90 }
91
92 // 3 - Test the same polygon as in test No 2 but with duplicated top point
93 template<>
94 template<>
95 void object::test<3>
96 ()
97 {
98 const std::string wkt("POLYGON ((60 180, 140 120, 100 180, 140 240, 140 240, 60 180))");
99 checkOrientationCCW(true, wkt);
100 }
101
102 // 4 - Test orientation the narrow (almost collapsed) ring
103 // resulting in GEOS during execution of the union described
104 // in http://trac.osgeo.org/geos/ticket/398
105 template<>
106 template<>
107 void object::test<4>
108 ()
109 {
110 std::istringstream
111 wkt("0102000000040000000000000000000000841D588465963540F56BFB214F0341408F26B714B2971B40F66BFB214F0341408C26B714B2971B400000000000000000841D588465963540");
112 checkHexOrientationCCW(true, wkt);
113 }
114
115 // 5 - Test orientation the narrow (almost collapsed) ring
116 // resulting in JTS during execution of the union described
117 // in http://trac.osgeo.org/geos/ticket/398
118 template<>
119 template<>
120 void object::test<5>
121 ()
122 {
123 std::istringstream
124 wkt("0102000000040000000000000000000000841D588465963540F56BFB214F0341408F26B714B2971B40F66BFB214F0341408E26B714B2971B400000000000000000841D588465963540");
125 checkHexOrientationCCW(true, wkt);
126 }
127
128 // testCCWSmall
129 template<>
130 template<>
131 void object::test<6>
132 ()
133 {
134 const std::string wkt("POLYGON ((1 1, 9 1, 5 9, 1 1))");
135 checkOrientationCCW(true, wkt);
136 }
137
138 // testFlatTopSegment
139 template<>
140 template<>
141 void object::test<7>
142 ()
143 {
144 const std::string wkt("POLYGON ((100 200, 200 200, 200 100, 100 100, 100 200))");
145 checkOrientationCCW(false, wkt);
146 }
147
148 // testFlatMultipleTopSegment
149 template<>
150 template<>
151 void object::test<8>
152 ()
153 {
154 const std::string wkt("POLYGON ((100 200, 127 200, 151 200, 173 200, 200 200, 100 100, 100 200))");
155 checkOrientationCCW(false, wkt);
156 }
157
158 // testDegenerateRingHorizontal
159 template<>
160 template<>
161 void object::test<9>
162 ()
163 {
164 const std::string wkt("POLYGON ((100 200, 100 200, 200 200, 100 200))");
165 checkOrientationCCW(false, wkt);
166 }
167
168 // testDegenerateRingAngled
169 template<>
170 template<>
171 void object::test<10>
172 ()
173 {
174 const std::string wkt("POLYGON ((100 100, 100 100, 200 200, 100 100))");
175 checkOrientationCCW(false, wkt);
176 }
177
178 // testDegenerateRingVertical
179 template<>
180 template<>
181 void object::test<11>
182 ()
183 {
184 const std::string wkt("POLYGON ((200 100, 200 100, 200 200, 200 100))");
185 checkOrientationCCW(false, wkt);
186 }
187
188 /**
189 * This case is an invalid ring, so answer is a default value
190 */
191 // testTopAngledSegmentCollapse
192 template<>
193 template<>
194 void object::test<12>
195 ()
196 {
197 const std::string wkt("POLYGON ((10 20, 61 20, 20 30, 50 60, 10 20))");
198 checkOrientationCCW(false, wkt);
199 }
200
201 // testABATopFlatSegmentCollapse
202 template<>
203 template<>
204 void object::test<13>
205 ()
206 {
207 const std::string wkt("POLYGON ((71 0, 40 40, 70 40, 40 40, 20 0, 71 0))");
208 checkOrientationCCW(true, wkt);
209 }
210
211 // testABATopFlatSegmentCollapseMiddleStart
212 template<>
213 template<>
214 void object::test<14>
215 ()
216 {
217 const std::string wkt("POLYGON ((90 90, 50 90, 10 10, 90 10, 50 90, 90 90))");
218 checkOrientationCCW(true, wkt);
219 }
220
221 // testMultipleTopFlatSegmentCollapseSinglePoint
222 template<>
223 template<>
224 void object::test<15>
225 ()
226 {
227 const std::string wkt("POLYGON ((100 100, 200 100, 150 200, 170 200, 200 200, 100 200, 150 200, 100 100))");
228 checkOrientationCCW(true, wkt);
229 }
230
231 // testMultipleTopFlatSegmentCollapseFlatTop
232 template<>
233 template<>
234 void object::test<16>
235 ()
236 {
237 const std::string wkt("POLYGON ((10 10, 90 10, 70 70, 90 70, 10 70, 30 70, 50 70, 10 10))");
238 checkOrientationCCW(true, wkt);
239 }
240
241
242
243
244 } // namespace tut
245
0 #include <tut/tut.hpp>
1 #include "capi_test_utils.h"
2
3 namespace tut {
4 //
5 // Test Group
6 //
7
8 struct test_geosgeom_createlinestring_data : public capitest::utility {};
9
10 typedef test_group<test_geosgeom_createlinestring_data> group;
11 typedef group::object object;
12
13 group test_geosgeom_createlinestring("capi::GEOSGeom_createLineString");
14
15 template<>
16 template<>
17 void object::test<1>
18 ()
19 {
20 GEOSCoordSequence* seq = GEOSCoordSeq_create(3, 2);
21
22 GEOSCoordSeq_setXY(seq, 0, 1, 2);
23 GEOSCoordSeq_setXY(seq, 1, 4, 5);
24 GEOSCoordSeq_setXY(seq, 2, 9, -2);
25
26 GEOSGeometry* result = GEOSGeom_createLineString(seq);
27 GEOSGeometry* expected = GEOSGeomFromWKT("LINESTRING (1 2, 4 5, 9 -2)");
28
29 ensure_equals(GEOSEqualsExact(result, expected, 0), 1);
30
31 GEOSGeom_destroy(result);
32 GEOSGeom_destroy(expected);
33 }
34
35 } // namespace tut
36
0 #include <tut/tut.hpp>
1 #include "capi_test_utils.h"
2
3 namespace tut {
4 //
5 // Test Group
6 //
7
8 struct test_geosgeom_createpolygon_data : public capitest::utility {};
9
10 typedef test_group<test_geosgeom_createpolygon_data> group;
11 typedef group::object object;
12
13 group test_geosgeom_createpolygon("capi::GEOSGeom_createPolygon");
14
15 template<>
16 template<>
17 void object::test<1>
18 ()
19 {
20 GEOSCoordSequence* shell_seq = GEOSCoordSeq_create(5, 2);
21 GEOSCoordSequence* hole_seq = GEOSCoordSeq_create(5, 2);
22
23 double shell_coords[] = {0,0, 0,10, 10,10, 10,0, 0,0};
24 double hole_coords[] = {5,5, 5,6, 6,6, 6,5, 5,5};
25 for (int i = 0; i < 5; i++) {
26 GEOSCoordSeq_setXY(shell_seq, i, shell_coords[2*i], shell_coords[2*i+1]);
27 GEOSCoordSeq_setXY(hole_seq, i, hole_coords[2*i], hole_coords[2*i+1]);
28 }
29
30 GEOSGeometry* shell = GEOSGeom_createLinearRing(shell_seq);
31 GEOSGeometry* hole = GEOSGeom_createLinearRing(hole_seq);
32 GEOSGeometry** holes = (GEOSGeometry**)malloc(sizeof(GEOSGeometry *));
33 holes[0] = hole;
34
35 GEOSGeometry* polygon = GEOSGeom_createPolygon(shell, holes, 1);
36 GEOSGeometry* expected = GEOSGeomFromWKT("POLYGON((0 0, 0 10, 10 10, 10 0, 0 0),(5 5, 5 6, 6 6, 6 5, 5 5))");
37
38 // GEOSWKTWriter* w = GEOSWKTWriter_create();
39 // printf("%s\n", GEOSWKTWriter_write(w, polygon));
40 // printf("%s\n", GEOSWKTWriter_write(w, expected));
41
42 ensure_equals(GEOSEqualsExact(polygon, expected, 0), 1);
43
44 GEOSGeom_destroy(polygon);
45 GEOSGeom_destroy(expected);
46 // WARNING! The GEOSGeom_createPolygon takes ownership of the
47 // GEOSGeometry, but not the containing array!
48 // maybe this should be changed...
49 free(holes);
50 }
51
52 } // namespace tut
53
22
33 // tut
44 #include <tut/tut.hpp>
5 #include <utility.h>
56 // geos
67 #include <geos/operation/buffer/BufferOp.h>
78 #include <geos/operation/buffer/BufferParameters.h>
446447 ensure_equals(gBuffer->getGeometryTypeId(), geos::geom::GEOS_MULTIPOLYGON);
447448 }
448449
450
451 // This now works since buffer ring orientation is changed to use signed-area test.
452 // testBowtiePolygonLargestAreaRetained
453 template<>
454 template<>
455 void object::test<15>
456 ()
457 {
458 std::string wkt0("POLYGON ((10 10, 50 10, 25 35, 35 35, 10 10))");
459 GeomPtr g0(wktreader.read(wkt0));
460 GeomPtr gresult = g0->buffer(0.0);
461 std::string wkt1("POLYGON ((10 10, 30 30, 50 10, 10 10))");
462 GeomPtr gexpected(wktreader.read(wkt1));
463 ensure_equals_geometry(gresult.get(), gexpected.get());
464 }
465
466
449467 } // namespace tut
450468
4141 // std::string wkt_result = w.write(geom_result.get());
4242 // std::cout << std::endl << wkt_result << std::endl;
4343 ensure_equals_geometry(geom_expected.get(), geom_result.get());
44 }
45
46 void
47 testOverlayExact(const std::string& a, const std::string& b, const std::string& expected, int opCode, double scaleFactor)
48 {
49 std::unique_ptr<PrecisionModel> pm;
50 if (scaleFactor > 0)
51 pm.reset(new PrecisionModel(scaleFactor));
52 else
53 pm.reset(new PrecisionModel());
54
55 std::unique_ptr<Geometry> geom_a = r.read(a);
56 std::unique_ptr<Geometry> geom_b = r.read(b);
57 std::unique_ptr<Geometry> geom_expected = r.read(expected);
58 std::unique_ptr<Geometry> geom_result = OverlayNG::overlay(geom_a.get(), geom_b.get(), opCode, pm.get());
59 // std::string wkt_result = w.write(geom_result.get());
60 // std::cout << std::endl << wkt_result << std::endl;
61 ensure_equals_exact_geometry(geom_expected.get(), geom_result.get(), 0);
4462 }
4563
4664 void
530548 testOverlay(a, b, exp, OverlayNG::INTERSECTION, 0);
531549 }
532550
551 template<>
552 template<>
553 void object::test<43> ()
554 {
555 set_test_name("testPolygonLineIntersectionOrder");
556 std::string a = "POLYGON ((1 1, 1 9, 9 9, 9 7, 3 7, 3 3, 9 3, 9 1, 1 1))";
557 std::string b = "MULTILINESTRING ((2 10, 2 0), (4 10, 4 0))";
558 std::string exp = "MULTILINESTRING ((2 9, 2 1), (4 9, 4 7), (4 3, 4 1))";
559 testOverlay(a, b, exp, OverlayNG::INTERSECTION, 0);
560 }
561
562 template<>
563 template<>
564 void object::test<44> ()
565 {
566 set_test_name("testPolygonLineVerticalntersection");
567 std::string a = "POLYGON ((-200 -200, 200 -200, 200 200, -200 200, -200 -200))";
568 std::string b = "LINESTRING (-100 100, -100 -100)";
569 std::string exp = "LINESTRING (-100 100, -100 -100)";
570 testOverlay(a, b, exp, OverlayNG::INTERSECTION, 0);
571 }
572
573 template<>
574 template<>
575 void object::test<45> ()
576 {
577 set_test_name("testPolygonLineHorizontalIntersection");
578 std::string a = "POLYGON ((10 90, 90 90, 90 10, 10 10, 10 90))";
579 std::string b = "LINESTRING (20 50, 80 50)";
580 std::string exp = "LINESTRING (20 50, 80 50)";
581 testOverlay(a, b, exp, OverlayNG::INTERSECTION, 0);
582 }
583
533584 } // namespace tut
0 #include <tut/tut.hpp>
1 // geos
2 #include <geos/constants.h> // for std::isnan
3 #include <geos/geom/Coordinate.h>
4 #include <geos/geom/CoordinateSequenceFactory.h>
5 #include <geos/geom/Polygon.h>
6 #include <geos/geom/GeometryFactory.h>
7 #include <geos/operation/valid/MakeValid.h>
8 #include <geos/io/WKTReader.h>
9 #include <geos/io/WKTWriter.h>
10 // std
11 #include <cmath>
12 #include <string>
13 #include <vector>
14 #include <fstream>
15
16 using namespace geos::geom;
17 using namespace geos::operation::valid;
18
19 namespace tut {
20 //
21 // Test Group
22 //
23
24 struct test_makevalid_data {
25 test_makevalid_data() {}
26 };
27
28 typedef test_group<test_makevalid_data> group;
29 typedef group::object object;
30
31 group test_makevalid_group("geos::operation::valid::MakeValid");
32
33 //
34 // Test Cases
35 //
36
37 // https://github.com/libgeos/geos/issues/265
38 template<>
39 template<>
40 void object::test<1>
41 ()
42 {
43 std::vector<Coordinate> v;
44 v.emplace_back(2.22, 2.28);
45 v.emplace_back(7.67, 2.06);
46 v.emplace_back(10.98, 7.70);
47 v.emplace_back(9.39, 5.00);
48 v.emplace_back(7.96, 7.12);
49 v.emplace_back(6.77, 5.16);
50 v.emplace_back(7.43, 6.24);
51 v.emplace_back(3.70, 7.22);
52 v.emplace_back(5.72, 5.77);
53 v.emplace_back(4.18, 10.74);
54 v.emplace_back(2.20, 6.83);
55 v.emplace_back(2.22, 2.28);
56
57 auto gf = GeometryFactory::getDefaultInstance();
58
59 auto cs = gf->getCoordinateSequenceFactory()->create(std::move(v));
60 auto lr = gf->createLinearRing(std::move(cs));
61 auto errplyg = gf->createPolygon(std::move(lr));
62
63 ensure(!errplyg->isValid());
64
65 MakeValid mkvalid;
66 auto validGeom = mkvalid.build(errplyg.get());
67
68 ensure(validGeom->isValid());
69 }
70
71 // template<>
72 // template<>
73 // void object::test<2>
74 // ()
75 // {
76
77
78 // std::ifstream ifs("GoesBathymetryBug.txt");
79 // std::string content((std::istreambuf_iterator<char>(ifs)),
80 // (std::istreambuf_iterator<char>()));
81
82 // geos::io::WKTReader reader;
83 // auto geom(reader.read(content));
84
85 // // auto gf = GeometryFactory::getDefaultInstance();
86
87 // // auto cs = gf->getCoordinateSequenceFactory()->create(std::move(v));
88 // // auto lr = gf->createLinearRing(std::move(cs));
89 // // auto errplyg = gf->createPolygon(std::move(lr));
90
91 // // ensure(!errplyg->isValid());
92
93 // MakeValid mkvalid;
94 // auto validGeom = mkvalid.build(geom.get());
95 // ensure("MakeValid output is not valid", validGeom->isValid());
96
97 // geos::io::WKTWriter writer;
98 // writer.setOutputDimension(2);
99 // writer.setTrim(true);
100 // std::string result = writer.write(validGeom.get());
101 // std::cout << result << std::endl;
102
103 // }
104
105
106
107 } // namespace tut
11 // Test Suite for geos::simplify::DouglasPeuckerSimplifierTest
22
33 #include <tut/tut.hpp>
4 #include <utility.h>
45 // geos
56 #include <geos/io/WKTReader.h>
67 #include <geos/io/WKTWriter.h>
352353 // 13 - Polygon with inner ring whose extent is less than the simplify distance (#741)
353354 template<>
354355 template<>
356 void object::test<12>
357 ()
358 {
359 std::string wkt_in("POLYGON ((0 0,0 1,1 1,0 0),(0.1 0.1,0.2 0.1,0.2 0.2,0.1 0.1))");
360
361 std::string wkt_ex("POLYGON ((0 0,0 1,1 1,0 0))");
362
363 GeomPtr g(wktreader.read(wkt_in));
364
365 GeomPtr expected(wktreader.read(wkt_ex));
366
367 GeomPtr simplified = DouglasPeuckerSimplifier::simplify(
368 g.get(), 0.5);
369
370 ensure(simplified->isValid());
371
372 ensure(simplified->equalsExact(expected.get()));
373 }
374
375 /**
376 * Test that a polygon made invalid by simplification
377 * is fixed in a sensible way.
378 * Fixed by buffer(0) area-base orientation
379 * See https://github.com/locationtech/jts/issues/498
380 */
381 template<>
382 template<>
355383 void object::test<13>
356384 ()
357385 {
358 std::string wkt_in("POLYGON ((0 0,0 1,1 1,0 0),(0.1 0.1,0.2 0.1,0.2 0.2,0.1 0.1))");
359
360 std::string wkt_ex("POLYGON ((0 0,0 1,1 1,0 0))");
361
362 GeomPtr g(wktreader.read(wkt_in));
363
364 GeomPtr expected(wktreader.read(wkt_ex));
365
366 GeomPtr simplified = DouglasPeuckerSimplifier::simplify(
367 g.get(), 0.5);
368
369 ensure(simplified->isValid());
370
371 ensure(simplified->equalsExact(expected.get()));
372 }
386 std::string wkt_in("POLYGON ((21.32686 47.78723, 21.32386 47.79023, 21.32186 47.80223, 21.31486 47.81023, 21.32786 47.81123, 21.33986 47.80223, 21.33886 47.81123, 21.32686 47.82023, 21.32586 47.82723, 21.32786 47.82323, 21.33886 47.82623, 21.34186 47.82123, 21.36386 47.82223, 21.40686 47.81723, 21.32686 47.78723))");
387 std::string wkt_ex("POLYGON ((21.32686 47.78723, 21.31486 47.81023, 21.32786 47.81123, 21.33986 47.80223, 21.328068201892744 47.823286782334385, 21.33886 47.82623, 21.34186 47.82123, 21.40686 47.81723, 21.32686 47.78723))");
388 GeomPtr g(wktreader.read(wkt_in));
389 GeomPtr expected(wktreader.read(wkt_ex));
390 GeomPtr simplified = DouglasPeuckerSimplifier::simplify(g.get(), 0.0036);
391 ensure(simplified->isValid());
392 ensure_equals_geometry(simplified.get(), expected.get());
393 }
394
395
373396
374397 } // namespace tut
375398
311311 // std::cout << "expected " << *exp << std::endl;
312312 // std::cout << "result " << *simplified << std::endl;
313313 ensure("Simplified geometry is invalid!", simplified->isValid());
314 ensure_equals_geometry(exp.get(), simplified.get());
314 /* Temporarily disable this component of the test only for MSVC
315 See https://trac.osgeo.org/geos/ticket/1081 */
316 #ifndef _MSC_VER
317 ensure_equals_geometry(exp.get(), simplified.get());
318 #endif
315319 }
316320
317321 // GeometryCollection
326326 ensure_equals_exact_geometry_xyz(g1.get(), g2.get(), tolerance);
327327 }
328328
329 /*
330 * Checks for geometries exactly equal in XY only
331 */
332
333 template <typename T> inline void ensure_equals_exact_geometry(const T *lhs_in, const T *rhs_in, double tolerance = 0.0);
334
335 template <>
336 inline void
337 ensure_equals_exact_geometry(const geos::geom::Geometry *lhs_in,
338 const geos::geom::Geometry *rhs_in,
339 double tolerance)
340 {
341 assert(nullptr != lhs_in);
342 assert(nullptr != rhs_in);
343
344 using geos::geom::Point;
345 using geos::geom::LineString;
346 using geos::geom::Polygon;
347 using geos::geom::CoordinateSequence;
348 using geos::geom::GeometryCollection;
349
350 ensure_equals("type id do not match",
351 lhs_in->getGeometryTypeId(), rhs_in->getGeometryTypeId());
352
353 if (const Point* gpt1 = dynamic_cast<const Point *>(lhs_in)) {
354 const Point *gpt2 = static_cast<const Point *>(rhs_in);
355 return ensure_equals_dims( gpt1->getCoordinatesRO(), gpt2->getCoordinatesRO(), 2, tolerance);
356 }
357 else if (const LineString* gln1 = dynamic_cast<const LineString *>(lhs_in)) {
358 const LineString *gln2 = static_cast<const LineString *>(rhs_in);
359 return ensure_equals_dims( gln1->getCoordinatesRO(), gln2->getCoordinatesRO(), 2, tolerance);
360 }
361 else if (dynamic_cast<const Polygon *>(lhs_in)) {
362 assert("Not implemented yet" == 0);
363 }
364 else if (const GeometryCollection* gc1 = dynamic_cast<const GeometryCollection *>(lhs_in)) {
365 const GeometryCollection *gc2 = static_cast<const GeometryCollection *>(rhs_in);
366 for (unsigned int i = 0; i < gc1->getNumGeometries(); i++) {
367 ensure_equals_exact_geometry(gc1->getGeometryN(i), gc2->getGeometryN(i), tolerance);
368 }
369 }
370 }
371
329372 //
330373 // Utility functions
331374 //
352395 } // namespace tut
353396
354397 #endif // #ifndef GEOS_TUT_UTILITY_H_INCLUDED
355
165165 $(srcdir)/tests/issue/issue-geos-990.xml \
166166 $(srcdir)/tests/issue/issue-geos-994.xml \
167167 $(srcdir)/tests/issue/issue-geos-1018.xml \
168 $(srcdir)/tests/issue/issue-geos-1085.xml \
168169 $(srcdir)/tests/validate/TestRelateAA-big.xml \
169170 $(srcdir)/tests/validate/TestRelateAA.xml \
170171 $(srcdir)/tests/validate/TestRelateAC.xml \
12361236 $(srcdir)/tests/issue/issue-geos-990.xml \
12371237 $(srcdir)/tests/issue/issue-geos-994.xml \
12381238 $(srcdir)/tests/issue/issue-geos-1018.xml \
1239 $(srcdir)/tests/issue/issue-geos-1085.xml \
12391240 $(srcdir)/tests/validate/TestRelateAA-big.xml \
12401241 $(srcdir)/tests/validate/TestRelateAA.xml \
12411242 $(srcdir)/tests/validate/TestRelateAC.xml \
13111311
13121312 else if(opName == "union") {
13131313 GeomPtr gRes(parseGeometry(opRes, "expected"));
1314 gRes->normalize();
13141315
13151316 profile.start();
13161317
13231324 }
13241325
13251326 profile.stop();
1327 gRealRes->normalize();
13261328
13271329 success = checkOverlaySuccess(*gRes, *gRealRes);
13281330
24132415 * Revision 1.29 2006/03/17 14:56:39 strk
24142416 * Fixed filename normalizer for sql output
24152417 **********************************************************************/
2416
204204 </case>
205205
206206 <case>
207 <desc>LA - vertical Line</desc>
208 <a>
209 LINESTRING (50 50, 50 20)
210 </a>
211 <b>
212 POLYGON ((10 60, 90 60, 90 10, 10 10, 10 60))
213 </b>
214 <test> <op name="intersectionNG" arg1="A" arg2="B">
215 LINESTRING (50 50, 50 20)
216 </op></test>
217 <test> <op name="unionNG" arg1="A" arg2="B">
218 POLYGON ((90 60, 90 10, 10 10, 10 60, 90 60))
219 </op></test>
220 <test> <op name="differenceNG" arg1="A" arg2="B">
221 LINESTRING EMPTY
222 </op></test>
223 <test> <op name="differenceNG" arg1="B" arg2="A">
224 POLYGON ((90 60, 90 10, 10 10, 10 60, 90 60))
225 </op></test>
226 <test> <op name="symdifferenceNG" arg1="A" arg2="B">
227 POLYGON ((90 60, 90 10, 10 10, 10 60, 90 60))
228 </op></test>
229 </case>
230
231 <case>
207232 <desc>mLmA - disjoint and overlaps in lines and points</desc>
208233 <a>
209234 MULTILINESTRING ((50 150, 150 150), (100 350, 200 350), (320 350, 350 350), (300 150, 400 150), (150 300, 400 300))