├── example ├── check_phdfs.php ├── connect.php ├── delete.php ├── disconnect.php ├── exists.php ├── read.php ├── tell.php ├── copy.php ├── file_info.php ├── list_directory.php ├── write.php ├── create_directory.php └── rename.php ├── config.nice ├── config.w32 ├── tests ├── 001.phpt ├── 002.phpt ├── 003.phpt ├── 004.phpt ├── 008.phpt ├── 010.phpt ├── 007.phpt ├── 013.phpt ├── 006.phpt ├── 009.phpt ├── 012.phpt ├── 011.phpt └── 005.phpt ├── README.md ├── config.m4 ├── config.h.in ├── config.h ├── LICENSE ├── configure.in ├── php_phdfs.h ├── config.status ├── config.log ├── phdfs.c ├── config.sub └── config.guess /example/check_phdfs.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /config.nice: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # Created by configure 4 | 5 | './configure' \ 6 | '--with-php-config=/usr/local/php5.5/bin/php-config' \ 7 | "$@" 8 | -------------------------------------------------------------------------------- /example/connect.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | } catch (Exception $ex) { 7 | var_dump($ex->getMessage()); 8 | } 9 | ?> 10 | -------------------------------------------------------------------------------- /config.w32: -------------------------------------------------------------------------------- 1 | // $ Id: $ 2 | // vim:ft=javascript 3 | 4 | ARG_ENABLE('phdfs' , 'phdfs', 'no'); 5 | if (PHP_PHDFS == "yes") { 6 | EXTENSION("phdfs", "phdfs.c"); 7 | AC_DEFINE("HAVE_PHDFS", 1, "phdfs support"); 8 | } 9 | -------------------------------------------------------------------------------- /example/delete.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->delete('/test.txt'); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /example/disconnect.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->disconnect(); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /example/exists.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->exists('/test.txt'); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /example/read.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->read('/test.txt',1024); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /example/tell.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->tell('/test.txt'); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /example/copy.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->copy('/test.txt','/test1.txt'); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /example/file_info.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->file_info('/test.txt'); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /example/list_directory.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->list_directory('/'); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /example/write.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->write('/test.txt','hello world'); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /tests/001.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs presence 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | 9 | --EXPECT-- 10 | phdfs extension is available 11 | -------------------------------------------------------------------------------- /example/create_directory.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->create_directory('/a/b/c/'); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /example/rename.php: -------------------------------------------------------------------------------- 1 | connect(); 6 | $log = $obj->rename('/test.txt','/test_new.txt'); 7 | } catch (Exception $ex) { 8 | var_dump($ex->getMessage()); 9 | } 10 | ?> 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ###Summary 3 | 4 | phdfs - PHP extensions, using PHP to manipulate Hadoop HDFS,Extension is an interface to HDFS 5 | 6 | ## Documentation 7 | [English](https://github.com/yuduanchen/phdfs/wiki/phdfs) 8 | 9 | 10 | 11 | ### more 12 | 13 | Author blog: http://www.woyuw.com 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/002.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs connect function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | var_dump($log); 12 | } catch (Exception $ex) { 13 | var_dump($ex->getMessage()); 14 | } 15 | ?> 16 | --EXPECT-- 17 | bool(true) 18 | -------------------------------------------------------------------------------- /tests/003.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs exists function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->exists('/test.txt'); 12 | } catch (Exception $ex) { 13 | var_dump($ex->getMessage()); 14 | } 15 | ?> 16 | --EXPECT-- 17 | bool(true) 18 | -------------------------------------------------------------------------------- /tests/004.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs write function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->write('/test.txt','hello world'); 12 | } catch (Exception $ex) { 13 | var_dump($ex->getMessage()); 14 | } 15 | ?> 16 | --EXPECT-- 17 | bool(true) 18 | -------------------------------------------------------------------------------- /tests/008.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs rename function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->rename('/test.txt','/test_new.txt'); 12 | } catch (Exception $ex) { 13 | var_dump($ex->getMessage()); 14 | } 15 | ?> 16 | --EXPECT-- 17 | bool(true) 18 | -------------------------------------------------------------------------------- /tests/010.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs tell function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->tell('/test.txt'); 12 | var_dump($log); 13 | } catch (Exception $ex) { 14 | var_dump($ex->getMessage()); 15 | } 16 | ?> 17 | --EXPECT-- 18 | int(0) 19 | -------------------------------------------------------------------------------- /tests/007.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs create_directory function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->create_directory('/a/b/c/'); 12 | } catch (Exception $ex) { 13 | var_dump($ex->getMessage()); 14 | } 15 | ?> 16 | --EXPECT-- 17 | bool(true) 18 | -------------------------------------------------------------------------------- /tests/013.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs disconnect function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->disconnect(); 12 | var_dump($log); 13 | } catch (Exception $ex) { 14 | var_dump($ex->getMessage()); 15 | } 16 | ?> 17 | --EXPECT-- 18 | bool(true) 19 | -------------------------------------------------------------------------------- /tests/006.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs file_info function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->file_info('/test.txt'); 12 | print($log); 13 | } catch (Exception $ex) { 14 | var_dump($ex->getMessage()); 15 | } 16 | ?> 17 | --EXPECT-- 18 | Array 19 | -------------------------------------------------------------------------------- /tests/009.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs list_directory function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->list_directory('/'); 12 | print($log); 13 | } catch (Exception $ex) { 14 | var_dump($ex->getMessage()); 15 | } 16 | ?> 17 | --EXPECT-- 18 | Array 19 | -------------------------------------------------------------------------------- /tests/012.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs delete function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->delete('/test.txt'); 12 | var_dump($log); 13 | } catch (Exception $ex) { 14 | var_dump($ex->getMessage()); 15 | } 16 | ?> 17 | --EXPECT-- 18 | bool(true) 19 | -------------------------------------------------------------------------------- /tests/011.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs copy function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->copy('/test.txt','/test1.txt'); 12 | var_dump($log); 13 | } catch (Exception $ex) { 14 | var_dump($ex->getMessage()); 15 | } 16 | ?> 17 | --EXPECT-- 18 | bool(true) 19 | -------------------------------------------------------------------------------- /tests/005.phpt: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Check for phdfs read function 3 | --SKIPIF-- 4 | 5 | --FILE-- 6 | connect(); 11 | $log = $obj->read('/test.txt',1024); 12 | } catch (Exception $ex) { 13 | var_dump($ex->getMessage()); 14 | } 15 | ?> 16 | --EXPECT-- 17 | Environment variable CLASSPATH not set! 18 | string(27) " Failed to hdfs connection " 19 | -------------------------------------------------------------------------------- /config.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl $ Id: $ 3 | dnl 4 | 5 | PHP_ARG_ENABLE(phdfs, whether to enable phdfs functions, 6 | [ --enable-phdfs Enable phdfs support]) 7 | 8 | if test "$PHP_PHDFS" != "no"; then 9 | export OLD_CPPFLAGS="$CPPFLAGS" 10 | export CPPFLAGS="$CPPFLAGS $INCLUDES -DHAVE_PHDFS " 11 | if test $(getconf LONG_BIT) == '64' ; then 12 | HADOOP_DIR=" -I ${HADOOP_HOME}/src/c++/libhdfs -I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux -L${HADOOP_HOME}/c++/Linux-amd64-64/lib -lhdfs -L${JAVA_HOME}/jre/lib/amd64/server -ljvm" 13 | else 14 | HADOOP_DIR=" -I ${HADOOP_HOME}/src/c++/libhdfs -I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux -L${HADOOP_HOME}/c++/Linux-i386-32/lib -lhdfs -L${JAVA_HOME}/jre/lib/i386/server -ljvm" 15 | fi 16 | AC_MSG_CHECKING(PHP version) 17 | AC_TRY_COMPILE([#include ], [ 18 | #if PHP_VERSION_ID < 50000 19 | #error this extension requires at least PHP version 5.0.0 20 | #endif 21 | ], 22 | [AC_MSG_RESULT(ok)], 23 | [AC_MSG_ERROR([need at least PHP 5.0.0])]) 24 | 25 | export CPPFLAGS="$OLD_CPPFLAGS $HADOOP_DIR" 26 | PHP_SUBST(PHDFS_SHARED_LIBADD) 27 | AC_DEFINE(HAVE_PHDFS, 1, [ ]) 28 | 29 | PHP_NEW_EXTENSION(phdfs, phdfs.c , $ext_shared) 30 | 31 | fi 32 | 33 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.in by autoheader. */ 2 | 3 | /* Whether to build phdfs as dynamic module */ 4 | #undef COMPILE_DL_PHDFS 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_DLFCN_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_INTTYPES_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_MEMORY_H 14 | 15 | /* */ 16 | #undef HAVE_PHDFS 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STDINT_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STDLIB_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STRINGS_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STRING_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_STAT_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_SYS_TYPES_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_UNISTD_H 38 | 39 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 40 | #undef NO_MINUS_C_MINUS_O 41 | 42 | /* Define to the address where bug reports for this package should be sent. */ 43 | #undef PACKAGE_BUGREPORT 44 | 45 | /* Define to the full name of this package. */ 46 | #undef PACKAGE_NAME 47 | 48 | /* Define to the full name and version of this package. */ 49 | #undef PACKAGE_STRING 50 | 51 | /* Define to the one symbol short name of this package. */ 52 | #undef PACKAGE_TARNAME 53 | 54 | /* Define to the home page for this package. */ 55 | #undef PACKAGE_URL 56 | 57 | /* Define to the version of this package. */ 58 | #undef PACKAGE_VERSION 59 | 60 | /* Define to 1 if you have the ANSI C header files. */ 61 | #undef STDC_HEADERS 62 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated from config.h.in by configure. */ 2 | /* config.h.in. Generated from configure.in by autoheader. */ 3 | 4 | /* Whether to build phdfs as dynamic module */ 5 | #define COMPILE_DL_PHDFS 1 6 | 7 | /* Define to 1 if you have the header file. */ 8 | #define HAVE_DLFCN_H 1 9 | 10 | /* Define to 1 if you have the header file. */ 11 | #define HAVE_INTTYPES_H 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MEMORY_H 1 15 | 16 | /* */ 17 | #define HAVE_PHDFS 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define HAVE_STDINT_H 1 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_STRINGS_H 1 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #define HAVE_UNISTD_H 1 39 | 40 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 41 | /* #undef NO_MINUS_C_MINUS_O */ 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #define PACKAGE_BUGREPORT "" 45 | 46 | /* Define to the full name of this package. */ 47 | #define PACKAGE_NAME "" 48 | 49 | /* Define to the full name and version of this package. */ 50 | #define PACKAGE_STRING "" 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #define PACKAGE_TARNAME "" 54 | 55 | /* Define to the home page for this package. */ 56 | #define PACKAGE_URL "" 57 | 58 | /* Define to the version of this package. */ 59 | #define PACKAGE_VERSION "" 60 | 61 | /* Define to 1 if you have the ANSI C header files. */ 62 | #define STDC_HEADERS 1 63 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------- 2 | The PHP License, version 3.01 3 | Copyright (c) 1999 - 2014 The PHP Group. All rights reserved. 4 | -------------------------------------------------------------------- 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, is permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in 15 | the documentation and/or other materials provided with the 16 | distribution. 17 | 18 | 3. The name "PHP" must not be used to endorse or promote products 19 | derived from this software without prior written permission. For 20 | written permission, please contact group@php.net. 21 | 22 | 4. Products derived from this software may not be called "PHP", nor 23 | may "PHP" appear in their name, without prior written permission 24 | from group@php.net. You may indicate that your software works in 25 | conjunction with PHP by saying "Foo for PHP" instead of calling 26 | it "PHP Foo" or "phpfoo" 27 | 28 | 5. The PHP Group may publish revised and/or new versions of the 29 | license from time to time. Each version will be given a 30 | distinguishing version number. 31 | Once covered code has been published under a particular version 32 | of the license, you may always continue to use it under the terms 33 | of that version. You may also choose to use such covered code 34 | under the terms of any subsequent version of the license 35 | published by the PHP Group. No one other than the PHP Group has 36 | the right to modify the terms applicable to covered code created 37 | under this License. 38 | 39 | 6. Redistributions of any form whatsoever must retain the following 40 | acknowledgment: 41 | "This product includes PHP software, freely available from 42 | ". 43 | 44 | THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 45 | ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 46 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 47 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP 48 | DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 49 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 50 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 51 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 52 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 53 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 54 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 55 | OF THE POSSIBILITY OF SUCH DAMAGE. 56 | 57 | -------------------------------------------------------------------- 58 | 59 | This software consists of voluntary contributions made by many 60 | individuals on behalf of the PHP Group. 61 | 62 | The PHP Group can be contacted via Email at group@php.net. 63 | 64 | For more information on the PHP Group and the PHP project, 65 | please see . 66 | 67 | PHP includes the Zend Engine, freely available at 68 | . 69 | -------------------------------------------------------------------------------- /configure.in: -------------------------------------------------------------------------------- 1 | dnl This file becomes configure.in for self-contained extensions. 2 | 3 | AC_PREREQ(2.59) 4 | AC_INIT(config.m4) 5 | ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], []) 6 | 7 | PHP_CONFIG_NICE(config.nice) 8 | 9 | dnl 10 | AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl 11 | AC_DEFUN([PHP_EXT_DIR],[""])dnl 12 | AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl 13 | AC_DEFUN([PHP_ALWAYS_SHARED],[ 14 | ext_output="yes, shared" 15 | ext_shared=yes 16 | test "[$]$1" = "no" && $1=yes 17 | ])dnl 18 | dnl 19 | 20 | test -z "$CFLAGS" && auto_cflags=1 21 | 22 | abs_srcdir=`(cd $srcdir && pwd)` 23 | abs_builddir=`pwd` 24 | 25 | AC_PROG_CC([cc gcc]) 26 | PHP_DETECT_ICC 27 | PHP_DETECT_SUNCC 28 | AC_PROG_CC_C_O 29 | 30 | dnl Support systems with system libraries in e.g. /usr/lib64 31 | PHP_ARG_WITH(libdir, for system library directory, 32 | [ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib], lib, no) 33 | 34 | PHP_RUNPATH_SWITCH 35 | PHP_SHLIB_SUFFIX_NAMES 36 | 37 | dnl Find php-config script 38 | PHP_ARG_WITH(php-config,, 39 | [ --with-php-config=PATH Path to php-config [php-config]], php-config, no) 40 | 41 | dnl For BC 42 | PHP_CONFIG=$PHP_PHP_CONFIG 43 | prefix=`$PHP_CONFIG --prefix 2>/dev/null` 44 | phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null` 45 | INCLUDES=`$PHP_CONFIG --includes 2>/dev/null` 46 | EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null` 47 | PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null` 48 | 49 | if test -z "$prefix"; then 50 | AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH]) 51 | fi 52 | 53 | php_shtool=$srcdir/build/shtool 54 | PHP_INIT_BUILD_SYSTEM 55 | 56 | AC_MSG_CHECKING([for PHP prefix]) 57 | AC_MSG_RESULT([$prefix]) 58 | AC_MSG_CHECKING([for PHP includes]) 59 | AC_MSG_RESULT([$INCLUDES]) 60 | AC_MSG_CHECKING([for PHP extension directory]) 61 | AC_MSG_RESULT([$EXTENSION_DIR]) 62 | AC_MSG_CHECKING([for PHP installed headers prefix]) 63 | AC_MSG_RESULT([$phpincludedir]) 64 | 65 | dnl Checks for PHP_DEBUG / ZEND_DEBUG / ZTS 66 | AC_MSG_CHECKING([if debug is enabled]) 67 | old_CPPFLAGS=$CPPFLAGS 68 | CPPFLAGS="-I$phpincludedir" 69 | AC_EGREP_CPP(php_debug_is_enabled,[ 70 | #include
71 | #if ZEND_DEBUG 72 | php_debug_is_enabled 73 | #endif 74 | ],[ 75 | PHP_DEBUG=yes 76 | ],[ 77 | PHP_DEBUG=no 78 | ]) 79 | CPPFLAGS=$old_CPPFLAGS 80 | AC_MSG_RESULT([$PHP_DEBUG]) 81 | 82 | AC_MSG_CHECKING([if zts is enabled]) 83 | old_CPPFLAGS=$CPPFLAGS 84 | CPPFLAGS="-I$phpincludedir" 85 | AC_EGREP_CPP(php_zts_is_enabled,[ 86 | #include
87 | #if ZTS 88 | php_zts_is_enabled 89 | #endif 90 | ],[ 91 | PHP_THREAD_SAFETY=yes 92 | ],[ 93 | PHP_THREAD_SAFETY=no 94 | ]) 95 | CPPFLAGS=$old_CPPFLAGS 96 | AC_MSG_RESULT([$PHP_DEBUG]) 97 | 98 | dnl Support for building and testing Zend extensions 99 | ZEND_EXT_TYPE="zend_extension" 100 | PHP_SUBST(ZEND_EXT_TYPE) 101 | 102 | dnl Discard optimization flags when debugging is enabled 103 | if test "$PHP_DEBUG" = "yes"; then 104 | PHP_DEBUG=1 105 | ZEND_DEBUG=yes 106 | changequote({,}) 107 | CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'` 108 | CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'` 109 | changequote([,]) 110 | dnl add -O0 only if GCC or ICC is used 111 | if test "$GCC" = "yes" || test "$ICC" = "yes"; then 112 | CFLAGS="$CFLAGS -O0" 113 | CXXFLAGS="$CXXFLAGS -g -O0" 114 | fi 115 | if test "$SUNCC" = "yes"; then 116 | if test -n "$auto_cflags"; then 117 | CFLAGS="-g" 118 | CXXFLAGS="-g" 119 | else 120 | CFLAGS="$CFLAGS -g" 121 | CXXFLAGS="$CFLAGS -g" 122 | fi 123 | fi 124 | else 125 | PHP_DEBUG=0 126 | ZEND_DEBUG=no 127 | fi 128 | 129 | dnl Always shared 130 | PHP_BUILD_SHARED 131 | 132 | dnl Required programs 133 | PHP_PROG_RE2C 134 | PHP_PROG_AWK 135 | 136 | sinclude(config.m4) 137 | 138 | enable_static=no 139 | enable_shared=yes 140 | 141 | dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX). 142 | dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler. 143 | AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [ 144 | undefine([AC_PROG_CXX]) 145 | AC_DEFUN([AC_PROG_CXX], []) 146 | undefine([AC_PROG_CXXCPP]) 147 | AC_DEFUN([AC_PROG_CXXCPP], [php_prog_cxxcpp=disabled]) 148 | ]) 149 | AC_PROG_LIBTOOL 150 | 151 | all_targets='$(PHP_MODULES) $(PHP_ZEND_EX)' 152 | install_targets="install-modules install-headers" 153 | phplibdir="`pwd`/modules" 154 | CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H" 155 | CFLAGS_CLEAN='$(CFLAGS)' 156 | CXXFLAGS_CLEAN='$(CXXFLAGS)' 157 | 158 | test "$prefix" = "NONE" && prefix="/usr/local" 159 | test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' 160 | 161 | PHP_SUBST(PHP_MODULES) 162 | PHP_SUBST(PHP_ZEND_EX) 163 | 164 | PHP_SUBST(all_targets) 165 | PHP_SUBST(install_targets) 166 | 167 | PHP_SUBST(prefix) 168 | PHP_SUBST(exec_prefix) 169 | PHP_SUBST(libdir) 170 | PHP_SUBST(prefix) 171 | PHP_SUBST(phplibdir) 172 | PHP_SUBST(phpincludedir) 173 | 174 | PHP_SUBST(CC) 175 | PHP_SUBST(CFLAGS) 176 | PHP_SUBST(CFLAGS_CLEAN) 177 | PHP_SUBST(CPP) 178 | PHP_SUBST(CPPFLAGS) 179 | PHP_SUBST(CXX) 180 | PHP_SUBST(CXXFLAGS) 181 | PHP_SUBST(CXXFLAGS_CLEAN) 182 | PHP_SUBST(EXTENSION_DIR) 183 | PHP_SUBST(PHP_EXECUTABLE) 184 | PHP_SUBST(EXTRA_LDFLAGS) 185 | PHP_SUBST(EXTRA_LIBS) 186 | PHP_SUBST(INCLUDES) 187 | PHP_SUBST(LFLAGS) 188 | PHP_SUBST(LDFLAGS) 189 | PHP_SUBST(SHARED_LIBTOOL) 190 | PHP_SUBST(LIBTOOL) 191 | PHP_SUBST(SHELL) 192 | PHP_SUBST(INSTALL_HEADERS) 193 | 194 | PHP_GEN_BUILD_DIRS 195 | PHP_GEN_GLOBAL_MAKEFILE 196 | 197 | test -d modules || $php_shtool mkdir modules 198 | touch .deps 199 | 200 | AC_CONFIG_HEADER(config.h) 201 | 202 | AC_OUTPUT() 203 | -------------------------------------------------------------------------------- /php_phdfs.h: -------------------------------------------------------------------------------- 1 | /* 2 | +----------------------------------------------------------------------+ 3 | | PHP Version 5 | 4 | +----------------------------------------------------------------------+ 5 | | Copyright (c) 1997-2012 The PHP Group | 6 | +----------------------------------------------------------------------+ 7 | | This source file is subject to version 3.01 of the PHP license, | 8 | | that is bundled with this package in the file LICENSE, and is | 9 | | available through the world-wide-web at the following url: | 10 | | http://www.php.net/license/3_01.txt | 11 | | If you did not receive a copy of the PHP license and are unable to | 12 | | obtain it through the world-wide-web, please send a note to | 13 | | license@php.net so we can mail you a copy immediately. | 14 | +----------------------------------------------------------------------+ 15 | | Authors: yuduan chen | 16 | +----------------------------------------------------------------------+ 17 | */ 18 | 19 | #ifndef PHP_PHDFS_H 20 | #define PHP_PHDFS_H 21 | 22 | #define phdfs_hadoop_tsize tSize 23 | #define phdfs_hadoop_hdfs_connect hdfsConnect 24 | #define phdfs_hadoop_hdfs_file hdfsFile 25 | #define phdfs_hadoop_hdfs_open_file hdfsOpenFile 26 | #define phdfs_hadoop_hdfs_write hdfsWrite 27 | #define phdfs_hadoop_hdfs_close_file hdfsCloseFile 28 | #define phdfs_hadoop_hdfs_disconnect hdfsDisconnect 29 | #define phdfs_hadoop_hdfs_exists hdfsExists 30 | #define phdfs_hadoop_hdfs_create_directory hdfsCreateDirectory 31 | #define phdfs_hadoop_hdfs_delete hdfsDelete 32 | #define phdfs_hadoop_hdfs_rename hdfsRename 33 | #define phdfs_hadoop_hdfs_read hdfsRead 34 | #define phdfs_hadoop_hdfs_get_path_info hdfsGetPathInfo 35 | #define phdfs_hadoop_hdfs_file_info hdfsFileInfo 36 | #define phdfs_hadoop_hdfs_free_file_info hdfsFreeFileInfo 37 | #define phdfs_hadoop_hdfs_flush hdfsFlush 38 | #define phdfs_hadoop_hdfs_copy hdfsCopy 39 | #define phdfs_hadoop_hdfs_list_directory hdfsListDirectory 40 | #define phdfs_hadoop_hdfs_tell hdfsTell 41 | #define phdfs_hadoop_toffset tOffset 42 | #define phdfs_hadoop_hdfs hdfsFS 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | #ifdef HAVE_CONFIG_H 49 | #include "config.h" 50 | #endif 51 | 52 | #include 53 | 54 | #ifdef HAVE_PHDFS 55 | #define PHP_PHDFS_VERSION "0.1.2" 56 | 57 | 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include "hdfs.h" 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | #ifdef __cplusplus 69 | extern "C" { 70 | #endif 71 | 72 | extern zend_module_entry phdfs_module_entry; 73 | #define phpext_phdfs_ptr &phdfs_module_entry 74 | 75 | #ifdef PHP_WIN32 76 | #define PHP_PHDFS_API __declspec(dllexport) 77 | #else 78 | #define PHP_PHDFS_API 79 | #endif 80 | 81 | PHP_MINIT_FUNCTION(phdfs); 82 | PHP_MSHUTDOWN_FUNCTION(phdfs); 83 | PHP_RINIT_FUNCTION(phdfs); 84 | PHP_RSHUTDOWN_FUNCTION(phdfs); 85 | PHP_MINFO_FUNCTION(phdfs); 86 | 87 | PHP_METHOD(phdfs, __construct); 88 | PHP_METHOD(phdfs, __destruct); 89 | 90 | #ifdef ZTS 91 | #include "TSRM.h" 92 | #endif 93 | 94 | #define FREE_RESOURCE(resource) zend_list_delete(Z_LVAL_P(resource)) 95 | 96 | #define PROP_GET_LONG(name) Z_LVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) 97 | #define PROP_SET_LONG(name, l) zend_update_property_long(_this_ce, _this_zval, #name, strlen(#name), l TSRMLS_CC) 98 | #define PROP_GET_DOUBLE(name) Z_DVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) 99 | #define PROP_SET_DOUBLE(name, d) zend_update_property_double(_this_ce, _this_zval, #name, strlen(#name), d TSRMLS_CC) 100 | #define PROP_GET_STRING(name) Z_STRVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) 101 | #define PROP_GET_STRLEN(name) Z_STRLEN_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) 102 | #define PROP_SET_STRING(name, s) zend_update_property_string(_this_ce, _this_zval, #name, strlen(#name), s TSRMLS_CC) 103 | #define PROP_SET_STRINGL(name, s, l) zend_update_property_stringl(_this_ce, _this_zval, #name, strlen(#name), s, l TSRMLS_CC) 104 | 105 | PHP_METHOD(phdfs, __construct); 106 | PHP_METHOD(phdfs, __destruct); 107 | typedef struct _ze_phdfs_object { 108 | zend_object zo; 109 | phdfs_hadoop_hdfs ptr; 110 | char *hdfs_host; 111 | char *hdfs_port; 112 | } ze_phdfs_object; 113 | 114 | ZEND_BEGIN_MODULE_GLOBALS(phdfs) 115 | phdfs_hadoop_hdfs fs; 116 | ZEND_END_MODULE_GLOBALS(phdfs) 117 | #ifdef ZTS 118 | #define PHDFS_G(v) TSRMG(phdfs_globals_id,zend_phdfs_globals *, v) 119 | #else 120 | #define PHDFS_G(v) (phdfs_globals.v) 121 | #endif 122 | ZEND_DECLARE_MODULE_GLOBALS(phdfs) 123 | 124 | PHP_METHOD(phdfs, __construct); 125 | #if (PHP_MAJOR_VERSION >= 5) 126 | ZEND_BEGIN_ARG_INFO(phdfs__construct_args,2) 127 | ZEND_ARG_INFO(0,host) 128 | ZEND_ARG_INFO(0,port) 129 | ZEND_END_ARG_INFO() 130 | #else /* PHP 4.x */ 131 | #define phdfs__construct_args NULL 132 | #endif 133 | 134 | PHP_METHOD(phdfs, connect); 135 | #if (PHP_MAJOR_VERSION >= 5) 136 | ZEND_BEGIN_ARG_INFO_EX(phdfs__connect_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE,0) 137 | ZEND_END_ARG_INFO() 138 | #else /* PHP 4.x */ 139 | #define phdfs__connect_args NULL 140 | #endif 141 | 142 | PHP_METHOD(phdfs, rename); 143 | #if (PHP_MAJOR_VERSION >= 5) 144 | ZEND_BEGIN_ARG_INFO_EX(phdfs__rename_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE,2) 145 | ZEND_ARG_INFO(0,old_path) 146 | ZEND_ARG_INFO(0,new_path) 147 | ZEND_END_ARG_INFO() 148 | #else /* PHP 4.x */ 149 | #define phdfs__rename_args NULL 150 | #endif 151 | 152 | PHP_METHOD(phdfs, read); 153 | #if (PHP_MAJOR_VERSION >= 5) 154 | ZEND_BEGIN_ARG_INFO_EX(phdfs__read_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE,1) 155 | ZEND_ARG_INFO(0,path) 156 | ZEND_ARG_INFO(0,length) 157 | ZEND_END_ARG_INFO() 158 | #else /* PHP 4.x */ 159 | #define phdfs__read_args NULL 160 | #endif 161 | 162 | PHP_METHOD(phdfs, file_info); 163 | #if (PHP_MAJOR_VERSION >= 5) 164 | ZEND_BEGIN_ARG_INFO_EX(phdfs__file_info_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) 165 | ZEND_ARG_INFO(0,path) 166 | ZEND_END_ARG_INFO() 167 | #else /* PHP 4.x */ 168 | #define phdfs__file_info_args NULL 169 | #endif 170 | 171 | PHP_METHOD(phdfs,create_directory); 172 | #if (PHP_MAJOR_VERSION >= 5) 173 | ZEND_BEGIN_ARG_INFO_EX(phdfs__create_directory_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) 174 | ZEND_ARG_INFO(0,path) 175 | ZEND_END_ARG_INFO() 176 | #else /* PHP 4.x */ 177 | #define phdfs__create_directory_args NULL 178 | #endif 179 | 180 | PHP_METHOD(phdfs, exists); 181 | #if (PHP_MAJOR_VERSION >= 5) 182 | ZEND_BEGIN_ARG_INFO_EX(phdfs__exists_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) 183 | ZEND_ARG_INFO(0,path) 184 | ZEND_END_ARG_INFO() 185 | #else /* PHP 4.x */ 186 | #define phdfs__exists_args NULL 187 | #endif 188 | 189 | PHP_METHOD(phdfs, disconnect); 190 | #if (PHP_MAJOR_VERSION >= 5) 191 | ZEND_BEGIN_ARG_INFO_EX(phdfs__disconnect_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE,0) 192 | ZEND_END_ARG_INFO() 193 | #else /* PHP 4.x */ 194 | #define phdfs__disconnect_args NULL 195 | #endif 196 | 197 | 198 | PHP_METHOD(phdfs, write); 199 | #if (PHP_MAJOR_VERSION >= 5) 200 | ZEND_BEGIN_ARG_INFO_EX(phdfs__write_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) 201 | ZEND_ARG_INFO(0,path) 202 | ZEND_ARG_INFO(0,buffer) 203 | ZEND_ARG_INFO(0,mode) 204 | ZEND_END_ARG_INFO() 205 | #else /* PHP 4.x */ 206 | #define phdfs__write_args NULL 207 | #endif 208 | 209 | PHP_METHOD(phdfs, delete); 210 | #if (PHP_MAJOR_VERSION >= 5) 211 | ZEND_BEGIN_ARG_INFO_EX(phdfs__delete_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) 212 | ZEND_ARG_INFO(0,path) 213 | ZEND_END_ARG_INFO() 214 | #else /* PHP 4.x */ 215 | #define phdfs__delete_args NULL 216 | #endif 217 | 218 | PHP_METHOD(phdfs, copy); 219 | #if (PHP_MAJOR_VERSION >= 5) 220 | ZEND_BEGIN_ARG_INFO_EX(phdfs__copy_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE,2) 221 | ZEND_ARG_INFO(0, source_file) 222 | ZEND_ARG_INFO(0, destination_file) 223 | ZEND_END_ARG_INFO() 224 | #else /* PHP 4.x */ 225 | #define phdfs__copy_args NULL 226 | #endif 227 | 228 | PHP_METHOD(phdfs,list_directory); 229 | #if (PHP_MAJOR_VERSION >= 5) 230 | ZEND_BEGIN_ARG_INFO_EX(phdfs__list_directory_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) 231 | ZEND_ARG_INFO(0,path) 232 | ZEND_END_ARG_INFO() 233 | #else /* PHP 4.x */ 234 | #define phdfs__list_directory_args NULL 235 | #endif 236 | 237 | PHP_METHOD(phdfs,tell); 238 | #if (PHP_MAJOR_VERSION >= 5) 239 | ZEND_BEGIN_ARG_INFO_EX(phdfs__tell_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) 240 | ZEND_ARG_INFO(0,path) 241 | ZEND_END_ARG_INFO() 242 | #else /* PHP 4.x */ 243 | #define phdfs__tell_args NULL 244 | #endif 245 | 246 | PHP_METHOD(phdfs, __destruct); 247 | #if (PHP_MAJOR_VERSION >= 5) 248 | ZEND_BEGIN_ARG_INFO_EX(phdfs__destruct_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) 249 | ZEND_END_ARG_INFO() 250 | #else /* PHP 4.x */ 251 | #define phdfs__destruct_args NULL 252 | #endif 253 | 254 | #ifdef __cplusplus 255 | } 256 | #endif 257 | 258 | #endif /* PHP_HAVE_PHDFS */ 259 | 260 | #endif /* PHP_PHDFS_H */ 261 | 262 | -------------------------------------------------------------------------------- /config.status: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # Generated by configure. 3 | # Run this file to recreate the current configuration. 4 | # Compiler output produced by configure, useful for debugging 5 | # configure, is in config.log if it exists. 6 | 7 | debug=false 8 | ac_cs_recheck=false 9 | ac_cs_silent=false 10 | 11 | SHELL=${CONFIG_SHELL-/bin/bash} 12 | export SHELL 13 | ## -------------------- ## 14 | ## M4sh Initialization. ## 15 | ## -------------------- ## 16 | 17 | # Be more Bourne compatible 18 | DUALCASE=1; export DUALCASE # for MKS sh 19 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : 20 | emulate sh 21 | NULLCMD=: 22 | # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which 23 | # is contrary to our usage. Disable this feature. 24 | alias -g '${1+"$@"}'='"$@"' 25 | setopt NO_GLOB_SUBST 26 | else 27 | case `(set -o) 2>/dev/null` in #( 28 | *posix*) : 29 | set -o posix ;; #( 30 | *) : 31 | ;; 32 | esac 33 | fi 34 | 35 | 36 | as_nl=' 37 | ' 38 | export as_nl 39 | # Printing a long string crashes Solaris 7 /usr/bin/printf. 40 | as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' 41 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo 42 | as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo 43 | # Prefer a ksh shell builtin over an external printf program on Solaris, 44 | # but without wasting forks for bash or zsh. 45 | if test -z "$BASH_VERSION$ZSH_VERSION" \ 46 | && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then 47 | as_echo='print -r --' 48 | as_echo_n='print -rn --' 49 | elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then 50 | as_echo='printf %s\n' 51 | as_echo_n='printf %s' 52 | else 53 | if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then 54 | as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' 55 | as_echo_n='/usr/ucb/echo -n' 56 | else 57 | as_echo_body='eval expr "X$1" : "X\\(.*\\)"' 58 | as_echo_n_body='eval 59 | arg=$1; 60 | case $arg in #( 61 | *"$as_nl"*) 62 | expr "X$arg" : "X\\(.*\\)$as_nl"; 63 | arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; 64 | esac; 65 | expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" 66 | ' 67 | export as_echo_n_body 68 | as_echo_n='sh -c $as_echo_n_body as_echo' 69 | fi 70 | export as_echo_body 71 | as_echo='sh -c $as_echo_body as_echo' 72 | fi 73 | 74 | # The user is always right. 75 | if test "${PATH_SEPARATOR+set}" != set; then 76 | PATH_SEPARATOR=: 77 | (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { 78 | (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || 79 | PATH_SEPARATOR=';' 80 | } 81 | fi 82 | 83 | 84 | # IFS 85 | # We need space, tab and new line, in precisely that order. Quoting is 86 | # there to prevent editors from complaining about space-tab. 87 | # (If _AS_PATH_WALK were called with IFS unset, it would disable word 88 | # splitting by setting IFS to empty value.) 89 | IFS=" "" $as_nl" 90 | 91 | # Find who we are. Look in the path if we contain no directory separator. 92 | as_myself= 93 | case $0 in #(( 94 | *[\\/]* ) as_myself=$0 ;; 95 | *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 96 | for as_dir in $PATH 97 | do 98 | IFS=$as_save_IFS 99 | test -z "$as_dir" && as_dir=. 100 | test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break 101 | done 102 | IFS=$as_save_IFS 103 | 104 | ;; 105 | esac 106 | # We did not find ourselves, most probably we were run as `sh COMMAND' 107 | # in which case we are not to be found in the path. 108 | if test "x$as_myself" = x; then 109 | as_myself=$0 110 | fi 111 | if test ! -f "$as_myself"; then 112 | $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 113 | exit 1 114 | fi 115 | 116 | # Unset variables that we do not need and which cause bugs (e.g. in 117 | # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" 118 | # suppresses any "Segmentation fault" message there. '((' could 119 | # trigger a bug in pdksh 5.2.14. 120 | for as_var in BASH_ENV ENV MAIL MAILPATH 121 | do eval test x\${$as_var+set} = xset \ 122 | && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : 123 | done 124 | PS1='$ ' 125 | PS2='> ' 126 | PS4='+ ' 127 | 128 | # NLS nuisances. 129 | LC_ALL=C 130 | export LC_ALL 131 | LANGUAGE=C 132 | export LANGUAGE 133 | 134 | # CDPATH. 135 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 136 | 137 | 138 | # as_fn_error STATUS ERROR [LINENO LOG_FD] 139 | # ---------------------------------------- 140 | # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are 141 | # provided, also output the error to LOG_FD, referencing LINENO. Then exit the 142 | # script with STATUS, using 1 if that was 0. 143 | as_fn_error () 144 | { 145 | as_status=$1; test $as_status -eq 0 && as_status=1 146 | if test "$4"; then 147 | as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack 148 | $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 149 | fi 150 | $as_echo "$as_me: error: $2" >&2 151 | as_fn_exit $as_status 152 | } # as_fn_error 153 | 154 | 155 | # as_fn_set_status STATUS 156 | # ----------------------- 157 | # Set $? to STATUS, without forking. 158 | as_fn_set_status () 159 | { 160 | return $1 161 | } # as_fn_set_status 162 | 163 | # as_fn_exit STATUS 164 | # ----------------- 165 | # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. 166 | as_fn_exit () 167 | { 168 | set +e 169 | as_fn_set_status $1 170 | exit $1 171 | } # as_fn_exit 172 | 173 | # as_fn_unset VAR 174 | # --------------- 175 | # Portably unset VAR. 176 | as_fn_unset () 177 | { 178 | { eval $1=; unset $1;} 179 | } 180 | as_unset=as_fn_unset 181 | # as_fn_append VAR VALUE 182 | # ---------------------- 183 | # Append the text in VALUE to the end of the definition contained in VAR. Take 184 | # advantage of any shell optimizations that allow amortized linear growth over 185 | # repeated appends, instead of the typical quadratic growth present in naive 186 | # implementations. 187 | if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : 188 | eval 'as_fn_append () 189 | { 190 | eval $1+=\$2 191 | }' 192 | else 193 | as_fn_append () 194 | { 195 | eval $1=\$$1\$2 196 | } 197 | fi # as_fn_append 198 | 199 | # as_fn_arith ARG... 200 | # ------------------ 201 | # Perform arithmetic evaluation on the ARGs, and store the result in the 202 | # global $as_val. Take advantage of shells that can avoid forks. The arguments 203 | # must be portable across $(()) and expr. 204 | if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : 205 | eval 'as_fn_arith () 206 | { 207 | as_val=$(( $* )) 208 | }' 209 | else 210 | as_fn_arith () 211 | { 212 | as_val=`expr "$@" || test $? -eq 1` 213 | } 214 | fi # as_fn_arith 215 | 216 | 217 | if expr a : '\(a\)' >/dev/null 2>&1 && 218 | test "X`expr 00001 : '.*\(...\)'`" = X001; then 219 | as_expr=expr 220 | else 221 | as_expr=false 222 | fi 223 | 224 | if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then 225 | as_basename=basename 226 | else 227 | as_basename=false 228 | fi 229 | 230 | if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then 231 | as_dirname=dirname 232 | else 233 | as_dirname=false 234 | fi 235 | 236 | as_me=`$as_basename -- "$0" || 237 | $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ 238 | X"$0" : 'X\(//\)$' \| \ 239 | X"$0" : 'X\(/\)' \| . 2>/dev/null || 240 | $as_echo X/"$0" | 241 | sed '/^.*\/\([^/][^/]*\)\/*$/{ 242 | s//\1/ 243 | q 244 | } 245 | /^X\/\(\/\/\)$/{ 246 | s//\1/ 247 | q 248 | } 249 | /^X\/\(\/\).*/{ 250 | s//\1/ 251 | q 252 | } 253 | s/.*/./; q'` 254 | 255 | # Avoid depending upon Character Ranges. 256 | as_cr_letters='abcdefghijklmnopqrstuvwxyz' 257 | as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' 258 | as_cr_Letters=$as_cr_letters$as_cr_LETTERS 259 | as_cr_digits='0123456789' 260 | as_cr_alnum=$as_cr_Letters$as_cr_digits 261 | 262 | ECHO_C= ECHO_N= ECHO_T= 263 | case `echo -n x` in #((((( 264 | -n*) 265 | case `echo 'xy\c'` in 266 | *c*) ECHO_T=' ';; # ECHO_T is single tab character. 267 | xy) ECHO_C='\c';; 268 | *) echo `echo ksh88 bug on AIX 6.1` > /dev/null 269 | ECHO_T=' ';; 270 | esac;; 271 | *) 272 | ECHO_N='-n';; 273 | esac 274 | 275 | rm -f conf$$ conf$$.exe conf$$.file 276 | if test -d conf$$.dir; then 277 | rm -f conf$$.dir/conf$$.file 278 | else 279 | rm -f conf$$.dir 280 | mkdir conf$$.dir 2>/dev/null 281 | fi 282 | if (echo >conf$$.file) 2>/dev/null; then 283 | if ln -s conf$$.file conf$$ 2>/dev/null; then 284 | as_ln_s='ln -s' 285 | # ... but there are two gotchas: 286 | # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. 287 | # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. 288 | # In both cases, we have to default to `cp -p'. 289 | ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || 290 | as_ln_s='cp -p' 291 | elif ln conf$$.file conf$$ 2>/dev/null; then 292 | as_ln_s=ln 293 | else 294 | as_ln_s='cp -p' 295 | fi 296 | else 297 | as_ln_s='cp -p' 298 | fi 299 | rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file 300 | rmdir conf$$.dir 2>/dev/null 301 | 302 | 303 | # as_fn_mkdir_p 304 | # ------------- 305 | # Create "$as_dir" as a directory, including parents if necessary. 306 | as_fn_mkdir_p () 307 | { 308 | 309 | case $as_dir in #( 310 | -*) as_dir=./$as_dir;; 311 | esac 312 | test -d "$as_dir" || eval $as_mkdir_p || { 313 | as_dirs= 314 | while :; do 315 | case $as_dir in #( 316 | *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( 317 | *) as_qdir=$as_dir;; 318 | esac 319 | as_dirs="'$as_qdir' $as_dirs" 320 | as_dir=`$as_dirname -- "$as_dir" || 321 | $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 322 | X"$as_dir" : 'X\(//\)[^/]' \| \ 323 | X"$as_dir" : 'X\(//\)$' \| \ 324 | X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || 325 | $as_echo X"$as_dir" | 326 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 327 | s//\1/ 328 | q 329 | } 330 | /^X\(\/\/\)[^/].*/{ 331 | s//\1/ 332 | q 333 | } 334 | /^X\(\/\/\)$/{ 335 | s//\1/ 336 | q 337 | } 338 | /^X\(\/\).*/{ 339 | s//\1/ 340 | q 341 | } 342 | s/.*/./; q'` 343 | test -d "$as_dir" && break 344 | done 345 | test -z "$as_dirs" || eval "mkdir $as_dirs" 346 | } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" 347 | 348 | 349 | } # as_fn_mkdir_p 350 | if mkdir -p . 2>/dev/null; then 351 | as_mkdir_p='mkdir -p "$as_dir"' 352 | else 353 | test -d ./-p && rmdir ./-p 354 | as_mkdir_p=false 355 | fi 356 | 357 | if test -x / >/dev/null 2>&1; then 358 | as_test_x='test -x' 359 | else 360 | if ls -dL / >/dev/null 2>&1; then 361 | as_ls_L_option=L 362 | else 363 | as_ls_L_option= 364 | fi 365 | as_test_x=' 366 | eval sh -c '\'' 367 | if test -d "$1"; then 368 | test -d "$1/."; 369 | else 370 | case $1 in #( 371 | -*)set "./$1";; 372 | esac; 373 | case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( 374 | ???[sx]*):;;*)false;;esac;fi 375 | '\'' sh 376 | ' 377 | fi 378 | as_executable_p=$as_test_x 379 | 380 | # Sed expression to map a string onto a valid CPP name. 381 | as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" 382 | 383 | # Sed expression to map a string onto a valid variable name. 384 | as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" 385 | 386 | 387 | exec 6>&1 388 | ## ----------------------------------- ## 389 | ## Main body of $CONFIG_STATUS script. ## 390 | ## ----------------------------------- ## 391 | # Save the log message, to keep $0 and so on meaningful, and to 392 | # report actual input values of CONFIG_FILES etc. instead of their 393 | # values after options handling. 394 | ac_log=" 395 | This file was extended by $as_me, which was 396 | generated by GNU Autoconf 2.68. Invocation command line was 397 | 398 | CONFIG_FILES = $CONFIG_FILES 399 | CONFIG_HEADERS = $CONFIG_HEADERS 400 | CONFIG_LINKS = $CONFIG_LINKS 401 | CONFIG_COMMANDS = $CONFIG_COMMANDS 402 | $ $0 $@ 403 | 404 | on `(hostname || uname -n) 2>/dev/null | sed 1q` 405 | " 406 | 407 | # Files that config.status was made for. 408 | config_headers=" config.h" 409 | 410 | ac_cs_usage="\ 411 | \`$as_me' instantiates files and other configuration actions 412 | from templates according to the current configuration. Unless the files 413 | and actions are specified as TAGs, all are instantiated by default. 414 | 415 | Usage: $0 [OPTION]... [TAG]... 416 | 417 | -h, --help print this help, then exit 418 | -V, --version print version number and configuration settings, then exit 419 | --config print configuration, then exit 420 | -q, --quiet, --silent 421 | do not print progress messages 422 | -d, --debug don't remove temporary files 423 | --recheck update $as_me by reconfiguring in the same conditions 424 | --header=FILE[:TEMPLATE] 425 | instantiate the configuration header FILE 426 | 427 | Configuration headers: 428 | $config_headers 429 | 430 | Report bugs to the package provider." 431 | 432 | ac_cs_config="'--with-php-config=/usr/local/php5.5/bin/php-config'" 433 | ac_cs_version="\ 434 | config.status 435 | configured by ./configure, generated by GNU Autoconf 2.68, 436 | with options \"$ac_cs_config\" 437 | 438 | Copyright (C) 2010 Free Software Foundation, Inc. 439 | This config.status script is free software; the Free Software Foundation 440 | gives unlimited permission to copy, distribute and modify it." 441 | 442 | ac_pwd='/home/cyd/桌面/project/php_header/ext/phdfs' 443 | srcdir='.' 444 | test -n "$AWK" || AWK=awk 445 | # The default lists apply if the user does not specify any file. 446 | ac_need_defaults=: 447 | while test $# != 0 448 | do 449 | case $1 in 450 | --*=?*) 451 | ac_option=`expr "X$1" : 'X\([^=]*\)='` 452 | ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` 453 | ac_shift=: 454 | ;; 455 | --*=) 456 | ac_option=`expr "X$1" : 'X\([^=]*\)='` 457 | ac_optarg= 458 | ac_shift=: 459 | ;; 460 | *) 461 | ac_option=$1 462 | ac_optarg=$2 463 | ac_shift=shift 464 | ;; 465 | esac 466 | 467 | case $ac_option in 468 | # Handling of the options. 469 | -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) 470 | ac_cs_recheck=: ;; 471 | --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) 472 | $as_echo "$ac_cs_version"; exit ;; 473 | --config | --confi | --conf | --con | --co | --c ) 474 | $as_echo "$ac_cs_config"; exit ;; 475 | --debug | --debu | --deb | --de | --d | -d ) 476 | debug=: ;; 477 | --header | --heade | --head | --hea ) 478 | $ac_shift 479 | case $ac_optarg in 480 | *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; 481 | esac 482 | as_fn_append CONFIG_HEADERS " '$ac_optarg'" 483 | ac_need_defaults=false;; 484 | --he | --h) 485 | # Conflict between --help and --header 486 | as_fn_error $? "ambiguous option: \`$1' 487 | Try \`$0 --help' for more information.";; 488 | --help | --hel | -h ) 489 | $as_echo "$ac_cs_usage"; exit ;; 490 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ 491 | | -silent | --silent | --silen | --sile | --sil | --si | --s) 492 | ac_cs_silent=: ;; 493 | 494 | # This is an error. 495 | -*) as_fn_error $? "unrecognized option: \`$1' 496 | Try \`$0 --help' for more information." ;; 497 | 498 | *) as_fn_append ac_config_targets " $1" 499 | ac_need_defaults=false ;; 500 | 501 | esac 502 | shift 503 | done 504 | 505 | ac_configure_extra_args= 506 | 507 | if $ac_cs_silent; then 508 | exec 6>/dev/null 509 | ac_configure_extra_args="$ac_configure_extra_args --silent" 510 | fi 511 | 512 | if $ac_cs_recheck; then 513 | set X '/bin/bash' './configure' '--with-php-config=/usr/local/php5.5/bin/php-config' $ac_configure_extra_args --no-create --no-recursion 514 | shift 515 | $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 516 | CONFIG_SHELL='/bin/bash' 517 | export CONFIG_SHELL 518 | exec "$@" 519 | fi 520 | 521 | exec 5>>config.log 522 | { 523 | echo 524 | sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX 525 | ## Running $as_me. ## 526 | _ASBOX 527 | $as_echo "$ac_log" 528 | } >&5 529 | 530 | 531 | # Handling of arguments. 532 | for ac_config_target in $ac_config_targets 533 | do 534 | case $ac_config_target in 535 | "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; 536 | 537 | *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 538 | esac 539 | done 540 | 541 | 542 | # If the user did not use the arguments to specify the items to instantiate, 543 | # then the envvar interface is used. Set only those that are not. 544 | # We use the long form for the default assignment because of an extremely 545 | # bizarre bug on SunOS 4.1.3. 546 | if $ac_need_defaults; then 547 | test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers 548 | fi 549 | 550 | # Have a temporary directory for convenience. Make it in the build tree 551 | # simply because there is no reason against having it here, and in addition, 552 | # creating and moving files from /tmp can sometimes cause problems. 553 | # Hook for its removal unless debugging. 554 | # Note that there is a small window in which the directory will not be cleaned: 555 | # after its creation but before its name has been assigned to `$tmp'. 556 | $debug || 557 | { 558 | tmp= ac_tmp= 559 | trap 'exit_status=$? 560 | : "${ac_tmp:=$tmp}" 561 | { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status 562 | ' 0 563 | trap 'as_fn_exit 1' 1 2 13 15 564 | } 565 | # Create a (secure) tmp directory for tmp files. 566 | 567 | { 568 | tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && 569 | test -d "$tmp" 570 | } || 571 | { 572 | tmp=./conf$$-$RANDOM 573 | (umask 077 && mkdir "$tmp") 574 | } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 575 | ac_tmp=$tmp 576 | 577 | # Set up the scripts for CONFIG_HEADERS section. 578 | # No need to generate them if there are no CONFIG_HEADERS. 579 | # This happens for instance with `./config.status Makefile'. 580 | if test -n "$CONFIG_HEADERS"; then 581 | cat >"$ac_tmp/defines.awk" <<\_ACAWK || 582 | BEGIN { 583 | D["PACKAGE_NAME"]=" \"\"" 584 | D["PACKAGE_TARNAME"]=" \"\"" 585 | D["PACKAGE_VERSION"]=" \"\"" 586 | D["PACKAGE_STRING"]=" \"\"" 587 | D["PACKAGE_BUGREPORT"]=" \"\"" 588 | D["PACKAGE_URL"]=" \"\"" 589 | D["HAVE_PHDFS"]=" 1" 590 | D["COMPILE_DL_PHDFS"]=" 1" 591 | D["STDC_HEADERS"]=" 1" 592 | D["HAVE_SYS_TYPES_H"]=" 1" 593 | D["HAVE_SYS_STAT_H"]=" 1" 594 | D["HAVE_STDLIB_H"]=" 1" 595 | D["HAVE_STRING_H"]=" 1" 596 | D["HAVE_MEMORY_H"]=" 1" 597 | D["HAVE_STRINGS_H"]=" 1" 598 | D["HAVE_INTTYPES_H"]=" 1" 599 | D["HAVE_STDINT_H"]=" 1" 600 | D["HAVE_UNISTD_H"]=" 1" 601 | D["HAVE_DLFCN_H"]=" 1" 602 | for (key in D) D_is_set[key] = 1 603 | FS = "" 604 | } 605 | /^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ { 606 | line = $ 0 607 | split(line, arg, " ") 608 | if (arg[1] == "#") { 609 | defundef = arg[2] 610 | mac1 = arg[3] 611 | } else { 612 | defundef = substr(arg[1], 2) 613 | mac1 = arg[2] 614 | } 615 | split(mac1, mac2, "(") #) 616 | macro = mac2[1] 617 | prefix = substr(line, 1, index(line, defundef) - 1) 618 | if (D_is_set[macro]) { 619 | # Preserve the white space surrounding the "#". 620 | print prefix "define", macro P[macro] D[macro] 621 | next 622 | } else { 623 | # Replace #undef with comments. This is necessary, for example, 624 | # in the case of _POSIX_SOURCE, which is predefined and required 625 | # on some systems where configure will not decide to define it. 626 | if (defundef == "undef") { 627 | print "/*", prefix defundef, macro, "*/" 628 | next 629 | } 630 | } 631 | } 632 | { print } 633 | _ACAWK 634 | as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 635 | fi # test -n "$CONFIG_HEADERS" 636 | 637 | 638 | eval set X " :H $CONFIG_HEADERS " 639 | shift 640 | for ac_tag 641 | do 642 | case $ac_tag in 643 | :[FHLC]) ac_mode=$ac_tag; continue;; 644 | esac 645 | case $ac_mode$ac_tag in 646 | :[FHL]*:*);; 647 | :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; 648 | :[FH]-) ac_tag=-:-;; 649 | :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; 650 | esac 651 | ac_save_IFS=$IFS 652 | IFS=: 653 | set x $ac_tag 654 | IFS=$ac_save_IFS 655 | shift 656 | ac_file=$1 657 | shift 658 | 659 | case $ac_mode in 660 | :L) ac_source=$1;; 661 | :[FH]) 662 | ac_file_inputs= 663 | for ac_f 664 | do 665 | case $ac_f in 666 | -) ac_f="$ac_tmp/stdin";; 667 | *) # Look for the file first in the build tree, then in the source tree 668 | # (if the path is not absolute). The absolute path cannot be DOS-style, 669 | # because $ac_f cannot contain `:'. 670 | test -f "$ac_f" || 671 | case $ac_f in 672 | [\\/$]*) false;; 673 | *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; 674 | esac || 675 | as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; 676 | esac 677 | case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac 678 | as_fn_append ac_file_inputs " '$ac_f'" 679 | done 680 | 681 | # Let's still pretend it is `configure' which instantiates (i.e., don't 682 | # use $as_me), people would be surprised to read: 683 | # /* config.h. Generated by config.status. */ 684 | configure_input='Generated from '` 685 | $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' 686 | `' by configure.' 687 | if test x"$ac_file" != x-; then 688 | configure_input="$ac_file. $configure_input" 689 | { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 690 | $as_echo "$as_me: creating $ac_file" >&6;} 691 | fi 692 | # Neutralize special characters interpreted by sed in replacement strings. 693 | case $configure_input in #( 694 | *\&* | *\|* | *\\* ) 695 | ac_sed_conf_input=`$as_echo "$configure_input" | 696 | sed 's/[\\\\&|]/\\\\&/g'`;; #( 697 | *) ac_sed_conf_input=$configure_input;; 698 | esac 699 | 700 | case $ac_tag in 701 | *:-:* | *:-) cat >"$ac_tmp/stdin" \ 702 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; 703 | esac 704 | ;; 705 | esac 706 | 707 | ac_dir=`$as_dirname -- "$ac_file" || 708 | $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 709 | X"$ac_file" : 'X\(//\)[^/]' \| \ 710 | X"$ac_file" : 'X\(//\)$' \| \ 711 | X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || 712 | $as_echo X"$ac_file" | 713 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ 714 | s//\1/ 715 | q 716 | } 717 | /^X\(\/\/\)[^/].*/{ 718 | s//\1/ 719 | q 720 | } 721 | /^X\(\/\/\)$/{ 722 | s//\1/ 723 | q 724 | } 725 | /^X\(\/\).*/{ 726 | s//\1/ 727 | q 728 | } 729 | s/.*/./; q'` 730 | as_dir="$ac_dir"; as_fn_mkdir_p 731 | ac_builddir=. 732 | 733 | case "$ac_dir" in 734 | .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; 735 | *) 736 | ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` 737 | # A ".." for each directory in $ac_dir_suffix. 738 | ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` 739 | case $ac_top_builddir_sub in 740 | "") ac_top_builddir_sub=. ac_top_build_prefix= ;; 741 | *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; 742 | esac ;; 743 | esac 744 | ac_abs_top_builddir=$ac_pwd 745 | ac_abs_builddir=$ac_pwd$ac_dir_suffix 746 | # for backward compatibility: 747 | ac_top_builddir=$ac_top_build_prefix 748 | 749 | case $srcdir in 750 | .) # We are building in place. 751 | ac_srcdir=. 752 | ac_top_srcdir=$ac_top_builddir_sub 753 | ac_abs_top_srcdir=$ac_pwd ;; 754 | [\\/]* | ?:[\\/]* ) # Absolute name. 755 | ac_srcdir=$srcdir$ac_dir_suffix; 756 | ac_top_srcdir=$srcdir 757 | ac_abs_top_srcdir=$srcdir ;; 758 | *) # Relative name. 759 | ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix 760 | ac_top_srcdir=$ac_top_build_prefix$srcdir 761 | ac_abs_top_srcdir=$ac_pwd/$srcdir ;; 762 | esac 763 | ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix 764 | 765 | 766 | case $ac_mode in 767 | 768 | :H) 769 | # 770 | # CONFIG_HEADER 771 | # 772 | if test x"$ac_file" != x-; then 773 | { 774 | $as_echo "/* $configure_input */" \ 775 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" 776 | } >"$ac_tmp/config.h" \ 777 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 778 | if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then 779 | { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 780 | $as_echo "$as_me: $ac_file is unchanged" >&6;} 781 | else 782 | rm -f "$ac_file" 783 | mv "$ac_tmp/config.h" "$ac_file" \ 784 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 785 | fi 786 | else 787 | $as_echo "/* $configure_input */" \ 788 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ 789 | || as_fn_error $? "could not create -" "$LINENO" 5 790 | fi 791 | ;; 792 | 793 | 794 | esac 795 | 796 | done # for ac_tag 797 | 798 | 799 | as_fn_exit 0 800 | -------------------------------------------------------------------------------- /config.log: -------------------------------------------------------------------------------- 1 | This file contains any messages produced by compilers while 2 | running configure, to aid debugging if configure makes a mistake. 3 | 4 | It was created by configure, which was 5 | generated by GNU Autoconf 2.68. Invocation command line was 6 | 7 | $ ./configure --with-php-config=/usr/local/php5.5/bin/php-config 8 | 9 | ## --------- ## 10 | ## Platform. ## 11 | ## --------- ## 12 | 13 | hostname = cyd-ThinkPad-T400 14 | uname -m = i686 15 | uname -r = 3.2.0-55-generic-pae 16 | uname -s = Linux 17 | uname -v = #85-Ubuntu SMP Wed Oct 2 14:03:15 UTC 2013 18 | 19 | /usr/bin/uname -p = unknown 20 | /bin/uname -X = unknown 21 | 22 | /bin/arch = unknown 23 | /usr/bin/arch -k = unknown 24 | /usr/convex/getsysinfo = unknown 25 | /usr/bin/hostinfo = unknown 26 | /bin/machine = unknown 27 | /usr/bin/oslevel = unknown 28 | /bin/universe = unknown 29 | 30 | PATH: /usr/local/sbin 31 | PATH: /usr/local/bin 32 | PATH: /usr/sbin 33 | PATH: /usr/bin 34 | PATH: /sbin 35 | PATH: /bin 36 | PATH: /usr/games 37 | PATH: /opt/scala-2.10.4/ 38 | 39 | 40 | ## ----------- ## 41 | ## Core tests. ## 42 | ## ----------- ## 43 | 44 | configure:2276: checking for grep that handles long lines and -e 45 | configure:2334: result: /bin/grep 46 | configure:2339: checking for egrep 47 | configure:2401: result: /bin/grep -E 48 | configure:2406: checking for a sed that does not truncate output 49 | configure:2460: result: /bin/sed 50 | configure:2592: checking for cc 51 | configure:2608: found /usr/bin/cc 52 | configure:2619: result: cc 53 | configure:2650: checking for C compiler version 54 | configure:2659: cc --version >&5 55 | cc (Ubuntu/Linaro 4.7.3-2ubuntu1~12.04) 4.7.3 56 | Copyright (C) 2012 Free Software Foundation, Inc. 57 | This is free software; see the source for copying conditions. There is NO 58 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 59 | 60 | configure:2670: $? = 0 61 | configure:2659: cc -v >&5 62 | Using built-in specs. 63 | COLLECT_GCC=cc 64 | COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper 65 | Target: i686-linux-gnu 66 | Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.3-2ubuntu1~12.04' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu 67 | Thread model: posix 68 | gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-2ubuntu1~12.04) 69 | configure:2670: $? = 0 70 | configure:2659: cc -V >&5 71 | cc: error: unrecognized command line option '-V' 72 | cc: fatal error: no input files 73 | compilation terminated. 74 | configure:2670: $? = 4 75 | configure:2659: cc -qversion >&5 76 | cc: error: unrecognized command line option '-qversion' 77 | cc: fatal error: no input files 78 | compilation terminated. 79 | configure:2670: $? = 4 80 | configure:2690: checking whether the C compiler works 81 | configure:2712: cc conftest.c >&5 82 | configure:2716: $? = 0 83 | configure:2764: result: yes 84 | configure:2767: checking for C compiler default output file name 85 | configure:2769: result: a.out 86 | configure:2775: checking for suffix of executables 87 | configure:2782: cc -o conftest conftest.c >&5 88 | configure:2786: $? = 0 89 | configure:2808: result: 90 | configure:2830: checking whether we are cross compiling 91 | configure:2838: cc -o conftest conftest.c >&5 92 | configure:2842: $? = 0 93 | configure:2849: ./conftest 94 | configure:2853: $? = 0 95 | configure:2868: result: no 96 | configure:2873: checking for suffix of object files 97 | configure:2895: cc -c conftest.c >&5 98 | configure:2899: $? = 0 99 | configure:2920: result: o 100 | configure:2924: checking whether we are using the GNU C compiler 101 | configure:2943: cc -c conftest.c >&5 102 | configure:2943: $? = 0 103 | configure:2952: result: yes 104 | configure:2961: checking whether cc accepts -g 105 | configure:2981: cc -c -g conftest.c >&5 106 | configure:2981: $? = 0 107 | configure:3022: result: yes 108 | configure:3039: checking for cc option to accept ISO C89 109 | configure:3103: cc -c -g -O2 conftest.c >&5 110 | configure:3103: $? = 0 111 | configure:3116: result: none needed 112 | configure:3142: checking how to run the C preprocessor 113 | configure:3173: cc -E conftest.c 114 | configure:3173: $? = 0 115 | configure:3187: cc -E conftest.c 116 | conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory 117 | compilation terminated. 118 | configure:3187: $? = 1 119 | configure: failed program was: 120 | | /* confdefs.h */ 121 | | #define PACKAGE_NAME "" 122 | | #define PACKAGE_TARNAME "" 123 | | #define PACKAGE_VERSION "" 124 | | #define PACKAGE_STRING "" 125 | | #define PACKAGE_BUGREPORT "" 126 | | #define PACKAGE_URL "" 127 | | /* end confdefs.h. */ 128 | | #include 129 | configure:3212: result: cc -E 130 | configure:3232: cc -E conftest.c 131 | configure:3232: $? = 0 132 | configure:3246: cc -E conftest.c 133 | conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory 134 | compilation terminated. 135 | configure:3246: $? = 1 136 | configure: failed program was: 137 | | /* confdefs.h */ 138 | | #define PACKAGE_NAME "" 139 | | #define PACKAGE_TARNAME "" 140 | | #define PACKAGE_VERSION "" 141 | | #define PACKAGE_STRING "" 142 | | #define PACKAGE_BUGREPORT "" 143 | | #define PACKAGE_URL "" 144 | | /* end confdefs.h. */ 145 | | #include 146 | configure:3277: checking for icc 147 | configure:3286: result: no 148 | configure:3300: checking for suncc 149 | configure:3309: result: no 150 | configure:3327: checking whether cc understands -c and -o together 151 | configure:3355: cc -c conftest.c -o conftest2.o >&5 152 | configure:3359: $? = 0 153 | configure:3365: cc -c conftest.c -o conftest2.o >&5 154 | configure:3369: $? = 0 155 | configure:3424: result: yes 156 | configure:3438: checking for system library directory 157 | configure:3453: result: lib 158 | configure:3460: checking if compiler supports -R 159 | configure:3479: cc -o conftest -g -O2 conftest.c -R /usr/lib >&5 160 | cc: error: unrecognized option '-R' 161 | configure:3479: $? = 1 162 | configure: failed program was: 163 | | /* confdefs.h */ 164 | | #define PACKAGE_NAME "" 165 | | #define PACKAGE_TARNAME "" 166 | | #define PACKAGE_VERSION "" 167 | | #define PACKAGE_STRING "" 168 | | #define PACKAGE_BUGREPORT "" 169 | | #define PACKAGE_URL "" 170 | | /* end confdefs.h. */ 171 | | 172 | | int 173 | | main () 174 | | { 175 | | 176 | | ; 177 | | return 0; 178 | | } 179 | configure:3489: result: no 180 | configure:3494: checking if compiler supports -Wl,-rpath, 181 | configure:3513: cc -o conftest -g -O2 conftest.c -Wl,-rpath,/usr/lib >&5 182 | configure:3513: $? = 0 183 | configure:3523: result: yes 184 | configure:3568: checking build system type 185 | configure:3582: result: i686-pc-linux-gnu 186 | configure:3602: checking host system type 187 | configure:3615: result: i686-pc-linux-gnu 188 | configure:3635: checking target system type 189 | configure:3648: result: i686-pc-linux-gnu 190 | configure:3751: checking for PHP prefix 191 | configure:3753: result: /usr/local/php5.5 192 | configure:3755: checking for PHP includes 193 | configure:3757: result: -I/usr/local/php5.5/include/php -I/usr/local/php5.5/include/php/main -I/usr/local/php5.5/include/php/TSRM -I/usr/local/php5.5/include/php/Zend -I/usr/local/php5.5/include/php/ext -I/usr/local/php5.5/include/php/ext/date/lib 194 | configure:3759: checking for PHP extension directory 195 | configure:3761: result: /usr/local/php5.5/lib/php/extensions/no-debug-non-zts-20121212 196 | configure:3763: checking for PHP installed headers prefix 197 | configure:3765: result: /usr/local/php5.5/include/php 198 | configure:3768: checking if debug is enabled 199 | configure:3794: result: no 200 | configure:3797: checking if zts is enabled 201 | configure:3823: result: no 202 | configure:3894: checking for re2c 203 | configure:3924: result: no 204 | configure:3949: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. 205 | configure:3963: checking for gawk 206 | configure:3994: result: no 207 | configure:3963: checking for nawk 208 | configure:3980: found /usr/bin/nawk 209 | configure:3991: result: nawk 210 | configure:4014: checking if nawk is broken 211 | configure:4021: result: no 212 | configure:4035: checking whether to enable phdfs functions 213 | configure:4074: result: yes, shared 214 | configure:4088: checking PHP version 215 | configure:4105: cc -c -g -O2 -I/usr/local/php5.5/include/php -I/usr/local/php5.5/include/php/main -I/usr/local/php5.5/include/php/TSRM -I/usr/local/php5.5/include/php/Zend -I/usr/local/php5.5/include/php/ext -I/usr/local/php5.5/include/php/ext/date/lib -DHAVE_PHDFS conftest.c >&5 216 | configure:4105: $? = 0 217 | configure:4106: result: ok 218 | configure:4511: checking for ld used by cc 219 | configure:4578: result: /usr/bin/ld 220 | configure:4585: checking if the linker (/usr/bin/ld) is GNU ld 221 | configure:4600: result: yes 222 | configure:4605: checking for /usr/bin/ld option to reload object files 223 | configure:4612: result: -r 224 | configure:4630: checking for BSD-compatible nm 225 | configure:4679: result: /usr/bin/nm -B 226 | configure:4683: checking whether ln -s works 227 | configure:4687: result: yes 228 | configure:4694: checking how to recognize dependent libraries 229 | configure:4880: result: pass_all 230 | configure:5092: checking for ANSI C header files 231 | configure:5112: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 232 | configure:5112: $? = 0 233 | configure:5185: cc -o conftest -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 234 | configure:5185: $? = 0 235 | configure:5185: ./conftest 236 | configure:5185: $? = 0 237 | configure:5196: result: yes 238 | configure:5209: checking for sys/types.h 239 | configure:5209: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 240 | configure:5209: $? = 0 241 | configure:5209: result: yes 242 | configure:5209: checking for sys/stat.h 243 | configure:5209: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 244 | configure:5209: $? = 0 245 | configure:5209: result: yes 246 | configure:5209: checking for stdlib.h 247 | configure:5209: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 248 | configure:5209: $? = 0 249 | configure:5209: result: yes 250 | configure:5209: checking for string.h 251 | configure:5209: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 252 | configure:5209: $? = 0 253 | configure:5209: result: yes 254 | configure:5209: checking for memory.h 255 | configure:5209: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 256 | configure:5209: $? = 0 257 | configure:5209: result: yes 258 | configure:5209: checking for strings.h 259 | configure:5209: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 260 | configure:5209: $? = 0 261 | configure:5209: result: yes 262 | configure:5209: checking for inttypes.h 263 | configure:5209: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 264 | configure:5209: $? = 0 265 | configure:5209: result: yes 266 | configure:5209: checking for stdint.h 267 | configure:5209: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 268 | configure:5209: $? = 0 269 | configure:5209: result: yes 270 | configure:5209: checking for unistd.h 271 | configure:5209: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 272 | configure:5209: $? = 0 273 | configure:5209: result: yes 274 | configure:5223: checking dlfcn.h usability 275 | configure:5223: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 276 | configure:5223: $? = 0 277 | configure:5223: result: yes 278 | configure:5223: checking dlfcn.h presence 279 | configure:5223: cc -E -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c 280 | configure:5223: $? = 0 281 | configure:5223: result: yes 282 | configure:5223: checking for dlfcn.h 283 | configure:5223: result: yes 284 | configure:5245: checking the maximum length of command line arguments 285 | configure:5357: result: 1572864 286 | configure:5369: checking command to parse /usr/bin/nm -B output from cc object 287 | configure:5474: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 288 | configure:5477: $? = 0 289 | configure:5481: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' \> conftest.nm 290 | configure:5484: $? = 0 291 | configure:5536: cc -o conftest -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c conftstm.o >&5 292 | configure:5539: $? = 0 293 | configure:5577: result: ok 294 | configure:5581: checking for objdir 295 | configure:5596: result: .libs 296 | configure:5688: checking for ar 297 | configure:5704: found /usr/bin/ar 298 | configure:5715: result: ar 299 | configure:5780: checking for ranlib 300 | configure:5796: found /usr/bin/ranlib 301 | configure:5807: result: ranlib 302 | configure:5872: checking for strip 303 | configure:5888: found /usr/bin/strip 304 | configure:5899: result: strip 305 | configure:6468: checking if cc supports -fno-rtti -fno-exceptions 306 | configure:6486: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm -fno-rtti -fno-exceptions conftest.c >&5 307 | cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C [enabled by default] 308 | configure:6490: $? = 0 309 | configure:6503: result: no 310 | configure:6518: checking for cc option to produce PIC 311 | configure:6758: result: -fPIC 312 | configure:6766: checking if cc PIC flag -fPIC works 313 | configure:6784: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm -fPIC -DPIC conftest.c >&5 314 | configure:6788: $? = 0 315 | configure:6801: result: yes 316 | configure:6829: checking if cc static flag -static works 317 | configure:6857: result: no 318 | configure:6867: checking if cc supports -c -o file.o 319 | configure:6888: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm -o out/conftest2.o conftest.c >&5 320 | configure:6892: $? = 0 321 | configure:6914: result: yes 322 | configure:6940: checking whether the cc linker (/usr/bin/ld) supports shared libraries 323 | configure:7872: result: yes 324 | configure:7893: checking whether -lc should be explicitly linked in 325 | configure:7898: cc -c -g -O2 -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm conftest.c >&5 326 | configure:7901: $? = 0 327 | configure:7916: cc -shared conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| grep -lc \>/dev/null 2\>\&1 328 | configure:7919: $? = 0 329 | configure:7931: result: no 330 | configure:7939: checking dynamic linker characteristics 331 | configure:8541: result: GNU/Linux ld.so 332 | configure:8565: checking how to hardcode library paths into programs 333 | configure:8590: result: immediate 334 | configure:8604: checking whether stripping libraries is possible 335 | configure:8609: result: yes 336 | configure:9126: checking if libtool supports shared libraries 337 | configure:9128: result: yes 338 | configure:9131: checking whether to build shared libraries 339 | configure:9152: result: yes 340 | configure:9155: checking whether to build static libraries 341 | configure:9159: result: no 342 | configure:9254: result: 343 | creating libtool 344 | configure:12957: creating ./config.status 345 | 346 | ## ---------------------- ## 347 | ## Running config.status. ## 348 | ## ---------------------- ## 349 | 350 | This file was extended by config.status, which was 351 | generated by GNU Autoconf 2.68. Invocation command line was 352 | 353 | CONFIG_FILES = 354 | CONFIG_HEADERS = 355 | CONFIG_LINKS = 356 | CONFIG_COMMANDS = 357 | $ ./config.status 358 | 359 | on cyd-ThinkPad-T400 360 | 361 | config.status:689: creating config.h 362 | config.status:779: config.h is unchanged 363 | 364 | ## ---------------- ## 365 | ## Cache variables. ## 366 | ## ---------------- ## 367 | 368 | ac_cv_build=i686-pc-linux-gnu 369 | ac_cv_c_compiler_gnu=yes 370 | ac_cv_env_CC_set= 371 | ac_cv_env_CC_value= 372 | ac_cv_env_CFLAGS_set= 373 | ac_cv_env_CFLAGS_value= 374 | ac_cv_env_CPPFLAGS_set= 375 | ac_cv_env_CPPFLAGS_value= 376 | ac_cv_env_CPP_set= 377 | ac_cv_env_CPP_value= 378 | ac_cv_env_LDFLAGS_set= 379 | ac_cv_env_LDFLAGS_value= 380 | ac_cv_env_LIBS_set= 381 | ac_cv_env_LIBS_value= 382 | ac_cv_env_build_alias_set= 383 | ac_cv_env_build_alias_value= 384 | ac_cv_env_host_alias_set= 385 | ac_cv_env_host_alias_value= 386 | ac_cv_env_target_alias_set= 387 | ac_cv_env_target_alias_value= 388 | ac_cv_header_dlfcn_h=yes 389 | ac_cv_header_inttypes_h=yes 390 | ac_cv_header_memory_h=yes 391 | ac_cv_header_stdc=yes 392 | ac_cv_header_stdint_h=yes 393 | ac_cv_header_stdlib_h=yes 394 | ac_cv_header_string_h=yes 395 | ac_cv_header_strings_h=yes 396 | ac_cv_header_sys_stat_h=yes 397 | ac_cv_header_sys_types_h=yes 398 | ac_cv_header_unistd_h=yes 399 | ac_cv_host=i686-pc-linux-gnu 400 | ac_cv_objext=o 401 | ac_cv_path_EGREP='/bin/grep -E' 402 | ac_cv_path_GREP=/bin/grep 403 | ac_cv_prog_AWK=nawk 404 | ac_cv_prog_CPP='cc -E' 405 | ac_cv_prog_ac_ct_AR=ar 406 | ac_cv_prog_ac_ct_CC=cc 407 | ac_cv_prog_ac_ct_RANLIB=ranlib 408 | ac_cv_prog_ac_ct_STRIP=strip 409 | ac_cv_prog_cc_c89= 410 | ac_cv_prog_cc_cc_c_o=yes 411 | ac_cv_prog_cc_g=yes 412 | ac_cv_target=i686-pc-linux-gnu 413 | lt_cv_deplibs_check_method=pass_all 414 | lt_cv_file_magic_cmd='$MAGIC_CMD' 415 | lt_cv_file_magic_test_file= 416 | lt_cv_ld_reload_flag=-r 417 | lt_cv_objdir=.libs 418 | lt_cv_path_LD=/usr/bin/ld 419 | lt_cv_path_NM='/usr/bin/nm -B' 420 | lt_cv_path_SED=/bin/sed 421 | lt_cv_prog_compiler_c_o=yes 422 | lt_cv_prog_compiler_pic_works=yes 423 | lt_cv_prog_compiler_rtti_exceptions=no 424 | lt_cv_prog_compiler_static_works=no 425 | lt_cv_prog_gnu_ld=yes 426 | lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\''' 427 | lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/ {\"\1\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr) \&\2},/p'\''' 428 | lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^. .* \(.*\)$/extern int \1;/p'\''' 429 | lt_cv_sys_lib_dlsearch_path_spec='/lib /usr/lib /usr/lib/i386-linux-gnu/mesa /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib ${HADOOP_HOME}/c++/Linux-i386-32/lib ${JAVA_HOME}/jre/lib/i386/client ' 430 | lt_cv_sys_lib_search_path_spec='/usr/lib/gcc/i686-linux-gnu/4.7 /usr/lib/i386-linux-gnu /usr/lib /lib/i386-linux-gnu /lib' 431 | lt_cv_sys_max_cmd_len=1572864 432 | lt_lt_cv_prog_compiler_c_o='"yes"' 433 | lt_lt_cv_sys_global_symbol_pipe='"sed -n -e '\''s/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'\''"' 434 | lt_lt_cv_sys_global_symbol_to_c_name_address='"sed -n -e '\''s/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'\''"' 435 | lt_lt_cv_sys_global_symbol_to_cdecl='"sed -n -e '\''s/^. .* \\(.*\\)\$/extern int \\1;/p'\''"' 436 | php_cv_cc_dashr=no 437 | php_cv_cc_rpath=yes 438 | 439 | ## ----------------- ## 440 | ## Output variables. ## 441 | ## ----------------- ## 442 | 443 | AR='ar' 444 | AWK='nawk' 445 | CC='cc' 446 | CFLAGS='-g -O2' 447 | CONFIGURE_COMMAND=' '\''./configure'\'' '\''--with-php-config=/usr/local/php5.5/bin/php-config'\''' 448 | CONFIGURE_OPTIONS=' '\''--with-php-config=/usr/local/php5.5/bin/php-config'\''' 449 | CPP='cc -E' 450 | CPPFLAGS=' -I /home/cyd/hadoop//src/c++/libhdfs -I /usr/jdk1.7.0_40//include -I /usr/jdk1.7.0_40//include/linux -L/home/cyd/hadoop//c++/Linux-i386-32/lib -lhdfs -L/usr/jdk1.7.0_40//jre/lib/i386/server -ljvm -DHAVE_CONFIG_H' 451 | DEFS='-DHAVE_CONFIG_H' 452 | DSYMUTIL='' 453 | ECHO='echo' 454 | ECHO_C='' 455 | ECHO_N='-n' 456 | ECHO_T='' 457 | EGREP='/bin/grep -E' 458 | EXEEXT='' 459 | GREP='/bin/grep' 460 | LDFLAGS='' 461 | LIBOBJS='' 462 | LIBS='' 463 | LIBTOOL='$(SHELL) $(top_builddir)/libtool' 464 | LN_S='ln -s' 465 | LTLIBOBJS='' 466 | NMEDIT='' 467 | OBJEXT='o' 468 | PACKAGE_BUGREPORT='' 469 | PACKAGE_NAME='' 470 | PACKAGE_STRING='' 471 | PACKAGE_TARNAME='' 472 | PACKAGE_URL='' 473 | PACKAGE_VERSION='' 474 | PATH_SEPARATOR=':' 475 | RANLIB='ranlib' 476 | RE2C='exit 0;' 477 | SED='/bin/sed' 478 | SHELL='/bin/bash' 479 | SHLIB_DL_SUFFIX_NAME='so' 480 | SHLIB_SUFFIX_NAME='so' 481 | STRIP='strip' 482 | ac_ct_CC='cc' 483 | bindir='${exec_prefix}/bin' 484 | build='i686-pc-linux-gnu' 485 | build_alias='' 486 | build_cpu='i686' 487 | build_os='linux-gnu' 488 | build_vendor='pc' 489 | datadir='${datarootdir}' 490 | datarootdir='${prefix}/share' 491 | docdir='${datarootdir}/doc/${PACKAGE}' 492 | dvidir='${docdir}' 493 | exec_prefix='$(prefix)' 494 | host='i686-pc-linux-gnu' 495 | host_alias='i686-pc-linux-gnu' 496 | host_cpu='i686' 497 | host_os='linux-gnu' 498 | host_vendor='pc' 499 | htmldir='${docdir}' 500 | includedir='${prefix}/include' 501 | infodir='${datarootdir}/info' 502 | libdir='${exec_prefix}/lib' 503 | libexecdir='${exec_prefix}/libexec' 504 | localedir='${datarootdir}/locale' 505 | localstatedir='${prefix}/var' 506 | mandir='${datarootdir}/man' 507 | oldincludedir='/usr/include' 508 | pdfdir='${docdir}' 509 | prefix='/usr/local/php5.5' 510 | program_transform_name='s,x,x,' 511 | psdir='${docdir}' 512 | sbindir='${exec_prefix}/sbin' 513 | sharedstatedir='${prefix}/com' 514 | sysconfdir='${prefix}/etc' 515 | target='i686-pc-linux-gnu' 516 | target_alias='' 517 | target_cpu='i686' 518 | target_os='linux-gnu' 519 | target_vendor='pc' 520 | 521 | ## ----------- ## 522 | ## confdefs.h. ## 523 | ## ----------- ## 524 | 525 | /* confdefs.h */ 526 | #define PACKAGE_NAME "" 527 | #define PACKAGE_TARNAME "" 528 | #define PACKAGE_VERSION "" 529 | #define PACKAGE_STRING "" 530 | #define PACKAGE_BUGREPORT "" 531 | #define PACKAGE_URL "" 532 | #define HAVE_PHDFS 1 533 | #define COMPILE_DL_PHDFS 1 534 | #define STDC_HEADERS 1 535 | #define HAVE_SYS_TYPES_H 1 536 | #define HAVE_SYS_STAT_H 1 537 | #define HAVE_STDLIB_H 1 538 | #define HAVE_STRING_H 1 539 | #define HAVE_MEMORY_H 1 540 | #define HAVE_STRINGS_H 1 541 | #define HAVE_INTTYPES_H 1 542 | #define HAVE_STDINT_H 1 543 | #define HAVE_UNISTD_H 1 544 | #define HAVE_DLFCN_H 1 545 | 546 | configure: exit 0 547 | -------------------------------------------------------------------------------- /phdfs.c: -------------------------------------------------------------------------------- 1 | /* 2 | +----------------------------------------------------------------------+ 3 | | PHP Version 5 | 4 | +----------------------------------------------------------------------+ 5 | | Copyright (c) 1997-2012 The PHP Group | 6 | +----------------------------------------------------------------------+ 7 | | This source file is subject to version 3.01 of the PHP license, | 8 | | that is bundled with this package in the file LICENSE, and is | 9 | | available through the world-wide-web at the following url: | 10 | | http://www.php.net/license/3_01.txt | 11 | | If you did not receive a copy of the PHP license and are unable to | 12 | | obtain it through the world-wide-web, please send a note to | 13 | | license@php.net so we can mail you a copy immediately. | 14 | +----------------------------------------------------------------------+ 15 | | Authors: yuduan chen | 16 | +----------------------------------------------------------------------+ 17 | */ 18 | 19 | #include "php_phdfs.h" 20 | 21 | #if HAVE_PHDFS 22 | 23 | /* {{{ Class definitions */ 24 | 25 | zend_class_entry *phdfs_ce_ptr; 26 | 27 | static zend_object_handlers phdfs_object_handlers; 28 | typedef int (*php_phdfs_read_t)(ze_phdfs_object *phdfs_object, zval **retval TSRMLS_DC); 29 | typedef int (*php_phdfs_write_t)(ze_phdfs_object *phdfs_object, zval *newval TSRMLS_DC); 30 | 31 | typedef struct _ptp_phdfs_prop_handler { 32 | const char *name; 33 | size_t name_length; 34 | php_phdfs_read_t read_func; 35 | php_phdfs_write_t write_func; 36 | } php_phdfs_prop_handler; 37 | 38 | /* Class object properties */ 39 | static HashTable php_phdfs_properties; 40 | #if PHP_VERSION_ID >= 50400 41 | zval *php_phdfs_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC) { 42 | #else 43 | zval *php_phdfs_read_property(zval *object, zval *member, int type TSRMLS_DC) { 44 | #endif 45 | zval tmp_member; 46 | zval *retval; 47 | ze_phdfs_object *obj; 48 | php_phdfs_prop_handler *hnd; 49 | int ret; 50 | ret = FAILURE; 51 | obj = (ze_phdfs_object *) zend_objects_get_address(object TSRMLS_CC); 52 | if (Z_TYPE_P(member) != IS_STRING) { 53 | tmp_member = *member; 54 | zval_copy_ctor(&tmp_member); 55 | convert_to_string(&tmp_member); 56 | member = &tmp_member; 57 | } 58 | ret = zend_hash_find(&php_phdfs_properties, Z_STRVAL_P(member), Z_STRLEN_P(member) + 1, (void **) &hnd); 59 | if (ret == SUCCESS && hnd->read_func) { 60 | ret = hnd->read_func(obj, &retval TSRMLS_CC); 61 | if (ret == SUCCESS) { 62 | Z_SET_REFCOUNT_P(retval, 0); 63 | } else { 64 | retval = EG(uninitialized_zval_ptr); 65 | } 66 | } else { 67 | zend_object_handlers * std_hnd = zend_get_std_object_handlers(); 68 | #if PHP_VERSION_ID >= 50400 69 | retval = std_hnd->read_property(object, member, type, key TSRMLS_CC); 70 | #else 71 | retval = std_hnd->read_property(object, member, type TSRMLS_CC); 72 | #endif 73 | } 74 | if (member == &tmp_member) { 75 | zval_dtor(member); 76 | } 77 | return (retval); 78 | } 79 | #if PHP_VERSION_ID >= 50400 80 | void php_phdfs_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) { 81 | #else 82 | void php_phdfs_write_property(zval *object, zval *member, zval *value TSRMLS_DC) { 83 | #endif 84 | zval tmp_member; 85 | ze_phdfs_object *obj; 86 | php_phdfs_prop_handler *hnd; 87 | int ret; 88 | if (Z_TYPE_P(member) != IS_STRING) { 89 | tmp_member = *member; 90 | zval_copy_ctor(&tmp_member); 91 | convert_to_string(&tmp_member); 92 | member = &tmp_member; 93 | } 94 | ret = FAILURE; 95 | obj = (ze_phdfs_object *) zend_objects_get_address(object TSRMLS_CC); 96 | ret = zend_hash_find(&php_phdfs_properties, Z_STRVAL_P(member), Z_STRLEN_P(member) + 1, (void **) &hnd); 97 | if (ret == SUCCESS && hnd->write_func) { 98 | hnd->write_func(obj, value TSRMLS_CC); 99 | if (!PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) == 0) { 100 | Z_ADDREF_P(value); 101 | zval_ptr_dtor(&value); 102 | } 103 | } else { 104 | zend_object_handlers * std_hnd = zend_get_std_object_handlers(); 105 | #if PHP_VERSION_ID >= 50400 106 | std_hnd->write_property(object, member, value, key TSRMLS_CC); 107 | #else 108 | std_hnd->write_property(object, member, value TSRMLS_CC); 109 | #endif 110 | } 111 | if (member == &tmp_member) { 112 | zval_dtor(member); 113 | } 114 | } 115 | 116 | static void phdfs_objects_free_storage(void *object TSRMLS_DC) { 117 | ze_phdfs_object *intern = (ze_phdfs_object *) object; 118 | if (!intern) { 119 | return; 120 | } 121 | zend_object_std_dtor(&intern->zo TSRMLS_CC); 122 | efree(intern); 123 | } 124 | 125 | /* }}} */ 126 | #if PHP_VERSION_ID >= 50400 127 | static int php_phdfs_has_property(zval *object, zval *member, int has_set_exists, const zend_literal *key TSRMLS_DC) { 128 | #else 129 | static int php_phdfs_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) { 130 | #endif 131 | 132 | php_phdfs_prop_handler *hnd; 133 | int ret = 0; 134 | if (zend_hash_find(&php_phdfs_properties, Z_STRVAL_P(member), Z_STRLEN_P(member) + 1, (void **) &hnd) == SUCCESS) { 135 | switch (has_set_exists) { 136 | case 2: 137 | ret = 1; 138 | break; 139 | case 0: 140 | { 141 | #if PHP_VERSION_ID >= 50400 142 | zval *value = php_phdfs_read_property(object, member, BP_VAR_IS, key TSRMLS_CC); 143 | #else 144 | zval *value = php_phdfs_read_property(object, member, BP_VAR_IS TSRMLS_CC); 145 | #endif 146 | 147 | if (value != EG(uninitialized_zval_ptr)) { 148 | ret = Z_TYPE_P(value) != IS_NULL ? 1 : 0; 149 | Z_ADDREF_P(value); 150 | zval_ptr_dtor(&value); 151 | } 152 | break; 153 | } 154 | default: 155 | { 156 | #if PHP_VERSION_ID >= 50400 157 | zval *value = php_phdfs_read_property(object, member, BP_VAR_IS, key TSRMLS_CC); 158 | #else 159 | zval *value = php_phdfs_read_property(object, member, BP_VAR_IS TSRMLS_CC); 160 | #endif 161 | if (value != EG(uninitialized_zval_ptr)) { 162 | convert_to_boolean(value); 163 | ret = Z_BVAL_P(value) ? 1 : 0; 164 | Z_ADDREF_P(value); 165 | zval_ptr_dtor(&value); 166 | } 167 | break; 168 | } 169 | } 170 | } else { 171 | zend_object_handlers * std_hnd = zend_get_std_object_handlers(); 172 | #if PHP_VERSION_ID >= 50400 173 | ret = std_hnd->has_property(object, member, has_set_exists, key TSRMLS_CC); 174 | #else 175 | ret = std_hnd->has_property(object, member, has_set_exists TSRMLS_CC); 176 | #endif 177 | 178 | } 179 | return ret; 180 | } 181 | 182 | static HashTable *php_phdfs_get_properties(zval *object TSRMLS_DC) { 183 | ze_phdfs_object *obj; 184 | php_phdfs_prop_handler *hnd; 185 | HashTable *props; 186 | zval *val; 187 | char *key; 188 | uint key_len; 189 | HashPosition pos; 190 | ulong num_key; 191 | obj = (ze_phdfs_object *) zend_objects_get_address(object TSRMLS_CC); 192 | props = zend_std_get_properties(object TSRMLS_CC); 193 | zend_hash_internal_pointer_reset_ex(&php_phdfs_properties, &pos); 194 | while (zend_hash_get_current_data_ex(&php_phdfs_properties, (void**) &hnd, &pos) == SUCCESS) { 195 | zend_hash_get_current_key_ex(&php_phdfs_properties, &key, &key_len, &num_key, 0, &pos); 196 | if (!hnd->read_func || hnd->read_func(obj, &val TSRMLS_CC) != SUCCESS) { 197 | val = EG(uninitialized_zval_ptr); 198 | Z_ADDREF_P(val); 199 | } 200 | zend_hash_update(props, key, key_len, (void *) &val, sizeof (zval *), NULL); 201 | zend_hash_move_forward_ex(&php_phdfs_properties, &pos); 202 | } 203 | return obj->zo.properties; 204 | } 205 | 206 | static zend_object_value phdfs_objects_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ { 207 | zend_object_value retval; 208 | ze_phdfs_object *intern; 209 | intern = emalloc(sizeof (ze_phdfs_object)); 210 | memset(&intern->zo, 0, sizeof (ze_phdfs_object)); 211 | zend_object_std_init(&intern->zo, class_type TSRMLS_CC); 212 | object_properties_init(&intern->zo, class_type); 213 | retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) phdfs_objects_free_storage, NULL TSRMLS_CC); 214 | retval.handlers = (zend_object_handlers *) & phdfs_object_handlers; 215 | return retval; 216 | } 217 | 218 | /* {{{ Methods */ 219 | 220 | /* {{{ proto boolean __construct() 221 | */ 222 | PHP_METHOD(phdfs, __construct) { 223 | zval * _this_zval = NULL; 224 | int hdfs_host_len = 0; 225 | int hdfs_port_len = 0; 226 | char *hdfs_host,*hdfs_port; 227 | zval *id; 228 | id = getThis(); 229 | ze_phdfs_object *intern; 230 | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &hdfs_host,&hdfs_host_len,&hdfs_port,&hdfs_port_len) == FAILURE) { 231 | return; 232 | } 233 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 234 | intern->hdfs_host = hdfs_host; 235 | intern->hdfs_port = hdfs_port; 236 | intern->ptr = NULL; 237 | zend_update_property_string(phdfs_ce_ptr,id,"host",strlen("host"),hdfs_host TSRMLS_CC); 238 | zend_update_property_string(phdfs_ce_ptr,id,"port",strlen("port"),hdfs_port TSRMLS_CC); 239 | } 240 | /* }}} __construct */ 241 | 242 | /* {{{ proto boolean __destruct() 243 | */ 244 | PHP_METHOD(phdfs, __destruct) { 245 | } 246 | /* }}} __destruct */ 247 | 248 | /* {{{ proto boolean connect() 249 | */ 250 | PHP_METHOD(phdfs, connect) { 251 | zval * _this_zval = NULL; 252 | zval *id,*host,*port; 253 | ze_phdfs_object *intern; 254 | id = getThis(); 255 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &_this_zval, _this_zval) == FAILURE) { 256 | return; 257 | } 258 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 259 | host = zend_read_property(Z_OBJCE_P(_this_zval),id, ZEND_STRL("host"),0 TSRMLS_CC); 260 | port = zend_read_property(Z_OBJCE_P(_this_zval),id,ZEND_STRL("port"),0 TSRMLS_CC); 261 | intern->ptr = phdfs_hadoop_hdfs_connect(Z_STRVAL_P(host) ? Z_STRVAL_P(host) : 0, atoi(Z_STRVAL_P(port) ? Z_STRVAL_P(port) : 0)); 262 | if (!intern->ptr) { 263 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 264 | "Unable to connect to the server"); 265 | ZVAL_FALSE(return_value); 266 | return; 267 | } 268 | ZVAL_TRUE(return_value); 269 | return; 270 | } 271 | /* }}} connect */ 272 | 273 | /* {{{ proto mixed write(char* path,char* buffer [, int mode ]) 274 | */ 275 | PHP_METHOD(phdfs, write) { 276 | zval * _this_zval = NULL; 277 | const char * path = NULL; 278 | int path_len = 0; 279 | const char *buffer = NULL; 280 | int buffer_len = 0; 281 | int mode = O_WRONLY | O_CREAT; 282 | int mode_len = 0; 283 | zval *id; 284 | phdfs_hadoop_tsize buffer_size; 285 | phdfs_hadoop_hdfs_file hdfs_file; 286 | ze_phdfs_object *intern; 287 | phdfs_hadoop_tsize num_written_bytes; 288 | id = getThis(); 289 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss|l", &_this_zval, _this_zval, &path, &path_len, &buffer, &buffer_len, &mode, &mode_len) == FAILURE) { 290 | return; 291 | } 292 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 293 | if (!intern->ptr) { 294 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 295 | "Unable to connect to the server"); 296 | ZVAL_FALSE(return_value); 297 | return; 298 | } 299 | buffer_size = strtoul(buffer, NULL, 10); 300 | hdfs_file = phdfs_hadoop_hdfs_open_file(intern->ptr, path, mode, buffer_size, 0, 0); 301 | if (!hdfs_file) { 302 | ZVAL_FALSE(return_value); 303 | return; 304 | } 305 | num_written_bytes = phdfs_hadoop_hdfs_write(intern->ptr, hdfs_file, (void*) buffer, strlen(buffer) + 1); 306 | if (phdfs_hadoop_hdfs_flush(intern->ptr, hdfs_file)) { 307 | ZVAL_FALSE(return_value); 308 | return; 309 | } 310 | phdfs_hadoop_hdfs_close_file(intern->ptr, hdfs_file); 311 | ZVAL_TRUE(return_value); 312 | return; 313 | } 314 | 315 | /* }}} write */ 316 | 317 | /* {{{ proto boolean disconnect() 318 | */ 319 | PHP_METHOD(phdfs, disconnect) { 320 | zval *id; 321 | ze_phdfs_object *intern; 322 | id = getThis(); 323 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 324 | if (!intern->ptr) { 325 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 326 | "Unable to connect to the server"); 327 | ZVAL_FALSE(return_value); 328 | return; 329 | } 330 | if(phdfs_hadoop_hdfs_disconnect(intern->ptr)==0){ 331 | ZVAL_TRUE(return_value); 332 | return; 333 | }else{ 334 | ZVAL_FALSE(return_value); 335 | return; 336 | } 337 | } 338 | /* }}} disconnect */ 339 | 340 | /* {{{ proto boolean exists(char* path) 341 | */ 342 | PHP_METHOD(phdfs, exists) { 343 | zval * _this_zval = NULL; 344 | const char * path = NULL; 345 | int path_len = 0; 346 | int state; 347 | zval *id; 348 | ze_phdfs_object *intern; 349 | id = getThis(); 350 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 351 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &_this_zval, _this_zval, &path, &path_len) == FAILURE) { 352 | return; 353 | } 354 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 355 | if (!intern->ptr) { 356 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 357 | "Unable to connect to the server"); 358 | ZVAL_FALSE(return_value); 359 | return; 360 | } 361 | state = phdfs_hadoop_hdfs_exists(intern->ptr,path); 362 | if (state==0) { 363 | ZVAL_TRUE(return_value); 364 | return; 365 | } 366 | ZVAL_FALSE(return_value); 367 | return; 368 | } 369 | 370 | /* }}} exists */ 371 | 372 | /* {{{ proto boolean create_directory(const char* path) 373 | */ 374 | PHP_METHOD(phdfs, create_directory) { 375 | zval * _this_zval = NULL; 376 | const char * path = NULL; 377 | int path_len = 0; 378 | int state; 379 | zval *id; 380 | ze_phdfs_object *intern; 381 | id = getThis(); 382 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &_this_zval, _this_zval, &path, &path_len) == FAILURE) { 383 | return; 384 | } 385 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 386 | if (!intern->ptr) { 387 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 388 | "Unable to connect to the server"); 389 | ZVAL_FALSE(return_value); 390 | return; 391 | } 392 | state = phdfs_hadoop_hdfs_create_directory(intern->ptr, path); 393 | if (state==0) { 394 | ZVAL_TRUE(return_value); 395 | return; 396 | } 397 | ZVAL_FALSE(return_value); 398 | return; 399 | } 400 | /* }}} create_directory */ 401 | 402 | /* {{{ proto boolean delete(char* path) 403 | */ 404 | PHP_METHOD(phdfs, delete) { 405 | zval * _this_zval = NULL; 406 | const char * path = NULL; 407 | int path_len = 0; 408 | int state; 409 | zval *id; 410 | ze_phdfs_object *intern; 411 | id = getThis(); 412 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &_this_zval, _this_zval, &path, &path_len) == FAILURE) { 413 | return; 414 | } 415 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 416 | if (!intern->ptr) { 417 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 418 | "Unable to connect to the server"); 419 | ZVAL_FALSE(return_value); 420 | return; 421 | } 422 | state = phdfs_hadoop_hdfs_delete(intern->ptr, path); 423 | if (state==0) { 424 | ZVAL_TRUE(return_value); 425 | return; 426 | } 427 | ZVAL_FALSE(return_value); 428 | return; 429 | } 430 | /* }}} delete */ 431 | 432 | /* {{{ proto boolean rename(const char* old_path , const char* new_path) 433 | */ 434 | PHP_METHOD(phdfs, rename) { 435 | zval * _this_zval = NULL; 436 | const char * old_path = NULL; 437 | const char * new_path = NULL; 438 | int old_path_len = 0; 439 | int new_path_len = 0; 440 | int state; 441 | zval *id; 442 | ze_phdfs_object *intern; 443 | id = getThis(); 444 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &_this_zval, _this_zval, &old_path, &old_path_len, &new_path, &new_path_len) == FAILURE) { 445 | return; 446 | } 447 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 448 | if (!intern->ptr) { 449 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 450 | "Unable to connect to the server"); 451 | ZVAL_FALSE(return_value); 452 | return; 453 | } 454 | state = phdfs_hadoop_hdfs_rename(intern->ptr, old_path,new_path); 455 | if (state==0) { 456 | ZVAL_TRUE(return_value); 457 | return; 458 | } 459 | ZVAL_FALSE(return_value); 460 | return; 461 | } 462 | /* }}} rename */ 463 | 464 | /* {{{ proto boolean read(const char* path) 465 | */ 466 | PHP_METHOD(phdfs, read) { 467 | zval * _this_zval = NULL; 468 | const char * path = NULL; 469 | int path_len = 0; 470 | int read_length = 1024; 471 | phdfs_hadoop_hdfs_file hdfs_file; 472 | char* buffer; 473 | zval *id; 474 | ze_phdfs_object *intern; 475 | id = getThis(); 476 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &_this_zval, _this_zval, &path, &path_len, &read_length) == FAILURE) { 477 | return; 478 | } 479 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 480 | if (!intern->ptr) { 481 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 482 | "Unable to connect to the server"); 483 | ZVAL_FALSE(return_value); 484 | return; 485 | } 486 | hdfs_file = phdfs_hadoop_hdfs_open_file(intern->ptr,path,O_RDONLY, read_length, 0, 0); 487 | buffer = emalloc(sizeof(char) * read_length); 488 | phdfs_hadoop_hdfs_read(intern->ptr, hdfs_file, (void*)buffer,read_length); 489 | ZVAL_STRINGL(return_value,buffer,read_length, 1); 490 | efree(buffer); 491 | return; 492 | } 493 | /* }}} read */ 494 | 495 | /* {{{ proto array file_info(const char* path) 496 | */ 497 | PHP_METHOD(phdfs, file_info) { 498 | zval * _this_zval = NULL; 499 | const char * path = NULL; 500 | int path_len = 0; 501 | zval *id; 502 | ze_phdfs_object *intern; 503 | id = getThis(); 504 | phdfs_hadoop_hdfs_file_info *hdfs_file_info = NULL; 505 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &_this_zval, _this_zval, &path, &path_len) == FAILURE) { 506 | return; 507 | } 508 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 509 | if (!intern->ptr) { 510 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 511 | "Unable to connect to the server"); 512 | ZVAL_FALSE(return_value); 513 | return; 514 | } 515 | if((hdfs_file_info = phdfs_hadoop_hdfs_get_path_info(intern->ptr, path)) != NULL) { 516 | array_init(return_value); 517 | add_assoc_string(return_value,"name",hdfs_file_info->mName, 1); 518 | add_assoc_double(return_value,"replication",hdfs_file_info->mReplication); 519 | add_assoc_double(return_value,"blockSize",hdfs_file_info->mBlockSize); 520 | add_assoc_double(return_value,"size",hdfs_file_info->mSize); 521 | add_assoc_string(return_value,"lastMod",ctime(&hdfs_file_info->mLastMod), 1); 522 | add_assoc_string(return_value,"owner",hdfs_file_info->mOwner, 1); 523 | add_assoc_string(return_value,"group",hdfs_file_info->mGroup, 1); 524 | phdfs_hadoop_hdfs_free_file_info(hdfs_file_info, 1); 525 | }else{ 526 | ZVAL_FALSE(return_value); 527 | return; 528 | } 529 | return; 530 | } 531 | /* }}} file_info */ 532 | 533 | /* {{{ proto array list_directory(const char* path) 534 | */ 535 | PHP_METHOD(phdfs, list_directory) { 536 | zval * _this_zval = NULL; 537 | const char * path = NULL; 538 | int path_len = 0; 539 | int level = 0; 540 | zval *subarray; 541 | int i = 0; 542 | zval *id; 543 | ze_phdfs_object *intern; 544 | id = getThis(); 545 | phdfs_hadoop_hdfs_file_info *hdfs_file_info = NULL; 546 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &_this_zval, _this_zval, &path, &path_len, &level) == FAILURE) { 547 | return; 548 | } 549 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 550 | if (!intern->ptr) { 551 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 552 | "Unable to connect to the server"); 553 | ZVAL_FALSE(return_value); 554 | return; 555 | } 556 | if((hdfs_file_info = phdfs_hadoop_hdfs_list_directory(intern->ptr, path,&level)) != NULL) { 557 | array_init(return_value); 558 | for(i=0; i < level; ++i) { 559 | MAKE_STD_ZVAL(subarray); 560 | array_init(subarray); 561 | add_assoc_string(subarray,"name",hdfs_file_info[i].mName, 1); 562 | add_assoc_double(subarray,"replication",hdfs_file_info[i].mReplication); 563 | add_assoc_double(subarray,"blockSize",hdfs_file_info[i].mBlockSize); 564 | add_assoc_double(subarray,"size",hdfs_file_info[i].mSize); 565 | add_assoc_string(subarray,"lastMod",ctime(&hdfs_file_info[i].mLastMod), 1); 566 | add_assoc_string(subarray,"owner",hdfs_file_info[i].mOwner, 1); 567 | add_assoc_string(subarray,"group",hdfs_file_info[i].mGroup, 1); 568 | add_index_zval(return_value,i,subarray); 569 | } 570 | phdfs_hadoop_hdfs_free_file_info(hdfs_file_info,level); 571 | }else{ 572 | ZVAL_FALSE(return_value); 573 | return; 574 | } 575 | return; 576 | } 577 | /* }}} list_directory */ 578 | 579 | /* {{{ proto int tell(const char* path) 580 | */ 581 | PHP_METHOD(phdfs, tell) { 582 | zval * _this_zval = NULL; 583 | const char * path = NULL; 584 | int path_len = 0; 585 | int read_length = 1024; 586 | phdfs_hadoop_hdfs_file hdfs_file; 587 | phdfs_hadoop_toffset current_pos = -1; 588 | phdfs_hadoop_toffset seek_pos = 1; 589 | char* buffer; 590 | zval *id; 591 | ze_phdfs_object *intern; 592 | id = getThis(); 593 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|l", &_this_zval, _this_zval, &path, &path_len, &read_length) == FAILURE) { 594 | return; 595 | } 596 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 597 | if (!intern->ptr) { 598 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 599 | "Unable to connect to the server"); 600 | ZVAL_FALSE(return_value); 601 | return; 602 | } 603 | hdfs_file = phdfs_hadoop_hdfs_open_file(intern->ptr,path,O_RDONLY, read_length, 0, 0); 604 | if((current_pos = phdfs_hadoop_hdfs_tell(intern->ptr,hdfs_file)) != seek_pos) { 605 | ZVAL_LONG(return_value,current_pos); 606 | return; 607 | } 608 | ZVAL_LONG(return_value,current_pos); 609 | return; 610 | } 611 | /* }}} tell */ 612 | 613 | /* {{{ proto boolean copy(const char* source_file,const char* destination_file) 614 | */ 615 | PHP_METHOD(phdfs, copy) { 616 | zval * _this_zval = NULL; 617 | const char *source_file = NULL; 618 | const char *destination_file; 619 | int source_file_len = 0; 620 | int destination_file_len = 0; 621 | phdfs_hadoop_hdfs_file hdfs_file; 622 | zval *id; 623 | ze_phdfs_object *intern; 624 | id = getThis(); 625 | if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oss", &_this_zval, _this_zval, &source_file, &source_file_len, &destination_file, &destination_file_len) == FAILURE) { 626 | return; 627 | } 628 | intern = (ze_phdfs_object *) zend_object_store_get_object(id TSRMLS_CC); 629 | if (!intern->ptr) { 630 | php_error_docref(NULL TSRMLS_CC, E_WARNING, 631 | "Unable to connect to the server"); 632 | ZVAL_FALSE(return_value); 633 | return; 634 | } 635 | if(phdfs_hadoop_hdfs_copy(intern->ptr,source_file,intern->ptr, destination_file) == 0 ) { 636 | ZVAL_TRUE(return_value); 637 | return; 638 | } 639 | ZVAL_FALSE(return_value); 640 | return; 641 | } 642 | 643 | /* }}} copy */ 644 | 645 | static zend_function_entry phdfs_methods[] = { 646 | PHP_ME(phdfs, __construct, phdfs__construct_args, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) 647 | PHP_ME(phdfs, __destruct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_DTOR) 648 | PHP_ME(phdfs, connect, phdfs__connect_args, ZEND_ACC_PUBLIC) 649 | PHP_ME(phdfs, disconnect, phdfs__disconnect_args, ZEND_ACC_PUBLIC) 650 | PHP_ME(phdfs, exists, phdfs__exists_args, ZEND_ACC_PUBLIC) 651 | PHP_ME(phdfs, write, phdfs__write_args, ZEND_ACC_PUBLIC) 652 | PHP_ME(phdfs, read, phdfs__read_args, ZEND_ACC_PUBLIC) 653 | PHP_ME(phdfs, file_info, phdfs__file_info_args, ZEND_ACC_PUBLIC) 654 | PHP_ME(phdfs, create_directory, phdfs__create_directory_args, ZEND_ACC_PUBLIC) 655 | PHP_ME(phdfs, rename, phdfs__rename_args, ZEND_ACC_PUBLIC) 656 | PHP_ME(phdfs, list_directory, phdfs__list_directory_args, ZEND_ACC_PUBLIC) 657 | PHP_ME(phdfs, tell, phdfs__tell_args, ZEND_ACC_PUBLIC) 658 | PHP_ME(phdfs, copy, phdfs__copy_args, ZEND_ACC_PUBLIC) 659 | PHP_ME(phdfs, delete, phdfs__delete_args, ZEND_ACC_PUBLIC) { 660 | NULL, NULL, NULL 661 | } 662 | }; 663 | 664 | /* }}} Class definitions*/ 665 | 666 | /* {{{ phdfs_functions[] */ 667 | zend_function_entry phdfs_functions[] = { 668 | { NULL, NULL, NULL} 669 | }; 670 | /* }}} */ 671 | 672 | 673 | /* {{{ phdfs_module_entry 674 | */ 675 | zend_module_entry phdfs_module_entry = { 676 | STANDARD_MODULE_HEADER, 677 | "phdfs", 678 | phdfs_functions, 679 | PHP_MINIT(phdfs), /* Replace with NULL if there is nothing to do at php startup */ 680 | PHP_MSHUTDOWN(phdfs), /* Replace with NULL if there is nothing to do at php shutdown */ 681 | NULL, 682 | NULL, 683 | PHP_MINFO(phdfs), 684 | PHP_PHDFS_VERSION, 685 | STANDARD_MODULE_PROPERTIES 686 | }; 687 | /* }}} */ 688 | 689 | #ifdef COMPILE_DL_PHDFS 690 | 691 | ZEND_GET_MODULE(phdfs) 692 | #endif 693 | 694 | 695 | /* {{{ PHP_MINIT_FUNCTION */ 696 | PHP_MINIT_FUNCTION(phdfs) { 697 | zend_class_entry ce; 698 | memcpy(&phdfs_object_handlers, zend_get_std_object_handlers(), sizeof (zend_object_handlers)); 699 | phdfs_object_handlers.read_property = php_phdfs_read_property; 700 | phdfs_object_handlers.write_property = php_phdfs_write_property; 701 | phdfs_object_handlers.has_property = php_phdfs_has_property; 702 | phdfs_object_handlers.get_properties = php_phdfs_get_properties; 703 | INIT_CLASS_ENTRY(ce, "phdfs", phdfs_methods); 704 | ce.create_object = phdfs_objects_new; 705 | phdfs_object_handlers.clone_obj = NULL; 706 | phdfs_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC); 707 | zend_declare_property_string(phdfs_ce_ptr, "host", strlen("host"), "127.0.0.1", ZEND_ACC_PUBLIC|ZEND_ACC_STATIC TSRMLS_CC); 708 | zend_declare_property_string(phdfs_ce_ptr, "port", strlen("port"), "9000", ZEND_ACC_PUBLIC|ZEND_ACC_STATIC TSRMLS_CC); 709 | zend_hash_init(&php_phdfs_properties, 0, NULL, NULL, 1); 710 | REGISTER_LONG_CONSTANT("O_WRONLY", O_WRONLY, CONST_CS | CONST_PERSISTENT); 711 | REGISTER_LONG_CONSTANT("O_CREAT", O_CREAT, CONST_CS | CONST_PERSISTENT); 712 | REGISTER_LONG_CONSTANT("O_APPEND", O_APPEND, CONST_CS | CONST_PERSISTENT); 713 | 714 | return SUCCESS; 715 | } 716 | /* }}} */ 717 | 718 | /* {{{ PHP_MSHUTDOWN_FUNCTION */ 719 | PHP_MSHUTDOWN_FUNCTION(phdfs) { 720 | zend_hash_destroy(&php_phdfs_properties); 721 | return SUCCESS; 722 | } 723 | /* }}} */ 724 | 725 | /* {{{ PHP_RINIT_FUNCTION */ 726 | PHP_RINIT_FUNCTION(phdfs) { 727 | return SUCCESS; 728 | } 729 | /* }}} */ 730 | 731 | /* {{{ PHP_RSHUTDOWN_FUNCTION */ 732 | PHP_RSHUTDOWN_FUNCTION(phdfs) { 733 | return SUCCESS; 734 | } 735 | /* }}} */ 736 | 737 | /* {{{ PHP_MINFO_FUNCTION */ 738 | PHP_MINFO_FUNCTION(phdfs) { 739 | php_info_print_table_start(); 740 | php_info_print_table_header(2, "phdfs support", "enabled"); 741 | php_info_print_table_row(2, "Version", PHP_PHDFS_VERSION " (stable)"); 742 | php_info_print_table_end(); 743 | } 744 | /* }}} */ 745 | 746 | #endif /* HAVE_PHDFS */ 747 | 748 | 749 | /* 750 | * Local variables: 751 | * tab-width: 4 752 | * c-basic-offset: 4 753 | * End: 754 | * vim600: noet sw=4 ts=4 fdm=marker 755 | * vim<600: noet sw=4 ts=4 756 | */ 757 | -------------------------------------------------------------------------------- /config.sub: -------------------------------------------------------------------------------- 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, 2009, 2010, 5 | # 2011, 2012, 2013 Free Software Foundation, Inc. 6 | 7 | timestamp='2012-12-23' 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, see . 25 | # 26 | # As a special exception to the GNU General Public License, if you 27 | # distribute this file as part of a program that contains a 28 | # configuration script generated by Autoconf, you may include it under 29 | # the same distribution terms that you use for the rest of that program. 30 | 31 | 32 | # Please send patches to . Submit a context 33 | # diff and a properly formatted GNU ChangeLog entry. 34 | # 35 | # Configuration subroutine to validate and canonicalize a configuration type. 36 | # Supply the specified configuration type as an argument. 37 | # If it is invalid, we print an error message on stderr and exit with code 1. 38 | # Otherwise, we print the canonical config type on stdout and succeed. 39 | 40 | # You can get the latest version of this script from: 41 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 42 | 43 | # This file is supposed to be the same for all GNU packages 44 | # and recognize all the CPU types, system types and aliases 45 | # that are meaningful with *any* GNU software. 46 | # Each package is responsible for reporting which valid configurations 47 | # it does not support. The user should be able to distinguish 48 | # a failure to support a valid configuration from a meaningless 49 | # configuration. 50 | 51 | # The goal of this file is to map all the various variations of a given 52 | # machine specification into a single specification in the form: 53 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM 54 | # or in some cases, the newer four-part form: 55 | # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 56 | # It is wrong to echo any other type of specification. 57 | 58 | me=`echo "$0" | sed -e 's,.*/,,'` 59 | 60 | usage="\ 61 | Usage: $0 [OPTION] CPU-MFR-OPSYS 62 | $0 [OPTION] ALIAS 63 | 64 | Canonicalize a configuration name. 65 | 66 | Operation modes: 67 | -h, --help print this help, then exit 68 | -t, --time-stamp print date of last modification, then exit 69 | -v, --version print version number, then exit 70 | 71 | Report bugs and patches to ." 72 | 73 | version="\ 74 | GNU config.sub ($timestamp) 75 | 76 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 77 | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 78 | 2012, 2013 Free Software Foundation, Inc. 79 | 80 | This is free software; see the source for copying conditions. There is NO 81 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 82 | 83 | help=" 84 | Try \`$me --help' for more information." 85 | 86 | # Parse command line 87 | while test $# -gt 0 ; do 88 | case $1 in 89 | --time-stamp | --time* | -t ) 90 | echo "$timestamp" ; exit ;; 91 | --version | -v ) 92 | echo "$version" ; exit ;; 93 | --help | --h* | -h ) 94 | echo "$usage"; exit ;; 95 | -- ) # Stop option processing 96 | shift; break ;; 97 | - ) # Use stdin as input. 98 | break ;; 99 | -* ) 100 | echo "$me: invalid option $1$help" 101 | exit 1 ;; 102 | 103 | *local*) 104 | # First pass through any local machine types. 105 | echo $1 106 | exit ;; 107 | 108 | * ) 109 | break ;; 110 | esac 111 | done 112 | 113 | case $# in 114 | 0) echo "$me: missing argument$help" >&2 115 | exit 1;; 116 | 1) ;; 117 | *) echo "$me: too many arguments$help" >&2 118 | exit 1;; 119 | esac 120 | 121 | # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). 122 | # Here we must recognize all the valid KERNEL-OS combinations. 123 | maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` 124 | case $maybe_os in 125 | nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ 126 | linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ 127 | knetbsd*-gnu* | netbsd*-gnu* | \ 128 | kopensolaris*-gnu* | \ 129 | storm-chaos* | os2-emx* | rtmk-nova*) 130 | os=-$maybe_os 131 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` 132 | ;; 133 | android-linux) 134 | os=-linux-android 135 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown 136 | ;; 137 | *) 138 | basic_machine=`echo $1 | sed 's/-[^-]*$//'` 139 | if [ $basic_machine != $1 ] 140 | then os=`echo $1 | sed 's/.*-/-/'` 141 | else os=; fi 142 | ;; 143 | esac 144 | 145 | ### Let's recognize common machines as not being operating systems so 146 | ### that things like config.sub decstation-3100 work. We also 147 | ### recognize some manufacturers as not being operating systems, so we 148 | ### can provide default operating systems below. 149 | case $os in 150 | -sun*os*) 151 | # Prevent following clause from handling this invalid input. 152 | ;; 153 | -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ 154 | -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ 155 | -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ 156 | -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ 157 | -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ 158 | -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ 159 | -apple | -axis | -knuth | -cray | -microblaze*) 160 | os= 161 | basic_machine=$1 162 | ;; 163 | -bluegene*) 164 | os=-cnk 165 | ;; 166 | -sim | -cisco | -oki | -wec | -winbond) 167 | os= 168 | basic_machine=$1 169 | ;; 170 | -scout) 171 | ;; 172 | -wrs) 173 | os=-vxworks 174 | basic_machine=$1 175 | ;; 176 | -chorusos*) 177 | os=-chorusos 178 | basic_machine=$1 179 | ;; 180 | -chorusrdb) 181 | os=-chorusrdb 182 | basic_machine=$1 183 | ;; 184 | -hiux*) 185 | os=-hiuxwe2 186 | ;; 187 | -sco6) 188 | os=-sco5v6 189 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 190 | ;; 191 | -sco5) 192 | os=-sco3.2v5 193 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 194 | ;; 195 | -sco4) 196 | os=-sco3.2v4 197 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 198 | ;; 199 | -sco3.2.[4-9]*) 200 | os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` 201 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 202 | ;; 203 | -sco3.2v[4-9]*) 204 | # Don't forget version if it is 3.2v4 or newer. 205 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 206 | ;; 207 | -sco5v6*) 208 | # Don't forget version if it is 3.2v4 or newer. 209 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 210 | ;; 211 | -sco*) 212 | os=-sco3.2v2 213 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 214 | ;; 215 | -udk*) 216 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 217 | ;; 218 | -isc) 219 | os=-isc2.2 220 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 221 | ;; 222 | -clix*) 223 | basic_machine=clipper-intergraph 224 | ;; 225 | -isc*) 226 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 227 | ;; 228 | -lynx*178) 229 | os=-lynxos178 230 | ;; 231 | -lynx*5) 232 | os=-lynxos5 233 | ;; 234 | -lynx*) 235 | os=-lynxos 236 | ;; 237 | -ptx*) 238 | basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` 239 | ;; 240 | -windowsnt*) 241 | os=`echo $os | sed -e 's/windowsnt/winnt/'` 242 | ;; 243 | -psos*) 244 | os=-psos 245 | ;; 246 | -mint | -mint[0-9]*) 247 | basic_machine=m68k-atari 248 | os=-mint 249 | ;; 250 | esac 251 | 252 | # Decode aliases for certain CPU-COMPANY combinations. 253 | case $basic_machine in 254 | # Recognize the basic CPU types without company name. 255 | # Some are omitted here because they have special meanings below. 256 | 1750a | 580 \ 257 | | a29k \ 258 | | aarch64 | aarch64_be \ 259 | | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ 260 | | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ 261 | | am33_2.0 \ 262 | | arc \ 263 | | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ 264 | | avr | avr32 \ 265 | | be32 | be64 \ 266 | | bfin \ 267 | | c4x | clipper \ 268 | | d10v | d30v | dlx | dsp16xx \ 269 | | epiphany \ 270 | | fido | fr30 | frv \ 271 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ 272 | | hexagon \ 273 | | i370 | i860 | i960 | ia64 \ 274 | | ip2k | iq2000 \ 275 | | le32 | le64 \ 276 | | lm32 \ 277 | | m32c | m32r | m32rle | m68000 | m68k | m88k \ 278 | | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ 279 | | mips | mipsbe | mipseb | mipsel | mipsle \ 280 | | mips16 \ 281 | | mips64 | mips64el \ 282 | | mips64octeon | mips64octeonel \ 283 | | mips64orion | mips64orionel \ 284 | | mips64r5900 | mips64r5900el \ 285 | | mips64vr | mips64vrel \ 286 | | mips64vr4100 | mips64vr4100el \ 287 | | mips64vr4300 | mips64vr4300el \ 288 | | mips64vr5000 | mips64vr5000el \ 289 | | mips64vr5900 | mips64vr5900el \ 290 | | mipsisa32 | mipsisa32el \ 291 | | mipsisa32r2 | mipsisa32r2el \ 292 | | mipsisa64 | mipsisa64el \ 293 | | mipsisa64r2 | mipsisa64r2el \ 294 | | mipsisa64sb1 | mipsisa64sb1el \ 295 | | mipsisa64sr71k | mipsisa64sr71kel \ 296 | | mipstx39 | mipstx39el \ 297 | | mn10200 | mn10300 \ 298 | | moxie \ 299 | | mt \ 300 | | msp430 \ 301 | | nds32 | nds32le | nds32be \ 302 | | nios | nios2 \ 303 | | ns16k | ns32k \ 304 | | open8 \ 305 | | or32 \ 306 | | pdp10 | pdp11 | pj | pjl \ 307 | | powerpc | powerpc64 | powerpc64le | powerpcle \ 308 | | pyramid \ 309 | | rl78 | rx \ 310 | | score \ 311 | | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ 312 | | sh64 | sh64le \ 313 | | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ 314 | | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ 315 | | spu \ 316 | | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ 317 | | ubicom32 \ 318 | | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ 319 | | we32k \ 320 | | x86 | xc16x | xstormy16 | xtensa \ 321 | | z8k | z80) 322 | basic_machine=$basic_machine-unknown 323 | ;; 324 | c54x) 325 | basic_machine=tic54x-unknown 326 | ;; 327 | c55x) 328 | basic_machine=tic55x-unknown 329 | ;; 330 | c6x) 331 | basic_machine=tic6x-unknown 332 | ;; 333 | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) 334 | basic_machine=$basic_machine-unknown 335 | os=-none 336 | ;; 337 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) 338 | ;; 339 | ms1) 340 | basic_machine=mt-unknown 341 | ;; 342 | 343 | strongarm | thumb | xscale) 344 | basic_machine=arm-unknown 345 | ;; 346 | xgate) 347 | basic_machine=$basic_machine-unknown 348 | os=-none 349 | ;; 350 | xscaleeb) 351 | basic_machine=armeb-unknown 352 | ;; 353 | 354 | xscaleel) 355 | basic_machine=armel-unknown 356 | ;; 357 | 358 | # We use `pc' rather than `unknown' 359 | # because (1) that's what they normally are, and 360 | # (2) the word "unknown" tends to confuse beginning users. 361 | i*86 | x86_64) 362 | basic_machine=$basic_machine-pc 363 | ;; 364 | # Object if more than one company name word. 365 | *-*-*) 366 | echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 367 | exit 1 368 | ;; 369 | # Recognize the basic CPU types with company name. 370 | 580-* \ 371 | | a29k-* \ 372 | | aarch64-* | aarch64_be-* \ 373 | | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ 374 | | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ 375 | | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ 376 | | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ 377 | | avr-* | avr32-* \ 378 | | be32-* | be64-* \ 379 | | bfin-* | bs2000-* \ 380 | | c[123]* | c30-* | [cjt]90-* | c4x-* \ 381 | | clipper-* | craynv-* | cydra-* \ 382 | | d10v-* | d30v-* | dlx-* \ 383 | | elxsi-* \ 384 | | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ 385 | | h8300-* | h8500-* \ 386 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ 387 | | hexagon-* \ 388 | | i*86-* | i860-* | i960-* | ia64-* \ 389 | | ip2k-* | iq2000-* \ 390 | | le32-* | le64-* \ 391 | | lm32-* \ 392 | | m32c-* | m32r-* | m32rle-* \ 393 | | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ 394 | | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ 395 | | microblaze-* | microblazeel-* \ 396 | | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ 397 | | mips16-* \ 398 | | mips64-* | mips64el-* \ 399 | | mips64octeon-* | mips64octeonel-* \ 400 | | mips64orion-* | mips64orionel-* \ 401 | | mips64r5900-* | mips64r5900el-* \ 402 | | mips64vr-* | mips64vrel-* \ 403 | | mips64vr4100-* | mips64vr4100el-* \ 404 | | mips64vr4300-* | mips64vr4300el-* \ 405 | | mips64vr5000-* | mips64vr5000el-* \ 406 | | mips64vr5900-* | mips64vr5900el-* \ 407 | | mipsisa32-* | mipsisa32el-* \ 408 | | mipsisa32r2-* | mipsisa32r2el-* \ 409 | | mipsisa64-* | mipsisa64el-* \ 410 | | mipsisa64r2-* | mipsisa64r2el-* \ 411 | | mipsisa64sb1-* | mipsisa64sb1el-* \ 412 | | mipsisa64sr71k-* | mipsisa64sr71kel-* \ 413 | | mipstx39-* | mipstx39el-* \ 414 | | mmix-* \ 415 | | mt-* \ 416 | | msp430-* \ 417 | | nds32-* | nds32le-* | nds32be-* \ 418 | | nios-* | nios2-* \ 419 | | none-* | np1-* | ns16k-* | ns32k-* \ 420 | | open8-* \ 421 | | orion-* \ 422 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ 423 | | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ 424 | | pyramid-* \ 425 | | rl78-* | romp-* | rs6000-* | rx-* \ 426 | | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ 427 | | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ 428 | | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ 429 | | sparclite-* \ 430 | | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ 431 | | tahoe-* \ 432 | | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ 433 | | tile*-* \ 434 | | tron-* \ 435 | | ubicom32-* \ 436 | | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ 437 | | vax-* \ 438 | | we32k-* \ 439 | | x86-* | x86_64-* | xc16x-* | xps100-* \ 440 | | xstormy16-* | xtensa*-* \ 441 | | ymp-* \ 442 | | z8k-* | z80-*) 443 | ;; 444 | # Recognize the basic CPU types without company name, with glob match. 445 | xtensa*) 446 | basic_machine=$basic_machine-unknown 447 | ;; 448 | # Recognize the various machine names and aliases which stand 449 | # for a CPU type and a company and sometimes even an OS. 450 | 386bsd) 451 | basic_machine=i386-unknown 452 | os=-bsd 453 | ;; 454 | 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 455 | basic_machine=m68000-att 456 | ;; 457 | 3b*) 458 | basic_machine=we32k-att 459 | ;; 460 | a29khif) 461 | basic_machine=a29k-amd 462 | os=-udi 463 | ;; 464 | abacus) 465 | basic_machine=abacus-unknown 466 | ;; 467 | adobe68k) 468 | basic_machine=m68010-adobe 469 | os=-scout 470 | ;; 471 | alliant | fx80) 472 | basic_machine=fx80-alliant 473 | ;; 474 | altos | altos3068) 475 | basic_machine=m68k-altos 476 | ;; 477 | am29k) 478 | basic_machine=a29k-none 479 | os=-bsd 480 | ;; 481 | amd64) 482 | basic_machine=x86_64-pc 483 | ;; 484 | amd64-*) 485 | basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` 486 | ;; 487 | amdahl) 488 | basic_machine=580-amdahl 489 | os=-sysv 490 | ;; 491 | amiga | amiga-*) 492 | basic_machine=m68k-unknown 493 | ;; 494 | amigaos | amigados) 495 | basic_machine=m68k-unknown 496 | os=-amigaos 497 | ;; 498 | amigaunix | amix) 499 | basic_machine=m68k-unknown 500 | os=-sysv4 501 | ;; 502 | apollo68) 503 | basic_machine=m68k-apollo 504 | os=-sysv 505 | ;; 506 | apollo68bsd) 507 | basic_machine=m68k-apollo 508 | os=-bsd 509 | ;; 510 | aros) 511 | basic_machine=i386-pc 512 | os=-aros 513 | ;; 514 | aux) 515 | basic_machine=m68k-apple 516 | os=-aux 517 | ;; 518 | balance) 519 | basic_machine=ns32k-sequent 520 | os=-dynix 521 | ;; 522 | blackfin) 523 | basic_machine=bfin-unknown 524 | os=-linux 525 | ;; 526 | blackfin-*) 527 | basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` 528 | os=-linux 529 | ;; 530 | bluegene*) 531 | basic_machine=powerpc-ibm 532 | os=-cnk 533 | ;; 534 | c54x-*) 535 | basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` 536 | ;; 537 | c55x-*) 538 | basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` 539 | ;; 540 | c6x-*) 541 | basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` 542 | ;; 543 | c90) 544 | basic_machine=c90-cray 545 | os=-unicos 546 | ;; 547 | cegcc) 548 | basic_machine=arm-unknown 549 | os=-cegcc 550 | ;; 551 | convex-c1) 552 | basic_machine=c1-convex 553 | os=-bsd 554 | ;; 555 | convex-c2) 556 | basic_machine=c2-convex 557 | os=-bsd 558 | ;; 559 | convex-c32) 560 | basic_machine=c32-convex 561 | os=-bsd 562 | ;; 563 | convex-c34) 564 | basic_machine=c34-convex 565 | os=-bsd 566 | ;; 567 | convex-c38) 568 | basic_machine=c38-convex 569 | os=-bsd 570 | ;; 571 | cray | j90) 572 | basic_machine=j90-cray 573 | os=-unicos 574 | ;; 575 | craynv) 576 | basic_machine=craynv-cray 577 | os=-unicosmp 578 | ;; 579 | cr16 | cr16-*) 580 | basic_machine=cr16-unknown 581 | os=-elf 582 | ;; 583 | crds | unos) 584 | basic_machine=m68k-crds 585 | ;; 586 | crisv32 | crisv32-* | etraxfs*) 587 | basic_machine=crisv32-axis 588 | ;; 589 | cris | cris-* | etrax*) 590 | basic_machine=cris-axis 591 | ;; 592 | crx) 593 | basic_machine=crx-unknown 594 | os=-elf 595 | ;; 596 | da30 | da30-*) 597 | basic_machine=m68k-da30 598 | ;; 599 | decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) 600 | basic_machine=mips-dec 601 | ;; 602 | decsystem10* | dec10*) 603 | basic_machine=pdp10-dec 604 | os=-tops10 605 | ;; 606 | decsystem20* | dec20*) 607 | basic_machine=pdp10-dec 608 | os=-tops20 609 | ;; 610 | delta | 3300 | motorola-3300 | motorola-delta \ 611 | | 3300-motorola | delta-motorola) 612 | basic_machine=m68k-motorola 613 | ;; 614 | delta88) 615 | basic_machine=m88k-motorola 616 | os=-sysv3 617 | ;; 618 | dicos) 619 | basic_machine=i686-pc 620 | os=-dicos 621 | ;; 622 | djgpp) 623 | basic_machine=i586-pc 624 | os=-msdosdjgpp 625 | ;; 626 | dpx20 | dpx20-*) 627 | basic_machine=rs6000-bull 628 | os=-bosx 629 | ;; 630 | dpx2* | dpx2*-bull) 631 | basic_machine=m68k-bull 632 | os=-sysv3 633 | ;; 634 | ebmon29k) 635 | basic_machine=a29k-amd 636 | os=-ebmon 637 | ;; 638 | elxsi) 639 | basic_machine=elxsi-elxsi 640 | os=-bsd 641 | ;; 642 | encore | umax | mmax) 643 | basic_machine=ns32k-encore 644 | ;; 645 | es1800 | OSE68k | ose68k | ose | OSE) 646 | basic_machine=m68k-ericsson 647 | os=-ose 648 | ;; 649 | fx2800) 650 | basic_machine=i860-alliant 651 | ;; 652 | genix) 653 | basic_machine=ns32k-ns 654 | ;; 655 | gmicro) 656 | basic_machine=tron-gmicro 657 | os=-sysv 658 | ;; 659 | go32) 660 | basic_machine=i386-pc 661 | os=-go32 662 | ;; 663 | h3050r* | hiux*) 664 | basic_machine=hppa1.1-hitachi 665 | os=-hiuxwe2 666 | ;; 667 | h8300hms) 668 | basic_machine=h8300-hitachi 669 | os=-hms 670 | ;; 671 | h8300xray) 672 | basic_machine=h8300-hitachi 673 | os=-xray 674 | ;; 675 | h8500hms) 676 | basic_machine=h8500-hitachi 677 | os=-hms 678 | ;; 679 | harris) 680 | basic_machine=m88k-harris 681 | os=-sysv3 682 | ;; 683 | hp300-*) 684 | basic_machine=m68k-hp 685 | ;; 686 | hp300bsd) 687 | basic_machine=m68k-hp 688 | os=-bsd 689 | ;; 690 | hp300hpux) 691 | basic_machine=m68k-hp 692 | os=-hpux 693 | ;; 694 | hp3k9[0-9][0-9] | hp9[0-9][0-9]) 695 | basic_machine=hppa1.0-hp 696 | ;; 697 | hp9k2[0-9][0-9] | hp9k31[0-9]) 698 | basic_machine=m68000-hp 699 | ;; 700 | hp9k3[2-9][0-9]) 701 | basic_machine=m68k-hp 702 | ;; 703 | hp9k6[0-9][0-9] | hp6[0-9][0-9]) 704 | basic_machine=hppa1.0-hp 705 | ;; 706 | hp9k7[0-79][0-9] | hp7[0-79][0-9]) 707 | basic_machine=hppa1.1-hp 708 | ;; 709 | hp9k78[0-9] | hp78[0-9]) 710 | # FIXME: really hppa2.0-hp 711 | basic_machine=hppa1.1-hp 712 | ;; 713 | hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) 714 | # FIXME: really hppa2.0-hp 715 | basic_machine=hppa1.1-hp 716 | ;; 717 | hp9k8[0-9][13679] | hp8[0-9][13679]) 718 | basic_machine=hppa1.1-hp 719 | ;; 720 | hp9k8[0-9][0-9] | hp8[0-9][0-9]) 721 | basic_machine=hppa1.0-hp 722 | ;; 723 | hppa-next) 724 | os=-nextstep3 725 | ;; 726 | hppaosf) 727 | basic_machine=hppa1.1-hp 728 | os=-osf 729 | ;; 730 | hppro) 731 | basic_machine=hppa1.1-hp 732 | os=-proelf 733 | ;; 734 | i370-ibm* | ibm*) 735 | basic_machine=i370-ibm 736 | ;; 737 | i*86v32) 738 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 739 | os=-sysv32 740 | ;; 741 | i*86v4*) 742 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 743 | os=-sysv4 744 | ;; 745 | i*86v) 746 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 747 | os=-sysv 748 | ;; 749 | i*86sol2) 750 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 751 | os=-solaris2 752 | ;; 753 | i386mach) 754 | basic_machine=i386-mach 755 | os=-mach 756 | ;; 757 | i386-vsta | vsta) 758 | basic_machine=i386-unknown 759 | os=-vsta 760 | ;; 761 | iris | iris4d) 762 | basic_machine=mips-sgi 763 | case $os in 764 | -irix*) 765 | ;; 766 | *) 767 | os=-irix4 768 | ;; 769 | esac 770 | ;; 771 | isi68 | isi) 772 | basic_machine=m68k-isi 773 | os=-sysv 774 | ;; 775 | m68knommu) 776 | basic_machine=m68k-unknown 777 | os=-linux 778 | ;; 779 | m68knommu-*) 780 | basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` 781 | os=-linux 782 | ;; 783 | m88k-omron*) 784 | basic_machine=m88k-omron 785 | ;; 786 | magnum | m3230) 787 | basic_machine=mips-mips 788 | os=-sysv 789 | ;; 790 | merlin) 791 | basic_machine=ns32k-utek 792 | os=-sysv 793 | ;; 794 | microblaze*) 795 | basic_machine=microblaze-xilinx 796 | ;; 797 | mingw64) 798 | basic_machine=x86_64-pc 799 | os=-mingw64 800 | ;; 801 | mingw32) 802 | basic_machine=i386-pc 803 | os=-mingw32 804 | ;; 805 | mingw32ce) 806 | basic_machine=arm-unknown 807 | os=-mingw32ce 808 | ;; 809 | miniframe) 810 | basic_machine=m68000-convergent 811 | ;; 812 | *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) 813 | basic_machine=m68k-atari 814 | os=-mint 815 | ;; 816 | mips3*-*) 817 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` 818 | ;; 819 | mips3*) 820 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown 821 | ;; 822 | monitor) 823 | basic_machine=m68k-rom68k 824 | os=-coff 825 | ;; 826 | morphos) 827 | basic_machine=powerpc-unknown 828 | os=-morphos 829 | ;; 830 | msdos) 831 | basic_machine=i386-pc 832 | os=-msdos 833 | ;; 834 | ms1-*) 835 | basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` 836 | ;; 837 | msys) 838 | basic_machine=i386-pc 839 | os=-msys 840 | ;; 841 | mvs) 842 | basic_machine=i370-ibm 843 | os=-mvs 844 | ;; 845 | nacl) 846 | basic_machine=le32-unknown 847 | os=-nacl 848 | ;; 849 | ncr3000) 850 | basic_machine=i486-ncr 851 | os=-sysv4 852 | ;; 853 | netbsd386) 854 | basic_machine=i386-unknown 855 | os=-netbsd 856 | ;; 857 | netwinder) 858 | basic_machine=armv4l-rebel 859 | os=-linux 860 | ;; 861 | news | news700 | news800 | news900) 862 | basic_machine=m68k-sony 863 | os=-newsos 864 | ;; 865 | news1000) 866 | basic_machine=m68030-sony 867 | os=-newsos 868 | ;; 869 | news-3600 | risc-news) 870 | basic_machine=mips-sony 871 | os=-newsos 872 | ;; 873 | necv70) 874 | basic_machine=v70-nec 875 | os=-sysv 876 | ;; 877 | next | m*-next ) 878 | basic_machine=m68k-next 879 | case $os in 880 | -nextstep* ) 881 | ;; 882 | -ns2*) 883 | os=-nextstep2 884 | ;; 885 | *) 886 | os=-nextstep3 887 | ;; 888 | esac 889 | ;; 890 | nh3000) 891 | basic_machine=m68k-harris 892 | os=-cxux 893 | ;; 894 | nh[45]000) 895 | basic_machine=m88k-harris 896 | os=-cxux 897 | ;; 898 | nindy960) 899 | basic_machine=i960-intel 900 | os=-nindy 901 | ;; 902 | mon960) 903 | basic_machine=i960-intel 904 | os=-mon960 905 | ;; 906 | nonstopux) 907 | basic_machine=mips-compaq 908 | os=-nonstopux 909 | ;; 910 | np1) 911 | basic_machine=np1-gould 912 | ;; 913 | neo-tandem) 914 | basic_machine=neo-tandem 915 | ;; 916 | nse-tandem) 917 | basic_machine=nse-tandem 918 | ;; 919 | nsr-tandem) 920 | basic_machine=nsr-tandem 921 | ;; 922 | op50n-* | op60c-*) 923 | basic_machine=hppa1.1-oki 924 | os=-proelf 925 | ;; 926 | openrisc | openrisc-*) 927 | basic_machine=or32-unknown 928 | ;; 929 | os400) 930 | basic_machine=powerpc-ibm 931 | os=-os400 932 | ;; 933 | OSE68000 | ose68000) 934 | basic_machine=m68000-ericsson 935 | os=-ose 936 | ;; 937 | os68k) 938 | basic_machine=m68k-none 939 | os=-os68k 940 | ;; 941 | pa-hitachi) 942 | basic_machine=hppa1.1-hitachi 943 | os=-hiuxwe2 944 | ;; 945 | paragon) 946 | basic_machine=i860-intel 947 | os=-osf 948 | ;; 949 | parisc) 950 | basic_machine=hppa-unknown 951 | os=-linux 952 | ;; 953 | parisc-*) 954 | basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` 955 | os=-linux 956 | ;; 957 | pbd) 958 | basic_machine=sparc-tti 959 | ;; 960 | pbb) 961 | basic_machine=m68k-tti 962 | ;; 963 | pc532 | pc532-*) 964 | basic_machine=ns32k-pc532 965 | ;; 966 | pc98) 967 | basic_machine=i386-pc 968 | ;; 969 | pc98-*) 970 | basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` 971 | ;; 972 | pentium | p5 | k5 | k6 | nexgen | viac3) 973 | basic_machine=i586-pc 974 | ;; 975 | pentiumpro | p6 | 6x86 | athlon | athlon_*) 976 | basic_machine=i686-pc 977 | ;; 978 | pentiumii | pentium2 | pentiumiii | pentium3) 979 | basic_machine=i686-pc 980 | ;; 981 | pentium4) 982 | basic_machine=i786-pc 983 | ;; 984 | pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) 985 | basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` 986 | ;; 987 | pentiumpro-* | p6-* | 6x86-* | athlon-*) 988 | basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` 989 | ;; 990 | pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) 991 | basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` 992 | ;; 993 | pentium4-*) 994 | basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` 995 | ;; 996 | pn) 997 | basic_machine=pn-gould 998 | ;; 999 | power) basic_machine=power-ibm 1000 | ;; 1001 | ppc | ppcbe) basic_machine=powerpc-unknown 1002 | ;; 1003 | ppc-* | ppcbe-*) 1004 | basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` 1005 | ;; 1006 | ppcle | powerpclittle | ppc-le | powerpc-little) 1007 | basic_machine=powerpcle-unknown 1008 | ;; 1009 | ppcle-* | powerpclittle-*) 1010 | basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` 1011 | ;; 1012 | ppc64) basic_machine=powerpc64-unknown 1013 | ;; 1014 | ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` 1015 | ;; 1016 | ppc64le | powerpc64little | ppc64-le | powerpc64-little) 1017 | basic_machine=powerpc64le-unknown 1018 | ;; 1019 | ppc64le-* | powerpc64little-*) 1020 | basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` 1021 | ;; 1022 | ps2) 1023 | basic_machine=i386-ibm 1024 | ;; 1025 | pw32) 1026 | basic_machine=i586-unknown 1027 | os=-pw32 1028 | ;; 1029 | rdos | rdos64) 1030 | basic_machine=x86_64-pc 1031 | os=-rdos 1032 | ;; 1033 | rdos32) 1034 | basic_machine=i386-pc 1035 | os=-rdos 1036 | ;; 1037 | rom68k) 1038 | basic_machine=m68k-rom68k 1039 | os=-coff 1040 | ;; 1041 | rm[46]00) 1042 | basic_machine=mips-siemens 1043 | ;; 1044 | rtpc | rtpc-*) 1045 | basic_machine=romp-ibm 1046 | ;; 1047 | s390 | s390-*) 1048 | basic_machine=s390-ibm 1049 | ;; 1050 | s390x | s390x-*) 1051 | basic_machine=s390x-ibm 1052 | ;; 1053 | sa29200) 1054 | basic_machine=a29k-amd 1055 | os=-udi 1056 | ;; 1057 | sb1) 1058 | basic_machine=mipsisa64sb1-unknown 1059 | ;; 1060 | sb1el) 1061 | basic_machine=mipsisa64sb1el-unknown 1062 | ;; 1063 | sde) 1064 | basic_machine=mipsisa32-sde 1065 | os=-elf 1066 | ;; 1067 | sei) 1068 | basic_machine=mips-sei 1069 | os=-seiux 1070 | ;; 1071 | sequent) 1072 | basic_machine=i386-sequent 1073 | ;; 1074 | sh) 1075 | basic_machine=sh-hitachi 1076 | os=-hms 1077 | ;; 1078 | sh5el) 1079 | basic_machine=sh5le-unknown 1080 | ;; 1081 | sh64) 1082 | basic_machine=sh64-unknown 1083 | ;; 1084 | sparclite-wrs | simso-wrs) 1085 | basic_machine=sparclite-wrs 1086 | os=-vxworks 1087 | ;; 1088 | sps7) 1089 | basic_machine=m68k-bull 1090 | os=-sysv2 1091 | ;; 1092 | spur) 1093 | basic_machine=spur-unknown 1094 | ;; 1095 | st2000) 1096 | basic_machine=m68k-tandem 1097 | ;; 1098 | stratus) 1099 | basic_machine=i860-stratus 1100 | os=-sysv4 1101 | ;; 1102 | strongarm-* | thumb-*) 1103 | basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` 1104 | ;; 1105 | sun2) 1106 | basic_machine=m68000-sun 1107 | ;; 1108 | sun2os3) 1109 | basic_machine=m68000-sun 1110 | os=-sunos3 1111 | ;; 1112 | sun2os4) 1113 | basic_machine=m68000-sun 1114 | os=-sunos4 1115 | ;; 1116 | sun3os3) 1117 | basic_machine=m68k-sun 1118 | os=-sunos3 1119 | ;; 1120 | sun3os4) 1121 | basic_machine=m68k-sun 1122 | os=-sunos4 1123 | ;; 1124 | sun4os3) 1125 | basic_machine=sparc-sun 1126 | os=-sunos3 1127 | ;; 1128 | sun4os4) 1129 | basic_machine=sparc-sun 1130 | os=-sunos4 1131 | ;; 1132 | sun4sol2) 1133 | basic_machine=sparc-sun 1134 | os=-solaris2 1135 | ;; 1136 | sun3 | sun3-*) 1137 | basic_machine=m68k-sun 1138 | ;; 1139 | sun4) 1140 | basic_machine=sparc-sun 1141 | ;; 1142 | sun386 | sun386i | roadrunner) 1143 | basic_machine=i386-sun 1144 | ;; 1145 | sv1) 1146 | basic_machine=sv1-cray 1147 | os=-unicos 1148 | ;; 1149 | symmetry) 1150 | basic_machine=i386-sequent 1151 | os=-dynix 1152 | ;; 1153 | t3e) 1154 | basic_machine=alphaev5-cray 1155 | os=-unicos 1156 | ;; 1157 | t90) 1158 | basic_machine=t90-cray 1159 | os=-unicos 1160 | ;; 1161 | tile*) 1162 | basic_machine=$basic_machine-unknown 1163 | os=-linux-gnu 1164 | ;; 1165 | tx39) 1166 | basic_machine=mipstx39-unknown 1167 | ;; 1168 | tx39el) 1169 | basic_machine=mipstx39el-unknown 1170 | ;; 1171 | toad1) 1172 | basic_machine=pdp10-xkl 1173 | os=-tops20 1174 | ;; 1175 | tower | tower-32) 1176 | basic_machine=m68k-ncr 1177 | ;; 1178 | tpf) 1179 | basic_machine=s390x-ibm 1180 | os=-tpf 1181 | ;; 1182 | udi29k) 1183 | basic_machine=a29k-amd 1184 | os=-udi 1185 | ;; 1186 | ultra3) 1187 | basic_machine=a29k-nyu 1188 | os=-sym1 1189 | ;; 1190 | v810 | necv810) 1191 | basic_machine=v810-nec 1192 | os=-none 1193 | ;; 1194 | vaxv) 1195 | basic_machine=vax-dec 1196 | os=-sysv 1197 | ;; 1198 | vms) 1199 | basic_machine=vax-dec 1200 | os=-vms 1201 | ;; 1202 | vpp*|vx|vx-*) 1203 | basic_machine=f301-fujitsu 1204 | ;; 1205 | vxworks960) 1206 | basic_machine=i960-wrs 1207 | os=-vxworks 1208 | ;; 1209 | vxworks68) 1210 | basic_machine=m68k-wrs 1211 | os=-vxworks 1212 | ;; 1213 | vxworks29k) 1214 | basic_machine=a29k-wrs 1215 | os=-vxworks 1216 | ;; 1217 | w65*) 1218 | basic_machine=w65-wdc 1219 | os=-none 1220 | ;; 1221 | w89k-*) 1222 | basic_machine=hppa1.1-winbond 1223 | os=-proelf 1224 | ;; 1225 | xbox) 1226 | basic_machine=i686-pc 1227 | os=-mingw32 1228 | ;; 1229 | xps | xps100) 1230 | basic_machine=xps100-honeywell 1231 | ;; 1232 | xscale-* | xscalee[bl]-*) 1233 | basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` 1234 | ;; 1235 | ymp) 1236 | basic_machine=ymp-cray 1237 | os=-unicos 1238 | ;; 1239 | z8k-*-coff) 1240 | basic_machine=z8k-unknown 1241 | os=-sim 1242 | ;; 1243 | z80-*-coff) 1244 | basic_machine=z80-unknown 1245 | os=-sim 1246 | ;; 1247 | none) 1248 | basic_machine=none-none 1249 | os=-none 1250 | ;; 1251 | 1252 | # Here we handle the default manufacturer of certain CPU types. It is in 1253 | # some cases the only manufacturer, in others, it is the most popular. 1254 | w89k) 1255 | basic_machine=hppa1.1-winbond 1256 | ;; 1257 | op50n) 1258 | basic_machine=hppa1.1-oki 1259 | ;; 1260 | op60c) 1261 | basic_machine=hppa1.1-oki 1262 | ;; 1263 | romp) 1264 | basic_machine=romp-ibm 1265 | ;; 1266 | mmix) 1267 | basic_machine=mmix-knuth 1268 | ;; 1269 | rs6000) 1270 | basic_machine=rs6000-ibm 1271 | ;; 1272 | vax) 1273 | basic_machine=vax-dec 1274 | ;; 1275 | pdp10) 1276 | # there are many clones, so DEC is not a safe bet 1277 | basic_machine=pdp10-unknown 1278 | ;; 1279 | pdp11) 1280 | basic_machine=pdp11-dec 1281 | ;; 1282 | we32k) 1283 | basic_machine=we32k-att 1284 | ;; 1285 | sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) 1286 | basic_machine=sh-unknown 1287 | ;; 1288 | sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) 1289 | basic_machine=sparc-sun 1290 | ;; 1291 | cydra) 1292 | basic_machine=cydra-cydrome 1293 | ;; 1294 | orion) 1295 | basic_machine=orion-highlevel 1296 | ;; 1297 | orion105) 1298 | basic_machine=clipper-highlevel 1299 | ;; 1300 | mac | mpw | mac-mpw) 1301 | basic_machine=m68k-apple 1302 | ;; 1303 | pmac | pmac-mpw) 1304 | basic_machine=powerpc-apple 1305 | ;; 1306 | *-unknown) 1307 | # Make sure to match an already-canonicalized machine name. 1308 | ;; 1309 | *) 1310 | echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 1311 | exit 1 1312 | ;; 1313 | esac 1314 | 1315 | # Here we canonicalize certain aliases for manufacturers. 1316 | case $basic_machine in 1317 | *-digital*) 1318 | basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` 1319 | ;; 1320 | *-commodore*) 1321 | basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` 1322 | ;; 1323 | *) 1324 | ;; 1325 | esac 1326 | 1327 | # Decode manufacturer-specific aliases for certain operating systems. 1328 | 1329 | if [ x"$os" != x"" ] 1330 | then 1331 | case $os in 1332 | # First match some system type aliases 1333 | # that might get confused with valid system types. 1334 | # -solaris* is a basic system type, with this one exception. 1335 | -auroraux) 1336 | os=-auroraux 1337 | ;; 1338 | -solaris1 | -solaris1.*) 1339 | os=`echo $os | sed -e 's|solaris1|sunos4|'` 1340 | ;; 1341 | -solaris) 1342 | os=-solaris2 1343 | ;; 1344 | -svr4*) 1345 | os=-sysv4 1346 | ;; 1347 | -unixware*) 1348 | os=-sysv4.2uw 1349 | ;; 1350 | -gnu/linux*) 1351 | os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` 1352 | ;; 1353 | # First accept the basic system types. 1354 | # The portable systems comes first. 1355 | # Each alternative MUST END IN A *, to match a version number. 1356 | # -sysv* is not here because it comes later, after sysvr4. 1357 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 1358 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ 1359 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ 1360 | | -sym* | -kopensolaris* \ 1361 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 1362 | | -aos* | -aros* \ 1363 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 1364 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ 1365 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ 1366 | | -bitrig* | -openbsd* | -solidbsd* \ 1367 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ 1368 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ 1369 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ 1370 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ 1371 | | -chorusos* | -chorusrdb* | -cegcc* \ 1372 | | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ 1373 | | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ 1374 | | -linux-newlib* | -linux-musl* | -linux-uclibc* \ 1375 | | -uxpv* | -beos* | -mpeix* | -udk* \ 1376 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ 1377 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ 1378 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ 1379 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ 1380 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ 1381 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ 1382 | | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) 1383 | # Remember, each alternative MUST END IN *, to match a version number. 1384 | ;; 1385 | -qnx*) 1386 | case $basic_machine in 1387 | x86-* | i*86-*) 1388 | ;; 1389 | *) 1390 | os=-nto$os 1391 | ;; 1392 | esac 1393 | ;; 1394 | -nto-qnx*) 1395 | ;; 1396 | -nto*) 1397 | os=`echo $os | sed -e 's|nto|nto-qnx|'` 1398 | ;; 1399 | -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ 1400 | | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ 1401 | | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) 1402 | ;; 1403 | -mac*) 1404 | os=`echo $os | sed -e 's|mac|macos|'` 1405 | ;; 1406 | -linux-dietlibc) 1407 | os=-linux-dietlibc 1408 | ;; 1409 | -linux*) 1410 | os=`echo $os | sed -e 's|linux|linux-gnu|'` 1411 | ;; 1412 | -sunos5*) 1413 | os=`echo $os | sed -e 's|sunos5|solaris2|'` 1414 | ;; 1415 | -sunos6*) 1416 | os=`echo $os | sed -e 's|sunos6|solaris3|'` 1417 | ;; 1418 | -opened*) 1419 | os=-openedition 1420 | ;; 1421 | -os400*) 1422 | os=-os400 1423 | ;; 1424 | -wince*) 1425 | os=-wince 1426 | ;; 1427 | -osfrose*) 1428 | os=-osfrose 1429 | ;; 1430 | -osf*) 1431 | os=-osf 1432 | ;; 1433 | -utek*) 1434 | os=-bsd 1435 | ;; 1436 | -dynix*) 1437 | os=-bsd 1438 | ;; 1439 | -acis*) 1440 | os=-aos 1441 | ;; 1442 | -atheos*) 1443 | os=-atheos 1444 | ;; 1445 | -syllable*) 1446 | os=-syllable 1447 | ;; 1448 | -386bsd) 1449 | os=-bsd 1450 | ;; 1451 | -ctix* | -uts*) 1452 | os=-sysv 1453 | ;; 1454 | -nova*) 1455 | os=-rtmk-nova 1456 | ;; 1457 | -ns2 ) 1458 | os=-nextstep2 1459 | ;; 1460 | -nsk*) 1461 | os=-nsk 1462 | ;; 1463 | # Preserve the version number of sinix5. 1464 | -sinix5.*) 1465 | os=`echo $os | sed -e 's|sinix|sysv|'` 1466 | ;; 1467 | -sinix*) 1468 | os=-sysv4 1469 | ;; 1470 | -tpf*) 1471 | os=-tpf 1472 | ;; 1473 | -triton*) 1474 | os=-sysv3 1475 | ;; 1476 | -oss*) 1477 | os=-sysv3 1478 | ;; 1479 | -svr4) 1480 | os=-sysv4 1481 | ;; 1482 | -svr3) 1483 | os=-sysv3 1484 | ;; 1485 | -sysvr4) 1486 | os=-sysv4 1487 | ;; 1488 | # This must come after -sysvr4. 1489 | -sysv*) 1490 | ;; 1491 | -ose*) 1492 | os=-ose 1493 | ;; 1494 | -es1800*) 1495 | os=-ose 1496 | ;; 1497 | -xenix) 1498 | os=-xenix 1499 | ;; 1500 | -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1501 | os=-mint 1502 | ;; 1503 | -aros*) 1504 | os=-aros 1505 | ;; 1506 | -kaos*) 1507 | os=-kaos 1508 | ;; 1509 | -zvmoe) 1510 | os=-zvmoe 1511 | ;; 1512 | -dicos*) 1513 | os=-dicos 1514 | ;; 1515 | -nacl*) 1516 | ;; 1517 | -none) 1518 | ;; 1519 | *) 1520 | # Get rid of the `-' at the beginning of $os. 1521 | os=`echo $os | sed 's/[^-]*-//'` 1522 | echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 1523 | exit 1 1524 | ;; 1525 | esac 1526 | else 1527 | 1528 | # Here we handle the default operating systems that come with various machines. 1529 | # The value should be what the vendor currently ships out the door with their 1530 | # machine or put another way, the most popular os provided with the machine. 1531 | 1532 | # Note that if you're going to try to match "-MANUFACTURER" here (say, 1533 | # "-sun"), then you have to tell the case statement up towards the top 1534 | # that MANUFACTURER isn't an operating system. Otherwise, code above 1535 | # will signal an error saying that MANUFACTURER isn't an operating 1536 | # system, and we'll never get to this point. 1537 | 1538 | case $basic_machine in 1539 | score-*) 1540 | os=-elf 1541 | ;; 1542 | spu-*) 1543 | os=-elf 1544 | ;; 1545 | *-acorn) 1546 | os=-riscix1.2 1547 | ;; 1548 | arm*-rebel) 1549 | os=-linux 1550 | ;; 1551 | arm*-semi) 1552 | os=-aout 1553 | ;; 1554 | c4x-* | tic4x-*) 1555 | os=-coff 1556 | ;; 1557 | hexagon-*) 1558 | os=-elf 1559 | ;; 1560 | tic54x-*) 1561 | os=-coff 1562 | ;; 1563 | tic55x-*) 1564 | os=-coff 1565 | ;; 1566 | tic6x-*) 1567 | os=-coff 1568 | ;; 1569 | # This must come before the *-dec entry. 1570 | pdp10-*) 1571 | os=-tops20 1572 | ;; 1573 | pdp11-*) 1574 | os=-none 1575 | ;; 1576 | *-dec | vax-*) 1577 | os=-ultrix4.2 1578 | ;; 1579 | m68*-apollo) 1580 | os=-domain 1581 | ;; 1582 | i386-sun) 1583 | os=-sunos4.0.2 1584 | ;; 1585 | m68000-sun) 1586 | os=-sunos3 1587 | ;; 1588 | m68*-cisco) 1589 | os=-aout 1590 | ;; 1591 | mep-*) 1592 | os=-elf 1593 | ;; 1594 | mips*-cisco) 1595 | os=-elf 1596 | ;; 1597 | mips*-*) 1598 | os=-elf 1599 | ;; 1600 | or32-*) 1601 | os=-coff 1602 | ;; 1603 | *-tti) # must be before sparc entry or we get the wrong os. 1604 | os=-sysv3 1605 | ;; 1606 | sparc-* | *-sun) 1607 | os=-sunos4.1.1 1608 | ;; 1609 | *-be) 1610 | os=-beos 1611 | ;; 1612 | *-haiku) 1613 | os=-haiku 1614 | ;; 1615 | *-ibm) 1616 | os=-aix 1617 | ;; 1618 | *-knuth) 1619 | os=-mmixware 1620 | ;; 1621 | *-wec) 1622 | os=-proelf 1623 | ;; 1624 | *-winbond) 1625 | os=-proelf 1626 | ;; 1627 | *-oki) 1628 | os=-proelf 1629 | ;; 1630 | *-hp) 1631 | os=-hpux 1632 | ;; 1633 | *-hitachi) 1634 | os=-hiux 1635 | ;; 1636 | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) 1637 | os=-sysv 1638 | ;; 1639 | *-cbm) 1640 | os=-amigaos 1641 | ;; 1642 | *-dg) 1643 | os=-dgux 1644 | ;; 1645 | *-dolphin) 1646 | os=-sysv3 1647 | ;; 1648 | m68k-ccur) 1649 | os=-rtu 1650 | ;; 1651 | m88k-omron*) 1652 | os=-luna 1653 | ;; 1654 | *-next ) 1655 | os=-nextstep 1656 | ;; 1657 | *-sequent) 1658 | os=-ptx 1659 | ;; 1660 | *-crds) 1661 | os=-unos 1662 | ;; 1663 | *-ns) 1664 | os=-genix 1665 | ;; 1666 | i370-*) 1667 | os=-mvs 1668 | ;; 1669 | *-next) 1670 | os=-nextstep3 1671 | ;; 1672 | *-gould) 1673 | os=-sysv 1674 | ;; 1675 | *-highlevel) 1676 | os=-bsd 1677 | ;; 1678 | *-encore) 1679 | os=-bsd 1680 | ;; 1681 | *-sgi) 1682 | os=-irix 1683 | ;; 1684 | *-siemens) 1685 | os=-sysv4 1686 | ;; 1687 | *-masscomp) 1688 | os=-rtu 1689 | ;; 1690 | f30[01]-fujitsu | f700-fujitsu) 1691 | os=-uxpv 1692 | ;; 1693 | *-rom68k) 1694 | os=-coff 1695 | ;; 1696 | *-*bug) 1697 | os=-coff 1698 | ;; 1699 | *-apple) 1700 | os=-macos 1701 | ;; 1702 | *-atari*) 1703 | os=-mint 1704 | ;; 1705 | *) 1706 | os=-none 1707 | ;; 1708 | esac 1709 | fi 1710 | 1711 | # Here we handle the case where we know the os, and the CPU type, but not the 1712 | # manufacturer. We pick the logical manufacturer. 1713 | vendor=unknown 1714 | case $basic_machine in 1715 | *-unknown) 1716 | case $os in 1717 | -riscix*) 1718 | vendor=acorn 1719 | ;; 1720 | -sunos*) 1721 | vendor=sun 1722 | ;; 1723 | -cnk*|-aix*) 1724 | vendor=ibm 1725 | ;; 1726 | -beos*) 1727 | vendor=be 1728 | ;; 1729 | -hpux*) 1730 | vendor=hp 1731 | ;; 1732 | -mpeix*) 1733 | vendor=hp 1734 | ;; 1735 | -hiux*) 1736 | vendor=hitachi 1737 | ;; 1738 | -unos*) 1739 | vendor=crds 1740 | ;; 1741 | -dgux*) 1742 | vendor=dg 1743 | ;; 1744 | -luna*) 1745 | vendor=omron 1746 | ;; 1747 | -genix*) 1748 | vendor=ns 1749 | ;; 1750 | -mvs* | -opened*) 1751 | vendor=ibm 1752 | ;; 1753 | -os400*) 1754 | vendor=ibm 1755 | ;; 1756 | -ptx*) 1757 | vendor=sequent 1758 | ;; 1759 | -tpf*) 1760 | vendor=ibm 1761 | ;; 1762 | -vxsim* | -vxworks* | -windiss*) 1763 | vendor=wrs 1764 | ;; 1765 | -aux*) 1766 | vendor=apple 1767 | ;; 1768 | -hms*) 1769 | vendor=hitachi 1770 | ;; 1771 | -mpw* | -macos*) 1772 | vendor=apple 1773 | ;; 1774 | -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1775 | vendor=atari 1776 | ;; 1777 | -vos*) 1778 | vendor=stratus 1779 | ;; 1780 | esac 1781 | basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` 1782 | ;; 1783 | esac 1784 | 1785 | echo $basic_machine$os 1786 | exit 1787 | 1788 | # Local variables: 1789 | # eval: (add-hook 'write-file-hooks 'time-stamp) 1790 | # time-stamp-start: "timestamp='" 1791 | # time-stamp-format: "%:y-%02m-%02d" 1792 | # time-stamp-end: "'" 1793 | # End: 1794 | -------------------------------------------------------------------------------- /config.guess: -------------------------------------------------------------------------------- 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, 2009, 2010, 5 | # 2011, 2012, 2013 Free Software Foundation, Inc. 6 | 7 | timestamp='2012-12-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, see . 21 | # 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | 28 | # Originally written by Per Bothner. Please send patches (context 29 | # diff format) to and include a ChangeLog 30 | # entry. 31 | # 32 | # This script attempts to guess a canonical system name similar to 33 | # config.sub. If it succeeds, it prints the system name on stdout, and 34 | # exits with 0. Otherwise, it exits with 1. 35 | # 36 | # You can get the latest version of this script from: 37 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 38 | 39 | me=`echo "$0" | sed -e 's,.*/,,'` 40 | 41 | usage="\ 42 | Usage: $0 [OPTION] 43 | 44 | Output the configuration name of the system \`$me' is run on. 45 | 46 | Operation modes: 47 | -h, --help print this help, then exit 48 | -t, --time-stamp print date of last modification, then exit 49 | -v, --version print version number, then exit 50 | 51 | Report bugs and patches to ." 52 | 53 | version="\ 54 | GNU config.guess ($timestamp) 55 | 56 | Originally written by Per Bothner. 57 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 58 | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 59 | 2012, 2013 Free Software Foundation, Inc. 60 | 61 | This is free software; see the source for copying conditions. There is NO 62 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 63 | 64 | help=" 65 | Try \`$me --help' for more information." 66 | 67 | # Parse command line 68 | while test $# -gt 0 ; do 69 | case $1 in 70 | --time-stamp | --time* | -t ) 71 | echo "$timestamp" ; exit ;; 72 | --version | -v ) 73 | echo "$version" ; exit ;; 74 | --help | --h* | -h ) 75 | echo "$usage"; exit ;; 76 | -- ) # Stop option processing 77 | shift; break ;; 78 | - ) # Use stdin as input. 79 | break ;; 80 | -* ) 81 | echo "$me: invalid option $1$help" >&2 82 | exit 1 ;; 83 | * ) 84 | break ;; 85 | esac 86 | done 87 | 88 | if test $# != 0; then 89 | echo "$me: too many arguments$help" >&2 90 | exit 1 91 | fi 92 | 93 | trap 'exit 1' 1 2 15 94 | 95 | # CC_FOR_BUILD -- compiler used by this script. Note that the use of a 96 | # compiler to aid in system detection is discouraged as it requires 97 | # temporary files to be created and, as you can see below, it is a 98 | # headache to deal with in a portable fashion. 99 | 100 | # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 101 | # use `HOST_CC' if defined, but it is deprecated. 102 | 103 | # Portable tmp directory creation inspired by the Autoconf team. 104 | 105 | set_cc_for_build=' 106 | trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 107 | trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 108 | : ${TMPDIR=/tmp} ; 109 | { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 110 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 111 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 112 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 113 | dummy=$tmp/dummy ; 114 | tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 115 | case $CC_FOR_BUILD,$HOST_CC,$CC in 116 | ,,) echo "int x;" > $dummy.c ; 117 | for c in cc gcc c89 c99 ; do 118 | if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 119 | CC_FOR_BUILD="$c"; break ; 120 | fi ; 121 | done ; 122 | if test x"$CC_FOR_BUILD" = x ; then 123 | CC_FOR_BUILD=no_compiler_found ; 124 | fi 125 | ;; 126 | ,,*) CC_FOR_BUILD=$CC ;; 127 | ,*,*) CC_FOR_BUILD=$HOST_CC ;; 128 | esac ; set_cc_for_build= ;' 129 | 130 | # This is needed to find uname on a Pyramid OSx when run in the BSD universe. 131 | # (ghazi@noc.rutgers.edu 1994-08-24) 132 | if (test -f /.attbin/uname) >/dev/null 2>&1 ; then 133 | PATH=$PATH:/.attbin ; export PATH 134 | fi 135 | 136 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 137 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 138 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 139 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 140 | 141 | # Note: order is significant - the case branches are not exclusive. 142 | 143 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 144 | *:NetBSD:*:*) 145 | # NetBSD (nbsd) targets should (where applicable) match one or 146 | # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 147 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 148 | # switched to ELF, *-*-netbsd* would select the old 149 | # object file format. This provides both forward 150 | # compatibility and a consistent mechanism for selecting the 151 | # object file format. 152 | # 153 | # Note: NetBSD doesn't particularly care about the vendor 154 | # portion of the name. We always set it to "unknown". 155 | sysctl="sysctl -n hw.machine_arch" 156 | UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 157 | /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 158 | case "${UNAME_MACHINE_ARCH}" in 159 | armeb) machine=armeb-unknown ;; 160 | arm*) machine=arm-unknown ;; 161 | sh3el) machine=shl-unknown ;; 162 | sh3eb) machine=sh-unknown ;; 163 | sh5el) machine=sh5le-unknown ;; 164 | *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 165 | esac 166 | # The Operating System including object format, if it has switched 167 | # to ELF recently, or will in the future. 168 | case "${UNAME_MACHINE_ARCH}" in 169 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) 170 | eval $set_cc_for_build 171 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 172 | | grep -q __ELF__ 173 | then 174 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 175 | # Return netbsd for either. FIX? 176 | os=netbsd 177 | else 178 | os=netbsdelf 179 | fi 180 | ;; 181 | *) 182 | os=netbsd 183 | ;; 184 | esac 185 | # The OS release 186 | # Debian GNU/NetBSD machines have a different userland, and 187 | # thus, need a distinct triplet. However, they do not need 188 | # kernel version information, so it can be replaced with a 189 | # suitable tag, in the style of linux-gnu. 190 | case "${UNAME_VERSION}" in 191 | Debian*) 192 | release='-gnu' 193 | ;; 194 | *) 195 | release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 196 | ;; 197 | esac 198 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 199 | # contains redundant information, the shorter form: 200 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 201 | echo "${machine}-${os}${release}" 202 | exit ;; 203 | *:Bitrig:*:*) 204 | UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 205 | echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} 206 | exit ;; 207 | *:OpenBSD:*:*) 208 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 209 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 210 | exit ;; 211 | *:ekkoBSD:*:*) 212 | echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 213 | exit ;; 214 | *:SolidBSD:*:*) 215 | echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 216 | exit ;; 217 | macppc:MirBSD:*:*) 218 | echo powerpc-unknown-mirbsd${UNAME_RELEASE} 219 | exit ;; 220 | *:MirBSD:*:*) 221 | echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 222 | exit ;; 223 | alpha:OSF1:*:*) 224 | case $UNAME_RELEASE in 225 | *4.0) 226 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 227 | ;; 228 | *5.*) 229 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 230 | ;; 231 | esac 232 | # According to Compaq, /usr/sbin/psrinfo has been available on 233 | # OSF/1 and Tru64 systems produced since 1995. I hope that 234 | # covers most systems running today. This code pipes the CPU 235 | # types through head -n 1, so we only detect the type of CPU 0. 236 | ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 237 | case "$ALPHA_CPU_TYPE" in 238 | "EV4 (21064)") 239 | UNAME_MACHINE="alpha" ;; 240 | "EV4.5 (21064)") 241 | UNAME_MACHINE="alpha" ;; 242 | "LCA4 (21066/21068)") 243 | UNAME_MACHINE="alpha" ;; 244 | "EV5 (21164)") 245 | UNAME_MACHINE="alphaev5" ;; 246 | "EV5.6 (21164A)") 247 | UNAME_MACHINE="alphaev56" ;; 248 | "EV5.6 (21164PC)") 249 | UNAME_MACHINE="alphapca56" ;; 250 | "EV5.7 (21164PC)") 251 | UNAME_MACHINE="alphapca57" ;; 252 | "EV6 (21264)") 253 | UNAME_MACHINE="alphaev6" ;; 254 | "EV6.7 (21264A)") 255 | UNAME_MACHINE="alphaev67" ;; 256 | "EV6.8CB (21264C)") 257 | UNAME_MACHINE="alphaev68" ;; 258 | "EV6.8AL (21264B)") 259 | UNAME_MACHINE="alphaev68" ;; 260 | "EV6.8CX (21264D)") 261 | UNAME_MACHINE="alphaev68" ;; 262 | "EV6.9A (21264/EV69A)") 263 | UNAME_MACHINE="alphaev69" ;; 264 | "EV7 (21364)") 265 | UNAME_MACHINE="alphaev7" ;; 266 | "EV7.9 (21364A)") 267 | UNAME_MACHINE="alphaev79" ;; 268 | esac 269 | # A Pn.n version is a patched version. 270 | # A Vn.n version is a released version. 271 | # A Tn.n version is a released field test version. 272 | # A Xn.n version is an unreleased experimental baselevel. 273 | # 1.2 uses "1.2" for uname -r. 274 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 275 | # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 276 | exitcode=$? 277 | trap '' 0 278 | exit $exitcode ;; 279 | Alpha\ *:Windows_NT*:*) 280 | # How do we know it's Interix rather than the generic POSIX subsystem? 281 | # Should we change UNAME_MACHINE based on the output of uname instead 282 | # of the specific Alpha model? 283 | echo alpha-pc-interix 284 | exit ;; 285 | 21064:Windows_NT:50:3) 286 | echo alpha-dec-winnt3.5 287 | exit ;; 288 | Amiga*:UNIX_System_V:4.0:*) 289 | echo m68k-unknown-sysv4 290 | exit ;; 291 | *:[Aa]miga[Oo][Ss]:*:*) 292 | echo ${UNAME_MACHINE}-unknown-amigaos 293 | exit ;; 294 | *:[Mm]orph[Oo][Ss]:*:*) 295 | echo ${UNAME_MACHINE}-unknown-morphos 296 | exit ;; 297 | *:OS/390:*:*) 298 | echo i370-ibm-openedition 299 | exit ;; 300 | *:z/VM:*:*) 301 | echo s390-ibm-zvmoe 302 | exit ;; 303 | *:OS400:*:*) 304 | echo powerpc-ibm-os400 305 | exit ;; 306 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 307 | echo arm-acorn-riscix${UNAME_RELEASE} 308 | exit ;; 309 | arm*:riscos:*:*|arm*:RISCOS:*:*) 310 | echo arm-unknown-riscos 311 | exit ;; 312 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 313 | echo hppa1.1-hitachi-hiuxmpp 314 | exit ;; 315 | Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 316 | # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 317 | if test "`(/bin/universe) 2>/dev/null`" = att ; then 318 | echo pyramid-pyramid-sysv3 319 | else 320 | echo pyramid-pyramid-bsd 321 | fi 322 | exit ;; 323 | NILE*:*:*:dcosx) 324 | echo pyramid-pyramid-svr4 325 | exit ;; 326 | DRS?6000:unix:4.0:6*) 327 | echo sparc-icl-nx6 328 | exit ;; 329 | DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 330 | case `/usr/bin/uname -p` in 331 | sparc) echo sparc-icl-nx7; exit ;; 332 | esac ;; 333 | s390x:SunOS:*:*) 334 | echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 335 | exit ;; 336 | sun4H:SunOS:5.*:*) 337 | echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 338 | exit ;; 339 | sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 340 | echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 341 | exit ;; 342 | i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 343 | echo i386-pc-auroraux${UNAME_RELEASE} 344 | exit ;; 345 | i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 346 | eval $set_cc_for_build 347 | SUN_ARCH="i386" 348 | # If there is a compiler, see if it is configured for 64-bit objects. 349 | # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 350 | # This test works for both compilers. 351 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 352 | if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 353 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 354 | grep IS_64BIT_ARCH >/dev/null 355 | then 356 | SUN_ARCH="x86_64" 357 | fi 358 | fi 359 | echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 360 | exit ;; 361 | sun4*:SunOS:6*:*) 362 | # According to config.sub, this is the proper way to canonicalize 363 | # SunOS6. Hard to guess exactly what SunOS6 will be like, but 364 | # it's likely to be more like Solaris than SunOS4. 365 | echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 366 | exit ;; 367 | sun4*:SunOS:*:*) 368 | case "`/usr/bin/arch -k`" in 369 | Series*|S4*) 370 | UNAME_RELEASE=`uname -v` 371 | ;; 372 | esac 373 | # Japanese Language versions have a version number like `4.1.3-JL'. 374 | echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 375 | exit ;; 376 | sun3*:SunOS:*:*) 377 | echo m68k-sun-sunos${UNAME_RELEASE} 378 | exit ;; 379 | sun*:*:4.2BSD:*) 380 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 381 | test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 382 | case "`/bin/arch`" in 383 | sun3) 384 | echo m68k-sun-sunos${UNAME_RELEASE} 385 | ;; 386 | sun4) 387 | echo sparc-sun-sunos${UNAME_RELEASE} 388 | ;; 389 | esac 390 | exit ;; 391 | aushp:SunOS:*:*) 392 | echo sparc-auspex-sunos${UNAME_RELEASE} 393 | exit ;; 394 | # The situation for MiNT is a little confusing. The machine name 395 | # can be virtually everything (everything which is not 396 | # "atarist" or "atariste" at least should have a processor 397 | # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 398 | # to the lowercase version "mint" (or "freemint"). Finally 399 | # the system name "TOS" denotes a system which is actually not 400 | # MiNT. But MiNT is downward compatible to TOS, so this should 401 | # be no problem. 402 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 403 | echo m68k-atari-mint${UNAME_RELEASE} 404 | exit ;; 405 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 406 | echo m68k-atari-mint${UNAME_RELEASE} 407 | exit ;; 408 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 409 | echo m68k-atari-mint${UNAME_RELEASE} 410 | exit ;; 411 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 412 | echo m68k-milan-mint${UNAME_RELEASE} 413 | exit ;; 414 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 415 | echo m68k-hades-mint${UNAME_RELEASE} 416 | exit ;; 417 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 418 | echo m68k-unknown-mint${UNAME_RELEASE} 419 | exit ;; 420 | m68k:machten:*:*) 421 | echo m68k-apple-machten${UNAME_RELEASE} 422 | exit ;; 423 | powerpc:machten:*:*) 424 | echo powerpc-apple-machten${UNAME_RELEASE} 425 | exit ;; 426 | RISC*:Mach:*:*) 427 | echo mips-dec-mach_bsd4.3 428 | exit ;; 429 | RISC*:ULTRIX:*:*) 430 | echo mips-dec-ultrix${UNAME_RELEASE} 431 | exit ;; 432 | VAX*:ULTRIX*:*:*) 433 | echo vax-dec-ultrix${UNAME_RELEASE} 434 | exit ;; 435 | 2020:CLIX:*:* | 2430:CLIX:*:*) 436 | echo clipper-intergraph-clix${UNAME_RELEASE} 437 | exit ;; 438 | mips:*:*:UMIPS | mips:*:*:RISCos) 439 | eval $set_cc_for_build 440 | sed 's/^ //' << EOF >$dummy.c 441 | #ifdef __cplusplus 442 | #include /* for printf() prototype */ 443 | int main (int argc, char *argv[]) { 444 | #else 445 | int main (argc, argv) int argc; char *argv[]; { 446 | #endif 447 | #if defined (host_mips) && defined (MIPSEB) 448 | #if defined (SYSTYPE_SYSV) 449 | printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 450 | #endif 451 | #if defined (SYSTYPE_SVR4) 452 | printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 453 | #endif 454 | #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 455 | printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 456 | #endif 457 | #endif 458 | exit (-1); 459 | } 460 | EOF 461 | $CC_FOR_BUILD -o $dummy $dummy.c && 462 | dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 463 | SYSTEM_NAME=`$dummy $dummyarg` && 464 | { echo "$SYSTEM_NAME"; exit; } 465 | echo mips-mips-riscos${UNAME_RELEASE} 466 | exit ;; 467 | Motorola:PowerMAX_OS:*:*) 468 | echo powerpc-motorola-powermax 469 | exit ;; 470 | Motorola:*:4.3:PL8-*) 471 | echo powerpc-harris-powermax 472 | exit ;; 473 | Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 474 | echo powerpc-harris-powermax 475 | exit ;; 476 | Night_Hawk:Power_UNIX:*:*) 477 | echo powerpc-harris-powerunix 478 | exit ;; 479 | m88k:CX/UX:7*:*) 480 | echo m88k-harris-cxux7 481 | exit ;; 482 | m88k:*:4*:R4*) 483 | echo m88k-motorola-sysv4 484 | exit ;; 485 | m88k:*:3*:R3*) 486 | echo m88k-motorola-sysv3 487 | exit ;; 488 | AViiON:dgux:*:*) 489 | # DG/UX returns AViiON for all architectures 490 | UNAME_PROCESSOR=`/usr/bin/uname -p` 491 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 492 | then 493 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 494 | [ ${TARGET_BINARY_INTERFACE}x = x ] 495 | then 496 | echo m88k-dg-dgux${UNAME_RELEASE} 497 | else 498 | echo m88k-dg-dguxbcs${UNAME_RELEASE} 499 | fi 500 | else 501 | echo i586-dg-dgux${UNAME_RELEASE} 502 | fi 503 | exit ;; 504 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) 505 | echo m88k-dolphin-sysv3 506 | exit ;; 507 | M88*:*:R3*:*) 508 | # Delta 88k system running SVR3 509 | echo m88k-motorola-sysv3 510 | exit ;; 511 | XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 512 | echo m88k-tektronix-sysv3 513 | exit ;; 514 | Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 515 | echo m68k-tektronix-bsd 516 | exit ;; 517 | *:IRIX*:*:*) 518 | echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 519 | exit ;; 520 | ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 521 | echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 522 | exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 523 | i*86:AIX:*:*) 524 | echo i386-ibm-aix 525 | exit ;; 526 | ia64:AIX:*:*) 527 | if [ -x /usr/bin/oslevel ] ; then 528 | IBM_REV=`/usr/bin/oslevel` 529 | else 530 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 531 | fi 532 | echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 533 | exit ;; 534 | *:AIX:2:3) 535 | if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 536 | eval $set_cc_for_build 537 | sed 's/^ //' << EOF >$dummy.c 538 | #include 539 | 540 | main() 541 | { 542 | if (!__power_pc()) 543 | exit(1); 544 | puts("powerpc-ibm-aix3.2.5"); 545 | exit(0); 546 | } 547 | EOF 548 | if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 549 | then 550 | echo "$SYSTEM_NAME" 551 | else 552 | echo rs6000-ibm-aix3.2.5 553 | fi 554 | elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 555 | echo rs6000-ibm-aix3.2.4 556 | else 557 | echo rs6000-ibm-aix3.2 558 | fi 559 | exit ;; 560 | *:AIX:*:[4567]) 561 | IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 562 | if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 563 | IBM_ARCH=rs6000 564 | else 565 | IBM_ARCH=powerpc 566 | fi 567 | if [ -x /usr/bin/oslevel ] ; then 568 | IBM_REV=`/usr/bin/oslevel` 569 | else 570 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 571 | fi 572 | echo ${IBM_ARCH}-ibm-aix${IBM_REV} 573 | exit ;; 574 | *:AIX:*:*) 575 | echo rs6000-ibm-aix 576 | exit ;; 577 | ibmrt:4.4BSD:*|romp-ibm:BSD:*) 578 | echo romp-ibm-bsd4.4 579 | exit ;; 580 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 581 | echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 582 | exit ;; # report: romp-ibm BSD 4.3 583 | *:BOSX:*:*) 584 | echo rs6000-bull-bosx 585 | exit ;; 586 | DPX/2?00:B.O.S.:*:*) 587 | echo m68k-bull-sysv3 588 | exit ;; 589 | 9000/[34]??:4.3bsd:1.*:*) 590 | echo m68k-hp-bsd 591 | exit ;; 592 | hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 593 | echo m68k-hp-bsd4.4 594 | exit ;; 595 | 9000/[34678]??:HP-UX:*:*) 596 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 597 | case "${UNAME_MACHINE}" in 598 | 9000/31? ) HP_ARCH=m68000 ;; 599 | 9000/[34]?? ) HP_ARCH=m68k ;; 600 | 9000/[678][0-9][0-9]) 601 | if [ -x /usr/bin/getconf ]; then 602 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 603 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 604 | case "${sc_cpu_version}" in 605 | 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 606 | 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 607 | 532) # CPU_PA_RISC2_0 608 | case "${sc_kernel_bits}" in 609 | 32) HP_ARCH="hppa2.0n" ;; 610 | 64) HP_ARCH="hppa2.0w" ;; 611 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 612 | esac ;; 613 | esac 614 | fi 615 | if [ "${HP_ARCH}" = "" ]; then 616 | eval $set_cc_for_build 617 | sed 's/^ //' << EOF >$dummy.c 618 | 619 | #define _HPUX_SOURCE 620 | #include 621 | #include 622 | 623 | int main () 624 | { 625 | #if defined(_SC_KERNEL_BITS) 626 | long bits = sysconf(_SC_KERNEL_BITS); 627 | #endif 628 | long cpu = sysconf (_SC_CPU_VERSION); 629 | 630 | switch (cpu) 631 | { 632 | case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 633 | case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 634 | case CPU_PA_RISC2_0: 635 | #if defined(_SC_KERNEL_BITS) 636 | switch (bits) 637 | { 638 | case 64: puts ("hppa2.0w"); break; 639 | case 32: puts ("hppa2.0n"); break; 640 | default: puts ("hppa2.0"); break; 641 | } break; 642 | #else /* !defined(_SC_KERNEL_BITS) */ 643 | puts ("hppa2.0"); break; 644 | #endif 645 | default: puts ("hppa1.0"); break; 646 | } 647 | exit (0); 648 | } 649 | EOF 650 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 651 | test -z "$HP_ARCH" && HP_ARCH=hppa 652 | fi ;; 653 | esac 654 | if [ ${HP_ARCH} = "hppa2.0w" ] 655 | then 656 | eval $set_cc_for_build 657 | 658 | # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 659 | # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 660 | # generating 64-bit code. GNU and HP use different nomenclature: 661 | # 662 | # $ CC_FOR_BUILD=cc ./config.guess 663 | # => hppa2.0w-hp-hpux11.23 664 | # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 665 | # => hppa64-hp-hpux11.23 666 | 667 | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 668 | grep -q __LP64__ 669 | then 670 | HP_ARCH="hppa2.0w" 671 | else 672 | HP_ARCH="hppa64" 673 | fi 674 | fi 675 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} 676 | exit ;; 677 | ia64:HP-UX:*:*) 678 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 679 | echo ia64-hp-hpux${HPUX_REV} 680 | exit ;; 681 | 3050*:HI-UX:*:*) 682 | eval $set_cc_for_build 683 | sed 's/^ //' << EOF >$dummy.c 684 | #include 685 | int 686 | main () 687 | { 688 | long cpu = sysconf (_SC_CPU_VERSION); 689 | /* The order matters, because CPU_IS_HP_MC68K erroneously returns 690 | true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 691 | results, however. */ 692 | if (CPU_IS_PA_RISC (cpu)) 693 | { 694 | switch (cpu) 695 | { 696 | case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 697 | case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 698 | case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 699 | default: puts ("hppa-hitachi-hiuxwe2"); break; 700 | } 701 | } 702 | else if (CPU_IS_HP_MC68K (cpu)) 703 | puts ("m68k-hitachi-hiuxwe2"); 704 | else puts ("unknown-hitachi-hiuxwe2"); 705 | exit (0); 706 | } 707 | EOF 708 | $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 709 | { echo "$SYSTEM_NAME"; exit; } 710 | echo unknown-hitachi-hiuxwe2 711 | exit ;; 712 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 713 | echo hppa1.1-hp-bsd 714 | exit ;; 715 | 9000/8??:4.3bsd:*:*) 716 | echo hppa1.0-hp-bsd 717 | exit ;; 718 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 719 | echo hppa1.0-hp-mpeix 720 | exit ;; 721 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 722 | echo hppa1.1-hp-osf 723 | exit ;; 724 | hp8??:OSF1:*:*) 725 | echo hppa1.0-hp-osf 726 | exit ;; 727 | i*86:OSF1:*:*) 728 | if [ -x /usr/sbin/sysversion ] ; then 729 | echo ${UNAME_MACHINE}-unknown-osf1mk 730 | else 731 | echo ${UNAME_MACHINE}-unknown-osf1 732 | fi 733 | exit ;; 734 | parisc*:Lites*:*:*) 735 | echo hppa1.1-hp-lites 736 | exit ;; 737 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 738 | echo c1-convex-bsd 739 | exit ;; 740 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 741 | if getsysinfo -f scalar_acc 742 | then echo c32-convex-bsd 743 | else echo c2-convex-bsd 744 | fi 745 | exit ;; 746 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 747 | echo c34-convex-bsd 748 | exit ;; 749 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 750 | echo c38-convex-bsd 751 | exit ;; 752 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 753 | echo c4-convex-bsd 754 | exit ;; 755 | CRAY*Y-MP:*:*:*) 756 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 757 | exit ;; 758 | CRAY*[A-Z]90:*:*:*) 759 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 760 | | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 761 | -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 762 | -e 's/\.[^.]*$/.X/' 763 | exit ;; 764 | CRAY*TS:*:*:*) 765 | echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 766 | exit ;; 767 | CRAY*T3E:*:*:*) 768 | echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 769 | exit ;; 770 | CRAY*SV1:*:*:*) 771 | echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 772 | exit ;; 773 | *:UNICOS/mp:*:*) 774 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 775 | exit ;; 776 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 777 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 778 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 779 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 780 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 781 | exit ;; 782 | 5000:UNIX_System_V:4.*:*) 783 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 784 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 785 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 786 | exit ;; 787 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 788 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 789 | exit ;; 790 | sparc*:BSD/OS:*:*) 791 | echo sparc-unknown-bsdi${UNAME_RELEASE} 792 | exit ;; 793 | *:BSD/OS:*:*) 794 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 795 | exit ;; 796 | *:FreeBSD:*:*) 797 | UNAME_PROCESSOR=`/usr/bin/uname -p` 798 | case ${UNAME_PROCESSOR} in 799 | amd64) 800 | echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 801 | *) 802 | echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 803 | esac 804 | exit ;; 805 | i*:CYGWIN*:*) 806 | echo ${UNAME_MACHINE}-pc-cygwin 807 | exit ;; 808 | *:MINGW64*:*) 809 | echo ${UNAME_MACHINE}-pc-mingw64 810 | exit ;; 811 | *:MINGW*:*) 812 | echo ${UNAME_MACHINE}-pc-mingw32 813 | exit ;; 814 | i*:MSYS*:*) 815 | echo ${UNAME_MACHINE}-pc-msys 816 | exit ;; 817 | i*:windows32*:*) 818 | # uname -m includes "-pc" on this system. 819 | echo ${UNAME_MACHINE}-mingw32 820 | exit ;; 821 | i*:PW*:*) 822 | echo ${UNAME_MACHINE}-pc-pw32 823 | exit ;; 824 | *:Interix*:*) 825 | case ${UNAME_MACHINE} in 826 | x86) 827 | echo i586-pc-interix${UNAME_RELEASE} 828 | exit ;; 829 | authenticamd | genuineintel | EM64T) 830 | echo x86_64-unknown-interix${UNAME_RELEASE} 831 | exit ;; 832 | IA64) 833 | echo ia64-unknown-interix${UNAME_RELEASE} 834 | exit ;; 835 | esac ;; 836 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 837 | echo i${UNAME_MACHINE}-pc-mks 838 | exit ;; 839 | 8664:Windows_NT:*) 840 | echo x86_64-pc-mks 841 | exit ;; 842 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 843 | # How do we know it's Interix rather than the generic POSIX subsystem? 844 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 845 | # UNAME_MACHINE based on the output of uname instead of i386? 846 | echo i586-pc-interix 847 | exit ;; 848 | i*:UWIN*:*) 849 | echo ${UNAME_MACHINE}-pc-uwin 850 | exit ;; 851 | amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 852 | echo x86_64-unknown-cygwin 853 | exit ;; 854 | p*:CYGWIN*:*) 855 | echo powerpcle-unknown-cygwin 856 | exit ;; 857 | prep*:SunOS:5.*:*) 858 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 859 | exit ;; 860 | *:GNU:*:*) 861 | # the GNU system 862 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 863 | exit ;; 864 | *:GNU/*:*:*) 865 | # other systems with GNU libc and userland 866 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 867 | exit ;; 868 | i*86:Minix:*:*) 869 | echo ${UNAME_MACHINE}-pc-minix 870 | exit ;; 871 | aarch64:Linux:*:*) 872 | echo ${UNAME_MACHINE}-unknown-linux-gnu 873 | exit ;; 874 | aarch64_be:Linux:*:*) 875 | UNAME_MACHINE=aarch64_be 876 | echo ${UNAME_MACHINE}-unknown-linux-gnu 877 | exit ;; 878 | alpha:Linux:*:*) 879 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 880 | EV5) UNAME_MACHINE=alphaev5 ;; 881 | EV56) UNAME_MACHINE=alphaev56 ;; 882 | PCA56) UNAME_MACHINE=alphapca56 ;; 883 | PCA57) UNAME_MACHINE=alphapca56 ;; 884 | EV6) UNAME_MACHINE=alphaev6 ;; 885 | EV67) UNAME_MACHINE=alphaev67 ;; 886 | EV68*) UNAME_MACHINE=alphaev68 ;; 887 | esac 888 | objdump --private-headers /bin/sh | grep -q ld.so.1 889 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 890 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 891 | exit ;; 892 | arm*:Linux:*:*) 893 | eval $set_cc_for_build 894 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 895 | | grep -q __ARM_EABI__ 896 | then 897 | echo ${UNAME_MACHINE}-unknown-linux-gnu 898 | else 899 | if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 900 | | grep -q __ARM_PCS_VFP 901 | then 902 | echo ${UNAME_MACHINE}-unknown-linux-gnueabi 903 | else 904 | echo ${UNAME_MACHINE}-unknown-linux-gnueabihf 905 | fi 906 | fi 907 | exit ;; 908 | avr32*:Linux:*:*) 909 | echo ${UNAME_MACHINE}-unknown-linux-gnu 910 | exit ;; 911 | cris:Linux:*:*) 912 | echo ${UNAME_MACHINE}-axis-linux-gnu 913 | exit ;; 914 | crisv32:Linux:*:*) 915 | echo ${UNAME_MACHINE}-axis-linux-gnu 916 | exit ;; 917 | frv:Linux:*:*) 918 | echo ${UNAME_MACHINE}-unknown-linux-gnu 919 | exit ;; 920 | hexagon:Linux:*:*) 921 | echo ${UNAME_MACHINE}-unknown-linux-gnu 922 | exit ;; 923 | i*86:Linux:*:*) 924 | LIBC=gnu 925 | eval $set_cc_for_build 926 | sed 's/^ //' << EOF >$dummy.c 927 | #ifdef __dietlibc__ 928 | LIBC=dietlibc 929 | #endif 930 | EOF 931 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` 932 | echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 933 | exit ;; 934 | ia64:Linux:*:*) 935 | echo ${UNAME_MACHINE}-unknown-linux-gnu 936 | exit ;; 937 | m32r*:Linux:*:*) 938 | echo ${UNAME_MACHINE}-unknown-linux-gnu 939 | exit ;; 940 | m68*:Linux:*:*) 941 | echo ${UNAME_MACHINE}-unknown-linux-gnu 942 | exit ;; 943 | mips:Linux:*:* | mips64:Linux:*:*) 944 | eval $set_cc_for_build 945 | sed 's/^ //' << EOF >$dummy.c 946 | #undef CPU 947 | #undef ${UNAME_MACHINE} 948 | #undef ${UNAME_MACHINE}el 949 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 950 | CPU=${UNAME_MACHINE}el 951 | #else 952 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 953 | CPU=${UNAME_MACHINE} 954 | #else 955 | CPU= 956 | #endif 957 | #endif 958 | EOF 959 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 960 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 961 | ;; 962 | or32:Linux:*:*) 963 | echo ${UNAME_MACHINE}-unknown-linux-gnu 964 | exit ;; 965 | padre:Linux:*:*) 966 | echo sparc-unknown-linux-gnu 967 | exit ;; 968 | parisc64:Linux:*:* | hppa64:Linux:*:*) 969 | echo hppa64-unknown-linux-gnu 970 | exit ;; 971 | parisc:Linux:*:* | hppa:Linux:*:*) 972 | # Look for CPU level 973 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 974 | PA7*) echo hppa1.1-unknown-linux-gnu ;; 975 | PA8*) echo hppa2.0-unknown-linux-gnu ;; 976 | *) echo hppa-unknown-linux-gnu ;; 977 | esac 978 | exit ;; 979 | ppc64:Linux:*:*) 980 | echo powerpc64-unknown-linux-gnu 981 | exit ;; 982 | ppc:Linux:*:*) 983 | echo powerpc-unknown-linux-gnu 984 | exit ;; 985 | s390:Linux:*:* | s390x:Linux:*:*) 986 | echo ${UNAME_MACHINE}-ibm-linux 987 | exit ;; 988 | sh64*:Linux:*:*) 989 | echo ${UNAME_MACHINE}-unknown-linux-gnu 990 | exit ;; 991 | sh*:Linux:*:*) 992 | echo ${UNAME_MACHINE}-unknown-linux-gnu 993 | exit ;; 994 | sparc:Linux:*:* | sparc64:Linux:*:*) 995 | echo ${UNAME_MACHINE}-unknown-linux-gnu 996 | exit ;; 997 | tile*:Linux:*:*) 998 | echo ${UNAME_MACHINE}-unknown-linux-gnu 999 | exit ;; 1000 | vax:Linux:*:*) 1001 | echo ${UNAME_MACHINE}-dec-linux-gnu 1002 | exit ;; 1003 | x86_64:Linux:*:*) 1004 | echo ${UNAME_MACHINE}-unknown-linux-gnu 1005 | exit ;; 1006 | xtensa*:Linux:*:*) 1007 | echo ${UNAME_MACHINE}-unknown-linux-gnu 1008 | exit ;; 1009 | i*86:DYNIX/ptx:4*:*) 1010 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1011 | # earlier versions are messed up and put the nodename in both 1012 | # sysname and nodename. 1013 | echo i386-sequent-sysv4 1014 | exit ;; 1015 | i*86:UNIX_SV:4.2MP:2.*) 1016 | # Unixware is an offshoot of SVR4, but it has its own version 1017 | # number series starting with 2... 1018 | # I am not positive that other SVR4 systems won't match this, 1019 | # I just have to hope. -- rms. 1020 | # Use sysv4.2uw... so that sysv4* matches it. 1021 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 1022 | exit ;; 1023 | i*86:OS/2:*:*) 1024 | # If we were able to find `uname', then EMX Unix compatibility 1025 | # is probably installed. 1026 | echo ${UNAME_MACHINE}-pc-os2-emx 1027 | exit ;; 1028 | i*86:XTS-300:*:STOP) 1029 | echo ${UNAME_MACHINE}-unknown-stop 1030 | exit ;; 1031 | i*86:atheos:*:*) 1032 | echo ${UNAME_MACHINE}-unknown-atheos 1033 | exit ;; 1034 | i*86:syllable:*:*) 1035 | echo ${UNAME_MACHINE}-pc-syllable 1036 | exit ;; 1037 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1038 | echo i386-unknown-lynxos${UNAME_RELEASE} 1039 | exit ;; 1040 | i*86:*DOS:*:*) 1041 | echo ${UNAME_MACHINE}-pc-msdosdjgpp 1042 | exit ;; 1043 | i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 1044 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 1045 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1046 | echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 1047 | else 1048 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 1049 | fi 1050 | exit ;; 1051 | i*86:*:5:[678]*) 1052 | # UnixWare 7.x, OpenUNIX and OpenServer 6. 1053 | case `/bin/uname -X | grep "^Machine"` in 1054 | *486*) UNAME_MACHINE=i486 ;; 1055 | *Pentium) UNAME_MACHINE=i586 ;; 1056 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1057 | esac 1058 | echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1059 | exit ;; 1060 | i*86:*:3.2:*) 1061 | if test -f /usr/options/cb.name; then 1062 | UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then 1065 | UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 1066 | (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 1067 | (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 1068 | && UNAME_MACHINE=i586 1069 | (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 1070 | && UNAME_MACHINE=i686 1071 | (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 1072 | && UNAME_MACHINE=i686 1073 | echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 1074 | else 1075 | echo ${UNAME_MACHINE}-pc-sysv32 1076 | fi 1077 | exit ;; 1078 | pc:*:*:*) 1079 | # Left here for compatibility: 1080 | # uname -m prints for DJGPP always 'pc', but it prints nothing about 1081 | # the processor, so we play safe by assuming i586. 1082 | # Note: whatever this is, it MUST be the same as what config.sub 1083 | # prints for the "djgpp" host, or else GDB configure will decide that 1084 | # this is a cross-build. 1085 | echo i586-pc-msdosdjgpp 1086 | exit ;; 1087 | Intel:Mach:3*:*) 1088 | echo i386-pc-mach3 1089 | exit ;; 1090 | paragon:*:*:*) 1091 | echo i860-intel-osf1 1092 | exit ;; 1093 | i860:*:4.*:*) # i860-SVR4 1094 | if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1095 | echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 1096 | else # Add other i860-SVR4 vendors below as they are discovered. 1097 | echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 1098 | fi 1099 | exit ;; 1100 | mini*:CTIX:SYS*5:*) 1101 | # "miniframe" 1102 | echo m68010-convergent-sysv 1103 | exit ;; 1104 | mc68k:UNIX:SYSTEM5:3.51m) 1105 | echo m68k-convergent-sysv 1106 | exit ;; 1107 | M680?0:D-NIX:5.3:*) 1108 | echo m68k-diab-dnix 1109 | exit ;; 1110 | M68*:*:R3V[5678]*:*) 1111 | test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1112 | 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) 1113 | OS_REL='' 1114 | test -r /etc/.relid \ 1115 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1116 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1117 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1118 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1119 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1120 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1121 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1122 | && { echo i486-ncr-sysv4; exit; } ;; 1123 | NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1124 | OS_REL='.3' 1125 | test -r /etc/.relid \ 1126 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1127 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1128 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1129 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1130 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 1131 | /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1132 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1133 | m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1134 | echo m68k-unknown-lynxos${UNAME_RELEASE} 1135 | exit ;; 1136 | mc68030:UNIX_System_V:4.*:*) 1137 | echo m68k-atari-sysv4 1138 | exit ;; 1139 | TSUNAMI:LynxOS:2.*:*) 1140 | echo sparc-unknown-lynxos${UNAME_RELEASE} 1141 | exit ;; 1142 | rs6000:LynxOS:2.*:*) 1143 | echo rs6000-unknown-lynxos${UNAME_RELEASE} 1144 | exit ;; 1145 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1146 | echo powerpc-unknown-lynxos${UNAME_RELEASE} 1147 | exit ;; 1148 | SM[BE]S:UNIX_SV:*:*) 1149 | echo mips-dde-sysv${UNAME_RELEASE} 1150 | exit ;; 1151 | RM*:ReliantUNIX-*:*:*) 1152 | echo mips-sni-sysv4 1153 | exit ;; 1154 | RM*:SINIX-*:*:*) 1155 | echo mips-sni-sysv4 1156 | exit ;; 1157 | *:SINIX-*:*:*) 1158 | if uname -p 2>/dev/null >/dev/null ; then 1159 | UNAME_MACHINE=`(uname -p) 2>/dev/null` 1160 | echo ${UNAME_MACHINE}-sni-sysv4 1161 | else 1162 | echo ns32k-sni-sysv 1163 | fi 1164 | exit ;; 1165 | PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1166 | # says 1167 | echo i586-unisys-sysv4 1168 | exit ;; 1169 | *:UNIX_System_V:4*:FTX*) 1170 | # From Gerald Hewes . 1171 | # How about differentiating between stratus architectures? -djm 1172 | echo hppa1.1-stratus-sysv4 1173 | exit ;; 1174 | *:*:*:FTX*) 1175 | # From seanf@swdc.stratus.com. 1176 | echo i860-stratus-sysv4 1177 | exit ;; 1178 | i*86:VOS:*:*) 1179 | # From Paul.Green@stratus.com. 1180 | echo ${UNAME_MACHINE}-stratus-vos 1181 | exit ;; 1182 | *:VOS:*:*) 1183 | # From Paul.Green@stratus.com. 1184 | echo hppa1.1-stratus-vos 1185 | exit ;; 1186 | mc68*:A/UX:*:*) 1187 | echo m68k-apple-aux${UNAME_RELEASE} 1188 | exit ;; 1189 | news*:NEWS-OS:6*:*) 1190 | echo mips-sony-newsos6 1191 | exit ;; 1192 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1193 | if [ -d /usr/nec ]; then 1194 | echo mips-nec-sysv${UNAME_RELEASE} 1195 | else 1196 | echo mips-unknown-sysv${UNAME_RELEASE} 1197 | fi 1198 | exit ;; 1199 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1200 | echo powerpc-be-beos 1201 | exit ;; 1202 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1203 | echo powerpc-apple-beos 1204 | exit ;; 1205 | BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1206 | echo i586-pc-beos 1207 | exit ;; 1208 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1209 | echo i586-pc-haiku 1210 | exit ;; 1211 | x86_64:Haiku:*:*) 1212 | echo x86_64-unknown-haiku 1213 | exit ;; 1214 | SX-4:SUPER-UX:*:*) 1215 | echo sx4-nec-superux${UNAME_RELEASE} 1216 | exit ;; 1217 | SX-5:SUPER-UX:*:*) 1218 | echo sx5-nec-superux${UNAME_RELEASE} 1219 | exit ;; 1220 | SX-6:SUPER-UX:*:*) 1221 | echo sx6-nec-superux${UNAME_RELEASE} 1222 | exit ;; 1223 | SX-7:SUPER-UX:*:*) 1224 | echo sx7-nec-superux${UNAME_RELEASE} 1225 | exit ;; 1226 | SX-8:SUPER-UX:*:*) 1227 | echo sx8-nec-superux${UNAME_RELEASE} 1228 | exit ;; 1229 | SX-8R:SUPER-UX:*:*) 1230 | echo sx8r-nec-superux${UNAME_RELEASE} 1231 | exit ;; 1232 | Power*:Rhapsody:*:*) 1233 | echo powerpc-apple-rhapsody${UNAME_RELEASE} 1234 | exit ;; 1235 | *:Rhapsody:*:*) 1236 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1237 | exit ;; 1238 | *:Darwin:*:*) 1239 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1240 | case $UNAME_PROCESSOR in 1241 | i386) 1242 | eval $set_cc_for_build 1243 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1244 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1245 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1246 | grep IS_64BIT_ARCH >/dev/null 1247 | then 1248 | UNAME_PROCESSOR="x86_64" 1249 | fi 1250 | fi ;; 1251 | unknown) UNAME_PROCESSOR=powerpc ;; 1252 | esac 1253 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1254 | exit ;; 1255 | *:procnto*:*:* | *:QNX:[0123456789]*:*) 1256 | UNAME_PROCESSOR=`uname -p` 1257 | if test "$UNAME_PROCESSOR" = "x86"; then 1258 | UNAME_PROCESSOR=i386 1259 | UNAME_MACHINE=pc 1260 | fi 1261 | echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 1262 | exit ;; 1263 | *:QNX:*:4*) 1264 | echo i386-pc-qnx 1265 | exit ;; 1266 | NEO-?:NONSTOP_KERNEL:*:*) 1267 | echo neo-tandem-nsk${UNAME_RELEASE} 1268 | exit ;; 1269 | NSE-*:NONSTOP_KERNEL:*:*) 1270 | echo nse-tandem-nsk${UNAME_RELEASE} 1271 | exit ;; 1272 | NSR-?:NONSTOP_KERNEL:*:*) 1273 | echo nsr-tandem-nsk${UNAME_RELEASE} 1274 | exit ;; 1275 | *:NonStop-UX:*:*) 1276 | echo mips-compaq-nonstopux 1277 | exit ;; 1278 | BS2000:POSIX*:*:*) 1279 | echo bs2000-siemens-sysv 1280 | exit ;; 1281 | DS/*:UNIX_System_V:*:*) 1282 | echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1283 | exit ;; 1284 | *:Plan9:*:*) 1285 | # "uname -m" is not consistent, so use $cputype instead. 386 1286 | # is converted to i386 for consistency with other x86 1287 | # operating systems. 1288 | if test "$cputype" = "386"; then 1289 | UNAME_MACHINE=i386 1290 | else 1291 | UNAME_MACHINE="$cputype" 1292 | fi 1293 | echo ${UNAME_MACHINE}-unknown-plan9 1294 | exit ;; 1295 | *:TOPS-10:*:*) 1296 | echo pdp10-unknown-tops10 1297 | exit ;; 1298 | *:TENEX:*:*) 1299 | echo pdp10-unknown-tenex 1300 | exit ;; 1301 | KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1302 | echo pdp10-dec-tops20 1303 | exit ;; 1304 | XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1305 | echo pdp10-xkl-tops20 1306 | exit ;; 1307 | *:TOPS-20:*:*) 1308 | echo pdp10-unknown-tops20 1309 | exit ;; 1310 | *:ITS:*:*) 1311 | echo pdp10-unknown-its 1312 | exit ;; 1313 | SEI:*:*:SEIUX) 1314 | echo mips-sei-seiux${UNAME_RELEASE} 1315 | exit ;; 1316 | *:DragonFly:*:*) 1317 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 1318 | exit ;; 1319 | *:*VMS:*:*) 1320 | UNAME_MACHINE=`(uname -p) 2>/dev/null` 1321 | case "${UNAME_MACHINE}" in 1322 | A*) echo alpha-dec-vms ; exit ;; 1323 | I*) echo ia64-dec-vms ; exit ;; 1324 | V*) echo vax-dec-vms ; exit ;; 1325 | esac ;; 1326 | *:XENIX:*:SysV) 1327 | echo i386-pc-xenix 1328 | exit ;; 1329 | i*86:skyos:*:*) 1330 | echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 1331 | exit ;; 1332 | i*86:rdos:*:*) 1333 | echo ${UNAME_MACHINE}-pc-rdos 1334 | exit ;; 1335 | i*86:AROS:*:*) 1336 | echo ${UNAME_MACHINE}-pc-aros 1337 | exit ;; 1338 | x86_64:VMkernel:*:*) 1339 | echo ${UNAME_MACHINE}-unknown-esx 1340 | exit ;; 1341 | esac 1342 | 1343 | eval $set_cc_for_build 1344 | cat >$dummy.c < 1347 | # include 1348 | #endif 1349 | main () 1350 | { 1351 | #if defined (sony) 1352 | #if defined (MIPSEB) 1353 | /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1354 | I don't know.... */ 1355 | printf ("mips-sony-bsd\n"); exit (0); 1356 | #else 1357 | #include 1358 | printf ("m68k-sony-newsos%s\n", 1359 | #ifdef NEWSOS4 1360 | "4" 1361 | #else 1362 | "" 1363 | #endif 1364 | ); exit (0); 1365 | #endif 1366 | #endif 1367 | 1368 | #if defined (__arm) && defined (__acorn) && defined (__unix) 1369 | printf ("arm-acorn-riscix\n"); exit (0); 1370 | #endif 1371 | 1372 | #if defined (hp300) && !defined (hpux) 1373 | printf ("m68k-hp-bsd\n"); exit (0); 1374 | #endif 1375 | 1376 | #if defined (NeXT) 1377 | #if !defined (__ARCHITECTURE__) 1378 | #define __ARCHITECTURE__ "m68k" 1379 | #endif 1380 | int version; 1381 | version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1382 | if (version < 4) 1383 | printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1384 | else 1385 | printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1386 | exit (0); 1387 | #endif 1388 | 1389 | #if defined (MULTIMAX) || defined (n16) 1390 | #if defined (UMAXV) 1391 | printf ("ns32k-encore-sysv\n"); exit (0); 1392 | #else 1393 | #if defined (CMU) 1394 | printf ("ns32k-encore-mach\n"); exit (0); 1395 | #else 1396 | printf ("ns32k-encore-bsd\n"); exit (0); 1397 | #endif 1398 | #endif 1399 | #endif 1400 | 1401 | #if defined (__386BSD__) 1402 | printf ("i386-pc-bsd\n"); exit (0); 1403 | #endif 1404 | 1405 | #if defined (sequent) 1406 | #if defined (i386) 1407 | printf ("i386-sequent-dynix\n"); exit (0); 1408 | #endif 1409 | #if defined (ns32000) 1410 | printf ("ns32k-sequent-dynix\n"); exit (0); 1411 | #endif 1412 | #endif 1413 | 1414 | #if defined (_SEQUENT_) 1415 | struct utsname un; 1416 | 1417 | uname(&un); 1418 | 1419 | if (strncmp(un.version, "V2", 2) == 0) { 1420 | printf ("i386-sequent-ptx2\n"); exit (0); 1421 | } 1422 | if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1423 | printf ("i386-sequent-ptx1\n"); exit (0); 1424 | } 1425 | printf ("i386-sequent-ptx\n"); exit (0); 1426 | 1427 | #endif 1428 | 1429 | #if defined (vax) 1430 | # if !defined (ultrix) 1431 | # include 1432 | # if defined (BSD) 1433 | # if BSD == 43 1434 | printf ("vax-dec-bsd4.3\n"); exit (0); 1435 | # else 1436 | # if BSD == 199006 1437 | printf ("vax-dec-bsd4.3reno\n"); exit (0); 1438 | # else 1439 | printf ("vax-dec-bsd\n"); exit (0); 1440 | # endif 1441 | # endif 1442 | # else 1443 | printf ("vax-dec-bsd\n"); exit (0); 1444 | # endif 1445 | # else 1446 | printf ("vax-dec-ultrix\n"); exit (0); 1447 | # endif 1448 | #endif 1449 | 1450 | #if defined (alliant) && defined (i860) 1451 | printf ("i860-alliant-bsd\n"); exit (0); 1452 | #endif 1453 | 1454 | exit (1); 1455 | } 1456 | EOF 1457 | 1458 | $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 1459 | { echo "$SYSTEM_NAME"; exit; } 1460 | 1461 | # Apollos put the system type in the environment. 1462 | 1463 | test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 1464 | 1465 | # Convex versions that predate uname can use getsysinfo(1) 1466 | 1467 | if [ -x /usr/convex/getsysinfo ] 1468 | then 1469 | case `getsysinfo -f cpu_type` in 1470 | c1*) 1471 | echo c1-convex-bsd 1472 | exit ;; 1473 | c2*) 1474 | if getsysinfo -f scalar_acc 1475 | then echo c32-convex-bsd 1476 | else echo c2-convex-bsd 1477 | fi 1478 | exit ;; 1479 | c34*) 1480 | echo c34-convex-bsd 1481 | exit ;; 1482 | c38*) 1483 | echo c38-convex-bsd 1484 | exit ;; 1485 | c4*) 1486 | echo c4-convex-bsd 1487 | exit ;; 1488 | esac 1489 | fi 1490 | 1491 | cat >&2 < in order to provide the needed 1505 | information to handle your system. 1506 | 1507 | config.guess timestamp = $timestamp 1508 | 1509 | uname -m = `(uname -m) 2>/dev/null || echo unknown` 1510 | uname -r = `(uname -r) 2>/dev/null || echo unknown` 1511 | uname -s = `(uname -s) 2>/dev/null || echo unknown` 1512 | uname -v = `(uname -v) 2>/dev/null || echo unknown` 1513 | 1514 | /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1515 | /bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1516 | 1517 | hostinfo = `(hostinfo) 2>/dev/null` 1518 | /bin/universe = `(/bin/universe) 2>/dev/null` 1519 | /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1520 | /bin/arch = `(/bin/arch) 2>/dev/null` 1521 | /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1522 | /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1523 | 1524 | UNAME_MACHINE = ${UNAME_MACHINE} 1525 | UNAME_RELEASE = ${UNAME_RELEASE} 1526 | UNAME_SYSTEM = ${UNAME_SYSTEM} 1527 | UNAME_VERSION = ${UNAME_VERSION} 1528 | EOF 1529 | 1530 | exit 1 1531 | 1532 | # Local variables: 1533 | # eval: (add-hook 'write-file-hooks 'time-stamp) 1534 | # time-stamp-start: "timestamp='" 1535 | # time-stamp-format: "%:y-%02m-%02d" 1536 | # time-stamp-end: "'" 1537 | # End: 1538 | --------------------------------------------------------------------------------