Commit 8cc442a7110107bf185c11f1ec3e77918090c404
1 parent
121a7a63
Exists in
master
Implementando módulo PHP5 stand-alone
Showing
16 changed files
with
4972 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,23 @@ |
1 | +Makefile | |
2 | +*~ | |
3 | +*.bak | |
4 | +*.layout | |
5 | +aclocal.m4 | |
6 | +autom4te.cache | |
7 | +*.log | |
8 | +config.status | |
9 | +configure | |
10 | +config.h | |
11 | +stamp-h1 | |
12 | +.bin | |
13 | +.obj | |
14 | +.src | |
15 | +*.zip | |
16 | +*.tar | |
17 | +*.bz2 | |
18 | +rpm | |
19 | +*.depend | |
20 | +ChangeLog | |
21 | +revision | |
22 | +revision.m4 | |
23 | +php3270.h | ... | ... |
... | ... | @@ -0,0 +1,164 @@ |
1 | +GNU LESSER GENERAL PUBLIC LICENSE (LICENÇA PÚBLICA MENOS GERAL GNU) | |
2 | +Versão 3, 29 de junho de 2007 | |
3 | +Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org> | |
4 | + | |
5 | +É permitido a todos copiar e distribuir cópias literais deste documento de | |
6 | +licença, mas sua alteração não é permitida. | |
7 | + | |
8 | +Esta versão da GNU Lesser General Public License incorpora os termos e | |
9 | +condições da versão 3 da GNU General Public License, complementada pelas | |
10 | +permissões adicionais listadas abaixo. | |
11 | + | |
12 | +0. Definições Adicionais. | |
13 | + | |
14 | +De acordo com sua utilização no presente documento, "esta Licença" refere- | |
15 | +se à versão 3 da GNU Lesser General Public License (Licença Pública Menos | |
16 | +Geral GNU) e "GNU GPL" refere-se à versão 3 da GNU General Public | |
17 | +License (Licença Pública Geral GNU). | |
18 | + | |
19 | +"A Biblioteca" refere-se a um trabalho coberto regido nos termos desta | |
20 | +Licença que não se trate de um Aplicativo ou Trabalho Combinado conforme | |
21 | +definido abaixo. | |
22 | + | |
23 | +Um "Aplicativo" constitui qualquer trabalho que faça uso de uma interface | |
24 | +fornecida pela Biblioteca, mas que não se encontra de outra forma baseada na | |
25 | +referida Biblioteca. A definição de uma subclasse de uma classe definida pela | |
26 | +Biblioteca é considerada um modo de utilizar uma interface fornecida pela | |
27 | +Biblioteca. | |
28 | + | |
29 | +Um "Trabalho Combinado" constitui um trabalho produzido através da | |
30 | +combinação ou vinculação de um Aplicativo à Biblioteca. A versão | |
31 | +específica da Biblioteca com a qual o Trabalho Combinado foi elaborado é | |
32 | +também denominada "Linked Version" [Versão Vinculada]. | |
33 | + | |
34 | +A "Fonte Mínima Correspondente" de um Trabalho Combinado significa a | |
35 | +Fonte Correspondente ao Trabalho Combinado, excluindo qualquer código | |
36 | +fonte de parte do Trabalho Combinado que, considerado de forma isolada, | |
37 | +seja baseado no Aplicativo e não na Versão Vinculada. | |
38 | + | |
39 | +O "Código do aplicativo Correspondente" de um Trabalho Combinado | |
40 | +significa o código objeto e/ou código fonte do Aplicativo, incluindo | |
41 | +quaisquer dados e programas utilitários necessários para a reprodução do | |
42 | +Trabalho Combinado do Aplicativo, mas excluindo as Bibliotecas de Sistema | |
43 | +do Trabalho Combinado. | |
44 | + | |
45 | +1. Exceção à Seção 3 da GNU GPL. | |
46 | + | |
47 | +Você pode distribuir um trabalho coberto nos termos das seções 3 e 4 desta | |
48 | +Licença sem estar limitado aos termos da seção 3 da GNU GPL. | |
49 | + | |
50 | +2. Distribuição de Versões Modificadas. | |
51 | + | |
52 | +Ser vocẽ modificar uma cópia da Biblioteca e, em suas modificações um | |
53 | +recurso referir-se a uma função os dados a serem fornecidos por um | |
54 | +Aplicativo que utiliza o recurso (diferente de quando um argumento é | |
55 | +transmitido quando o recurso é chamado), voçe pode distribuir uma cópia da | |
56 | +versão modificada: | |
57 | + | |
58 | +a) Nos termos desta Licença, desde que você faça um esforço de boa-fé para | |
59 | +garantir que, caso um Aplicativo não forneça a função o dado, o recurso | |
60 | +ainda funcione e execute qualquer parte do seu propósito que permaneça | |
61 | +significatio, ou | |
62 | + | |
63 | +b) nos termos da GNU GPL, sem nenhuma permissão adicional desta Licença | |
64 | +aplicável à referida cópia. | |
65 | + | |
66 | +3. Material que Incorpore Código Objeto dos Arquivos de Cabeçalho da | |
67 | +Biblioteca. | |
68 | + | |
69 | +A forma do código objeto de um Aplicativo pode incorporar material de um | |
70 | +arquivo de cabeçalho que faz parte da Biblioteca. Você pode distribuir o | |
71 | +referido código objeto da forma como escolher, desde que, se o material | |
72 | +incorporado não estiver limitado a parâmetros numéricos, layouts de | |
73 | +estruturas de dados e agentes de acesso ou pequenas macros, funções | |
74 | +sequenciais e modelos (dez ou menos linhas de comprimento), voçê faça o | |
75 | +seguinte: | |
76 | + | |
77 | +a) Forneça um aviso proeminente com cada cópia do código objeto de que | |
78 | +este utiliza a Biblioteca e que a Biblioteca e seu uso são coberto por | |
79 | +esta Licença. | |
80 | + | |
81 | +b) Forneça o código objeto com uma cópia da GNU GPL e esta Licença. | |
82 | + | |
83 | +4. Trabalhos Combinados. | |
84 | + | |
85 | +Você pode distribuir um Trabalho Combinado nos termos que escolher e que, | |
86 | +reunidos em conjunto, não restrinjam de forma efetiva a modificação das | |
87 | +partes da Biblioteca contidas no Trabalho Combinado e a engenharia reversa | |
88 | +para depurações de tais modificações se você também fizer o seguinte: | |
89 | + | |
90 | +a) Fornecer um aviso proeminente com cada cópia do Trabalho Combinado | |
91 | +de que este utiliza a Biblioteca e que a Biblioteca e seu uso são cobertos | |
92 | +por esta Licença. | |
93 | + | |
94 | +b) Fornecer o Trabalho Combinado com uma cópia da GNU GPL e esta | |
95 | +Licença. | |
96 | + | |
97 | +c) Para um Trabalho Combinado que exiba avisos de copyright durante | |
98 | +a execução, incluir o aviso de copyright da Biblioteca entre esses avisos,bem | |
99 | +como uma referência direcionando o usuário para as cópias da GNU GPL e | |
100 | +esta Licença. | |
101 | + | |
102 | +d) Faça um dos seguintes: | |
103 | + | |
104 | +0) Distribua a Fonte Mínima Correspondente nos termos desta Licença e o | |
105 | +Código do Aplicativo Correspondente em uma forma adequada para, e sob | |
106 | +termos que permitam, que o usuário recombine ou revincule o Aplicativo a | |
107 | +uma versão modificada da Versão Vinculada para produzir um Trabalho | |
108 | +Combinado modificado, na forma especificada pela seção 6 da GNU GPL | |
109 | +para distribuição da Fonte Correspondente. | |
110 | + | |
111 | +1) Utilize um mecanismo de biblioteca compartilhada adequado para | |
112 | +vinculação à Biblioteca. | |
113 | + | |
114 | +Um mecanismo adequado é um mecanismo que (a) utiliza em tempo de | |
115 | +execução uma cópia da Biblioteca já presente no sistema de computadores de | |
116 | +usuário e, (b) operará de forma apropriada com uma versão modificada da | |
117 | +Biblioteca que seja compatível com a interface da Versão Vinculada. | |
118 | +e) Forneça Informações de Instalação, mas somente se for necessário de outro | |
119 | +modo fornecer as referidas informações nos termos da seção 6 da GNU GPL, | |
120 | +e somente na medida em que tais informações sejam necessárias para instalar | |
121 | +e executar uma versão modificada do Trabalho Combinado produzido através | |
122 | +da recombinação ou revinculação do Aplicativo a uma versão modificada da | |
123 | +Versão Vinculada. (Se você utilizar a opção 4d0, as Informações de | |
124 | +Instalação devem acompanhar a Fonte Mínima Correspondente e o Código do | |
125 | +Aplicativo Correspondente. Se utilizar a opção 4d1, você deve fornecer as | |
126 | +Informações de Instalação da forma especificada na seção 6 da GNU GPL | |
127 | +para distribuição da Fonte Correspondente.) | |
128 | + | |
129 | +5. Bibliotecas Combinadas. | |
130 | + | |
131 | +Você pode colocar os recursos de biblioteca que constituem um trabalho | |
132 | +baseado na Biblioteca lado a lado em uma única biblioteca em conjunto com | |
133 | +outros recursos de biblioteca que não sejam Aplicativos e não sejam cobertos | |
134 | +por esta Licença, e distribuir a referida biblioteca combinada nos termos de | |
135 | +sua escolha, se fizer o seguinte: | |
136 | + | |
137 | +a) Faça a biblioteca combinada ser acompanhada de uma cópia do mesmo | |
138 | +trabalho baseado na Biblioteca, não combinado a nenhum outro recurso da | |
139 | +biblioteca, distribuído nos termos desta Licença. | |
140 | + | |
141 | +b) Forneça um aviso proeminente com a biblioteca combinada de que parte | |
142 | +da mesma corresponde a um trabalho baseado na Biblioteca e explique onde | |
143 | +localizar a forma não combinada de acompanhamento do mesmo trabalho. | |
144 | + | |
145 | +6. Versões Revisadas da GNU Lesser General Public License. | |
146 | + | |
147 | +A Free Software Foundation pode, de tempos em tempos, publicar versões | |
148 | +revisadas e/ou novas versões da GNU Lesser General Public License. Tais | |
149 | +novas versões serão similares em essência à versão atual, mas podem diferir | |
150 | +em detalhes para abordar novos problemas e/ou interesses. | |
151 | + | |
152 | +Cada versão recebe um número de versão distinto. Se a Biblioteca recebida | |
153 | +especificar que uma determinada versão numerada da GNU Lesser General | |
154 | +Public License "ou qualquer versão posterior" se aplique a ela, você tem a | |
155 | +opção de seguir os termos e condições da versão publicada ou de qualquer | |
156 | +versão posterior publicada pela Free Software Foundation. Se a Biblioteca, da | |
157 | +forma como foi recebida, não especificar um número de versão da GNU Lesser | |
158 | +General Public License, você pode escolher qualquer versão da GNU | |
159 | +Lesser General Public License já publicada pela Free Software Foundation. | |
160 | +Se a Biblioteca recebida especificar que um procurador pode decidir se | |
161 | +versões futuras da GNU Lesses General Public License serão aplicáveis, a | |
162 | +instrução pública do procurados de aceitação de qualquer versão constitui | |
163 | +uma autorização permanente para que você escolha esta versão da Biblioteca. | |
164 | + | ... | ... |
... | ... | @@ -0,0 +1,166 @@ |
1 | + GNU LESSER GENERAL PUBLIC LICENSE | |
2 | + Version 3, 29 June 2007 | |
3 | + | |
4 | + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
5 | + Everyone is permitted to copy and distribute verbatim copies | |
6 | + of this license document, but changing it is not allowed. | |
7 | + | |
8 | + | |
9 | + This version of the GNU Lesser General Public License incorporates | |
10 | +the terms and conditions of version 3 of the GNU General Public | |
11 | +License, supplemented by the additional permissions listed below. | |
12 | + | |
13 | + 0. Additional Definitions. | |
14 | + | |
15 | + As used herein, "this License" refers to version 3 of the GNU Lesser | |
16 | +General Public License, and the "GNU GPL" refers to version 3 of the GNU | |
17 | +General Public License. | |
18 | + | |
19 | + "The Library" refers to a covered work governed by this License, | |
20 | +other than an Application or a Combined Work as defined below. | |
21 | + | |
22 | + An "Application" is any work that makes use of an interface provided | |
23 | +by the Library, but which is not otherwise based on the Library. | |
24 | +Defining a subclass of a class defined by the Library is deemed a mode | |
25 | +of using an interface provided by the Library. | |
26 | + | |
27 | + A "Combined Work" is a work produced by combining or linking an | |
28 | +Application with the Library. The particular version of the Library | |
29 | +with which the Combined Work was made is also called the "Linked | |
30 | +Version". | |
31 | + | |
32 | + The "Minimal Corresponding Source" for a Combined Work means the | |
33 | +Corresponding Source for the Combined Work, excluding any source code | |
34 | +for portions of the Combined Work that, considered in isolation, are | |
35 | +based on the Application, and not on the Linked Version. | |
36 | + | |
37 | + The "Corresponding Application Code" for a Combined Work means the | |
38 | +object code and/or source code for the Application, including any data | |
39 | +and utility programs needed for reproducing the Combined Work from the | |
40 | +Application, but excluding the System Libraries of the Combined Work. | |
41 | + | |
42 | + 1. Exception to Section 3 of the GNU GPL. | |
43 | + | |
44 | + You may convey a covered work under sections 3 and 4 of this License | |
45 | +without being bound by section 3 of the GNU GPL. | |
46 | + | |
47 | + 2. Conveying Modified Versions. | |
48 | + | |
49 | + If you modify a copy of the Library, and, in your modifications, a | |
50 | +facility refers to a function or data to be supplied by an Application | |
51 | +that uses the facility (other than as an argument passed when the | |
52 | +facility is invoked), then you may convey a copy of the modified | |
53 | +version: | |
54 | + | |
55 | + a) under this License, provided that you make a good faith effort to | |
56 | + ensure that, in the event an Application does not supply the | |
57 | + function or data, the facility still operates, and performs | |
58 | + whatever part of its purpose remains meaningful, or | |
59 | + | |
60 | + b) under the GNU GPL, with none of the additional permissions of | |
61 | + this License applicable to that copy. | |
62 | + | |
63 | + 3. Object Code Incorporating Material from Library Header Files. | |
64 | + | |
65 | + The object code form of an Application may incorporate material from | |
66 | +a header file that is part of the Library. You may convey such object | |
67 | +code under terms of your choice, provided that, if the incorporated | |
68 | +material is not limited to numerical parameters, data structure | |
69 | +layouts and accessors, or small macros, inline functions and templates | |
70 | +(ten or fewer lines in length), you do both of the following: | |
71 | + | |
72 | + a) Give prominent notice with each copy of the object code that the | |
73 | + Library is used in it and that the Library and its use are | |
74 | + covered by this License. | |
75 | + | |
76 | + b) Accompany the object code with a copy of the GNU GPL and this license | |
77 | + document. | |
78 | + | |
79 | + 4. Combined Works. | |
80 | + | |
81 | + You may convey a Combined Work under terms of your choice that, | |
82 | +taken together, effectively do not restrict modification of the | |
83 | +portions of the Library contained in the Combined Work and reverse | |
84 | +engineering for debugging such modifications, if you also do each of | |
85 | +the following: | |
86 | + | |
87 | + a) Give prominent notice with each copy of the Combined Work that | |
88 | + the Library is used in it and that the Library and its use are | |
89 | + covered by this License. | |
90 | + | |
91 | + b) Accompany the Combined Work with a copy of the GNU GPL and this license | |
92 | + document. | |
93 | + | |
94 | + c) For a Combined Work that displays copyright notices during | |
95 | + execution, include the copyright notice for the Library among | |
96 | + these notices, as well as a reference directing the user to the | |
97 | + copies of the GNU GPL and this license document. | |
98 | + | |
99 | + d) Do one of the following: | |
100 | + | |
101 | + 0) Convey the Minimal Corresponding Source under the terms of this | |
102 | + License, and the Corresponding Application Code in a form | |
103 | + suitable for, and under terms that permit, the user to | |
104 | + recombine or relink the Application with a modified version of | |
105 | + the Linked Version to produce a modified Combined Work, in the | |
106 | + manner specified by section 6 of the GNU GPL for conveying | |
107 | + Corresponding Source. | |
108 | + | |
109 | + 1) Use a suitable shared library mechanism for linking with the | |
110 | + Library. A suitable mechanism is one that (a) uses at run time | |
111 | + a copy of the Library already present on the user's computer | |
112 | + system, and (b) will operate properly with a modified version | |
113 | + of the Library that is interface-compatible with the Linked | |
114 | + Version. | |
115 | + | |
116 | + e) Provide Installation Information, but only if you would otherwise | |
117 | + be required to provide such information under section 6 of the | |
118 | + GNU GPL, and only to the extent that such information is | |
119 | + necessary to install and execute a modified version of the | |
120 | + Combined Work produced by recombining or relinking the | |
121 | + Application with a modified version of the Linked Version. (If | |
122 | + you use option 4d0, the Installation Information must accompany | |
123 | + the Minimal Corresponding Source and Corresponding Application | |
124 | + Code. If you use option 4d1, you must provide the Installation | |
125 | + Information in the manner specified by section 6 of the GNU GPL | |
126 | + for conveying Corresponding Source.) | |
127 | + | |
128 | + 5. Combined Libraries. | |
129 | + | |
130 | + You may place library facilities that are a work based on the | |
131 | +Library side by side in a single library together with other library | |
132 | +facilities that are not Applications and are not covered by this | |
133 | +License, and convey such a combined library under terms of your | |
134 | +choice, if you do both of the following: | |
135 | + | |
136 | + a) Accompany the combined library with a copy of the same work based | |
137 | + on the Library, uncombined with any other library facilities, | |
138 | + conveyed under the terms of this License. | |
139 | + | |
140 | + b) Give prominent notice with the combined library that part of it | |
141 | + is a work based on the Library, and explaining where to find the | |
142 | + accompanying uncombined form of the same work. | |
143 | + | |
144 | + 6. Revised Versions of the GNU Lesser General Public License. | |
145 | + | |
146 | + The Free Software Foundation may publish revised and/or new versions | |
147 | +of the GNU Lesser General Public License from time to time. Such new | |
148 | +versions will be similar in spirit to the present version, but may | |
149 | +differ in detail to address new problems or concerns. | |
150 | + | |
151 | + Each version is given a distinguishing version number. If the | |
152 | +Library as you received it specifies that a certain numbered version | |
153 | +of the GNU Lesser General Public License "or any later version" | |
154 | +applies to it, you have the option of following the terms and | |
155 | +conditions either of that published version or of any later version | |
156 | +published by the Free Software Foundation. If the Library as you | |
157 | +received it does not specify a version number of the GNU Lesser | |
158 | +General Public License, you may choose any version of the GNU Lesser | |
159 | +General Public License ever published by the Free Software Foundation. | |
160 | + | |
161 | + If the Library as you received it specifies that a proxy can decide | |
162 | +whether future versions of the GNU Lesser General Public License shall | |
163 | +apply, that proxy's public statement of acceptance of any version is | |
164 | +permanent authorization for you to choose that version for the | |
165 | +Library. | |
166 | + | ... | ... |
... | ... | @@ -0,0 +1,94 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +APPLEVEL="0" | |
4 | + | |
5 | +test -n "$srcdir" || srcdir=`dirname "$0"` | |
6 | +test -n "$srcdir" || srcdir=. | |
7 | + | |
8 | +olddir=`pwd` | |
9 | +cd "$srcdir" | |
10 | + | |
11 | +if test -e revision ; then | |
12 | + . revision | |
13 | +fi | |
14 | + | |
15 | +touch ChangeLog | |
16 | + | |
17 | +# Inicia com os defaults | |
18 | +TEMPFILE=autogen.tmp | |
19 | + | |
20 | +if [ -d .svn ]; then | |
21 | + | |
22 | + # Tenta detectar a versão | |
23 | + SVNVERSION=$(which svnversion 2> /dev/null) | |
24 | + if test -x "${SVNVERSION}" ; then | |
25 | + svnversion | cut -d: -f2 | sed 's@[M|m]@@g' > ${TEMPFILE} 2> /dev/null | |
26 | + if [ "$?" == "0" ]; then | |
27 | + PACKAGE_REVISION=$(cat ${TEMPFILE}) | |
28 | + fi | |
29 | + fi | |
30 | + | |
31 | + # Tenta detectar a URL | |
32 | + SVN=$(which svn 2> /dev/null) | |
33 | + if test -x "${SVN}" ; then | |
34 | + | |
35 | + LANG="EN_US" "${SVN}" info > ${TEMPFILE} 2>&1 | |
36 | + if [ "$?" == "0" ]; then | |
37 | + PACKAGE_SOURCE=$(cat ${TEMPFILE} | grep "^URL: " | cut -d" " -f2) | |
38 | + fi | |
39 | + | |
40 | + fi | |
41 | + | |
42 | +elif [ -d .git ]; then | |
43 | + | |
44 | + # Obtém revisão via git | |
45 | + # Referência: http://stackoverflow.com/questions/4120001/what-is-the-git-equivalent-for-revision-number | |
46 | + | |
47 | + # Obtém URL via git | |
48 | + PACKAGE_SOURCE=$(git config --get remote.origin.url) | |
49 | + | |
50 | + # Obtém número total de commits | |
51 | + PACKAGE_REVISION=$(git rev-list HEAD --count) | |
52 | + | |
53 | +fi | |
54 | + | |
55 | + | |
56 | +rm -f $TEMPFILE | |
57 | + | |
58 | +if test -z ${PACKAGE_REVISION} ; then | |
59 | + echo "Can´t detect package revision, using current date" | |
60 | + PACKAGE_REVISION=`date +%y%m%d` | |
61 | +fi | |
62 | + | |
63 | +if test -z ${PACKAGE_SOURCE} ; then | |
64 | + echo "Can´t detect package source" | |
65 | + exit -1 | |
66 | +fi | |
67 | + | |
68 | +#echo "PACKAGE_REVISION=${PACKAGE_REVISION}" > $srcdir/revision | |
69 | +#echo "PACKAGE_SOURCE=${PACKAGE_SOURCE}" >> $srcdir/revision | |
70 | +#echo "PACKAGE_LEVEL=${APPLEVEL}" >> $srcdir/revision | |
71 | + | |
72 | +#echo "m4_define([SVN_REVISION], ${PACKAGE_REVISION})" > $srcdir/revision.m4 | |
73 | +#echo "m4_define([SVN_URL], ${PACKAGE_SOURCE})" >> $srcdir/revision.m4 | |
74 | +#echo "m4_define([APP_LEVEL], ${APPLEVEL})" >> $srcdir/revision.m4 | |
75 | + | |
76 | +aclocal | |
77 | +if test $? != 0 ; then | |
78 | + echo "aclocal failed." | |
79 | + exit -1 | |
80 | +fi | |
81 | + | |
82 | +autoconf | |
83 | +if test $? != 0 ; then | |
84 | + echo "autoconf failed." | |
85 | + exit -1 | |
86 | +fi | |
87 | + | |
88 | +cd "$olddir" | |
89 | +test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" | |
90 | + | |
91 | +echo "Package set to revision $PACKAGE_REVISION and source $PACKAGE_SOURCE" | |
92 | + | |
93 | + | |
94 | + | ... | ... |
... | ... | @@ -0,0 +1,377 @@ |
1 | + | |
2 | +dnl Process this file with autoconf to produce a configure script. | |
3 | + | |
4 | +dnl The minimum version of autoconf required. | |
5 | +AC_PREREQ(2.59) | |
6 | + | |
7 | +dnl Initialise automake with the package name, version and | |
8 | +dnl bug-reporting address. | |
9 | +AC_INIT([php5-pw3270], [5.1], [perry.werneck@gmail.com]) | |
10 | + | |
11 | +dnl Place auxilliary scripts here. | |
12 | +AC_CONFIG_AUX_DIR([scripts]) | |
13 | + | |
14 | +dnl Compute the canonical host-system type | |
15 | +AC_CANONICAL_HOST | |
16 | + | |
17 | +dnl Put macro definitions here (though they aren't used). | |
18 | +AC_CONFIG_HEADER([src/include/config.h]) | |
19 | + | |
20 | +dnl Initialise automake stuff. | |
21 | +AM_INIT_AUTOMAKE | |
22 | + | |
23 | +dnl Check for iconv | |
24 | +AM_ICONV | |
25 | + | |
26 | +dnl Checks for programs. | |
27 | +AC_PROG_CXX | |
28 | +AC_PROG_CC | |
29 | +AC_PROG_SED | |
30 | +AC_PROG_LN_S | |
31 | + | |
32 | +AC_LANG([C++]) | |
33 | + | |
34 | +dnl --------------------------------------------------------------------------- | |
35 | +dnl Initialize defaults | |
36 | +dnl --------------------------------------------------------------------------- | |
37 | +DLLFLAGS="-shared -Wl,-soname,\$(@F)" | |
38 | +DBG_CFLAGS="-DDEBUG=1" | |
39 | +RLS_CFLAGS="-DNDEBUG=1" | |
40 | + | |
41 | +dnl --------------------------------------------------------------------------- | |
42 | +dnl Check for OS specifics | |
43 | +dnl --------------------------------------------------------------------------- | |
44 | + | |
45 | +case "$host" in | |
46 | + *-mingw32) | |
47 | + RLS_LDFLAGS="-Wl,--strip-all" | |
48 | + DBG_LDFLAGS="" | |
49 | + APP_LDFLAGS="" | |
50 | + | |
51 | + DBG_DATADIR="" | |
52 | + RLS_DATADIR="" | |
53 | + | |
54 | + EXEEXT=".exe" | |
55 | + | |
56 | + DLLPREFIX="" | |
57 | + DLLEXT=".dll" | |
58 | + | |
59 | + CFLAGS="$CFLAGS -Wall -Werror -D_WIN32_WINNT=0x0600" | |
60 | + LIBS="$LIBS -lws2_32 -lntdll -lwtsapi32" | |
61 | + RESOURCES="resources.rc" | |
62 | + | |
63 | + LOGDIR=. | |
64 | + ;; | |
65 | + | |
66 | + s390x-*) | |
67 | + RLS_LDFLAGS="" | |
68 | + DBG_LDFLAGS="" | |
69 | + APP_LDFLAGS="" | |
70 | + | |
71 | + DBG_DATADIR="-DDATADIR=." | |
72 | + DBG_CFLAGS="$DBG_CFLAGS" | |
73 | + | |
74 | + RLS_DATADIR="-DDATADIR=\$(datarootdir)/\$(PACKAGE_NAME)" | |
75 | + | |
76 | + EXEEXT="" | |
77 | + | |
78 | + DLLPREFIX="lib" | |
79 | + DLLEXT=".so" | |
80 | + | |
81 | + CFLAGS="$CFLAGS -pthread -Wall" | |
82 | + | |
83 | + LIBS="-Wl,--no-undefined -pthread $LIBS" | |
84 | + RESOURCES="" | |
85 | + | |
86 | + LOGDIR="/var/log" | |
87 | + ;; | |
88 | + | |
89 | + | |
90 | + *) | |
91 | + RLS_LDFLAGS="" | |
92 | + DBG_LDFLAGS="" | |
93 | + APP_LDFLAGS="" | |
94 | + | |
95 | + DBG_DATADIR="-DDATADIR=." | |
96 | + DBG_CFLAGS="-fstack-check $DBG_CFLAGS" | |
97 | + | |
98 | + RLS_DATADIR="-DDATADIR=\$(datarootdir)/\$(PACKAGE_NAME)" | |
99 | + | |
100 | + EXEEXT="" | |
101 | + | |
102 | + DLLPREFIX="lib" | |
103 | + DLLEXT=".so" | |
104 | + | |
105 | + CFLAGS="$CFLAGS -Wall -Werror" | |
106 | + | |
107 | + # LIBS="-Wl,--no-allow-shlib-undefined,--as-needed,--no-undefined -pthread $LIBS" | |
108 | + LIBS="-pthread $LIBS" | |
109 | + RESOURCES="" | |
110 | + | |
111 | + LOGDIR="/var/log" | |
112 | + | |
113 | + | |
114 | +esac | |
115 | + | |
116 | +AC_SUBST(LIBS) | |
117 | + | |
118 | +AC_SUBST(DBG_CFLAGS) | |
119 | +AC_SUBST(RLS_CFLAGS) | |
120 | + | |
121 | +AC_SUBST(DBG_LDFLAGS) | |
122 | +AC_SUBST(RLS_LDFLAGS) | |
123 | + | |
124 | +AC_SUBST(EXEEXT) | |
125 | +AC_SUBST(DLLEXT) | |
126 | +AC_SUBST(DLLPREFIX) | |
127 | + | |
128 | +dnl --------------------------------------------------------------------------- | |
129 | +dnl Check for other programs | |
130 | +dnl --------------------------------------------------------------------------- | |
131 | +AC_PATH_TOOL([STRIP], [strip]) | |
132 | +AC_PATH_TOOL([RPMBUILD], [rpmbuild], [no]) | |
133 | +AC_PATH_TOOL([MAKENSIS], [makensis], [no]) | |
134 | +AC_PATH_TOOL([VALGRIND], [valgrind], [no]) | |
135 | +AC_PATH_TOOL([WINDRES], [windres], [no]) | |
136 | +AC_PATH_TOOL([ZIP], [zip], [zip]) | |
137 | +AC_PATH_TOOL([FIND], [find], [find]) | |
138 | +AC_PATH_TOOL([AR], [ar], [ar]) | |
139 | + | |
140 | +dnl --------------------------------------------------------------------------- | |
141 | +dnl Version info | |
142 | +dnl --------------------------------------------------------------------------- | |
143 | + | |
144 | +app_vrs_major=$(echo $VERSION | cut -d. -f1) | |
145 | +app_vrs_minor=$(echo $VERSION | cut -d. -f2) | |
146 | + | |
147 | +AC_SUBST(PACKAGE_MAJOR_VERSION,$app_vrs_major) | |
148 | +AC_SUBST(PACKAGE_MINOR_VERSION,$app_vrs_minor) | |
149 | + | |
150 | +AC_DEFINE_UNQUOTED(PACKAGE_MAJOR_VERSION, $app_vrs_major) | |
151 | +AC_DEFINE_UNQUOTED(PACKAGE_MINOR_VERSION, $app_vrs_minor) | |
152 | + | |
153 | +AC_SUBST(PACKAGE_MAJOR_VERSION,$app_vrs_major) | |
154 | +AC_SUBST(PACKAGE_MINOR_VERSION,$app_vrs_minor) | |
155 | + | |
156 | +app_cv_description="PHP5 binding for pw3270/lib3270" | |
157 | + | |
158 | +AC_DEFINE_UNQUOTED(PACKAGE_DESCRIPTION,"$app_cv_description") | |
159 | +AC_SUBST(PACKAGE_DESCRIPTION,"$app_cv_description") | |
160 | + | |
161 | +dnl --------------------------------------------------------------------------- | |
162 | +dnl Check for PHP 5 | |
163 | +dnl --------------------------------------------------------------------------- | |
164 | + | |
165 | +AC_ARG_WITH([php-config], [AS_HELP_STRING([--with-php-config], [Path to php-config tool])], [ PHPCONFIG="$withval" ],[ AC_PATH_TOOL(PHPCONFIG, php-config, , $PATH) ]) | |
166 | + | |
167 | +case "$host" in | |
168 | +*-mingw32) | |
169 | + AC_MSG_NOTICE([PHP disabled on windows platforms.]) | |
170 | + ;; | |
171 | + | |
172 | +*-apple-*) | |
173 | + | |
174 | + AC_MSG_NOTICE([PHP disabled on apple platforms.]) | |
175 | + ;; | |
176 | + | |
177 | +*) | |
178 | + if test -z "${PHPCONFIG}"; then | |
179 | + | |
180 | + AC_MSG_NOTICE([Program php-config not found. Use --with-php-config=path to specify absolute path to the php-config tool.]) | |
181 | + | |
182 | + else | |
183 | + | |
184 | + PHPMAJOR=`$PHPCONFIG --version | cut -d. -f1` | |
185 | + PHPCONFDIR=`$PHPCONFIG | sed "s@ @\n@g" | grep "^--with-config-file-scan-dir=" | cut -d= -f2` | |
186 | + | |
187 | + if test -z "${PHPCONFDIR}"; then | |
188 | + | |
189 | + if test -d /etc/php${PHPMAJOR}/conf.d; then | |
190 | + PHPCONFDIR=/etc/php${PHPMAJOR}/conf.d | |
191 | + elif test -d /etc/php/conf.d; then | |
192 | + PHPCONFDIR=/etc/php/conf.d | |
193 | + else | |
194 | + PHPCONFDIR=/etc/php${PHPMAJOR}/cli | |
195 | + fi | |
196 | + | |
197 | + AC_MSG_NOTICE([Using $PHPCONFDIR for PHP config files.]) | |
198 | + | |
199 | + else | |
200 | + | |
201 | + AC_MSG_NOTICE([Detected $PHPCONFDIR for PHP config files.]) | |
202 | + | |
203 | + fi | |
204 | + | |
205 | + fi | |
206 | + | |
207 | +esac | |
208 | + | |
209 | +AC_SUBST(PHPCONFIG) | |
210 | +AC_SUBST(PHPMAJOR) | |
211 | +AC_SUBST(PHPCONFDIR) | |
212 | + | |
213 | +dnl --------------------------------------------------------------------------- | |
214 | +dnl Check for integer types & library functions | |
215 | +dnl --------------------------------------------------------------------------- | |
216 | + | |
217 | +AC_CHECK_TYPES([pid_t, uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t]) | |
218 | +AC_CHECK_FUNCS(srandom random getopt asprintf vasprintf) | |
219 | +AC_CHECK_FUNCS(getaddrinfo sendfile poll eventfd statfs64) | |
220 | + | |
221 | +dnl --------------------------------------------------------------------------- | |
222 | +dnl Check for libintl | |
223 | +dnl --------------------------------------------------------------------------- | |
224 | + | |
225 | +AC_PATH_TOOL([XGETTEXT], [xgettext], [no]) | |
226 | +AC_PATH_TOOL([MSGCAT], [msgcat], [no]) | |
227 | +AC_PATH_TOOL([MSGINIT], [msginit], [no]) | |
228 | +AC_PATH_TOOL([MSGMERGE], [msgmerge], [no]) | |
229 | +AC_PATH_TOOL([MSGFMT], [msgfmt], [no]) | |
230 | + | |
231 | +AC_CHECK_HEADER(libintl.h, [ | |
232 | + AC_DEFINE(HAVE_LIBINTL, 1) | |
233 | +]) | |
234 | + | |
235 | +dnl --------------------------------------------------------------------------- | |
236 | +dnl Check for C++ 2011 support | |
237 | +dnl --------------------------------------------------------------------------- | |
238 | +AC_DEFUN([AX_CHECK_COMPILE_FLAG], | |
239 | +[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX | |
240 | +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl | |
241 | +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ | |
242 | + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS | |
243 | + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" | |
244 | + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], | |
245 | + [AS_VAR_SET(CACHEVAR,[yes])], | |
246 | + [AS_VAR_SET(CACHEVAR,[no])]) | |
247 | + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) | |
248 | +AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], | |
249 | + [m4_default([$2], :)], | |
250 | + [m4_default([$3], :)]) | |
251 | +AS_VAR_POPDEF([CACHEVAR])dnl | |
252 | +])dnl AX_CHECK_COMPILE_FLAGS | |
253 | + | |
254 | +AX_CHECK_COMPILE_FLAG([-std=gnu++11], [CFLAGS="$CFLAGS -std=gnu++11"]) | |
255 | + | |
256 | +dnl --------------------------------------------------------------------------- | |
257 | +dnl Check for ELF symbol visibility support | |
258 | +dnl --------------------------------------------------------------------------- | |
259 | +m4_define([GLIB_CHECK_COMPILE_WARNINGS], | |
260 | +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl | |
261 | +rm -f conftest.$ac_objext | |
262 | +glib_ac_compile_save="$ac_compile" | |
263 | +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext' | |
264 | +AS_IF([_AC_EVAL_STDERR($ac_compile) && | |
265 | + AC_TRY_COMMAND([(if test -s conftest.err; then false ; else true; fi)])], | |
266 | + [$2], | |
267 | + [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD | |
268 | +cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD | |
269 | +m4_ifvaln([$3],[$3])dnl]) | |
270 | +ac_compile="$glib_ac_compile_save" | |
271 | +rm -f conftest.$ac_objext conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl | |
272 | +])# GLIB_CHECK_COMPILE_WARNINGS | |
273 | + | |
274 | +AC_MSG_CHECKING(for GNUC visibility attribute) | |
275 | +GLIB_CHECK_COMPILE_WARNINGS([ | |
276 | +void | |
277 | +__attribute__ ((visibility ("hidden"))) | |
278 | + f_hidden (void) | |
279 | +{ | |
280 | +} | |
281 | +void | |
282 | +__attribute__ ((visibility ("internal"))) | |
283 | + f_internal (void) | |
284 | +{ | |
285 | +} | |
286 | +void | |
287 | +__attribute__ ((visibility ("protected"))) | |
288 | + f_protected (void) | |
289 | +{ | |
290 | +} | |
291 | +void | |
292 | +__attribute__ ((visibility ("default"))) | |
293 | + f_default (void) | |
294 | +{ | |
295 | +} | |
296 | +int main (int argc, char **argv) | |
297 | +{ | |
298 | + f_hidden(); | |
299 | + f_internal(); | |
300 | + f_protected(); | |
301 | + f_default(); | |
302 | + return 0; | |
303 | +} | |
304 | +],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no) | |
305 | +AC_MSG_RESULT($g_have_gnuc_visibility) | |
306 | +if test x$g_have_gnuc_visibility = xyes; then | |
307 | + AC_DEFINE(HAVE_GNUC_VISIBILITY, 1, [supports GCC visibility attributes]) | |
308 | +fi | |
309 | + | |
310 | +dnl --------------------------------------------------------------------------- | |
311 | +dnl Check for compiler visibility flag | |
312 | +dnl --------------------------------------------------------------------------- | |
313 | +AC_MSG_CHECKING(whether $CC accepts -fvisibility=hidden) | |
314 | +AC_CACHE_VAL(app_cv_fvisibility_ok, | |
315 | +[ac_save_cc="$CC" | |
316 | +CC="$CC -fvisibility=hidden" | |
317 | +AC_TRY_RUN([int main() { return 0; }], | |
318 | + app_cv_fvisibility_ok=yes, | |
319 | + app_cv_fvisibility_ok=no, | |
320 | + app_cv_fvisibility_ok=no) | |
321 | +CC="$ac_save_cc"]) | |
322 | +AC_MSG_RESULT($app_cv_fvisibility_ok) | |
323 | +if test $app_cv_fvisibility_ok = yes; then | |
324 | + CFLAGS="$CFLAGS -fvisibility=hidden" | |
325 | +fi | |
326 | + | |
327 | +dnl --------------------------------------------------------------------------- | |
328 | +dnl Check for pic | |
329 | +dnl --------------------------------------------------------------------------- | |
330 | +AC_ARG_ENABLE([pic], | |
331 | + [AS_HELP_STRING([--disable-pic], [disable support for PIC libraries (required to compile on 64bits)])], | |
332 | +[ | |
333 | + app_cv_pic="$enableval" | |
334 | +],[ | |
335 | + | |
336 | + case "$host" in | |
337 | + *-mingw32) | |
338 | + app_cv_pic="no" | |
339 | + ;; | |
340 | + | |
341 | + s390x-*) | |
342 | + app_cv_pic="yes" | |
343 | + ;; | |
344 | + | |
345 | + *) | |
346 | + if test "$host_cpu" = "x86_64"; then | |
347 | + app_cv_pic="yes" | |
348 | + else | |
349 | + app_cv_pic="no" | |
350 | + fi | |
351 | + esac | |
352 | +]) | |
353 | + | |
354 | +if test "$app_cv_pic" == "yes"; then | |
355 | + CFLAGS="$CFLAGS -fPIC" | |
356 | +fi | |
357 | + | |
358 | +dnl --------------------------------------------------------------------------- | |
359 | +dnl Output config | |
360 | +dnl --------------------------------------------------------------------------- | |
361 | + | |
362 | +AC_SUBST(BASEDIR,$ac_pwd) | |
363 | + | |
364 | +dnl --------------------------------------------------------------------------- | |
365 | +dnl Configure which files to generate. | |
366 | +dnl --------------------------------------------------------------------------- | |
367 | + | |
368 | +dnl AC_CONFIG_FILES(Makefile) | |
369 | +dnl AC_CONFIG_FILES(src/extension/Makefile) | |
370 | +dnl AC_CONFIG_FILES(src/plugin/Makefile) | |
371 | +AC_CONFIG_FILES(src/include/php3270.h) | |
372 | + | |
373 | +dnl --------------------------------------------------------------------------- | |
374 | +dnl Output the generated config.status script. | |
375 | +dnl --------------------------------------------------------------------------- | |
376 | +AC_OUTPUT | |
377 | + | ... | ... |
... | ... | @@ -0,0 +1,1526 @@ |
1 | +#! /bin/sh | |
2 | +# Attempt to guess a canonical system name. | |
3 | +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | |
4 | +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 | |
5 | +# Free Software Foundation, Inc. | |
6 | + | |
7 | +timestamp='2008-01-23' | |
8 | + | |
9 | +# This file is free software; you can redistribute it and/or modify it | |
10 | +# under the terms of the GNU General Public License as published by | |
11 | +# the Free Software Foundation; either version 2 of the License, or | |
12 | +# (at your option) any later version. | |
13 | +# | |
14 | +# This program is distributed in the hope that it will be useful, but | |
15 | +# WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | +# General Public License for more details. | |
18 | +# | |
19 | +# You should have received a copy of the GNU General Public License | |
20 | +# along with this program; if not, write to the Free Software | |
21 | +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA | |
22 | +# 02110-1301, USA. | |
23 | +# | |
24 | +# As a special exception to the GNU General Public License, if you | |
25 | +# distribute this file as part of a program that contains a | |
26 | +# configuration script generated by Autoconf, you may include it under | |
27 | +# the same distribution terms that you use for the rest of that program. | |
28 | + | |
29 | + | |
30 | +# Originally written by Per Bothner <per@bothner.com>. | |
31 | +# Please send patches to <config-patches@gnu.org>. Submit a context | |
32 | +# diff and a properly formatted ChangeLog entry. | |
33 | +# | |
34 | +# This script attempts to guess a canonical system name similar to | |
35 | +# config.sub. If it succeeds, it prints the system name on stdout, and | |
36 | +# exits with 0. Otherwise, it exits with 1. | |
37 | +# | |
38 | +# The plan is that this can be called by configure scripts if you | |
39 | +# don't specify an explicit build system type. | |
40 | + | |
41 | +me=`echo "$0" | sed -e 's,.*/,,'` | |
42 | + | |
43 | +usage="\ | |
44 | +Usage: $0 [OPTION] | |
45 | + | |
46 | +Output the configuration name of the system \`$me' is run on. | |
47 | + | |
48 | +Operation modes: | |
49 | + -h, --help print this help, then exit | |
50 | + -t, --time-stamp print date of last modification, then exit | |
51 | + -v, --version print version number, then exit | |
52 | + | |
53 | +Report bugs and patches to <config-patches@gnu.org>." | |
54 | + | |
55 | +version="\ | |
56 | +GNU config.guess ($timestamp) | |
57 | + | |
58 | +Originally written by Per Bothner. | |
59 | +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, | |
60 | +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | |
61 | + | |
62 | +This is free software; see the source for copying conditions. There is NO | |
63 | +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | |
64 | + | |
65 | +help=" | |
66 | +Try \`$me --help' for more information." | |
67 | + | |
68 | +# Parse command line | |
69 | +while test $# -gt 0 ; do | |
70 | + case $1 in | |
71 | + --time-stamp | --time* | -t ) | |
72 | + echo "$timestamp" ; exit ;; | |
73 | + --version | -v ) | |
74 | + echo "$version" ; exit ;; | |
75 | + --help | --h* | -h ) | |
76 | + echo "$usage"; exit ;; | |
77 | + -- ) # Stop option processing | |
78 | + shift; break ;; | |
79 | + - ) # Use stdin as input. | |
80 | + break ;; | |
81 | + -* ) | |
82 | + echo "$me: invalid option $1$help" >&2 | |
83 | + exit 1 ;; | |
84 | + * ) | |
85 | + break ;; | |
86 | + esac | |
87 | +done | |
88 | + | |
89 | +if test $# != 0; then | |
90 | + echo "$me: too many arguments$help" >&2 | |
91 | + exit 1 | |
92 | +fi | |
93 | + | |
94 | +trap 'exit 1' 1 2 15 | |
95 | + | |
96 | +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a | |
97 | +# compiler to aid in system detection is discouraged as it requires | |
98 | +# temporary files to be created and, as you can see below, it is a | |
99 | +# headache to deal with in a portable fashion. | |
100 | + | |
101 | +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still | |
102 | +# use `HOST_CC' if defined, but it is deprecated. | |
103 | + | |
104 | +# Portable tmp directory creation inspired by the Autoconf team. | |
105 | + | |
106 | +set_cc_for_build=' | |
107 | +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; | |
108 | +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; | |
109 | +: ${TMPDIR=/tmp} ; | |
110 | + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || | |
111 | + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || | |
112 | + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || | |
113 | + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; | |
114 | +dummy=$tmp/dummy ; | |
115 | +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; | |
116 | +case $CC_FOR_BUILD,$HOST_CC,$CC in | |
117 | + ,,) echo "int x;" > $dummy.c ; | |
118 | + for c in cc gcc c89 c99 ; do | |
119 | + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then | |
120 | + CC_FOR_BUILD="$c"; break ; | |
121 | + fi ; | |
122 | + done ; | |
123 | + if test x"$CC_FOR_BUILD" = x ; then | |
124 | + CC_FOR_BUILD=no_compiler_found ; | |
125 | + fi | |
126 | + ;; | |
127 | + ,,*) CC_FOR_BUILD=$CC ;; | |
128 | + ,*,*) CC_FOR_BUILD=$HOST_CC ;; | |
129 | +esac ; set_cc_for_build= ;' | |
130 | + | |
131 | +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. | |
132 | +# (ghazi@noc.rutgers.edu 1994-08-24) | |
133 | +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then | |
134 | + PATH=$PATH:/.attbin ; export PATH | |
135 | +fi | |
136 | + | |
137 | +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown | |
138 | +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown | |
139 | +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown | |
140 | +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown | |
141 | + | |
142 | +# Note: order is significant - the case branches are not exclusive. | |
143 | + | |
144 | +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | |
145 | + *:NetBSD:*:*) | |
146 | + # NetBSD (nbsd) targets should (where applicable) match one or | |
147 | + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, | |
148 | + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently | |
149 | + # switched to ELF, *-*-netbsd* would select the old | |
150 | + # object file format. This provides both forward | |
151 | + # compatibility and a consistent mechanism for selecting the | |
152 | + # object file format. | |
153 | + # | |
154 | + # Note: NetBSD doesn't particularly care about the vendor | |
155 | + # portion of the name. We always set it to "unknown". | |
156 | + sysctl="sysctl -n hw.machine_arch" | |
157 | + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ | |
158 | + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` | |
159 | + case "${UNAME_MACHINE_ARCH}" in | |
160 | + armeb) machine=armeb-unknown ;; | |
161 | + arm*) machine=arm-unknown ;; | |
162 | + sh3el) machine=shl-unknown ;; | |
163 | + sh3eb) machine=sh-unknown ;; | |
164 | + sh5el) machine=sh5le-unknown ;; | |
165 | + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; | |
166 | + esac | |
167 | + # The Operating System including object format, if it has switched | |
168 | + # to ELF recently, or will in the future. | |
169 | + case "${UNAME_MACHINE_ARCH}" in | |
170 | + arm*|i386|m68k|ns32k|sh3*|sparc|vax) | |
171 | + eval $set_cc_for_build | |
172 | + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | |
173 | + | grep __ELF__ >/dev/null | |
174 | + then | |
175 | + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). | |
176 | + # Return netbsd for either. FIX? | |
177 | + os=netbsd | |
178 | + else | |
179 | + os=netbsdelf | |
180 | + fi | |
181 | + ;; | |
182 | + *) | |
183 | + os=netbsd | |
184 | + ;; | |
185 | + esac | |
186 | + # The OS release | |
187 | + # Debian GNU/NetBSD machines have a different userland, and | |
188 | + # thus, need a distinct triplet. However, they do not need | |
189 | + # kernel version information, so it can be replaced with a | |
190 | + # suitable tag, in the style of linux-gnu. | |
191 | + case "${UNAME_VERSION}" in | |
192 | + Debian*) | |
193 | + release='-gnu' | |
194 | + ;; | |
195 | + *) | |
196 | + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` | |
197 | + ;; | |
198 | + esac | |
199 | + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: | |
200 | + # contains redundant information, the shorter form: | |
201 | + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. | |
202 | + echo "${machine}-${os}${release}" | |
203 | + exit ;; | |
204 | + *:OpenBSD:*:*) | |
205 | + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` | |
206 | + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} | |
207 | + exit ;; | |
208 | + *:ekkoBSD:*:*) | |
209 | + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} | |
210 | + exit ;; | |
211 | + *:SolidBSD:*:*) | |
212 | + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} | |
213 | + exit ;; | |
214 | + macppc:MirBSD:*:*) | |
215 | + echo powerpc-unknown-mirbsd${UNAME_RELEASE} | |
216 | + exit ;; | |
217 | + *:MirBSD:*:*) | |
218 | + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} | |
219 | + exit ;; | |
220 | + alpha:OSF1:*:*) | |
221 | + case $UNAME_RELEASE in | |
222 | + *4.0) | |
223 | + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` | |
224 | + ;; | |
225 | + *5.*) | |
226 | + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` | |
227 | + ;; | |
228 | + esac | |
229 | + # According to Compaq, /usr/sbin/psrinfo has been available on | |
230 | + # OSF/1 and Tru64 systems produced since 1995. I hope that | |
231 | + # covers most systems running today. This code pipes the CPU | |
232 | + # types through head -n 1, so we only detect the type of CPU 0. | |
233 | + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` | |
234 | + case "$ALPHA_CPU_TYPE" in | |
235 | + "EV4 (21064)") | |
236 | + UNAME_MACHINE="alpha" ;; | |
237 | + "EV4.5 (21064)") | |
238 | + UNAME_MACHINE="alpha" ;; | |
239 | + "LCA4 (21066/21068)") | |
240 | + UNAME_MACHINE="alpha" ;; | |
241 | + "EV5 (21164)") | |
242 | + UNAME_MACHINE="alphaev5" ;; | |
243 | + "EV5.6 (21164A)") | |
244 | + UNAME_MACHINE="alphaev56" ;; | |
245 | + "EV5.6 (21164PC)") | |
246 | + UNAME_MACHINE="alphapca56" ;; | |
247 | + "EV5.7 (21164PC)") | |
248 | + UNAME_MACHINE="alphapca57" ;; | |
249 | + "EV6 (21264)") | |
250 | + UNAME_MACHINE="alphaev6" ;; | |
251 | + "EV6.7 (21264A)") | |
252 | + UNAME_MACHINE="alphaev67" ;; | |
253 | + "EV6.8CB (21264C)") | |
254 | + UNAME_MACHINE="alphaev68" ;; | |
255 | + "EV6.8AL (21264B)") | |
256 | + UNAME_MACHINE="alphaev68" ;; | |
257 | + "EV6.8CX (21264D)") | |
258 | + UNAME_MACHINE="alphaev68" ;; | |
259 | + "EV6.9A (21264/EV69A)") | |
260 | + UNAME_MACHINE="alphaev69" ;; | |
261 | + "EV7 (21364)") | |
262 | + UNAME_MACHINE="alphaev7" ;; | |
263 | + "EV7.9 (21364A)") | |
264 | + UNAME_MACHINE="alphaev79" ;; | |
265 | + esac | |
266 | + # A Pn.n version is a patched version. | |
267 | + # A Vn.n version is a released version. | |
268 | + # A Tn.n version is a released field test version. | |
269 | + # A Xn.n version is an unreleased experimental baselevel. | |
270 | + # 1.2 uses "1.2" for uname -r. | |
271 | + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | |
272 | + exit ;; | |
273 | + Alpha\ *:Windows_NT*:*) | |
274 | + # How do we know it's Interix rather than the generic POSIX subsystem? | |
275 | + # Should we change UNAME_MACHINE based on the output of uname instead | |
276 | + # of the specific Alpha model? | |
277 | + echo alpha-pc-interix | |
278 | + exit ;; | |
279 | + 21064:Windows_NT:50:3) | |
280 | + echo alpha-dec-winnt3.5 | |
281 | + exit ;; | |
282 | + Amiga*:UNIX_System_V:4.0:*) | |
283 | + echo m68k-unknown-sysv4 | |
284 | + exit ;; | |
285 | + *:[Aa]miga[Oo][Ss]:*:*) | |
286 | + echo ${UNAME_MACHINE}-unknown-amigaos | |
287 | + exit ;; | |
288 | + *:[Mm]orph[Oo][Ss]:*:*) | |
289 | + echo ${UNAME_MACHINE}-unknown-morphos | |
290 | + exit ;; | |
291 | + *:OS/390:*:*) | |
292 | + echo i370-ibm-openedition | |
293 | + exit ;; | |
294 | + *:z/VM:*:*) | |
295 | + echo s390-ibm-zvmoe | |
296 | + exit ;; | |
297 | + *:OS400:*:*) | |
298 | + echo powerpc-ibm-os400 | |
299 | + exit ;; | |
300 | + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) | |
301 | + echo arm-acorn-riscix${UNAME_RELEASE} | |
302 | + exit ;; | |
303 | + arm:riscos:*:*|arm:RISCOS:*:*) | |
304 | + echo arm-unknown-riscos | |
305 | + exit ;; | |
306 | + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) | |
307 | + echo hppa1.1-hitachi-hiuxmpp | |
308 | + exit ;; | |
309 | + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) | |
310 | + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. | |
311 | + if test "`(/bin/universe) 2>/dev/null`" = att ; then | |
312 | + echo pyramid-pyramid-sysv3 | |
313 | + else | |
314 | + echo pyramid-pyramid-bsd | |
315 | + fi | |
316 | + exit ;; | |
317 | + NILE*:*:*:dcosx) | |
318 | + echo pyramid-pyramid-svr4 | |
319 | + exit ;; | |
320 | + DRS?6000:unix:4.0:6*) | |
321 | + echo sparc-icl-nx6 | |
322 | + exit ;; | |
323 | + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) | |
324 | + case `/usr/bin/uname -p` in | |
325 | + sparc) echo sparc-icl-nx7; exit ;; | |
326 | + esac ;; | |
327 | + sun4H:SunOS:5.*:*) | |
328 | + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
329 | + exit ;; | |
330 | + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) | |
331 | + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
332 | + exit ;; | |
333 | + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) | |
334 | + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
335 | + exit ;; | |
336 | + sun4*:SunOS:6*:*) | |
337 | + # According to config.sub, this is the proper way to canonicalize | |
338 | + # SunOS6. Hard to guess exactly what SunOS6 will be like, but | |
339 | + # it's likely to be more like Solaris than SunOS4. | |
340 | + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
341 | + exit ;; | |
342 | + sun4*:SunOS:*:*) | |
343 | + case "`/usr/bin/arch -k`" in | |
344 | + Series*|S4*) | |
345 | + UNAME_RELEASE=`uname -v` | |
346 | + ;; | |
347 | + esac | |
348 | + # Japanese Language versions have a version number like `4.1.3-JL'. | |
349 | + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` | |
350 | + exit ;; | |
351 | + sun3*:SunOS:*:*) | |
352 | + echo m68k-sun-sunos${UNAME_RELEASE} | |
353 | + exit ;; | |
354 | + sun*:*:4.2BSD:*) | |
355 | + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` | |
356 | + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 | |
357 | + case "`/bin/arch`" in | |
358 | + sun3) | |
359 | + echo m68k-sun-sunos${UNAME_RELEASE} | |
360 | + ;; | |
361 | + sun4) | |
362 | + echo sparc-sun-sunos${UNAME_RELEASE} | |
363 | + ;; | |
364 | + esac | |
365 | + exit ;; | |
366 | + aushp:SunOS:*:*) | |
367 | + echo sparc-auspex-sunos${UNAME_RELEASE} | |
368 | + exit ;; | |
369 | + # The situation for MiNT is a little confusing. The machine name | |
370 | + # can be virtually everything (everything which is not | |
371 | + # "atarist" or "atariste" at least should have a processor | |
372 | + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" | |
373 | + # to the lowercase version "mint" (or "freemint"). Finally | |
374 | + # the system name "TOS" denotes a system which is actually not | |
375 | + # MiNT. But MiNT is downward compatible to TOS, so this should | |
376 | + # be no problem. | |
377 | + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) | |
378 | + echo m68k-atari-mint${UNAME_RELEASE} | |
379 | + exit ;; | |
380 | + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) | |
381 | + echo m68k-atari-mint${UNAME_RELEASE} | |
382 | + exit ;; | |
383 | + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) | |
384 | + echo m68k-atari-mint${UNAME_RELEASE} | |
385 | + exit ;; | |
386 | + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) | |
387 | + echo m68k-milan-mint${UNAME_RELEASE} | |
388 | + exit ;; | |
389 | + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) | |
390 | + echo m68k-hades-mint${UNAME_RELEASE} | |
391 | + exit ;; | |
392 | + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) | |
393 | + echo m68k-unknown-mint${UNAME_RELEASE} | |
394 | + exit ;; | |
395 | + m68k:machten:*:*) | |
396 | + echo m68k-apple-machten${UNAME_RELEASE} | |
397 | + exit ;; | |
398 | + powerpc:machten:*:*) | |
399 | + echo powerpc-apple-machten${UNAME_RELEASE} | |
400 | + exit ;; | |
401 | + RISC*:Mach:*:*) | |
402 | + echo mips-dec-mach_bsd4.3 | |
403 | + exit ;; | |
404 | + RISC*:ULTRIX:*:*) | |
405 | + echo mips-dec-ultrix${UNAME_RELEASE} | |
406 | + exit ;; | |
407 | + VAX*:ULTRIX*:*:*) | |
408 | + echo vax-dec-ultrix${UNAME_RELEASE} | |
409 | + exit ;; | |
410 | + 2020:CLIX:*:* | 2430:CLIX:*:*) | |
411 | + echo clipper-intergraph-clix${UNAME_RELEASE} | |
412 | + exit ;; | |
413 | + mips:*:*:UMIPS | mips:*:*:RISCos) | |
414 | + eval $set_cc_for_build | |
415 | + sed 's/^ //' << EOF >$dummy.c | |
416 | +#ifdef __cplusplus | |
417 | +#include <stdio.h> /* for printf() prototype */ | |
418 | + int main (int argc, char *argv[]) { | |
419 | +#else | |
420 | + int main (argc, argv) int argc; char *argv[]; { | |
421 | +#endif | |
422 | + #if defined (host_mips) && defined (MIPSEB) | |
423 | + #if defined (SYSTYPE_SYSV) | |
424 | + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); | |
425 | + #endif | |
426 | + #if defined (SYSTYPE_SVR4) | |
427 | + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); | |
428 | + #endif | |
429 | + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) | |
430 | + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); | |
431 | + #endif | |
432 | + #endif | |
433 | + exit (-1); | |
434 | + } | |
435 | +EOF | |
436 | + $CC_FOR_BUILD -o $dummy $dummy.c && | |
437 | + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && | |
438 | + SYSTEM_NAME=`$dummy $dummyarg` && | |
439 | + { echo "$SYSTEM_NAME"; exit; } | |
440 | + echo mips-mips-riscos${UNAME_RELEASE} | |
441 | + exit ;; | |
442 | + Motorola:PowerMAX_OS:*:*) | |
443 | + echo powerpc-motorola-powermax | |
444 | + exit ;; | |
445 | + Motorola:*:4.3:PL8-*) | |
446 | + echo powerpc-harris-powermax | |
447 | + exit ;; | |
448 | + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) | |
449 | + echo powerpc-harris-powermax | |
450 | + exit ;; | |
451 | + Night_Hawk:Power_UNIX:*:*) | |
452 | + echo powerpc-harris-powerunix | |
453 | + exit ;; | |
454 | + m88k:CX/UX:7*:*) | |
455 | + echo m88k-harris-cxux7 | |
456 | + exit ;; | |
457 | + m88k:*:4*:R4*) | |
458 | + echo m88k-motorola-sysv4 | |
459 | + exit ;; | |
460 | + m88k:*:3*:R3*) | |
461 | + echo m88k-motorola-sysv3 | |
462 | + exit ;; | |
463 | + AViiON:dgux:*:*) | |
464 | + # DG/UX returns AViiON for all architectures | |
465 | + UNAME_PROCESSOR=`/usr/bin/uname -p` | |
466 | + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] | |
467 | + then | |
468 | + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ | |
469 | + [ ${TARGET_BINARY_INTERFACE}x = x ] | |
470 | + then | |
471 | + echo m88k-dg-dgux${UNAME_RELEASE} | |
472 | + else | |
473 | + echo m88k-dg-dguxbcs${UNAME_RELEASE} | |
474 | + fi | |
475 | + else | |
476 | + echo i586-dg-dgux${UNAME_RELEASE} | |
477 | + fi | |
478 | + exit ;; | |
479 | + M88*:DolphinOS:*:*) # DolphinOS (SVR3) | |
480 | + echo m88k-dolphin-sysv3 | |
481 | + exit ;; | |
482 | + M88*:*:R3*:*) | |
483 | + # Delta 88k system running SVR3 | |
484 | + echo m88k-motorola-sysv3 | |
485 | + exit ;; | |
486 | + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) | |
487 | + echo m88k-tektronix-sysv3 | |
488 | + exit ;; | |
489 | + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) | |
490 | + echo m68k-tektronix-bsd | |
491 | + exit ;; | |
492 | + *:IRIX*:*:*) | |
493 | + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` | |
494 | + exit ;; | |
495 | + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. | |
496 | + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id | |
497 | + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' | |
498 | + i*86:AIX:*:*) | |
499 | + echo i386-ibm-aix | |
500 | + exit ;; | |
501 | + ia64:AIX:*:*) | |
502 | + if [ -x /usr/bin/oslevel ] ; then | |
503 | + IBM_REV=`/usr/bin/oslevel` | |
504 | + else | |
505 | + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} | |
506 | + fi | |
507 | + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} | |
508 | + exit ;; | |
509 | + *:AIX:2:3) | |
510 | + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then | |
511 | + eval $set_cc_for_build | |
512 | + sed 's/^ //' << EOF >$dummy.c | |
513 | + #include <sys/systemcfg.h> | |
514 | + | |
515 | + main() | |
516 | + { | |
517 | + if (!__power_pc()) | |
518 | + exit(1); | |
519 | + puts("powerpc-ibm-aix3.2.5"); | |
520 | + exit(0); | |
521 | + } | |
522 | +EOF | |
523 | + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` | |
524 | + then | |
525 | + echo "$SYSTEM_NAME" | |
526 | + else | |
527 | + echo rs6000-ibm-aix3.2.5 | |
528 | + fi | |
529 | + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then | |
530 | + echo rs6000-ibm-aix3.2.4 | |
531 | + else | |
532 | + echo rs6000-ibm-aix3.2 | |
533 | + fi | |
534 | + exit ;; | |
535 | + *:AIX:*:[456]) | |
536 | + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` | |
537 | + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then | |
538 | + IBM_ARCH=rs6000 | |
539 | + else | |
540 | + IBM_ARCH=powerpc | |
541 | + fi | |
542 | + if [ -x /usr/bin/oslevel ] ; then | |
543 | + IBM_REV=`/usr/bin/oslevel` | |
544 | + else | |
545 | + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} | |
546 | + fi | |
547 | + echo ${IBM_ARCH}-ibm-aix${IBM_REV} | |
548 | + exit ;; | |
549 | + *:AIX:*:*) | |
550 | + echo rs6000-ibm-aix | |
551 | + exit ;; | |
552 | + ibmrt:4.4BSD:*|romp-ibm:BSD:*) | |
553 | + echo romp-ibm-bsd4.4 | |
554 | + exit ;; | |
555 | + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and | |
556 | + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to | |
557 | + exit ;; # report: romp-ibm BSD 4.3 | |
558 | + *:BOSX:*:*) | |
559 | + echo rs6000-bull-bosx | |
560 | + exit ;; | |
561 | + DPX/2?00:B.O.S.:*:*) | |
562 | + echo m68k-bull-sysv3 | |
563 | + exit ;; | |
564 | + 9000/[34]??:4.3bsd:1.*:*) | |
565 | + echo m68k-hp-bsd | |
566 | + exit ;; | |
567 | + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) | |
568 | + echo m68k-hp-bsd4.4 | |
569 | + exit ;; | |
570 | + 9000/[34678]??:HP-UX:*:*) | |
571 | + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | |
572 | + case "${UNAME_MACHINE}" in | |
573 | + 9000/31? ) HP_ARCH=m68000 ;; | |
574 | + 9000/[34]?? ) HP_ARCH=m68k ;; | |
575 | + 9000/[678][0-9][0-9]) | |
576 | + if [ -x /usr/bin/getconf ]; then | |
577 | + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` | |
578 | + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` | |
579 | + case "${sc_cpu_version}" in | |
580 | + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 | |
581 | + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 | |
582 | + 532) # CPU_PA_RISC2_0 | |
583 | + case "${sc_kernel_bits}" in | |
584 | + 32) HP_ARCH="hppa2.0n" ;; | |
585 | + 64) HP_ARCH="hppa2.0w" ;; | |
586 | + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 | |
587 | + esac ;; | |
588 | + esac | |
589 | + fi | |
590 | + if [ "${HP_ARCH}" = "" ]; then | |
591 | + eval $set_cc_for_build | |
592 | + sed 's/^ //' << EOF >$dummy.c | |
593 | + | |
594 | + #define _HPUX_SOURCE | |
595 | + #include <stdlib.h> | |
596 | + #include <unistd.h> | |
597 | + | |
598 | + int main () | |
599 | + { | |
600 | + #if defined(_SC_KERNEL_BITS) | |
601 | + long bits = sysconf(_SC_KERNEL_BITS); | |
602 | + #endif | |
603 | + long cpu = sysconf (_SC_CPU_VERSION); | |
604 | + | |
605 | + switch (cpu) | |
606 | + { | |
607 | + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; | |
608 | + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; | |
609 | + case CPU_PA_RISC2_0: | |
610 | + #if defined(_SC_KERNEL_BITS) | |
611 | + switch (bits) | |
612 | + { | |
613 | + case 64: puts ("hppa2.0w"); break; | |
614 | + case 32: puts ("hppa2.0n"); break; | |
615 | + default: puts ("hppa2.0"); break; | |
616 | + } break; | |
617 | + #else /* !defined(_SC_KERNEL_BITS) */ | |
618 | + puts ("hppa2.0"); break; | |
619 | + #endif | |
620 | + default: puts ("hppa1.0"); break; | |
621 | + } | |
622 | + exit (0); | |
623 | + } | |
624 | +EOF | |
625 | + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | |
626 | + test -z "$HP_ARCH" && HP_ARCH=hppa | |
627 | + fi ;; | |
628 | + esac | |
629 | + if [ ${HP_ARCH} = "hppa2.0w" ] | |
630 | + then | |
631 | + eval $set_cc_for_build | |
632 | + | |
633 | + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating | |
634 | + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler | |
635 | + # generating 64-bit code. GNU and HP use different nomenclature: | |
636 | + # | |
637 | + # $ CC_FOR_BUILD=cc ./config.guess | |
638 | + # => hppa2.0w-hp-hpux11.23 | |
639 | + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess | |
640 | + # => hppa64-hp-hpux11.23 | |
641 | + | |
642 | + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | | |
643 | + grep __LP64__ >/dev/null | |
644 | + then | |
645 | + HP_ARCH="hppa2.0w" | |
646 | + else | |
647 | + HP_ARCH="hppa64" | |
648 | + fi | |
649 | + fi | |
650 | + echo ${HP_ARCH}-hp-hpux${HPUX_REV} | |
651 | + exit ;; | |
652 | + ia64:HP-UX:*:*) | |
653 | + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | |
654 | + echo ia64-hp-hpux${HPUX_REV} | |
655 | + exit ;; | |
656 | + 3050*:HI-UX:*:*) | |
657 | + eval $set_cc_for_build | |
658 | + sed 's/^ //' << EOF >$dummy.c | |
659 | + #include <unistd.h> | |
660 | + int | |
661 | + main () | |
662 | + { | |
663 | + long cpu = sysconf (_SC_CPU_VERSION); | |
664 | + /* The order matters, because CPU_IS_HP_MC68K erroneously returns | |
665 | + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct | |
666 | + results, however. */ | |
667 | + if (CPU_IS_PA_RISC (cpu)) | |
668 | + { | |
669 | + switch (cpu) | |
670 | + { | |
671 | + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; | |
672 | + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; | |
673 | + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; | |
674 | + default: puts ("hppa-hitachi-hiuxwe2"); break; | |
675 | + } | |
676 | + } | |
677 | + else if (CPU_IS_HP_MC68K (cpu)) | |
678 | + puts ("m68k-hitachi-hiuxwe2"); | |
679 | + else puts ("unknown-hitachi-hiuxwe2"); | |
680 | + exit (0); | |
681 | + } | |
682 | +EOF | |
683 | + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && | |
684 | + { echo "$SYSTEM_NAME"; exit; } | |
685 | + echo unknown-hitachi-hiuxwe2 | |
686 | + exit ;; | |
687 | + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) | |
688 | + echo hppa1.1-hp-bsd | |
689 | + exit ;; | |
690 | + 9000/8??:4.3bsd:*:*) | |
691 | + echo hppa1.0-hp-bsd | |
692 | + exit ;; | |
693 | + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) | |
694 | + echo hppa1.0-hp-mpeix | |
695 | + exit ;; | |
696 | + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) | |
697 | + echo hppa1.1-hp-osf | |
698 | + exit ;; | |
699 | + hp8??:OSF1:*:*) | |
700 | + echo hppa1.0-hp-osf | |
701 | + exit ;; | |
702 | + i*86:OSF1:*:*) | |
703 | + if [ -x /usr/sbin/sysversion ] ; then | |
704 | + echo ${UNAME_MACHINE}-unknown-osf1mk | |
705 | + else | |
706 | + echo ${UNAME_MACHINE}-unknown-osf1 | |
707 | + fi | |
708 | + exit ;; | |
709 | + parisc*:Lites*:*:*) | |
710 | + echo hppa1.1-hp-lites | |
711 | + exit ;; | |
712 | + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) | |
713 | + echo c1-convex-bsd | |
714 | + exit ;; | |
715 | + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) | |
716 | + if getsysinfo -f scalar_acc | |
717 | + then echo c32-convex-bsd | |
718 | + else echo c2-convex-bsd | |
719 | + fi | |
720 | + exit ;; | |
721 | + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) | |
722 | + echo c34-convex-bsd | |
723 | + exit ;; | |
724 | + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) | |
725 | + echo c38-convex-bsd | |
726 | + exit ;; | |
727 | + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) | |
728 | + echo c4-convex-bsd | |
729 | + exit ;; | |
730 | + CRAY*Y-MP:*:*:*) | |
731 | + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
732 | + exit ;; | |
733 | + CRAY*[A-Z]90:*:*:*) | |
734 | + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | |
735 | + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ | |
736 | + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ | |
737 | + -e 's/\.[^.]*$/.X/' | |
738 | + exit ;; | |
739 | + CRAY*TS:*:*:*) | |
740 | + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
741 | + exit ;; | |
742 | + CRAY*T3E:*:*:*) | |
743 | + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
744 | + exit ;; | |
745 | + CRAY*SV1:*:*:*) | |
746 | + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
747 | + exit ;; | |
748 | + *:UNICOS/mp:*:*) | |
749 | + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | |
750 | + exit ;; | |
751 | + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) | |
752 | + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | |
753 | + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
754 | + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` | |
755 | + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | |
756 | + exit ;; | |
757 | + 5000:UNIX_System_V:4.*:*) | |
758 | + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | |
759 | + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` | |
760 | + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | |
761 | + exit ;; | |
762 | + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) | |
763 | + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} | |
764 | + exit ;; | |
765 | + sparc*:BSD/OS:*:*) | |
766 | + echo sparc-unknown-bsdi${UNAME_RELEASE} | |
767 | + exit ;; | |
768 | + *:BSD/OS:*:*) | |
769 | + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} | |
770 | + exit ;; | |
771 | + *:FreeBSD:*:*) | |
772 | + case ${UNAME_MACHINE} in | |
773 | + pc98) | |
774 | + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
775 | + amd64) | |
776 | + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
777 | + *) | |
778 | + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | |
779 | + esac | |
780 | + exit ;; | |
781 | + i*:CYGWIN*:*) | |
782 | + echo ${UNAME_MACHINE}-pc-cygwin | |
783 | + exit ;; | |
784 | + *:MINGW*:*) | |
785 | + echo ${UNAME_MACHINE}-pc-mingw32 | |
786 | + exit ;; | |
787 | + i*:windows32*:*) | |
788 | + # uname -m includes "-pc" on this system. | |
789 | + echo ${UNAME_MACHINE}-mingw32 | |
790 | + exit ;; | |
791 | + i*:PW*:*) | |
792 | + echo ${UNAME_MACHINE}-pc-pw32 | |
793 | + exit ;; | |
794 | + *:Interix*:[3456]*) | |
795 | + case ${UNAME_MACHINE} in | |
796 | + x86) | |
797 | + echo i586-pc-interix${UNAME_RELEASE} | |
798 | + exit ;; | |
799 | + EM64T | authenticamd) | |
800 | + echo x86_64-unknown-interix${UNAME_RELEASE} | |
801 | + exit ;; | |
802 | + IA64) | |
803 | + echo ia64-unknown-interix${UNAME_RELEASE} | |
804 | + exit ;; | |
805 | + esac ;; | |
806 | + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) | |
807 | + echo i${UNAME_MACHINE}-pc-mks | |
808 | + exit ;; | |
809 | + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) | |
810 | + # How do we know it's Interix rather than the generic POSIX subsystem? | |
811 | + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we | |
812 | + # UNAME_MACHINE based on the output of uname instead of i386? | |
813 | + echo i586-pc-interix | |
814 | + exit ;; | |
815 | + i*:UWIN*:*) | |
816 | + echo ${UNAME_MACHINE}-pc-uwin | |
817 | + exit ;; | |
818 | + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) | |
819 | + echo x86_64-unknown-cygwin | |
820 | + exit ;; | |
821 | + p*:CYGWIN*:*) | |
822 | + echo powerpcle-unknown-cygwin | |
823 | + exit ;; | |
824 | + prep*:SunOS:5.*:*) | |
825 | + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
826 | + exit ;; | |
827 | + *:GNU:*:*) | |
828 | + # the GNU system | |
829 | + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | |
830 | + exit ;; | |
831 | + *:GNU/*:*:*) | |
832 | + # other systems with GNU libc and userland | |
833 | + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu | |
834 | + exit ;; | |
835 | + i*86:Minix:*:*) | |
836 | + echo ${UNAME_MACHINE}-pc-minix | |
837 | + exit ;; | |
838 | + arm*:Linux:*:*) | |
839 | + eval $set_cc_for_build | |
840 | + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | |
841 | + | grep -q __ARM_EABI__ | |
842 | + then | |
843 | + echo ${UNAME_MACHINE}-unknown-linux-gnu | |
844 | + else | |
845 | + echo ${UNAME_MACHINE}-unknown-linux-gnueabi | |
846 | + fi | |
847 | + exit ;; | |
848 | + avr32*:Linux:*:*) | |
849 | + echo ${UNAME_MACHINE}-unknown-linux-gnu | |
850 | + exit ;; | |
851 | + cris:Linux:*:*) | |
852 | + echo cris-axis-linux-gnu | |
853 | + exit ;; | |
854 | + crisv32:Linux:*:*) | |
855 | + echo crisv32-axis-linux-gnu | |
856 | + exit ;; | |
857 | + frv:Linux:*:*) | |
858 | + echo frv-unknown-linux-gnu | |
859 | + exit ;; | |
860 | + ia64:Linux:*:*) | |
861 | + echo ${UNAME_MACHINE}-unknown-linux-gnu | |
862 | + exit ;; | |
863 | + m32r*:Linux:*:*) | |
864 | + echo ${UNAME_MACHINE}-unknown-linux-gnu | |
865 | + exit ;; | |
866 | + m68*:Linux:*:*) | |
867 | + echo ${UNAME_MACHINE}-unknown-linux-gnu | |
868 | + exit ;; | |
869 | + mips:Linux:*:*) | |
870 | + eval $set_cc_for_build | |
871 | + sed 's/^ //' << EOF >$dummy.c | |
872 | + #undef CPU | |
873 | + #undef mips | |
874 | + #undef mipsel | |
875 | + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) | |
876 | + CPU=mipsel | |
877 | + #else | |
878 | + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) | |
879 | + CPU=mips | |
880 | + #else | |
881 | + CPU= | |
882 | + #endif | |
883 | + #endif | |
884 | +EOF | |
885 | + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' | |
886 | + /^CPU/{ | |
887 | + s: ::g | |
888 | + p | |
889 | + }'`" | |
890 | + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } | |
891 | + ;; | |
892 | + mips64:Linux:*:*) | |
893 | + eval $set_cc_for_build | |
894 | + sed 's/^ //' << EOF >$dummy.c | |
895 | + #undef CPU | |
896 | + #undef mips64 | |
897 | + #undef mips64el | |
898 | + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) | |
899 | + CPU=mips64el | |
900 | + #else | |
901 | + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) | |
902 | + CPU=mips64 | |
903 | + #else | |
904 | + CPU= | |
905 | + #endif | |
906 | + #endif | |
907 | +EOF | |
908 | + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' | |
909 | + /^CPU/{ | |
910 | + s: ::g | |
911 | + p | |
912 | + }'`" | |
913 | + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } | |
914 | + ;; | |
915 | + or32:Linux:*:*) | |
916 | + echo or32-unknown-linux-gnu | |
917 | + exit ;; | |
918 | + ppc:Linux:*:*) | |
919 | + echo powerpc-unknown-linux-gnu | |
920 | + exit ;; | |
921 | + ppc64:Linux:*:*) | |
922 | + echo powerpc64-unknown-linux-gnu | |
923 | + exit ;; | |
924 | + alpha:Linux:*:*) | |
925 | + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in | |
926 | + EV5) UNAME_MACHINE=alphaev5 ;; | |
927 | + EV56) UNAME_MACHINE=alphaev56 ;; | |
928 | + PCA56) UNAME_MACHINE=alphapca56 ;; | |
929 | + PCA57) UNAME_MACHINE=alphapca56 ;; | |
930 | + EV6) UNAME_MACHINE=alphaev6 ;; | |
931 | + EV67) UNAME_MACHINE=alphaev67 ;; | |
932 | + EV68*) UNAME_MACHINE=alphaev68 ;; | |
933 | + esac | |
934 | + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null | |
935 | + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi | |
936 | + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} | |
937 | + exit ;; | |
938 | + parisc:Linux:*:* | hppa:Linux:*:*) | |
939 | + # Look for CPU level | |
940 | + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in | |
941 | + PA7*) echo hppa1.1-unknown-linux-gnu ;; | |
942 | + PA8*) echo hppa2.0-unknown-linux-gnu ;; | |
943 | + *) echo hppa-unknown-linux-gnu ;; | |
944 | + esac | |
945 | + exit ;; | |
946 | + parisc64:Linux:*:* | hppa64:Linux:*:*) | |
947 | + echo hppa64-unknown-linux-gnu | |
948 | + exit ;; | |
949 | + s390:Linux:*:* | s390x:Linux:*:*) | |
950 | + echo ${UNAME_MACHINE}-ibm-linux | |
951 | + exit ;; | |
952 | + sh64*:Linux:*:*) | |
953 | + echo ${UNAME_MACHINE}-unknown-linux-gnu | |
954 | + exit ;; | |
955 | + sh*:Linux:*:*) | |
956 | + echo ${UNAME_MACHINE}-unknown-linux-gnu | |
957 | + exit ;; | |
958 | + sparc:Linux:*:* | sparc64:Linux:*:*) | |
959 | + echo ${UNAME_MACHINE}-unknown-linux-gnu | |
960 | + exit ;; | |
961 | + vax:Linux:*:*) | |
962 | + echo ${UNAME_MACHINE}-dec-linux-gnu | |
963 | + exit ;; | |
964 | + x86_64:Linux:*:*) | |
965 | + echo x86_64-unknown-linux-gnu | |
966 | + exit ;; | |
967 | + xtensa*:Linux:*:*) | |
968 | + echo ${UNAME_MACHINE}-unknown-linux-gnu | |
969 | + exit ;; | |
970 | + i*86:Linux:*:*) | |
971 | + # The BFD linker knows what the default object file format is, so | |
972 | + # first see if it will tell us. cd to the root directory to prevent | |
973 | + # problems with other programs or directories called `ld' in the path. | |
974 | + # Set LC_ALL=C to ensure ld outputs messages in English. | |
975 | + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | |
976 | + | sed -ne '/supported targets:/!d | |
977 | + s/[ ][ ]*/ /g | |
978 | + s/.*supported targets: *// | |
979 | + s/ .*// | |
980 | + p'` | |
981 | + case "$ld_supported_targets" in | |
982 | + elf32-i386) | |
983 | + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" | |
984 | + ;; | |
985 | + a.out-i386-linux) | |
986 | + echo "${UNAME_MACHINE}-pc-linux-gnuaout" | |
987 | + exit ;; | |
988 | + coff-i386) | |
989 | + echo "${UNAME_MACHINE}-pc-linux-gnucoff" | |
990 | + exit ;; | |
991 | + "") | |
992 | + # Either a pre-BFD a.out linker (linux-gnuoldld) or | |
993 | + # one that does not give us useful --help. | |
994 | + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" | |
995 | + exit ;; | |
996 | + esac | |
997 | + # Determine whether the default compiler is a.out or elf | |
998 | + eval $set_cc_for_build | |
999 | + sed 's/^ //' << EOF >$dummy.c | |
1000 | + #include <features.h> | |
1001 | + #ifdef __ELF__ | |
1002 | + # ifdef __GLIBC__ | |
1003 | + # if __GLIBC__ >= 2 | |
1004 | + LIBC=gnu | |
1005 | + # else | |
1006 | + LIBC=gnulibc1 | |
1007 | + # endif | |
1008 | + # else | |
1009 | + LIBC=gnulibc1 | |
1010 | + # endif | |
1011 | + #else | |
1012 | + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) | |
1013 | + LIBC=gnu | |
1014 | + #else | |
1015 | + LIBC=gnuaout | |
1016 | + #endif | |
1017 | + #endif | |
1018 | + #ifdef __dietlibc__ | |
1019 | + LIBC=dietlibc | |
1020 | + #endif | |
1021 | +EOF | |
1022 | + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' | |
1023 | + /^LIBC/{ | |
1024 | + s: ::g | |
1025 | + p | |
1026 | + }'`" | |
1027 | + test x"${LIBC}" != x && { | |
1028 | + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" | |
1029 | + exit | |
1030 | + } | |
1031 | + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } | |
1032 | + ;; | |
1033 | + i*86:DYNIX/ptx:4*:*) | |
1034 | + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. | |
1035 | + # earlier versions are messed up and put the nodename in both | |
1036 | + # sysname and nodename. | |
1037 | + echo i386-sequent-sysv4 | |
1038 | + exit ;; | |
1039 | + i*86:UNIX_SV:4.2MP:2.*) | |
1040 | + # Unixware is an offshoot of SVR4, but it has its own version | |
1041 | + # number series starting with 2... | |
1042 | + # I am not positive that other SVR4 systems won't match this, | |
1043 | + # I just have to hope. -- rms. | |
1044 | + # Use sysv4.2uw... so that sysv4* matches it. | |
1045 | + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} | |
1046 | + exit ;; | |
1047 | + i*86:OS/2:*:*) | |
1048 | + # If we were able to find `uname', then EMX Unix compatibility | |
1049 | + # is probably installed. | |
1050 | + echo ${UNAME_MACHINE}-pc-os2-emx | |
1051 | + exit ;; | |
1052 | + i*86:XTS-300:*:STOP) | |
1053 | + echo ${UNAME_MACHINE}-unknown-stop | |
1054 | + exit ;; | |
1055 | + i*86:atheos:*:*) | |
1056 | + echo ${UNAME_MACHINE}-unknown-atheos | |
1057 | + exit ;; | |
1058 | + i*86:syllable:*:*) | |
1059 | + echo ${UNAME_MACHINE}-pc-syllable | |
1060 | + exit ;; | |
1061 | + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) | |
1062 | + echo i386-unknown-lynxos${UNAME_RELEASE} | |
1063 | + exit ;; | |
1064 | + i*86:*DOS:*:*) | |
1065 | + echo ${UNAME_MACHINE}-pc-msdosdjgpp | |
1066 | + exit ;; | |
1067 | + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) | |
1068 | + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` | |
1069 | + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then | |
1070 | + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} | |
1071 | + else | |
1072 | + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} | |
1073 | + fi | |
1074 | + exit ;; | |
1075 | + i*86:*:5:[678]*) | |
1076 | + # UnixWare 7.x, OpenUNIX and OpenServer 6. | |
1077 | + case `/bin/uname -X | grep "^Machine"` in | |
1078 | + *486*) UNAME_MACHINE=i486 ;; | |
1079 | + *Pentium) UNAME_MACHINE=i586 ;; | |
1080 | + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; | |
1081 | + esac | |
1082 | + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} | |
1083 | + exit ;; | |
1084 | + i*86:*:3.2:*) | |
1085 | + if test -f /usr/options/cb.name; then | |
1086 | + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` | |
1087 | + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL | |
1088 | + elif /bin/uname -X 2>/dev/null >/dev/null ; then | |
1089 | + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` | |
1090 | + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 | |
1091 | + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ | |
1092 | + && UNAME_MACHINE=i586 | |
1093 | + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ | |
1094 | + && UNAME_MACHINE=i686 | |
1095 | + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ | |
1096 | + && UNAME_MACHINE=i686 | |
1097 | + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL | |
1098 | + else | |
1099 | + echo ${UNAME_MACHINE}-pc-sysv32 | |
1100 | + fi | |
1101 | + exit ;; | |
1102 | + pc:*:*:*) | |
1103 | + # Left here for compatibility: | |
1104 | + # uname -m prints for DJGPP always 'pc', but it prints nothing about | |
1105 | + # the processor, so we play safe by assuming i386. | |
1106 | + echo i386-pc-msdosdjgpp | |
1107 | + exit ;; | |
1108 | + Intel:Mach:3*:*) | |
1109 | + echo i386-pc-mach3 | |
1110 | + exit ;; | |
1111 | + paragon:*:*:*) | |
1112 | + echo i860-intel-osf1 | |
1113 | + exit ;; | |
1114 | + i860:*:4.*:*) # i860-SVR4 | |
1115 | + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then | |
1116 | + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 | |
1117 | + else # Add other i860-SVR4 vendors below as they are discovered. | |
1118 | + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 | |
1119 | + fi | |
1120 | + exit ;; | |
1121 | + mini*:CTIX:SYS*5:*) | |
1122 | + # "miniframe" | |
1123 | + echo m68010-convergent-sysv | |
1124 | + exit ;; | |
1125 | + mc68k:UNIX:SYSTEM5:3.51m) | |
1126 | + echo m68k-convergent-sysv | |
1127 | + exit ;; | |
1128 | + M680?0:D-NIX:5.3:*) | |
1129 | + echo m68k-diab-dnix | |
1130 | + exit ;; | |
1131 | + M68*:*:R3V[5678]*:*) | |
1132 | + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; | |
1133 | + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) | |
1134 | + OS_REL='' | |
1135 | + test -r /etc/.relid \ | |
1136 | + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` | |
1137 | + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | |
1138 | + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } | |
1139 | + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ | |
1140 | + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; | |
1141 | + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) | |
1142 | + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | |
1143 | + && { echo i486-ncr-sysv4; exit; } ;; | |
1144 | + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) | |
1145 | + echo m68k-unknown-lynxos${UNAME_RELEASE} | |
1146 | + exit ;; | |
1147 | + mc68030:UNIX_System_V:4.*:*) | |
1148 | + echo m68k-atari-sysv4 | |
1149 | + exit ;; | |
1150 | + TSUNAMI:LynxOS:2.*:*) | |
1151 | + echo sparc-unknown-lynxos${UNAME_RELEASE} | |
1152 | + exit ;; | |
1153 | + rs6000:LynxOS:2.*:*) | |
1154 | + echo rs6000-unknown-lynxos${UNAME_RELEASE} | |
1155 | + exit ;; | |
1156 | + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) | |
1157 | + echo powerpc-unknown-lynxos${UNAME_RELEASE} | |
1158 | + exit ;; | |
1159 | + SM[BE]S:UNIX_SV:*:*) | |
1160 | + echo mips-dde-sysv${UNAME_RELEASE} | |
1161 | + exit ;; | |
1162 | + RM*:ReliantUNIX-*:*:*) | |
1163 | + echo mips-sni-sysv4 | |
1164 | + exit ;; | |
1165 | + RM*:SINIX-*:*:*) | |
1166 | + echo mips-sni-sysv4 | |
1167 | + exit ;; | |
1168 | + *:SINIX-*:*:*) | |
1169 | + if uname -p 2>/dev/null >/dev/null ; then | |
1170 | + UNAME_MACHINE=`(uname -p) 2>/dev/null` | |
1171 | + echo ${UNAME_MACHINE}-sni-sysv4 | |
1172 | + else | |
1173 | + echo ns32k-sni-sysv | |
1174 | + fi | |
1175 | + exit ;; | |
1176 | + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort | |
1177 | + # says <Richard.M.Bartel@ccMail.Census.GOV> | |
1178 | + echo i586-unisys-sysv4 | |
1179 | + exit ;; | |
1180 | + *:UNIX_System_V:4*:FTX*) | |
1181 | + # From Gerald Hewes <hewes@openmarket.com>. | |
1182 | + # How about differentiating between stratus architectures? -djm | |
1183 | + echo hppa1.1-stratus-sysv4 | |
1184 | + exit ;; | |
1185 | + *:*:*:FTX*) | |
1186 | + # From seanf@swdc.stratus.com. | |
1187 | + echo i860-stratus-sysv4 | |
1188 | + exit ;; | |
1189 | + i*86:VOS:*:*) | |
1190 | + # From Paul.Green@stratus.com. | |
1191 | + echo ${UNAME_MACHINE}-stratus-vos | |
1192 | + exit ;; | |
1193 | + *:VOS:*:*) | |
1194 | + # From Paul.Green@stratus.com. | |
1195 | + echo hppa1.1-stratus-vos | |
1196 | + exit ;; | |
1197 | + mc68*:A/UX:*:*) | |
1198 | + echo m68k-apple-aux${UNAME_RELEASE} | |
1199 | + exit ;; | |
1200 | + news*:NEWS-OS:6*:*) | |
1201 | + echo mips-sony-newsos6 | |
1202 | + exit ;; | |
1203 | + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) | |
1204 | + if [ -d /usr/nec ]; then | |
1205 | + echo mips-nec-sysv${UNAME_RELEASE} | |
1206 | + else | |
1207 | + echo mips-unknown-sysv${UNAME_RELEASE} | |
1208 | + fi | |
1209 | + exit ;; | |
1210 | + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. | |
1211 | + echo powerpc-be-beos | |
1212 | + exit ;; | |
1213 | + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. | |
1214 | + echo powerpc-apple-beos | |
1215 | + exit ;; | |
1216 | + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. | |
1217 | + echo i586-pc-beos | |
1218 | + exit ;; | |
1219 | + SX-4:SUPER-UX:*:*) | |
1220 | + echo sx4-nec-superux${UNAME_RELEASE} | |
1221 | + exit ;; | |
1222 | + SX-5:SUPER-UX:*:*) | |
1223 | + echo sx5-nec-superux${UNAME_RELEASE} | |
1224 | + exit ;; | |
1225 | + SX-6:SUPER-UX:*:*) | |
1226 | + echo sx6-nec-superux${UNAME_RELEASE} | |
1227 | + exit ;; | |
1228 | + SX-7:SUPER-UX:*:*) | |
1229 | + echo sx7-nec-superux${UNAME_RELEASE} | |
1230 | + exit ;; | |
1231 | + SX-8:SUPER-UX:*:*) | |
1232 | + echo sx8-nec-superux${UNAME_RELEASE} | |
1233 | + exit ;; | |
1234 | + SX-8R:SUPER-UX:*:*) | |
1235 | + echo sx8r-nec-superux${UNAME_RELEASE} | |
1236 | + exit ;; | |
1237 | + Power*:Rhapsody:*:*) | |
1238 | + echo powerpc-apple-rhapsody${UNAME_RELEASE} | |
1239 | + exit ;; | |
1240 | + *:Rhapsody:*:*) | |
1241 | + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} | |
1242 | + exit ;; | |
1243 | + *:Darwin:*:*) | |
1244 | + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown | |
1245 | + case $UNAME_PROCESSOR in | |
1246 | + unknown) UNAME_PROCESSOR=powerpc ;; | |
1247 | + esac | |
1248 | + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} | |
1249 | + exit ;; | |
1250 | + *:procnto*:*:* | *:QNX:[0123456789]*:*) | |
1251 | + UNAME_PROCESSOR=`uname -p` | |
1252 | + if test "$UNAME_PROCESSOR" = "x86"; then | |
1253 | + UNAME_PROCESSOR=i386 | |
1254 | + UNAME_MACHINE=pc | |
1255 | + fi | |
1256 | + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} | |
1257 | + exit ;; | |
1258 | + *:QNX:*:4*) | |
1259 | + echo i386-pc-qnx | |
1260 | + exit ;; | |
1261 | + NSE-?:NONSTOP_KERNEL:*:*) | |
1262 | + echo nse-tandem-nsk${UNAME_RELEASE} | |
1263 | + exit ;; | |
1264 | + NSR-?:NONSTOP_KERNEL:*:*) | |
1265 | + echo nsr-tandem-nsk${UNAME_RELEASE} | |
1266 | + exit ;; | |
1267 | + *:NonStop-UX:*:*) | |
1268 | + echo mips-compaq-nonstopux | |
1269 | + exit ;; | |
1270 | + BS2000:POSIX*:*:*) | |
1271 | + echo bs2000-siemens-sysv | |
1272 | + exit ;; | |
1273 | + DS/*:UNIX_System_V:*:*) | |
1274 | + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} | |
1275 | + exit ;; | |
1276 | + *:Plan9:*:*) | |
1277 | + # "uname -m" is not consistent, so use $cputype instead. 386 | |
1278 | + # is converted to i386 for consistency with other x86 | |
1279 | + # operating systems. | |
1280 | + if test "$cputype" = "386"; then | |
1281 | + UNAME_MACHINE=i386 | |
1282 | + else | |
1283 | + UNAME_MACHINE="$cputype" | |
1284 | + fi | |
1285 | + echo ${UNAME_MACHINE}-unknown-plan9 | |
1286 | + exit ;; | |
1287 | + *:TOPS-10:*:*) | |
1288 | + echo pdp10-unknown-tops10 | |
1289 | + exit ;; | |
1290 | + *:TENEX:*:*) | |
1291 | + echo pdp10-unknown-tenex | |
1292 | + exit ;; | |
1293 | + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) | |
1294 | + echo pdp10-dec-tops20 | |
1295 | + exit ;; | |
1296 | + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) | |
1297 | + echo pdp10-xkl-tops20 | |
1298 | + exit ;; | |
1299 | + *:TOPS-20:*:*) | |
1300 | + echo pdp10-unknown-tops20 | |
1301 | + exit ;; | |
1302 | + *:ITS:*:*) | |
1303 | + echo pdp10-unknown-its | |
1304 | + exit ;; | |
1305 | + SEI:*:*:SEIUX) | |
1306 | + echo mips-sei-seiux${UNAME_RELEASE} | |
1307 | + exit ;; | |
1308 | + *:DragonFly:*:*) | |
1309 | + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` | |
1310 | + exit ;; | |
1311 | + *:*VMS:*:*) | |
1312 | + UNAME_MACHINE=`(uname -p) 2>/dev/null` | |
1313 | + case "${UNAME_MACHINE}" in | |
1314 | + A*) echo alpha-dec-vms ; exit ;; | |
1315 | + I*) echo ia64-dec-vms ; exit ;; | |
1316 | + V*) echo vax-dec-vms ; exit ;; | |
1317 | + esac ;; | |
1318 | + *:XENIX:*:SysV) | |
1319 | + echo i386-pc-xenix | |
1320 | + exit ;; | |
1321 | + i*86:skyos:*:*) | |
1322 | + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' | |
1323 | + exit ;; | |
1324 | + i*86:rdos:*:*) | |
1325 | + echo ${UNAME_MACHINE}-pc-rdos | |
1326 | + exit ;; | |
1327 | +esac | |
1328 | + | |
1329 | +#echo '(No uname command or uname output not recognized.)' 1>&2 | |
1330 | +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 | |
1331 | + | |
1332 | +eval $set_cc_for_build | |
1333 | +cat >$dummy.c <<EOF | |
1334 | +#ifdef _SEQUENT_ | |
1335 | +# include <sys/types.h> | |
1336 | +# include <sys/utsname.h> | |
1337 | +#endif | |
1338 | +main () | |
1339 | +{ | |
1340 | +#if defined (sony) | |
1341 | +#if defined (MIPSEB) | |
1342 | + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, | |
1343 | + I don't know.... */ | |
1344 | + printf ("mips-sony-bsd\n"); exit (0); | |
1345 | +#else | |
1346 | +#include <sys/param.h> | |
1347 | + printf ("m68k-sony-newsos%s\n", | |
1348 | +#ifdef NEWSOS4 | |
1349 | + "4" | |
1350 | +#else | |
1351 | + "" | |
1352 | +#endif | |
1353 | + ); exit (0); | |
1354 | +#endif | |
1355 | +#endif | |
1356 | + | |
1357 | +#if defined (__arm) && defined (__acorn) && defined (__unix) | |
1358 | + printf ("arm-acorn-riscix\n"); exit (0); | |
1359 | +#endif | |
1360 | + | |
1361 | +#if defined (hp300) && !defined (hpux) | |
1362 | + printf ("m68k-hp-bsd\n"); exit (0); | |
1363 | +#endif | |
1364 | + | |
1365 | +#if defined (NeXT) | |
1366 | +#if !defined (__ARCHITECTURE__) | |
1367 | +#define __ARCHITECTURE__ "m68k" | |
1368 | +#endif | |
1369 | + int version; | |
1370 | + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; | |
1371 | + if (version < 4) | |
1372 | + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); | |
1373 | + else | |
1374 | + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); | |
1375 | + exit (0); | |
1376 | +#endif | |
1377 | + | |
1378 | +#if defined (MULTIMAX) || defined (n16) | |
1379 | +#if defined (UMAXV) | |
1380 | + printf ("ns32k-encore-sysv\n"); exit (0); | |
1381 | +#else | |
1382 | +#if defined (CMU) | |
1383 | + printf ("ns32k-encore-mach\n"); exit (0); | |
1384 | +#else | |
1385 | + printf ("ns32k-encore-bsd\n"); exit (0); | |
1386 | +#endif | |
1387 | +#endif | |
1388 | +#endif | |
1389 | + | |
1390 | +#if defined (__386BSD__) | |
1391 | + printf ("i386-pc-bsd\n"); exit (0); | |
1392 | +#endif | |
1393 | + | |
1394 | +#if defined (sequent) | |
1395 | +#if defined (i386) | |
1396 | + printf ("i386-sequent-dynix\n"); exit (0); | |
1397 | +#endif | |
1398 | +#if defined (ns32000) | |
1399 | + printf ("ns32k-sequent-dynix\n"); exit (0); | |
1400 | +#endif | |
1401 | +#endif | |
1402 | + | |
1403 | +#if defined (_SEQUENT_) | |
1404 | + struct utsname un; | |
1405 | + | |
1406 | + uname(&un); | |
1407 | + | |
1408 | + if (strncmp(un.version, "V2", 2) == 0) { | |
1409 | + printf ("i386-sequent-ptx2\n"); exit (0); | |
1410 | + } | |
1411 | + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ | |
1412 | + printf ("i386-sequent-ptx1\n"); exit (0); | |
1413 | + } | |
1414 | + printf ("i386-sequent-ptx\n"); exit (0); | |
1415 | + | |
1416 | +#endif | |
1417 | + | |
1418 | +#if defined (vax) | |
1419 | +# if !defined (ultrix) | |
1420 | +# include <sys/param.h> | |
1421 | +# if defined (BSD) | |
1422 | +# if BSD == 43 | |
1423 | + printf ("vax-dec-bsd4.3\n"); exit (0); | |
1424 | +# else | |
1425 | +# if BSD == 199006 | |
1426 | + printf ("vax-dec-bsd4.3reno\n"); exit (0); | |
1427 | +# else | |
1428 | + printf ("vax-dec-bsd\n"); exit (0); | |
1429 | +# endif | |
1430 | +# endif | |
1431 | +# else | |
1432 | + printf ("vax-dec-bsd\n"); exit (0); | |
1433 | +# endif | |
1434 | +# else | |
1435 | + printf ("vax-dec-ultrix\n"); exit (0); | |
1436 | +# endif | |
1437 | +#endif | |
1438 | + | |
1439 | +#if defined (alliant) && defined (i860) | |
1440 | + printf ("i860-alliant-bsd\n"); exit (0); | |
1441 | +#endif | |
1442 | + | |
1443 | + exit (1); | |
1444 | +} | |
1445 | +EOF | |
1446 | + | |
1447 | +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && | |
1448 | + { echo "$SYSTEM_NAME"; exit; } | |
1449 | + | |
1450 | +# Apollos put the system type in the environment. | |
1451 | + | |
1452 | +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } | |
1453 | + | |
1454 | +# Convex versions that predate uname can use getsysinfo(1) | |
1455 | + | |
1456 | +if [ -x /usr/convex/getsysinfo ] | |
1457 | +then | |
1458 | + case `getsysinfo -f cpu_type` in | |
1459 | + c1*) | |
1460 | + echo c1-convex-bsd | |
1461 | + exit ;; | |
1462 | + c2*) | |
1463 | + if getsysinfo -f scalar_acc | |
1464 | + then echo c32-convex-bsd | |
1465 | + else echo c2-convex-bsd | |
1466 | + fi | |
1467 | + exit ;; | |
1468 | + c34*) | |
1469 | + echo c34-convex-bsd | |
1470 | + exit ;; | |
1471 | + c38*) | |
1472 | + echo c38-convex-bsd | |
1473 | + exit ;; | |
1474 | + c4*) | |
1475 | + echo c4-convex-bsd | |
1476 | + exit ;; | |
1477 | + esac | |
1478 | +fi | |
1479 | + | |
1480 | +cat >&2 <<EOF | |
1481 | +$0: unable to guess system type | |
1482 | + | |
1483 | +This script, last modified $timestamp, has failed to recognize | |
1484 | +the operating system you are using. It is advised that you | |
1485 | +download the most up to date version of the config scripts from | |
1486 | + | |
1487 | + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD | |
1488 | +and | |
1489 | + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD | |
1490 | + | |
1491 | +If the version you run ($0) is already up to date, please | |
1492 | +send the following data and any information you think might be | |
1493 | +pertinent to <config-patches@gnu.org> in order to provide the needed | |
1494 | +information to handle your system. | |
1495 | + | |
1496 | +config.guess timestamp = $timestamp | |
1497 | + | |
1498 | +uname -m = `(uname -m) 2>/dev/null || echo unknown` | |
1499 | +uname -r = `(uname -r) 2>/dev/null || echo unknown` | |
1500 | +uname -s = `(uname -s) 2>/dev/null || echo unknown` | |
1501 | +uname -v = `(uname -v) 2>/dev/null || echo unknown` | |
1502 | + | |
1503 | +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` | |
1504 | +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` | |
1505 | + | |
1506 | +hostinfo = `(hostinfo) 2>/dev/null` | |
1507 | +/bin/universe = `(/bin/universe) 2>/dev/null` | |
1508 | +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` | |
1509 | +/bin/arch = `(/bin/arch) 2>/dev/null` | |
1510 | +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` | |
1511 | +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` | |
1512 | + | |
1513 | +UNAME_MACHINE = ${UNAME_MACHINE} | |
1514 | +UNAME_RELEASE = ${UNAME_RELEASE} | |
1515 | +UNAME_SYSTEM = ${UNAME_SYSTEM} | |
1516 | +UNAME_VERSION = ${UNAME_VERSION} | |
1517 | +EOF | |
1518 | + | |
1519 | +exit 1 | |
1520 | + | |
1521 | +# Local variables: | |
1522 | +# eval: (add-hook 'write-file-hooks 'time-stamp) | |
1523 | +# time-stamp-start: "timestamp='" | |
1524 | +# time-stamp-format: "%:y-%02m-%02d" | |
1525 | +# time-stamp-end: "'" | |
1526 | +# End: | ... | ... |
... | ... | @@ -0,0 +1,1658 @@ |
1 | +#! /bin/sh | |
2 | +# Configuration validation subroutine script. | |
3 | +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | |
4 | +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 | |
5 | +# Free Software Foundation, Inc. | |
6 | + | |
7 | +timestamp='2008-01-16' | |
8 | + | |
9 | +# This file is (in principle) common to ALL GNU software. | |
10 | +# The presence of a machine in this file suggests that SOME GNU software | |
11 | +# can handle that machine. It does not imply ALL GNU software can. | |
12 | +# | |
13 | +# This file is free software; you can redistribute it and/or modify | |
14 | +# it under the terms of the GNU General Public License as published by | |
15 | +# the Free Software Foundation; either version 2 of the License, or | |
16 | +# (at your option) any later version. | |
17 | +# | |
18 | +# This program is distributed in the hope that it will be useful, | |
19 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | +# GNU General Public License for more details. | |
22 | +# | |
23 | +# You should have received a copy of the GNU General Public License | |
24 | +# along with this program; if not, write to the Free Software | |
25 | +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA | |
26 | +# 02110-1301, USA. | |
27 | +# | |
28 | +# As a special exception to the GNU General Public License, if you | |
29 | +# distribute this file as part of a program that contains a | |
30 | +# configuration script generated by Autoconf, you may include it under | |
31 | +# the same distribution terms that you use for the rest of that program. | |
32 | + | |
33 | + | |
34 | +# Please send patches to <config-patches@gnu.org>. Submit a context | |
35 | +# diff and a properly formatted ChangeLog entry. | |
36 | +# | |
37 | +# Configuration subroutine to validate and canonicalize a configuration type. | |
38 | +# Supply the specified configuration type as an argument. | |
39 | +# If it is invalid, we print an error message on stderr and exit with code 1. | |
40 | +# Otherwise, we print the canonical config type on stdout and succeed. | |
41 | + | |
42 | +# This file is supposed to be the same for all GNU packages | |
43 | +# and recognize all the CPU types, system types and aliases | |
44 | +# that are meaningful with *any* GNU software. | |
45 | +# Each package is responsible for reporting which valid configurations | |
46 | +# it does not support. The user should be able to distinguish | |
47 | +# a failure to support a valid configuration from a meaningless | |
48 | +# configuration. | |
49 | + | |
50 | +# The goal of this file is to map all the various variations of a given | |
51 | +# machine specification into a single specification in the form: | |
52 | +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM | |
53 | +# or in some cases, the newer four-part form: | |
54 | +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM | |
55 | +# It is wrong to echo any other type of specification. | |
56 | + | |
57 | +me=`echo "$0" | sed -e 's,.*/,,'` | |
58 | + | |
59 | +usage="\ | |
60 | +Usage: $0 [OPTION] CPU-MFR-OPSYS | |
61 | + $0 [OPTION] ALIAS | |
62 | + | |
63 | +Canonicalize a configuration name. | |
64 | + | |
65 | +Operation modes: | |
66 | + -h, --help print this help, then exit | |
67 | + -t, --time-stamp print date of last modification, then exit | |
68 | + -v, --version print version number, then exit | |
69 | + | |
70 | +Report bugs and patches to <config-patches@gnu.org>." | |
71 | + | |
72 | +version="\ | |
73 | +GNU config.sub ($timestamp) | |
74 | + | |
75 | +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, | |
76 | +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | |
77 | + | |
78 | +This is free software; see the source for copying conditions. There is NO | |
79 | +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | |
80 | + | |
81 | +help=" | |
82 | +Try \`$me --help' for more information." | |
83 | + | |
84 | +# Parse command line | |
85 | +while test $# -gt 0 ; do | |
86 | + case $1 in | |
87 | + --time-stamp | --time* | -t ) | |
88 | + echo "$timestamp" ; exit ;; | |
89 | + --version | -v ) | |
90 | + echo "$version" ; exit ;; | |
91 | + --help | --h* | -h ) | |
92 | + echo "$usage"; exit ;; | |
93 | + -- ) # Stop option processing | |
94 | + shift; break ;; | |
95 | + - ) # Use stdin as input. | |
96 | + break ;; | |
97 | + -* ) | |
98 | + echo "$me: invalid option $1$help" | |
99 | + exit 1 ;; | |
100 | + | |
101 | + *local*) | |
102 | + # First pass through any local machine types. | |
103 | + echo $1 | |
104 | + exit ;; | |
105 | + | |
106 | + * ) | |
107 | + break ;; | |
108 | + esac | |
109 | +done | |
110 | + | |
111 | +case $# in | |
112 | + 0) echo "$me: missing argument$help" >&2 | |
113 | + exit 1;; | |
114 | + 1) ;; | |
115 | + *) echo "$me: too many arguments$help" >&2 | |
116 | + exit 1;; | |
117 | +esac | |
118 | + | |
119 | +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). | |
120 | +# Here we must recognize all the valid KERNEL-OS combinations. | |
121 | +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` | |
122 | +case $maybe_os in | |
123 | + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ | |
124 | + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ | |
125 | + storm-chaos* | os2-emx* | rtmk-nova*) | |
126 | + os=-$maybe_os | |
127 | + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` | |
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 | + ;; | |
135 | +esac | |
136 | + | |
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) | |
152 | + os= | |
153 | + basic_machine=$1 | |
154 | + ;; | |
155 | + -sim | -cisco | -oki | -wec | -winbond) | |
156 | + os= | |
157 | + basic_machine=$1 | |
158 | + ;; | |
159 | + -scout) | |
160 | + ;; | |
161 | + -wrs) | |
162 | + os=-vxworks | |
163 | + basic_machine=$1 | |
164 | + ;; | |
165 | + -chorusos*) | |
166 | + os=-chorusos | |
167 | + basic_machine=$1 | |
168 | + ;; | |
169 | + -chorusrdb) | |
170 | + os=-chorusrdb | |
171 | + basic_machine=$1 | |
172 | + ;; | |
173 | + -hiux*) | |
174 | + os=-hiuxwe2 | |
175 | + ;; | |
176 | + -sco6) | |
177 | + os=-sco5v6 | |
178 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
179 | + ;; | |
180 | + -sco5) | |
181 | + os=-sco3.2v5 | |
182 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
183 | + ;; | |
184 | + -sco4) | |
185 | + os=-sco3.2v4 | |
186 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
187 | + ;; | |
188 | + -sco3.2.[4-9]*) | |
189 | + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` | |
190 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
191 | + ;; | |
192 | + -sco3.2v[4-9]*) | |
193 | + # Don't forget version if it is 3.2v4 or newer. | |
194 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
195 | + ;; | |
196 | + -sco5v6*) | |
197 | + # Don't forget version if it is 3.2v4 or newer. | |
198 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
199 | + ;; | |
200 | + -sco*) | |
201 | + os=-sco3.2v2 | |
202 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
203 | + ;; | |
204 | + -udk*) | |
205 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
206 | + ;; | |
207 | + -isc) | |
208 | + os=-isc2.2 | |
209 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
210 | + ;; | |
211 | + -clix*) | |
212 | + basic_machine=clipper-intergraph | |
213 | + ;; | |
214 | + -isc*) | |
215 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
216 | + ;; | |
217 | + -lynx*) | |
218 | + os=-lynxos | |
219 | + ;; | |
220 | + -ptx*) | |
221 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` | |
222 | + ;; | |
223 | + -windowsnt*) | |
224 | + os=`echo $os | sed -e 's/windowsnt/winnt/'` | |
225 | + ;; | |
226 | + -psos*) | |
227 | + os=-psos | |
228 | + ;; | |
229 | + -mint | -mint[0-9]*) | |
230 | + basic_machine=m68k-atari | |
231 | + os=-mint | |
232 | + ;; | |
233 | +esac | |
234 | + | |
235 | +# Decode aliases for certain CPU-COMPANY combinations. | |
236 | +case $basic_machine in | |
237 | + # Recognize the basic CPU types without company name. | |
238 | + # Some are omitted here because they have special meanings below. | |
239 | + 1750a | 580 \ | |
240 | + | a29k \ | |
241 | + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | |
242 | + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | |
243 | + | am33_2.0 \ | |
244 | + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | |
245 | + | bfin \ | |
246 | + | c4x | clipper \ | |
247 | + | d10v | d30v | dlx | dsp16xx \ | |
248 | + | fido | fr30 | frv \ | |
249 | + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | |
250 | + | i370 | i860 | i960 | ia64 \ | |
251 | + | ip2k | iq2000 \ | |
252 | + | m32c | m32r | m32rle | m68000 | m68k | m88k \ | |
253 | + | maxq | mb | microblaze | mcore | mep \ | |
254 | + | mips | mipsbe | mipseb | mipsel | mipsle \ | |
255 | + | mips16 \ | |
256 | + | mips64 | mips64el \ | |
257 | + | mips64vr | mips64vrel \ | |
258 | + | mips64orion | mips64orionel \ | |
259 | + | mips64vr4100 | mips64vr4100el \ | |
260 | + | mips64vr4300 | mips64vr4300el \ | |
261 | + | mips64vr5000 | mips64vr5000el \ | |
262 | + | mips64vr5900 | mips64vr5900el \ | |
263 | + | mipsisa32 | mipsisa32el \ | |
264 | + | mipsisa32r2 | mipsisa32r2el \ | |
265 | + | mipsisa64 | mipsisa64el \ | |
266 | + | mipsisa64r2 | mipsisa64r2el \ | |
267 | + | mipsisa64sb1 | mipsisa64sb1el \ | |
268 | + | mipsisa64sr71k | mipsisa64sr71kel \ | |
269 | + | mipstx39 | mipstx39el \ | |
270 | + | mn10200 | mn10300 \ | |
271 | + | mt \ | |
272 | + | msp430 \ | |
273 | + | nios | nios2 \ | |
274 | + | ns16k | ns32k \ | |
275 | + | or32 \ | |
276 | + | pdp10 | pdp11 | pj | pjl \ | |
277 | + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | |
278 | + | pyramid \ | |
279 | + | score \ | |
280 | + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | |
281 | + | sh64 | sh64le \ | |
282 | + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | |
283 | + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | |
284 | + | spu | strongarm \ | |
285 | + | tahoe | thumb | tic4x | tic80 | tron \ | |
286 | + | v850 | v850e \ | |
287 | + | we32k \ | |
288 | + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | |
289 | + | z8k) | |
290 | + basic_machine=$basic_machine-unknown | |
291 | + ;; | |
292 | + m6811 | m68hc11 | m6812 | m68hc12) | |
293 | + # Motorola 68HC11/12. | |
294 | + basic_machine=$basic_machine-unknown | |
295 | + os=-none | |
296 | + ;; | |
297 | + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) | |
298 | + ;; | |
299 | + ms1) | |
300 | + basic_machine=mt-unknown | |
301 | + ;; | |
302 | + | |
303 | + # We use `pc' rather than `unknown' | |
304 | + # because (1) that's what they normally are, and | |
305 | + # (2) the word "unknown" tends to confuse beginning users. | |
306 | + i*86 | x86_64) | |
307 | + basic_machine=$basic_machine-pc | |
308 | + ;; | |
309 | + # Object if more than one company name word. | |
310 | + *-*-*) | |
311 | + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 | |
312 | + exit 1 | |
313 | + ;; | |
314 | + # Recognize the basic CPU types with company name. | |
315 | + 580-* \ | |
316 | + | a29k-* \ | |
317 | + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | |
318 | + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | |
319 | + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | |
320 | + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | |
321 | + | avr-* | avr32-* \ | |
322 | + | bfin-* | bs2000-* \ | |
323 | + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | |
324 | + | clipper-* | craynv-* | cydra-* \ | |
325 | + | d10v-* | d30v-* | dlx-* \ | |
326 | + | elxsi-* \ | |
327 | + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | |
328 | + | h8300-* | h8500-* \ | |
329 | + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | |
330 | + | i*86-* | i860-* | i960-* | ia64-* \ | |
331 | + | ip2k-* | iq2000-* \ | |
332 | + | m32c-* | m32r-* | m32rle-* \ | |
333 | + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | |
334 | + | m88110-* | m88k-* | maxq-* | mcore-* \ | |
335 | + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | |
336 | + | mips16-* \ | |
337 | + | mips64-* | mips64el-* \ | |
338 | + | mips64vr-* | mips64vrel-* \ | |
339 | + | mips64orion-* | mips64orionel-* \ | |
340 | + | mips64vr4100-* | mips64vr4100el-* \ | |
341 | + | mips64vr4300-* | mips64vr4300el-* \ | |
342 | + | mips64vr5000-* | mips64vr5000el-* \ | |
343 | + | mips64vr5900-* | mips64vr5900el-* \ | |
344 | + | mipsisa32-* | mipsisa32el-* \ | |
345 | + | mipsisa32r2-* | mipsisa32r2el-* \ | |
346 | + | mipsisa64-* | mipsisa64el-* \ | |
347 | + | mipsisa64r2-* | mipsisa64r2el-* \ | |
348 | + | mipsisa64sb1-* | mipsisa64sb1el-* \ | |
349 | + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | |
350 | + | mipstx39-* | mipstx39el-* \ | |
351 | + | mmix-* \ | |
352 | + | mt-* \ | |
353 | + | msp430-* \ | |
354 | + | nios-* | nios2-* \ | |
355 | + | none-* | np1-* | ns16k-* | ns32k-* \ | |
356 | + | orion-* \ | |
357 | + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | |
358 | + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | |
359 | + | pyramid-* \ | |
360 | + | romp-* | rs6000-* \ | |
361 | + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | |
362 | + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | |
363 | + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | |
364 | + | sparclite-* \ | |
365 | + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | |
366 | + | tahoe-* | thumb-* \ | |
367 | + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | |
368 | + | tron-* \ | |
369 | + | v850-* | v850e-* | vax-* \ | |
370 | + | we32k-* \ | |
371 | + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | |
372 | + | xstormy16-* | xtensa*-* \ | |
373 | + | ymp-* \ | |
374 | + | z8k-*) | |
375 | + ;; | |
376 | + # Recognize the basic CPU types without company name, with glob match. | |
377 | + xtensa*) | |
378 | + basic_machine=$basic_machine-unknown | |
379 | + ;; | |
380 | + # Recognize the various machine names and aliases which stand | |
381 | + # for a CPU type and a company and sometimes even an OS. | |
382 | + 386bsd) | |
383 | + basic_machine=i386-unknown | |
384 | + os=-bsd | |
385 | + ;; | |
386 | + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) | |
387 | + basic_machine=m68000-att | |
388 | + ;; | |
389 | + 3b*) | |
390 | + basic_machine=we32k-att | |
391 | + ;; | |
392 | + a29khif) | |
393 | + basic_machine=a29k-amd | |
394 | + os=-udi | |
395 | + ;; | |
396 | + abacus) | |
397 | + basic_machine=abacus-unknown | |
398 | + ;; | |
399 | + adobe68k) | |
400 | + basic_machine=m68010-adobe | |
401 | + os=-scout | |
402 | + ;; | |
403 | + alliant | fx80) | |
404 | + basic_machine=fx80-alliant | |
405 | + ;; | |
406 | + altos | altos3068) | |
407 | + basic_machine=m68k-altos | |
408 | + ;; | |
409 | + am29k) | |
410 | + basic_machine=a29k-none | |
411 | + os=-bsd | |
412 | + ;; | |
413 | + amd64) | |
414 | + basic_machine=x86_64-pc | |
415 | + ;; | |
416 | + amd64-*) | |
417 | + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` | |
418 | + ;; | |
419 | + amdahl) | |
420 | + basic_machine=580-amdahl | |
421 | + os=-sysv | |
422 | + ;; | |
423 | + amiga | amiga-*) | |
424 | + basic_machine=m68k-unknown | |
425 | + ;; | |
426 | + amigaos | amigados) | |
427 | + basic_machine=m68k-unknown | |
428 | + os=-amigaos | |
429 | + ;; | |
430 | + amigaunix | amix) | |
431 | + basic_machine=m68k-unknown | |
432 | + os=-sysv4 | |
433 | + ;; | |
434 | + apollo68) | |
435 | + basic_machine=m68k-apollo | |
436 | + os=-sysv | |
437 | + ;; | |
438 | + apollo68bsd) | |
439 | + basic_machine=m68k-apollo | |
440 | + os=-bsd | |
441 | + ;; | |
442 | + aux) | |
443 | + basic_machine=m68k-apple | |
444 | + os=-aux | |
445 | + ;; | |
446 | + balance) | |
447 | + basic_machine=ns32k-sequent | |
448 | + os=-dynix | |
449 | + ;; | |
450 | + blackfin) | |
451 | + basic_machine=bfin-unknown | |
452 | + os=-linux | |
453 | + ;; | |
454 | + blackfin-*) | |
455 | + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` | |
456 | + os=-linux | |
457 | + ;; | |
458 | + c90) | |
459 | + basic_machine=c90-cray | |
460 | + os=-unicos | |
461 | + ;; | |
462 | + convex-c1) | |
463 | + basic_machine=c1-convex | |
464 | + os=-bsd | |
465 | + ;; | |
466 | + convex-c2) | |
467 | + basic_machine=c2-convex | |
468 | + os=-bsd | |
469 | + ;; | |
470 | + convex-c32) | |
471 | + basic_machine=c32-convex | |
472 | + os=-bsd | |
473 | + ;; | |
474 | + convex-c34) | |
475 | + basic_machine=c34-convex | |
476 | + os=-bsd | |
477 | + ;; | |
478 | + convex-c38) | |
479 | + basic_machine=c38-convex | |
480 | + os=-bsd | |
481 | + ;; | |
482 | + cray | j90) | |
483 | + basic_machine=j90-cray | |
484 | + os=-unicos | |
485 | + ;; | |
486 | + craynv) | |
487 | + basic_machine=craynv-cray | |
488 | + os=-unicosmp | |
489 | + ;; | |
490 | + cr16) | |
491 | + basic_machine=cr16-unknown | |
492 | + os=-elf | |
493 | + ;; | |
494 | + crds | unos) | |
495 | + basic_machine=m68k-crds | |
496 | + ;; | |
497 | + crisv32 | crisv32-* | etraxfs*) | |
498 | + basic_machine=crisv32-axis | |
499 | + ;; | |
500 | + cris | cris-* | etrax*) | |
501 | + basic_machine=cris-axis | |
502 | + ;; | |
503 | + crx) | |
504 | + basic_machine=crx-unknown | |
505 | + os=-elf | |
506 | + ;; | |
507 | + da30 | da30-*) | |
508 | + basic_machine=m68k-da30 | |
509 | + ;; | |
510 | + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) | |
511 | + basic_machine=mips-dec | |
512 | + ;; | |
513 | + decsystem10* | dec10*) | |
514 | + basic_machine=pdp10-dec | |
515 | + os=-tops10 | |
516 | + ;; | |
517 | + decsystem20* | dec20*) | |
518 | + basic_machine=pdp10-dec | |
519 | + os=-tops20 | |
520 | + ;; | |
521 | + delta | 3300 | motorola-3300 | motorola-delta \ | |
522 | + | 3300-motorola | delta-motorola) | |
523 | + basic_machine=m68k-motorola | |
524 | + ;; | |
525 | + delta88) | |
526 | + basic_machine=m88k-motorola | |
527 | + os=-sysv3 | |
528 | + ;; | |
529 | + djgpp) | |
530 | + basic_machine=i586-pc | |
531 | + os=-msdosdjgpp | |
532 | + ;; | |
533 | + dpx20 | dpx20-*) | |
534 | + basic_machine=rs6000-bull | |
535 | + os=-bosx | |
536 | + ;; | |
537 | + dpx2* | dpx2*-bull) | |
538 | + basic_machine=m68k-bull | |
539 | + os=-sysv3 | |
540 | + ;; | |
541 | + ebmon29k) | |
542 | + basic_machine=a29k-amd | |
543 | + os=-ebmon | |
544 | + ;; | |
545 | + elxsi) | |
546 | + basic_machine=elxsi-elxsi | |
547 | + os=-bsd | |
548 | + ;; | |
549 | + encore | umax | mmax) | |
550 | + basic_machine=ns32k-encore | |
551 | + ;; | |
552 | + es1800 | OSE68k | ose68k | ose | OSE) | |
553 | + basic_machine=m68k-ericsson | |
554 | + os=-ose | |
555 | + ;; | |
556 | + fx2800) | |
557 | + basic_machine=i860-alliant | |
558 | + ;; | |
559 | + genix) | |
560 | + basic_machine=ns32k-ns | |
561 | + ;; | |
562 | + gmicro) | |
563 | + basic_machine=tron-gmicro | |
564 | + os=-sysv | |
565 | + ;; | |
566 | + go32) | |
567 | + basic_machine=i386-pc | |
568 | + os=-go32 | |
569 | + ;; | |
570 | + h3050r* | hiux*) | |
571 | + basic_machine=hppa1.1-hitachi | |
572 | + os=-hiuxwe2 | |
573 | + ;; | |
574 | + h8300hms) | |
575 | + basic_machine=h8300-hitachi | |
576 | + os=-hms | |
577 | + ;; | |
578 | + h8300xray) | |
579 | + basic_machine=h8300-hitachi | |
580 | + os=-xray | |
581 | + ;; | |
582 | + h8500hms) | |
583 | + basic_machine=h8500-hitachi | |
584 | + os=-hms | |
585 | + ;; | |
586 | + harris) | |
587 | + basic_machine=m88k-harris | |
588 | + os=-sysv3 | |
589 | + ;; | |
590 | + hp300-*) | |
591 | + basic_machine=m68k-hp | |
592 | + ;; | |
593 | + hp300bsd) | |
594 | + basic_machine=m68k-hp | |
595 | + os=-bsd | |
596 | + ;; | |
597 | + hp300hpux) | |
598 | + basic_machine=m68k-hp | |
599 | + os=-hpux | |
600 | + ;; | |
601 | + hp3k9[0-9][0-9] | hp9[0-9][0-9]) | |
602 | + basic_machine=hppa1.0-hp | |
603 | + ;; | |
604 | + hp9k2[0-9][0-9] | hp9k31[0-9]) | |
605 | + basic_machine=m68000-hp | |
606 | + ;; | |
607 | + hp9k3[2-9][0-9]) | |
608 | + basic_machine=m68k-hp | |
609 | + ;; | |
610 | + hp9k6[0-9][0-9] | hp6[0-9][0-9]) | |
611 | + basic_machine=hppa1.0-hp | |
612 | + ;; | |
613 | + hp9k7[0-79][0-9] | hp7[0-79][0-9]) | |
614 | + basic_machine=hppa1.1-hp | |
615 | + ;; | |
616 | + hp9k78[0-9] | hp78[0-9]) | |
617 | + # FIXME: really hppa2.0-hp | |
618 | + basic_machine=hppa1.1-hp | |
619 | + ;; | |
620 | + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) | |
621 | + # FIXME: really hppa2.0-hp | |
622 | + basic_machine=hppa1.1-hp | |
623 | + ;; | |
624 | + hp9k8[0-9][13679] | hp8[0-9][13679]) | |
625 | + basic_machine=hppa1.1-hp | |
626 | + ;; | |
627 | + hp9k8[0-9][0-9] | hp8[0-9][0-9]) | |
628 | + basic_machine=hppa1.0-hp | |
629 | + ;; | |
630 | + hppa-next) | |
631 | + os=-nextstep3 | |
632 | + ;; | |
633 | + hppaosf) | |
634 | + basic_machine=hppa1.1-hp | |
635 | + os=-osf | |
636 | + ;; | |
637 | + hppro) | |
638 | + basic_machine=hppa1.1-hp | |
639 | + os=-proelf | |
640 | + ;; | |
641 | + i370-ibm* | ibm*) | |
642 | + basic_machine=i370-ibm | |
643 | + ;; | |
644 | +# I'm not sure what "Sysv32" means. Should this be sysv3.2? | |
645 | + i*86v32) | |
646 | + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
647 | + os=-sysv32 | |
648 | + ;; | |
649 | + i*86v4*) | |
650 | + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
651 | + os=-sysv4 | |
652 | + ;; | |
653 | + i*86v) | |
654 | + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
655 | + os=-sysv | |
656 | + ;; | |
657 | + i*86sol2) | |
658 | + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
659 | + os=-solaris2 | |
660 | + ;; | |
661 | + i386mach) | |
662 | + basic_machine=i386-mach | |
663 | + os=-mach | |
664 | + ;; | |
665 | + i386-vsta | vsta) | |
666 | + basic_machine=i386-unknown | |
667 | + os=-vsta | |
668 | + ;; | |
669 | + iris | iris4d) | |
670 | + basic_machine=mips-sgi | |
671 | + case $os in | |
672 | + -irix*) | |
673 | + ;; | |
674 | + *) | |
675 | + os=-irix4 | |
676 | + ;; | |
677 | + esac | |
678 | + ;; | |
679 | + isi68 | isi) | |
680 | + basic_machine=m68k-isi | |
681 | + os=-sysv | |
682 | + ;; | |
683 | + m68knommu) | |
684 | + basic_machine=m68k-unknown | |
685 | + os=-linux | |
686 | + ;; | |
687 | + m68knommu-*) | |
688 | + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` | |
689 | + os=-linux | |
690 | + ;; | |
691 | + m88k-omron*) | |
692 | + basic_machine=m88k-omron | |
693 | + ;; | |
694 | + magnum | m3230) | |
695 | + basic_machine=mips-mips | |
696 | + os=-sysv | |
697 | + ;; | |
698 | + merlin) | |
699 | + basic_machine=ns32k-utek | |
700 | + os=-sysv | |
701 | + ;; | |
702 | + mingw32) | |
703 | + basic_machine=i386-pc | |
704 | + os=-mingw32 | |
705 | + ;; | |
706 | + mingw32ce) | |
707 | + basic_machine=arm-unknown | |
708 | + os=-mingw32ce | |
709 | + ;; | |
710 | + miniframe) | |
711 | + basic_machine=m68000-convergent | |
712 | + ;; | |
713 | + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) | |
714 | + basic_machine=m68k-atari | |
715 | + os=-mint | |
716 | + ;; | |
717 | + mips3*-*) | |
718 | + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` | |
719 | + ;; | |
720 | + mips3*) | |
721 | + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown | |
722 | + ;; | |
723 | + monitor) | |
724 | + basic_machine=m68k-rom68k | |
725 | + os=-coff | |
726 | + ;; | |
727 | + morphos) | |
728 | + basic_machine=powerpc-unknown | |
729 | + os=-morphos | |
730 | + ;; | |
731 | + msdos) | |
732 | + basic_machine=i386-pc | |
733 | + os=-msdos | |
734 | + ;; | |
735 | + ms1-*) | |
736 | + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` | |
737 | + ;; | |
738 | + mvs) | |
739 | + basic_machine=i370-ibm | |
740 | + os=-mvs | |
741 | + ;; | |
742 | + ncr3000) | |
743 | + basic_machine=i486-ncr | |
744 | + os=-sysv4 | |
745 | + ;; | |
746 | + netbsd386) | |
747 | + basic_machine=i386-unknown | |
748 | + os=-netbsd | |
749 | + ;; | |
750 | + netwinder) | |
751 | + basic_machine=armv4l-rebel | |
752 | + os=-linux | |
753 | + ;; | |
754 | + news | news700 | news800 | news900) | |
755 | + basic_machine=m68k-sony | |
756 | + os=-newsos | |
757 | + ;; | |
758 | + news1000) | |
759 | + basic_machine=m68030-sony | |
760 | + os=-newsos | |
761 | + ;; | |
762 | + news-3600 | risc-news) | |
763 | + basic_machine=mips-sony | |
764 | + os=-newsos | |
765 | + ;; | |
766 | + necv70) | |
767 | + basic_machine=v70-nec | |
768 | + os=-sysv | |
769 | + ;; | |
770 | + next | m*-next ) | |
771 | + basic_machine=m68k-next | |
772 | + case $os in | |
773 | + -nextstep* ) | |
774 | + ;; | |
775 | + -ns2*) | |
776 | + os=-nextstep2 | |
777 | + ;; | |
778 | + *) | |
779 | + os=-nextstep3 | |
780 | + ;; | |
781 | + esac | |
782 | + ;; | |
783 | + nh3000) | |
784 | + basic_machine=m68k-harris | |
785 | + os=-cxux | |
786 | + ;; | |
787 | + nh[45]000) | |
788 | + basic_machine=m88k-harris | |
789 | + os=-cxux | |
790 | + ;; | |
791 | + nindy960) | |
792 | + basic_machine=i960-intel | |
793 | + os=-nindy | |
794 | + ;; | |
795 | + mon960) | |
796 | + basic_machine=i960-intel | |
797 | + os=-mon960 | |
798 | + ;; | |
799 | + nonstopux) | |
800 | + basic_machine=mips-compaq | |
801 | + os=-nonstopux | |
802 | + ;; | |
803 | + np1) | |
804 | + basic_machine=np1-gould | |
805 | + ;; | |
806 | + nsr-tandem) | |
807 | + basic_machine=nsr-tandem | |
808 | + ;; | |
809 | + op50n-* | op60c-*) | |
810 | + basic_machine=hppa1.1-oki | |
811 | + os=-proelf | |
812 | + ;; | |
813 | + openrisc | openrisc-*) | |
814 | + basic_machine=or32-unknown | |
815 | + ;; | |
816 | + os400) | |
817 | + basic_machine=powerpc-ibm | |
818 | + os=-os400 | |
819 | + ;; | |
820 | + OSE68000 | ose68000) | |
821 | + basic_machine=m68000-ericsson | |
822 | + os=-ose | |
823 | + ;; | |
824 | + os68k) | |
825 | + basic_machine=m68k-none | |
826 | + os=-os68k | |
827 | + ;; | |
828 | + pa-hitachi) | |
829 | + basic_machine=hppa1.1-hitachi | |
830 | + os=-hiuxwe2 | |
831 | + ;; | |
832 | + paragon) | |
833 | + basic_machine=i860-intel | |
834 | + os=-osf | |
835 | + ;; | |
836 | + parisc) | |
837 | + basic_machine=hppa-unknown | |
838 | + os=-linux | |
839 | + ;; | |
840 | + parisc-*) | |
841 | + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` | |
842 | + os=-linux | |
843 | + ;; | |
844 | + pbd) | |
845 | + basic_machine=sparc-tti | |
846 | + ;; | |
847 | + pbb) | |
848 | + basic_machine=m68k-tti | |
849 | + ;; | |
850 | + pc532 | pc532-*) | |
851 | + basic_machine=ns32k-pc532 | |
852 | + ;; | |
853 | + pc98) | |
854 | + basic_machine=i386-pc | |
855 | + ;; | |
856 | + pc98-*) | |
857 | + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` | |
858 | + ;; | |
859 | + pentium | p5 | k5 | k6 | nexgen | viac3) | |
860 | + basic_machine=i586-pc | |
861 | + ;; | |
862 | + pentiumpro | p6 | 6x86 | athlon | athlon_*) | |
863 | + basic_machine=i686-pc | |
864 | + ;; | |
865 | + pentiumii | pentium2 | pentiumiii | pentium3) | |
866 | + basic_machine=i686-pc | |
867 | + ;; | |
868 | + pentium4) | |
869 | + basic_machine=i786-pc | |
870 | + ;; | |
871 | + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) | |
872 | + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` | |
873 | + ;; | |
874 | + pentiumpro-* | p6-* | 6x86-* | athlon-*) | |
875 | + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` | |
876 | + ;; | |
877 | + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) | |
878 | + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` | |
879 | + ;; | |
880 | + pentium4-*) | |
881 | + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` | |
882 | + ;; | |
883 | + pn) | |
884 | + basic_machine=pn-gould | |
885 | + ;; | |
886 | + power) basic_machine=power-ibm | |
887 | + ;; | |
888 | + ppc) basic_machine=powerpc-unknown | |
889 | + ;; | |
890 | + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | |
891 | + ;; | |
892 | + ppcle | powerpclittle | ppc-le | powerpc-little) | |
893 | + basic_machine=powerpcle-unknown | |
894 | + ;; | |
895 | + ppcle-* | powerpclittle-*) | |
896 | + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` | |
897 | + ;; | |
898 | + ppc64) basic_machine=powerpc64-unknown | |
899 | + ;; | |
900 | + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` | |
901 | + ;; | |
902 | + ppc64le | powerpc64little | ppc64-le | powerpc64-little) | |
903 | + basic_machine=powerpc64le-unknown | |
904 | + ;; | |
905 | + ppc64le-* | powerpc64little-*) | |
906 | + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` | |
907 | + ;; | |
908 | + ps2) | |
909 | + basic_machine=i386-ibm | |
910 | + ;; | |
911 | + pw32) | |
912 | + basic_machine=i586-unknown | |
913 | + os=-pw32 | |
914 | + ;; | |
915 | + rdos) | |
916 | + basic_machine=i386-pc | |
917 | + os=-rdos | |
918 | + ;; | |
919 | + rom68k) | |
920 | + basic_machine=m68k-rom68k | |
921 | + os=-coff | |
922 | + ;; | |
923 | + rm[46]00) | |
924 | + basic_machine=mips-siemens | |
925 | + ;; | |
926 | + rtpc | rtpc-*) | |
927 | + basic_machine=romp-ibm | |
928 | + ;; | |
929 | + s390 | s390-*) | |
930 | + basic_machine=s390-ibm | |
931 | + ;; | |
932 | + s390x | s390x-*) | |
933 | + basic_machine=s390x-ibm | |
934 | + ;; | |
935 | + sa29200) | |
936 | + basic_machine=a29k-amd | |
937 | + os=-udi | |
938 | + ;; | |
939 | + sb1) | |
940 | + basic_machine=mipsisa64sb1-unknown | |
941 | + ;; | |
942 | + sb1el) | |
943 | + basic_machine=mipsisa64sb1el-unknown | |
944 | + ;; | |
945 | + sde) | |
946 | + basic_machine=mipsisa32-sde | |
947 | + os=-elf | |
948 | + ;; | |
949 | + sei) | |
950 | + basic_machine=mips-sei | |
951 | + os=-seiux | |
952 | + ;; | |
953 | + sequent) | |
954 | + basic_machine=i386-sequent | |
955 | + ;; | |
956 | + sh) | |
957 | + basic_machine=sh-hitachi | |
958 | + os=-hms | |
959 | + ;; | |
960 | + sh5el) | |
961 | + basic_machine=sh5le-unknown | |
962 | + ;; | |
963 | + sh64) | |
964 | + basic_machine=sh64-unknown | |
965 | + ;; | |
966 | + sparclite-wrs | simso-wrs) | |
967 | + basic_machine=sparclite-wrs | |
968 | + os=-vxworks | |
969 | + ;; | |
970 | + sps7) | |
971 | + basic_machine=m68k-bull | |
972 | + os=-sysv2 | |
973 | + ;; | |
974 | + spur) | |
975 | + basic_machine=spur-unknown | |
976 | + ;; | |
977 | + st2000) | |
978 | + basic_machine=m68k-tandem | |
979 | + ;; | |
980 | + stratus) | |
981 | + basic_machine=i860-stratus | |
982 | + os=-sysv4 | |
983 | + ;; | |
984 | + sun2) | |
985 | + basic_machine=m68000-sun | |
986 | + ;; | |
987 | + sun2os3) | |
988 | + basic_machine=m68000-sun | |
989 | + os=-sunos3 | |
990 | + ;; | |
991 | + sun2os4) | |
992 | + basic_machine=m68000-sun | |
993 | + os=-sunos4 | |
994 | + ;; | |
995 | + sun3os3) | |
996 | + basic_machine=m68k-sun | |
997 | + os=-sunos3 | |
998 | + ;; | |
999 | + sun3os4) | |
1000 | + basic_machine=m68k-sun | |
1001 | + os=-sunos4 | |
1002 | + ;; | |
1003 | + sun4os3) | |
1004 | + basic_machine=sparc-sun | |
1005 | + os=-sunos3 | |
1006 | + ;; | |
1007 | + sun4os4) | |
1008 | + basic_machine=sparc-sun | |
1009 | + os=-sunos4 | |
1010 | + ;; | |
1011 | + sun4sol2) | |
1012 | + basic_machine=sparc-sun | |
1013 | + os=-solaris2 | |
1014 | + ;; | |
1015 | + sun3 | sun3-*) | |
1016 | + basic_machine=m68k-sun | |
1017 | + ;; | |
1018 | + sun4) | |
1019 | + basic_machine=sparc-sun | |
1020 | + ;; | |
1021 | + sun386 | sun386i | roadrunner) | |
1022 | + basic_machine=i386-sun | |
1023 | + ;; | |
1024 | + sv1) | |
1025 | + basic_machine=sv1-cray | |
1026 | + os=-unicos | |
1027 | + ;; | |
1028 | + symmetry) | |
1029 | + basic_machine=i386-sequent | |
1030 | + os=-dynix | |
1031 | + ;; | |
1032 | + t3e) | |
1033 | + basic_machine=alphaev5-cray | |
1034 | + os=-unicos | |
1035 | + ;; | |
1036 | + t90) | |
1037 | + basic_machine=t90-cray | |
1038 | + os=-unicos | |
1039 | + ;; | |
1040 | + tic54x | c54x*) | |
1041 | + basic_machine=tic54x-unknown | |
1042 | + os=-coff | |
1043 | + ;; | |
1044 | + tic55x | c55x*) | |
1045 | + basic_machine=tic55x-unknown | |
1046 | + os=-coff | |
1047 | + ;; | |
1048 | + tic6x | c6x*) | |
1049 | + basic_machine=tic6x-unknown | |
1050 | + os=-coff | |
1051 | + ;; | |
1052 | + tile*) | |
1053 | + basic_machine=tile-unknown | |
1054 | + os=-linux-gnu | |
1055 | + ;; | |
1056 | + tx39) | |
1057 | + basic_machine=mipstx39-unknown | |
1058 | + ;; | |
1059 | + tx39el) | |
1060 | + basic_machine=mipstx39el-unknown | |
1061 | + ;; | |
1062 | + toad1) | |
1063 | + basic_machine=pdp10-xkl | |
1064 | + os=-tops20 | |
1065 | + ;; | |
1066 | + tower | tower-32) | |
1067 | + basic_machine=m68k-ncr | |
1068 | + ;; | |
1069 | + tpf) | |
1070 | + basic_machine=s390x-ibm | |
1071 | + os=-tpf | |
1072 | + ;; | |
1073 | + udi29k) | |
1074 | + basic_machine=a29k-amd | |
1075 | + os=-udi | |
1076 | + ;; | |
1077 | + ultra3) | |
1078 | + basic_machine=a29k-nyu | |
1079 | + os=-sym1 | |
1080 | + ;; | |
1081 | + v810 | necv810) | |
1082 | + basic_machine=v810-nec | |
1083 | + os=-none | |
1084 | + ;; | |
1085 | + vaxv) | |
1086 | + basic_machine=vax-dec | |
1087 | + os=-sysv | |
1088 | + ;; | |
1089 | + vms) | |
1090 | + basic_machine=vax-dec | |
1091 | + os=-vms | |
1092 | + ;; | |
1093 | + vpp*|vx|vx-*) | |
1094 | + basic_machine=f301-fujitsu | |
1095 | + ;; | |
1096 | + vxworks960) | |
1097 | + basic_machine=i960-wrs | |
1098 | + os=-vxworks | |
1099 | + ;; | |
1100 | + vxworks68) | |
1101 | + basic_machine=m68k-wrs | |
1102 | + os=-vxworks | |
1103 | + ;; | |
1104 | + vxworks29k) | |
1105 | + basic_machine=a29k-wrs | |
1106 | + os=-vxworks | |
1107 | + ;; | |
1108 | + w65*) | |
1109 | + basic_machine=w65-wdc | |
1110 | + os=-none | |
1111 | + ;; | |
1112 | + w89k-*) | |
1113 | + basic_machine=hppa1.1-winbond | |
1114 | + os=-proelf | |
1115 | + ;; | |
1116 | + xbox) | |
1117 | + basic_machine=i686-pc | |
1118 | + os=-mingw32 | |
1119 | + ;; | |
1120 | + xps | xps100) | |
1121 | + basic_machine=xps100-honeywell | |
1122 | + ;; | |
1123 | + ymp) | |
1124 | + basic_machine=ymp-cray | |
1125 | + os=-unicos | |
1126 | + ;; | |
1127 | + z8k-*-coff) | |
1128 | + basic_machine=z8k-unknown | |
1129 | + os=-sim | |
1130 | + ;; | |
1131 | + none) | |
1132 | + basic_machine=none-none | |
1133 | + os=-none | |
1134 | + ;; | |
1135 | + | |
1136 | +# Here we handle the default manufacturer of certain CPU types. It is in | |
1137 | +# some cases the only manufacturer, in others, it is the most popular. | |
1138 | + w89k) | |
1139 | + basic_machine=hppa1.1-winbond | |
1140 | + ;; | |
1141 | + op50n) | |
1142 | + basic_machine=hppa1.1-oki | |
1143 | + ;; | |
1144 | + op60c) | |
1145 | + basic_machine=hppa1.1-oki | |
1146 | + ;; | |
1147 | + romp) | |
1148 | + basic_machine=romp-ibm | |
1149 | + ;; | |
1150 | + mmix) | |
1151 | + basic_machine=mmix-knuth | |
1152 | + ;; | |
1153 | + rs6000) | |
1154 | + basic_machine=rs6000-ibm | |
1155 | + ;; | |
1156 | + vax) | |
1157 | + basic_machine=vax-dec | |
1158 | + ;; | |
1159 | + pdp10) | |
1160 | + # there are many clones, so DEC is not a safe bet | |
1161 | + basic_machine=pdp10-unknown | |
1162 | + ;; | |
1163 | + pdp11) | |
1164 | + basic_machine=pdp11-dec | |
1165 | + ;; | |
1166 | + we32k) | |
1167 | + basic_machine=we32k-att | |
1168 | + ;; | |
1169 | + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) | |
1170 | + basic_machine=sh-unknown | |
1171 | + ;; | |
1172 | + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) | |
1173 | + basic_machine=sparc-sun | |
1174 | + ;; | |
1175 | + cydra) | |
1176 | + basic_machine=cydra-cydrome | |
1177 | + ;; | |
1178 | + orion) | |
1179 | + basic_machine=orion-highlevel | |
1180 | + ;; | |
1181 | + orion105) | |
1182 | + basic_machine=clipper-highlevel | |
1183 | + ;; | |
1184 | + mac | mpw | mac-mpw) | |
1185 | + basic_machine=m68k-apple | |
1186 | + ;; | |
1187 | + pmac | pmac-mpw) | |
1188 | + basic_machine=powerpc-apple | |
1189 | + ;; | |
1190 | + *-unknown) | |
1191 | + # Make sure to match an already-canonicalized machine name. | |
1192 | + ;; | |
1193 | + *) | |
1194 | + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 | |
1195 | + exit 1 | |
1196 | + ;; | |
1197 | +esac | |
1198 | + | |
1199 | +# Here we canonicalize certain aliases for manufacturers. | |
1200 | +case $basic_machine in | |
1201 | + *-digital*) | |
1202 | + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` | |
1203 | + ;; | |
1204 | + *-commodore*) | |
1205 | + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` | |
1206 | + ;; | |
1207 | + *) | |
1208 | + ;; | |
1209 | +esac | |
1210 | + | |
1211 | +# Decode manufacturer-specific aliases for certain operating systems. | |
1212 | + | |
1213 | +if [ x"$os" != x"" ] | |
1214 | +then | |
1215 | +case $os in | |
1216 | + # First match some system type aliases | |
1217 | + # that might get confused with valid system types. | |
1218 | + # -solaris* is a basic system type, with this one exception. | |
1219 | + -solaris1 | -solaris1.*) | |
1220 | + os=`echo $os | sed -e 's|solaris1|sunos4|'` | |
1221 | + ;; | |
1222 | + -solaris) | |
1223 | + os=-solaris2 | |
1224 | + ;; | |
1225 | + -svr4*) | |
1226 | + os=-sysv4 | |
1227 | + ;; | |
1228 | + -unixware*) | |
1229 | + os=-sysv4.2uw | |
1230 | + ;; | |
1231 | + -gnu/linux*) | |
1232 | + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` | |
1233 | + ;; | |
1234 | + # First accept the basic system types. | |
1235 | + # The portable systems comes first. | |
1236 | + # Each alternative MUST END IN A *, to match a version number. | |
1237 | + # -sysv* is not here because it comes later, after sysvr4. | |
1238 | + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | |
1239 | + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | |
1240 | + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | |
1241 | + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | |
1242 | + | -aos* \ | |
1243 | + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | |
1244 | + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | |
1245 | + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | |
1246 | + | -openbsd* | -solidbsd* \ | |
1247 | + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | |
1248 | + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | |
1249 | + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | |
1250 | + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | |
1251 | + | -chorusos* | -chorusrdb* \ | |
1252 | + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | |
1253 | + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | |
1254 | + | -uxpv* | -beos* | -mpeix* | -udk* \ | |
1255 | + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | |
1256 | + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | |
1257 | + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | |
1258 | + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | |
1259 | + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | |
1260 | + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | |
1261 | + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) | |
1262 | + # Remember, each alternative MUST END IN *, to match a version number. | |
1263 | + ;; | |
1264 | + -qnx*) | |
1265 | + case $basic_machine in | |
1266 | + x86-* | i*86-*) | |
1267 | + ;; | |
1268 | + *) | |
1269 | + os=-nto$os | |
1270 | + ;; | |
1271 | + esac | |
1272 | + ;; | |
1273 | + -nto-qnx*) | |
1274 | + ;; | |
1275 | + -nto*) | |
1276 | + os=`echo $os | sed -e 's|nto|nto-qnx|'` | |
1277 | + ;; | |
1278 | + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | |
1279 | + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | |
1280 | + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) | |
1281 | + ;; | |
1282 | + -mac*) | |
1283 | + os=`echo $os | sed -e 's|mac|macos|'` | |
1284 | + ;; | |
1285 | + -linux-dietlibc) | |
1286 | + os=-linux-dietlibc | |
1287 | + ;; | |
1288 | + -linux*) | |
1289 | + os=`echo $os | sed -e 's|linux|linux-gnu|'` | |
1290 | + ;; | |
1291 | + -sunos5*) | |
1292 | + os=`echo $os | sed -e 's|sunos5|solaris2|'` | |
1293 | + ;; | |
1294 | + -sunos6*) | |
1295 | + os=`echo $os | sed -e 's|sunos6|solaris3|'` | |
1296 | + ;; | |
1297 | + -opened*) | |
1298 | + os=-openedition | |
1299 | + ;; | |
1300 | + -os400*) | |
1301 | + os=-os400 | |
1302 | + ;; | |
1303 | + -wince*) | |
1304 | + os=-wince | |
1305 | + ;; | |
1306 | + -osfrose*) | |
1307 | + os=-osfrose | |
1308 | + ;; | |
1309 | + -osf*) | |
1310 | + os=-osf | |
1311 | + ;; | |
1312 | + -utek*) | |
1313 | + os=-bsd | |
1314 | + ;; | |
1315 | + -dynix*) | |
1316 | + os=-bsd | |
1317 | + ;; | |
1318 | + -acis*) | |
1319 | + os=-aos | |
1320 | + ;; | |
1321 | + -atheos*) | |
1322 | + os=-atheos | |
1323 | + ;; | |
1324 | + -syllable*) | |
1325 | + os=-syllable | |
1326 | + ;; | |
1327 | + -386bsd) | |
1328 | + os=-bsd | |
1329 | + ;; | |
1330 | + -ctix* | -uts*) | |
1331 | + os=-sysv | |
1332 | + ;; | |
1333 | + -nova*) | |
1334 | + os=-rtmk-nova | |
1335 | + ;; | |
1336 | + -ns2 ) | |
1337 | + os=-nextstep2 | |
1338 | + ;; | |
1339 | + -nsk*) | |
1340 | + os=-nsk | |
1341 | + ;; | |
1342 | + # Preserve the version number of sinix5. | |
1343 | + -sinix5.*) | |
1344 | + os=`echo $os | sed -e 's|sinix|sysv|'` | |
1345 | + ;; | |
1346 | + -sinix*) | |
1347 | + os=-sysv4 | |
1348 | + ;; | |
1349 | + -tpf*) | |
1350 | + os=-tpf | |
1351 | + ;; | |
1352 | + -triton*) | |
1353 | + os=-sysv3 | |
1354 | + ;; | |
1355 | + -oss*) | |
1356 | + os=-sysv3 | |
1357 | + ;; | |
1358 | + -svr4) | |
1359 | + os=-sysv4 | |
1360 | + ;; | |
1361 | + -svr3) | |
1362 | + os=-sysv3 | |
1363 | + ;; | |
1364 | + -sysvr4) | |
1365 | + os=-sysv4 | |
1366 | + ;; | |
1367 | + # This must come after -sysvr4. | |
1368 | + -sysv*) | |
1369 | + ;; | |
1370 | + -ose*) | |
1371 | + os=-ose | |
1372 | + ;; | |
1373 | + -es1800*) | |
1374 | + os=-ose | |
1375 | + ;; | |
1376 | + -xenix) | |
1377 | + os=-xenix | |
1378 | + ;; | |
1379 | + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) | |
1380 | + os=-mint | |
1381 | + ;; | |
1382 | + -aros*) | |
1383 | + os=-aros | |
1384 | + ;; | |
1385 | + -kaos*) | |
1386 | + os=-kaos | |
1387 | + ;; | |
1388 | + -zvmoe) | |
1389 | + os=-zvmoe | |
1390 | + ;; | |
1391 | + -none) | |
1392 | + ;; | |
1393 | + *) | |
1394 | + # Get rid of the `-' at the beginning of $os. | |
1395 | + os=`echo $os | sed 's/[^-]*-//'` | |
1396 | + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 | |
1397 | + exit 1 | |
1398 | + ;; | |
1399 | +esac | |
1400 | +else | |
1401 | + | |
1402 | +# Here we handle the default operating systems that come with various machines. | |
1403 | +# The value should be what the vendor currently ships out the door with their | |
1404 | +# machine or put another way, the most popular os provided with the machine. | |
1405 | + | |
1406 | +# Note that if you're going to try to match "-MANUFACTURER" here (say, | |
1407 | +# "-sun"), then you have to tell the case statement up towards the top | |
1408 | +# that MANUFACTURER isn't an operating system. Otherwise, code above | |
1409 | +# will signal an error saying that MANUFACTURER isn't an operating | |
1410 | +# system, and we'll never get to this point. | |
1411 | + | |
1412 | +case $basic_machine in | |
1413 | + score-*) | |
1414 | + os=-elf | |
1415 | + ;; | |
1416 | + spu-*) | |
1417 | + os=-elf | |
1418 | + ;; | |
1419 | + *-acorn) | |
1420 | + os=-riscix1.2 | |
1421 | + ;; | |
1422 | + arm*-rebel) | |
1423 | + os=-linux | |
1424 | + ;; | |
1425 | + arm*-semi) | |
1426 | + os=-aout | |
1427 | + ;; | |
1428 | + c4x-* | tic4x-*) | |
1429 | + os=-coff | |
1430 | + ;; | |
1431 | + # This must come before the *-dec entry. | |
1432 | + pdp10-*) | |
1433 | + os=-tops20 | |
1434 | + ;; | |
1435 | + pdp11-*) | |
1436 | + os=-none | |
1437 | + ;; | |
1438 | + *-dec | vax-*) | |
1439 | + os=-ultrix4.2 | |
1440 | + ;; | |
1441 | + m68*-apollo) | |
1442 | + os=-domain | |
1443 | + ;; | |
1444 | + i386-sun) | |
1445 | + os=-sunos4.0.2 | |
1446 | + ;; | |
1447 | + m68000-sun) | |
1448 | + os=-sunos3 | |
1449 | + # This also exists in the configure program, but was not the | |
1450 | + # default. | |
1451 | + # os=-sunos4 | |
1452 | + ;; | |
1453 | + m68*-cisco) | |
1454 | + os=-aout | |
1455 | + ;; | |
1456 | + mep-*) | |
1457 | + os=-elf | |
1458 | + ;; | |
1459 | + mips*-cisco) | |
1460 | + os=-elf | |
1461 | + ;; | |
1462 | + mips*-*) | |
1463 | + os=-elf | |
1464 | + ;; | |
1465 | + or32-*) | |
1466 | + os=-coff | |
1467 | + ;; | |
1468 | + *-tti) # must be before sparc entry or we get the wrong os. | |
1469 | + os=-sysv3 | |
1470 | + ;; | |
1471 | + sparc-* | *-sun) | |
1472 | + os=-sunos4.1.1 | |
1473 | + ;; | |
1474 | + *-be) | |
1475 | + os=-beos | |
1476 | + ;; | |
1477 | + *-haiku) | |
1478 | + os=-haiku | |
1479 | + ;; | |
1480 | + *-ibm) | |
1481 | + os=-aix | |
1482 | + ;; | |
1483 | + *-knuth) | |
1484 | + os=-mmixware | |
1485 | + ;; | |
1486 | + *-wec) | |
1487 | + os=-proelf | |
1488 | + ;; | |
1489 | + *-winbond) | |
1490 | + os=-proelf | |
1491 | + ;; | |
1492 | + *-oki) | |
1493 | + os=-proelf | |
1494 | + ;; | |
1495 | + *-hp) | |
1496 | + os=-hpux | |
1497 | + ;; | |
1498 | + *-hitachi) | |
1499 | + os=-hiux | |
1500 | + ;; | |
1501 | + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) | |
1502 | + os=-sysv | |
1503 | + ;; | |
1504 | + *-cbm) | |
1505 | + os=-amigaos | |
1506 | + ;; | |
1507 | + *-dg) | |
1508 | + os=-dgux | |
1509 | + ;; | |
1510 | + *-dolphin) | |
1511 | + os=-sysv3 | |
1512 | + ;; | |
1513 | + m68k-ccur) | |
1514 | + os=-rtu | |
1515 | + ;; | |
1516 | + m88k-omron*) | |
1517 | + os=-luna | |
1518 | + ;; | |
1519 | + *-next ) | |
1520 | + os=-nextstep | |
1521 | + ;; | |
1522 | + *-sequent) | |
1523 | + os=-ptx | |
1524 | + ;; | |
1525 | + *-crds) | |
1526 | + os=-unos | |
1527 | + ;; | |
1528 | + *-ns) | |
1529 | + os=-genix | |
1530 | + ;; | |
1531 | + i370-*) | |
1532 | + os=-mvs | |
1533 | + ;; | |
1534 | + *-next) | |
1535 | + os=-nextstep3 | |
1536 | + ;; | |
1537 | + *-gould) | |
1538 | + os=-sysv | |
1539 | + ;; | |
1540 | + *-highlevel) | |
1541 | + os=-bsd | |
1542 | + ;; | |
1543 | + *-encore) | |
1544 | + os=-bsd | |
1545 | + ;; | |
1546 | + *-sgi) | |
1547 | + os=-irix | |
1548 | + ;; | |
1549 | + *-siemens) | |
1550 | + os=-sysv4 | |
1551 | + ;; | |
1552 | + *-masscomp) | |
1553 | + os=-rtu | |
1554 | + ;; | |
1555 | + f30[01]-fujitsu | f700-fujitsu) | |
1556 | + os=-uxpv | |
1557 | + ;; | |
1558 | + *-rom68k) | |
1559 | + os=-coff | |
1560 | + ;; | |
1561 | + *-*bug) | |
1562 | + os=-coff | |
1563 | + ;; | |
1564 | + *-apple) | |
1565 | + os=-macos | |
1566 | + ;; | |
1567 | + *-atari*) | |
1568 | + os=-mint | |
1569 | + ;; | |
1570 | + *) | |
1571 | + os=-none | |
1572 | + ;; | |
1573 | +esac | |
1574 | +fi | |
1575 | + | |
1576 | +# Here we handle the case where we know the os, and the CPU type, but not the | |
1577 | +# manufacturer. We pick the logical manufacturer. | |
1578 | +vendor=unknown | |
1579 | +case $basic_machine in | |
1580 | + *-unknown) | |
1581 | + case $os in | |
1582 | + -riscix*) | |
1583 | + vendor=acorn | |
1584 | + ;; | |
1585 | + -sunos*) | |
1586 | + vendor=sun | |
1587 | + ;; | |
1588 | + -aix*) | |
1589 | + vendor=ibm | |
1590 | + ;; | |
1591 | + -beos*) | |
1592 | + vendor=be | |
1593 | + ;; | |
1594 | + -hpux*) | |
1595 | + vendor=hp | |
1596 | + ;; | |
1597 | + -mpeix*) | |
1598 | + vendor=hp | |
1599 | + ;; | |
1600 | + -hiux*) | |
1601 | + vendor=hitachi | |
1602 | + ;; | |
1603 | + -unos*) | |
1604 | + vendor=crds | |
1605 | + ;; | |
1606 | + -dgux*) | |
1607 | + vendor=dg | |
1608 | + ;; | |
1609 | + -luna*) | |
1610 | + vendor=omron | |
1611 | + ;; | |
1612 | + -genix*) | |
1613 | + vendor=ns | |
1614 | + ;; | |
1615 | + -mvs* | -opened*) | |
1616 | + vendor=ibm | |
1617 | + ;; | |
1618 | + -os400*) | |
1619 | + vendor=ibm | |
1620 | + ;; | |
1621 | + -ptx*) | |
1622 | + vendor=sequent | |
1623 | + ;; | |
1624 | + -tpf*) | |
1625 | + vendor=ibm | |
1626 | + ;; | |
1627 | + -vxsim* | -vxworks* | -windiss*) | |
1628 | + vendor=wrs | |
1629 | + ;; | |
1630 | + -aux*) | |
1631 | + vendor=apple | |
1632 | + ;; | |
1633 | + -hms*) | |
1634 | + vendor=hitachi | |
1635 | + ;; | |
1636 | + -mpw* | -macos*) | |
1637 | + vendor=apple | |
1638 | + ;; | |
1639 | + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) | |
1640 | + vendor=atari | |
1641 | + ;; | |
1642 | + -vos*) | |
1643 | + vendor=stratus | |
1644 | + ;; | |
1645 | + esac | |
1646 | + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` | |
1647 | + ;; | |
1648 | +esac | |
1649 | + | |
1650 | +echo $basic_machine$os | |
1651 | +exit | |
1652 | + | |
1653 | +# Local variables: | |
1654 | +# eval: (add-hook 'write-file-hooks 'time-stamp) | |
1655 | +# time-stamp-start: "timestamp='" | |
1656 | +# time-stamp-format: "%:y-%02m-%02d" | |
1657 | +# time-stamp-end: "'" | |
1658 | +# End: | ... | ... |
... | ... | @@ -0,0 +1,251 @@ |
1 | +#!/bin/sh | |
2 | +# | |
3 | +# install - install a program, script, or datafile | |
4 | +# This comes from X11R5 (mit/util/scripts/install.sh). | |
5 | +# | |
6 | +# Copyright 1991 by the Massachusetts Institute of Technology | |
7 | +# | |
8 | +# Permission to use, copy, modify, distribute, and sell this software and its | |
9 | +# documentation for any purpose is hereby granted without fee, provided that | |
10 | +# the above copyright notice appear in all copies and that both that | |
11 | +# copyright notice and this permission notice appear in supporting | |
12 | +# documentation, and that the name of M.I.T. not be used in advertising or | |
13 | +# publicity pertaining to distribution of the software without specific, | |
14 | +# written prior permission. M.I.T. makes no representations about the | |
15 | +# suitability of this software for any purpose. It is provided "as is" | |
16 | +# without express or implied warranty. | |
17 | +# | |
18 | +# Calling this script install-sh is preferred over install.sh, to prevent | |
19 | +# `make' implicit rules from creating a file called install from it | |
20 | +# when there is no Makefile. | |
21 | +# | |
22 | +# This script is compatible with the BSD install script, but was written | |
23 | +# from scratch. It can only install one file at a time, a restriction | |
24 | +# shared with many OS's install programs. | |
25 | + | |
26 | + | |
27 | +# set DOITPROG to echo to test this script | |
28 | + | |
29 | +# Don't use :- since 4.3BSD and earlier shells don't like it. | |
30 | +doit="${DOITPROG-}" | |
31 | + | |
32 | + | |
33 | +# put in absolute paths if you don't have them in your path; or use env. vars. | |
34 | + | |
35 | +mvprog="${MVPROG-mv}" | |
36 | +cpprog="${CPPROG-cp}" | |
37 | +chmodprog="${CHMODPROG-chmod}" | |
38 | +chownprog="${CHOWNPROG-chown}" | |
39 | +chgrpprog="${CHGRPPROG-chgrp}" | |
40 | +stripprog="${STRIPPROG-strip}" | |
41 | +rmprog="${RMPROG-rm}" | |
42 | +mkdirprog="${MKDIRPROG-mkdir}" | |
43 | + | |
44 | +transformbasename="" | |
45 | +transform_arg="" | |
46 | +instcmd="$mvprog" | |
47 | +chmodcmd="$chmodprog 0755" | |
48 | +chowncmd="" | |
49 | +chgrpcmd="" | |
50 | +stripcmd="" | |
51 | +rmcmd="$rmprog -f" | |
52 | +mvcmd="$mvprog" | |
53 | +src="" | |
54 | +dst="" | |
55 | +dir_arg="" | |
56 | + | |
57 | +while [ x"$1" != x ]; do | |
58 | + case $1 in | |
59 | + -c) instcmd="$cpprog" | |
60 | + shift | |
61 | + continue;; | |
62 | + | |
63 | + -d) dir_arg=true | |
64 | + shift | |
65 | + continue;; | |
66 | + | |
67 | + -m) chmodcmd="$chmodprog $2" | |
68 | + shift | |
69 | + shift | |
70 | + continue;; | |
71 | + | |
72 | + -o) chowncmd="$chownprog $2" | |
73 | + shift | |
74 | + shift | |
75 | + continue;; | |
76 | + | |
77 | + -g) chgrpcmd="$chgrpprog $2" | |
78 | + shift | |
79 | + shift | |
80 | + continue;; | |
81 | + | |
82 | + -s) stripcmd="$stripprog" | |
83 | + shift | |
84 | + continue;; | |
85 | + | |
86 | + -t=*) transformarg=`echo $1 | sed 's/-t=//'` | |
87 | + shift | |
88 | + continue;; | |
89 | + | |
90 | + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` | |
91 | + shift | |
92 | + continue;; | |
93 | + | |
94 | + *) if [ x"$src" = x ] | |
95 | + then | |
96 | + src=$1 | |
97 | + else | |
98 | + # this colon is to work around a 386BSD /bin/sh bug | |
99 | + : | |
100 | + dst=$1 | |
101 | + fi | |
102 | + shift | |
103 | + continue;; | |
104 | + esac | |
105 | +done | |
106 | + | |
107 | +if [ x"$src" = x ] | |
108 | +then | |
109 | + echo "install: no input file specified" | |
110 | + exit 1 | |
111 | +else | |
112 | + : | |
113 | +fi | |
114 | + | |
115 | +if [ x"$dir_arg" != x ]; then | |
116 | + dst=$src | |
117 | + src="" | |
118 | + | |
119 | + if [ -d $dst ]; then | |
120 | + instcmd=: | |
121 | + chmodcmd="" | |
122 | + else | |
123 | + instcmd=$mkdirprog | |
124 | + fi | |
125 | +else | |
126 | + | |
127 | +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command | |
128 | +# might cause directories to be created, which would be especially bad | |
129 | +# if $src (and thus $dsttmp) contains '*'. | |
130 | + | |
131 | + if [ -f $src -o -d $src ] | |
132 | + then | |
133 | + : | |
134 | + else | |
135 | + echo "install: $src does not exist" | |
136 | + exit 1 | |
137 | + fi | |
138 | + | |
139 | + if [ x"$dst" = x ] | |
140 | + then | |
141 | + echo "install: no destination specified" | |
142 | + exit 1 | |
143 | + else | |
144 | + : | |
145 | + fi | |
146 | + | |
147 | +# If destination is a directory, append the input filename; if your system | |
148 | +# does not like double slashes in filenames, you may need to add some logic | |
149 | + | |
150 | + if [ -d $dst ] | |
151 | + then | |
152 | + dst="$dst"/`basename $src` | |
153 | + else | |
154 | + : | |
155 | + fi | |
156 | +fi | |
157 | + | |
158 | +## this sed command emulates the dirname command | |
159 | +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` | |
160 | + | |
161 | +# Make sure that the destination directory exists. | |
162 | +# this part is taken from Noah Friedman's mkinstalldirs script | |
163 | + | |
164 | +# Skip lots of stat calls in the usual case. | |
165 | +if [ ! -d "$dstdir" ]; then | |
166 | +defaultIFS=' | |
167 | + ' | |
168 | +IFS="${IFS-${defaultIFS}}" | |
169 | + | |
170 | +oIFS="${IFS}" | |
171 | +# Some sh's can't handle IFS=/ for some reason. | |
172 | +IFS='%' | |
173 | +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` | |
174 | +IFS="${oIFS}" | |
175 | + | |
176 | +pathcomp='' | |
177 | + | |
178 | +while [ $# -ne 0 ] ; do | |
179 | + pathcomp="${pathcomp}${1}" | |
180 | + shift | |
181 | + | |
182 | + if [ ! -d "${pathcomp}" ] ; | |
183 | + then | |
184 | + $mkdirprog "${pathcomp}" | |
185 | + else | |
186 | + : | |
187 | + fi | |
188 | + | |
189 | + pathcomp="${pathcomp}/" | |
190 | +done | |
191 | +fi | |
192 | + | |
193 | +if [ x"$dir_arg" != x ] | |
194 | +then | |
195 | + $doit $instcmd $dst && | |
196 | + | |
197 | + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && | |
198 | + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && | |
199 | + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && | |
200 | + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi | |
201 | +else | |
202 | + | |
203 | +# If we're going to rename the final executable, determine the name now. | |
204 | + | |
205 | + if [ x"$transformarg" = x ] | |
206 | + then | |
207 | + dstfile=`basename $dst` | |
208 | + else | |
209 | + dstfile=`basename $dst $transformbasename | | |
210 | + sed $transformarg`$transformbasename | |
211 | + fi | |
212 | + | |
213 | +# don't allow the sed command to completely eliminate the filename | |
214 | + | |
215 | + if [ x"$dstfile" = x ] | |
216 | + then | |
217 | + dstfile=`basename $dst` | |
218 | + else | |
219 | + : | |
220 | + fi | |
221 | + | |
222 | +# Make a temp file name in the proper directory. | |
223 | + | |
224 | + dsttmp=$dstdir/#inst.$$# | |
225 | + | |
226 | +# Move or copy the file name to the temp name | |
227 | + | |
228 | + $doit $instcmd $src $dsttmp && | |
229 | + | |
230 | + trap "rm -f ${dsttmp}" 0 && | |
231 | + | |
232 | +# and set any options; do chmod last to preserve setuid bits | |
233 | + | |
234 | +# If any of these fail, we abort the whole thing. If we want to | |
235 | +# ignore errors from any of these, just make sure not to ignore | |
236 | +# errors from the above "$doit $instcmd $src $dsttmp" command. | |
237 | + | |
238 | + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && | |
239 | + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && | |
240 | + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && | |
241 | + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && | |
242 | + | |
243 | +# Now rename the file to the real destination. | |
244 | + | |
245 | + $doit $rmcmd -f $dstdir/$dstfile && | |
246 | + $doit $mvcmd $dsttmp $dstdir/$dstfile | |
247 | + | |
248 | +fi && | |
249 | + | |
250 | + | |
251 | +exit 0 | ... | ... |
... | ... | @@ -0,0 +1,51 @@ |
1 | +/** | |
2 | + * @file config.h | |
3 | + * | |
4 | + * @brief Configuração para o aplicativo. | |
5 | + * | |
6 | + * Gerado automaticamente pelo processo ./configure esse arquivo descreve | |
7 | + * as configurações de ambiente detectadas automaticamente. | |
8 | + * | |
9 | + * @author perry.werneck@gmail.com | |
10 | + * | |
11 | + */ | |
12 | + | |
13 | +#ifndef CONFIG_H_INCLUDED | |
14 | + | |
15 | + #define CONFIG_H_INCLUDED 1 | |
16 | + | |
17 | + /** | |
18 | + * @brief Nome do pacote. | |
19 | + */ | |
20 | + #undef PACKAGE_NAME | |
21 | + | |
22 | + /** | |
23 | + * @brief Versão atual. | |
24 | + */ | |
25 | + #undef PACKAGE_VERSION | |
26 | + | |
27 | + /** | |
28 | + * @brief Revisão svn quando o pacote foi configurado. | |
29 | + * | |
30 | + */ | |
31 | + #undef PACKAGE_REVISION | |
32 | + | |
33 | + /** | |
34 | + * @brief Descrição do aplicativo. | |
35 | + */ | |
36 | + #undef PACKAGE_DESCRIPTION | |
37 | + | |
38 | + /** | |
39 | + * @brief Indica se o compilador atual possui suporte a "visibility" | |
40 | + * | |
41 | + * Quando disponível indica que o compilador atual permite tornar | |
42 | + * visíveis numa biblioteca apenas as funções declaradas para isso | |
43 | + * evitando que todos os símbolos fiquem visíveis. | |
44 | + * | |
45 | + * Isso permite um melhor controle sobre quais funções podem ser usados | |
46 | + * pelo programa principal. | |
47 | + * | |
48 | + */ | |
49 | + #undef HAVE_GNUC_VISIBILITY | |
50 | + | |
51 | +#endif // CONFIG_H_INCLUDED | ... | ... |
... | ... | @@ -0,0 +1,87 @@ |
1 | +/* | |
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | + * | |
21 | + * Este programa está nomeado como php3270.h e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
27 | + * | |
28 | + * Referências: | |
29 | + * | |
30 | + * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ | |
31 | + * | |
32 | + */ | |
33 | + | |
34 | +#ifndef PHP3270_INCLUDED | |
35 | + | |
36 | + #define PHP3270_INCLUDED 1 | |
37 | + | |
38 | + #define PHP3270_EXTNAME "@PACKAGE_NAME@" | |
39 | + #define PHP3270_EXTVER "@PACKAGE_VERSION@" | |
40 | + | |
41 | + extern "C" | |
42 | + { | |
43 | + #include "php.h" | |
44 | + } | |
45 | + | |
46 | + extern zend_module_entry lib3270_module_entry; | |
47 | + #define phpext_lib3270_ptr &lib3270_module_entry; | |
48 | + | |
49 | + // 3270 session methods | |
50 | + PHP_METHOD(tn3270,__construct); | |
51 | + PHP_METHOD(tn3270,connect); | |
52 | + PHP_METHOD(tn3270,disconnect); | |
53 | + PHP_METHOD(tn3270,isconnected); | |
54 | + PHP_METHOD(tn3270,isready); | |
55 | + PHP_METHOD(tn3270,waitforready); | |
56 | + PHP_METHOD(tn3270,wait); | |
57 | + PHP_METHOD(tn3270,iterate); | |
58 | + | |
59 | + PHP_METHOD(tn3270,pfkey); | |
60 | + PHP_METHOD(tn3270,pakey); | |
61 | + PHP_METHOD(tn3270,enter); | |
62 | + | |
63 | + PHP_METHOD(tn3270,getstringat); | |
64 | + PHP_METHOD(tn3270,setstringat); | |
65 | + PHP_METHOD(tn3270,cmpstringat); | |
66 | + | |
67 | + PHP_METHOD(tn3270,getisprotected); | |
68 | + PHP_METHOD(tn3270,getisprotectedat); | |
69 | + | |
70 | + PHP_METHOD(tn3270,action); | |
71 | + | |
72 | + #undef PACKAGE_NAME | |
73 | + #undef PACKAGE_VERSION | |
74 | + #undef HAVE_MALLOC_H | |
75 | + #include <pw3270/class.h> | |
76 | + | |
77 | + // PHP object | |
78 | + using namespace PW3270_NAMESPACE; | |
79 | + | |
80 | + struct tn3270_object | |
81 | + { | |
82 | + zend_object std; | |
83 | + session * hSession; | |
84 | + }; | |
85 | + | |
86 | + | |
87 | +#endif // PHP_LIB3270_INCLUDED | ... | ... |
... | ... | @@ -0,0 +1,108 @@ |
1 | +/* | |
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | + * | |
21 | + * Este programa está nomeado como get.cc e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
27 | + * | |
28 | + * Referências: | |
29 | + * | |
30 | + * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ | |
31 | + * | |
32 | + */ | |
33 | + | |
34 | + #include "php3270.h" | |
35 | + | |
36 | +/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ | |
37 | + | |
38 | +PHP_METHOD(tn3270, isconnected) | |
39 | +{ | |
40 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
41 | + RETURN_BOOL(obj->hSession->is_connected()); | |
42 | +} | |
43 | + | |
44 | +PHP_METHOD(tn3270, isready) | |
45 | +{ | |
46 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
47 | + RETURN_BOOL(obj->hSession->is_ready()); | |
48 | +} | |
49 | + | |
50 | +PHP_METHOD(tn3270, getstringat) | |
51 | +{ | |
52 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
53 | + long row; | |
54 | + long col; | |
55 | + long sz; | |
56 | + | |
57 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &row, &col, &sz) == FAILURE) | |
58 | + RETURN_NULL(); | |
59 | + | |
60 | + string str = obj->hSession->get_string_at(row,col,sz); | |
61 | + | |
62 | + trace("String = [%s]",str.c_str()); | |
63 | + RETURN_STRING(str.c_str(),1); | |
64 | +} | |
65 | + | |
66 | +PHP_METHOD(tn3270, cmpstringat) | |
67 | +{ | |
68 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
69 | + long row; | |
70 | + long col; | |
71 | + const char * text; | |
72 | + int szText; | |
73 | + | |
74 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls", &row, &col, &text, &szText) == FAILURE) | |
75 | + RETURN_NULL(); | |
76 | + | |
77 | + if(!szText) | |
78 | + RETURN_NULL(); | |
79 | + | |
80 | + char buffer[szText+1]; | |
81 | + memcpy(buffer,text,szText); | |
82 | + buffer[szText] = 0; | |
83 | + | |
84 | + RETURN_LONG(obj->hSession->cmp_string_at(row,col,buffer)); | |
85 | +} | |
86 | + | |
87 | +PHP_METHOD(tn3270, getisprotected) | |
88 | +{ | |
89 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
90 | + long baddr; | |
91 | + | |
92 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &baddr) == FAILURE) | |
93 | + RETURN_NULL(); | |
94 | + | |
95 | + RETURN_LONG(obj->hSession->get_is_protected(baddr)); | |
96 | +} | |
97 | + | |
98 | +PHP_METHOD(tn3270, getisprotectedat) | |
99 | +{ | |
100 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
101 | + long row; | |
102 | + long col; | |
103 | + | |
104 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &row, &col) == FAILURE) | |
105 | + RETURN_NULL(); | |
106 | + | |
107 | + RETURN_LONG(obj->hSession->get_is_protected_at(row,col)); | |
108 | +} | ... | ... |
... | ... | @@ -0,0 +1,86 @@ |
1 | +/* | |
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | + * | |
21 | + * Este programa está nomeado como init.cc e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
27 | + * | |
28 | + * Referências: | |
29 | + * | |
30 | + * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ | |
31 | + * | |
32 | + */ | |
33 | + | |
34 | + #include "php3270.h" | |
35 | + #include <Zend/zend_exceptions.h> | |
36 | + | |
37 | +/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ | |
38 | + | |
39 | +PHP_METHOD(tn3270, __construct) | |
40 | +{ | |
41 | + char * name; | |
42 | + int szName = 0; | |
43 | + char * url; | |
44 | + int szURL = 0; | |
45 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
46 | + | |
47 | + trace("%s %d",__FUNCTION__,ZEND_NUM_ARGS()); | |
48 | + | |
49 | + // http://www.php.net/manual/pt_BR/internals2.funcs.php | |
50 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sss", &name, &szName, &url, &szURL) == FAILURE) | |
51 | + RETURN_NULL(); | |
52 | + | |
53 | + trace("szName=%d",szName); | |
54 | + | |
55 | + try | |
56 | + { | |
57 | + | |
58 | + if(szName) | |
59 | + { | |
60 | + char text[szName+1]; | |
61 | + strncpy(text,name,szName); | |
62 | + text[szName] = 0; | |
63 | + trace("session_name=\"%s\"",text); | |
64 | + obj->hSession = session::start(text); | |
65 | + } | |
66 | + else | |
67 | + { | |
68 | + obj->hSession = session::start(); | |
69 | + } | |
70 | + | |
71 | + if(szURL) | |
72 | + { | |
73 | + char text[szURL+1]; | |
74 | + strncpy(text,url,szURL); | |
75 | + text[szURL] = 0; | |
76 | + obj->hSession->set_url(text); | |
77 | + } | |
78 | + | |
79 | + } | |
80 | + catch(std::exception &e) | |
81 | + { | |
82 | + zend_throw_error_exception(zend_exception_get_default(), (char *) e.what(), 0, 0 TSRMLS_DC); | |
83 | + } | |
84 | + | |
85 | +} | |
86 | + | ... | ... |
... | ... | @@ -0,0 +1,151 @@ |
1 | +/* | |
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | + * | |
21 | + * Este programa está nomeado como main.cc e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
27 | + * | |
28 | + * Referências: | |
29 | + * | |
30 | + * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ | |
31 | + * | |
32 | + */ | |
33 | + | |
34 | + #include "php3270.h" | |
35 | + | |
36 | +/*--[ Globals ]----------------------------------------------------------------------------------------------------*/ | |
37 | + | |
38 | +static zend_class_entry * tn3270_ce = NULL; | |
39 | +static zend_object_handlers tn3270_object_handlers; | |
40 | + | |
41 | +/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ | |
42 | + | |
43 | +zend_function_entry tn3270_methods[] = | |
44 | +{ | |
45 | + PHP_ME( tn3270, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
46 | + | |
47 | + PHP_ME( tn3270, connect, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
48 | + PHP_ME( tn3270, disconnect, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
49 | + | |
50 | + PHP_ME( tn3270, isconnected, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
51 | + PHP_ME( tn3270, isready, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
52 | + | |
53 | + PHP_ME( tn3270, waitforready, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
54 | + PHP_ME( tn3270, wait, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
55 | + PHP_ME( tn3270, iterate, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
56 | + | |
57 | + PHP_ME( tn3270, pfkey, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
58 | + PHP_ME( tn3270, pakey, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
59 | + PHP_ME( tn3270, enter, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
60 | + | |
61 | + PHP_ME( tn3270, getstringat, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
62 | + PHP_ME( tn3270, setstringat, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
63 | + PHP_ME( tn3270, cmpstringat, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
64 | + | |
65 | + PHP_ME( tn3270, getisprotected, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
66 | + PHP_ME( tn3270, getisprotectedat, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
67 | + | |
68 | + PHP_ME( tn3270, action, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) | |
69 | + | |
70 | + {NULL, NULL, NULL} | |
71 | +}; | |
72 | + | |
73 | +void tn3270_free_storage(void *object TSRMLS_DC) | |
74 | +{ | |
75 | + tn3270_object *obj = (tn3270_object *)object; | |
76 | + | |
77 | + trace("%s",__FUNCTION__); | |
78 | + | |
79 | + zend_object_std_dtor(&obj->std TSRMLS_CC); | |
80 | + delete obj->hSession; | |
81 | + | |
82 | + efree(obj); | |
83 | +} | |
84 | + | |
85 | +zend_object_value tn3270_create_handler(zend_class_entry *type TSRMLS_DC) | |
86 | +{ | |
87 | + zend_object_value retval; | |
88 | + tn3270_object * obj = (tn3270_object *) emalloc(sizeof(tn3270_object)); | |
89 | + | |
90 | + trace("%s",__FUNCTION__); | |
91 | + | |
92 | + memset(obj, 0, sizeof(tn3270_object)); | |
93 | + | |
94 | + zend_object_std_init( &(obj->std), type TSRMLS_CC ); | |
95 | + | |
96 | + // http://stackoverflow.com/questions/14105529/writing-a-c-extension-for-php-5-4-example-code-is-obsolete | |
97 | + // object_properties_init((zend_object*) &(obj->std), type); | |
98 | +#if PHP_VERSION_ID < 50399 | |
99 | + zend_hash_copy(obj->std.properties, &(type->default_properties),(copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*)); | |
100 | +#else | |
101 | + object_properties_init(&obj->std, type); | |
102 | +#endif | |
103 | + | |
104 | + retval.handle = zend_objects_store_put(obj, NULL, tn3270_free_storage, NULL TSRMLS_CC); | |
105 | + retval.handlers = &tn3270_object_handlers; | |
106 | + | |
107 | + return retval; | |
108 | +} | |
109 | + | |
110 | +PHP_MINIT_FUNCTION(tn3270) | |
111 | +{ | |
112 | + zend_class_entry ce; | |
113 | + | |
114 | + trace("%s",__FUNCTION__); | |
115 | + | |
116 | + INIT_CLASS_ENTRY(ce, "tn3270", tn3270_methods); | |
117 | + | |
118 | + tn3270_ce = zend_register_internal_class(&ce TSRMLS_CC); | |
119 | + tn3270_ce->create_object = tn3270_create_handler; | |
120 | + | |
121 | + memcpy(&tn3270_object_handlers,zend_get_std_object_handlers(), sizeof(zend_object_handlers)); | |
122 | + tn3270_object_handlers.clone_obj = NULL; | |
123 | + | |
124 | + return SUCCESS; | |
125 | +} | |
126 | + | |
127 | +zend_module_entry lib3270_module_entry = | |
128 | +{ | |
129 | +#if ZEND_MODULE_API_NO >= 20010901 | |
130 | + STANDARD_MODULE_HEADER, | |
131 | +#endif | |
132 | + PHP3270_EXTNAME, | |
133 | + NULL, /* Functions */ | |
134 | + PHP_MINIT(tn3270), | |
135 | + NULL, /* MSHUTDOWN */ | |
136 | + NULL, /* RINIT */ | |
137 | + NULL, /* RSHUTDOWN */ | |
138 | + NULL, /* MINFO */ | |
139 | +#if ZEND_MODULE_API_NO >= 20010901 | |
140 | + PHP3270_EXTVER, | |
141 | +#endif | |
142 | + STANDARD_MODULE_PROPERTIES | |
143 | +}; | |
144 | + | |
145 | +// #ifdef COMPILE_DL_LIB3270 | |
146 | +extern "C" | |
147 | +{ | |
148 | + ZEND_GET_MODULE(lib3270) | |
149 | +} | |
150 | +// #endif | |
151 | + | ... | ... |
... | ... | @@ -0,0 +1,139 @@ |
1 | +/* | |
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | + * | |
21 | + * Este programa está nomeado como main.cc e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
27 | + * | |
28 | + * Referências: | |
29 | + * | |
30 | + * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ | |
31 | + * | |
32 | + */ | |
33 | + | |
34 | + #include "php3270.h" | |
35 | + | |
36 | +/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ | |
37 | + | |
38 | +PHP_METHOD(tn3270, connect) | |
39 | +{ | |
40 | + const char * host; | |
41 | + int szHost; | |
42 | + zend_bool wait = 0; | |
43 | + int rc = 0; | |
44 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
45 | + | |
46 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sb", &host, &szHost, &wait) == FAILURE) | |
47 | + RETURN_NULL(); | |
48 | + | |
49 | + if(szHost) | |
50 | + { | |
51 | + char text[szHost+1]; | |
52 | + strncpy(text,host,szHost); | |
53 | + text[szHost] = 0; | |
54 | + rc = obj->hSession->connect(text,wait); | |
55 | + } | |
56 | + else | |
57 | + { | |
58 | + rc = obj->hSession->connect(); | |
59 | + } | |
60 | + | |
61 | + RETURN_LONG(rc); | |
62 | +} | |
63 | + | |
64 | +PHP_METHOD(tn3270, disconnect) | |
65 | +{ | |
66 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
67 | + RETURN_LONG(obj->hSession->disconnect()); | |
68 | +} | |
69 | + | |
70 | +PHP_METHOD(tn3270, waitforready) | |
71 | +{ | |
72 | + long seconds; | |
73 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
74 | + | |
75 | + // http://www.php.net/manual/pt_BR/internals2.funcs.php | |
76 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE) | |
77 | + RETURN_NULL(); | |
78 | + | |
79 | + RETURN_LONG(obj->hSession->wait_for_ready((int) seconds)); | |
80 | +} | |
81 | + | |
82 | +PHP_METHOD(tn3270, waity) | |
83 | +{ | |
84 | + long seconds; | |
85 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
86 | + | |
87 | + // http://www.php.net/manual/pt_BR/internals2.funcs.php | |
88 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE) | |
89 | + RETURN_NULL(); | |
90 | + | |
91 | + RETURN_LONG(obj->hSession->wait((int) seconds)); | |
92 | +} | |
93 | + | |
94 | +PHP_METHOD(tn3270, wait) | |
95 | +{ | |
96 | + long seconds; | |
97 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
98 | + | |
99 | + // http://www.php.net/manual/pt_BR/internals2.funcs.php | |
100 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE) | |
101 | + RETURN_NULL(); | |
102 | + | |
103 | + RETURN_LONG(obj->hSession->wait((int) seconds)); | |
104 | +} | |
105 | + | |
106 | + | |
107 | +PHP_METHOD(tn3270, iterate) | |
108 | +{ | |
109 | + zend_bool wait = 0; | |
110 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
111 | + | |
112 | + // http://www.php.net/manual/pt_BR/internals2.funcs.php | |
113 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &wait) == FAILURE) | |
114 | + RETURN_NULL(); | |
115 | + | |
116 | + RETURN_LONG(obj->hSession->iterate(wait)); | |
117 | +} | |
118 | + | |
119 | +PHP_METHOD(tn3270, action) | |
120 | +{ | |
121 | + | |
122 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
123 | + | |
124 | + const char * text; | |
125 | + int szText; | |
126 | + | |
127 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &text, &szText) == FAILURE) | |
128 | + RETURN_NULL(); | |
129 | + | |
130 | + if(!szText) | |
131 | + RETURN_NULL(); | |
132 | + | |
133 | + char buffer[szText+1]; | |
134 | + memcpy(buffer,text,szText); | |
135 | + buffer[szText] = 0; | |
136 | + | |
137 | + RETURN_LONG(obj->hSession->action(buffer)); | |
138 | + | |
139 | +} | ... | ... |
... | ... | @@ -0,0 +1,88 @@ |
1 | +/* | |
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | + * | |
21 | + * Este programa está nomeado como set.cc e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
27 | + * | |
28 | + * Referências: | |
29 | + * | |
30 | + * http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ | |
31 | + * | |
32 | + */ | |
33 | + | |
34 | + #include "php3270.h" | |
35 | + | |
36 | +/*--[ Implement ]--------------------------------------------------------------------------------------------------*/ | |
37 | + | |
38 | +PHP_METHOD(tn3270, pfkey) | |
39 | +{ | |
40 | + long id; | |
41 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
42 | + | |
43 | + // http://www.php.net/manual/pt_BR/internals2.funcs.php | |
44 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) | |
45 | + RETURN_NULL(); | |
46 | + | |
47 | + RETURN_LONG(obj->hSession->pfkey((int) id)); | |
48 | +} | |
49 | + | |
50 | +PHP_METHOD(tn3270, pakey) | |
51 | +{ | |
52 | + long id; | |
53 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
54 | + | |
55 | + // http://www.php.net/manual/pt_BR/internals2.funcs.php | |
56 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &id) == FAILURE) | |
57 | + RETURN_NULL(); | |
58 | + | |
59 | + RETURN_LONG(obj->hSession->pakey((int) id)); | |
60 | +} | |
61 | + | |
62 | +PHP_METHOD(tn3270, enter) | |
63 | +{ | |
64 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
65 | + RETURN_LONG(obj->hSession->enter()); | |
66 | +} | |
67 | + | |
68 | +PHP_METHOD(tn3270, setstringat) | |
69 | +{ | |
70 | + tn3270_object * obj = (tn3270_object *) zend_object_store_get_object(getThis() TSRMLS_CC); | |
71 | + long row; | |
72 | + long col; | |
73 | + const char * text; | |
74 | + int szText; | |
75 | + | |
76 | + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lls", &row, &col, &text, &szText) == FAILURE) | |
77 | + RETURN_NULL(); | |
78 | + | |
79 | + if(!szText) | |
80 | + RETURN_NULL(); | |
81 | + | |
82 | + char buffer[szText+1]; | |
83 | + memcpy(buffer,text,szText); | |
84 | + buffer[szText] = 0; | |
85 | + | |
86 | + RETURN_LONG(obj->hSession->set_string_at(row,col,buffer)); | |
87 | +} | |
88 | + | ... | ... |