├── avrdude-6.3-patches ├── 20-avrdude-6.3-no_gpio0_gpio1.patch ├── 10-avrdude-6.3-silent_bitbang_cmd.patch ├── 30-avrdude-6.3-added_arduinoisp.patch ├── 31-avrdude-6.3-added_arduinoorgisp.patch ├── 61-avrdude-6.3-add_fake_efuse_to_atmega8_for_Arduino_IDE.patch ├── 60-avrdude-6.3-attiny85_delay_increase.patch ├── 70-replace-AC_CHECK_LIB-with-AC_CHECK_HEADERS.patch ├── 90-check-if-hidapi-from-includes.patch ├── 02-ddk-headers.patch └── 80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch ├── .gitignore ├── libusb-1.0.20.build.bash ├── ncurses-patches ├── 0001-cpp-nasty.patch └── 0002-clang3.patch ├── libelf-0.8.13.build.bash ├── avrdude-6.3.build.bash ├── libhidapi.build.bash ├── libusb-compat-0.1.5.build.bash ├── libncurses-5.9.build.bash ├── Readme.md ├── package-avrdude.bash ├── libusb-compat-0.1.5-patches └── 01-mingw-build.patch └── libelf-0.8.13-patches └── 01-config.guess.patch /avrdude-6.3-patches/20-avrdude-6.3-no_gpio0_gpio1.patch: -------------------------------------------------------------------------------- 1 | Index: linuxgpio.c 2 | =================================================================== 3 | --- linuxgpio.c 4 | +++ linuxgpio.c 5 | 260c260 6 | < for (i=0; i for (i=2; i= 2) 10 | + if(verbose > 4) 11 | { 12 | fprintf(stderr, "bitbang_cmd(): [ "); 13 | for(i = 0; i < 4; i++) 14 | -------------------------------------------------------------------------------- /avrdude-6.3-patches/30-avrdude-6.3-added_arduinoisp.patch: -------------------------------------------------------------------------------- 1 | --- avrdude.conf.in 2013-09-18 07:59:06.000000000 +0200 2 | +++ avrdude.conf.in 2014-02-27 17:14:40.686503613 +0100 3 | @@ -751,6 +751,15 @@ 4 | ; 5 | 6 | programmer 7 | + id = "arduinoisp"; 8 | + desc = "Arduino ISP Programmer"; 9 | + type = "usbtiny"; 10 | + connection_type = usb; 11 | + usbvid = 0x2341; 12 | + usbpid = 0x0049; 13 | +; 14 | + 15 | +programmer 16 | id = "butterfly"; 17 | desc = "Atmel Butterfly Development Board"; 18 | type = "butterfly"; 19 | -------------------------------------------------------------------------------- /avrdude-6.3-patches/31-avrdude-6.3-added_arduinoorgisp.patch: -------------------------------------------------------------------------------- 1 | --- avrdude.conf.in.orig 2016-12-16 13:02:11.218301337 +0100 2 | +++ avrdude.conf.in 2016-12-16 13:02:13.446302698 +0100 3 | @@ -884,6 +884,15 @@ 4 | ; 5 | 6 | programmer 7 | + id = "arduinoisporg"; 8 | + desc = "Arduino ISP Programmer"; 9 | + type = "usbtiny"; 10 | + connection_type = usb; 11 | + usbvid = 0x2A03; 12 | + usbpid = 0x0049; 13 | +; 14 | + 15 | +programmer 16 | id = "butterfly"; 17 | desc = "Atmel Butterfly Development Board"; 18 | type = "butterfly"; 19 | -------------------------------------------------------------------------------- /avrdude-6.3-patches/61-avrdude-6.3-add_fake_efuse_to_atmega8_for_Arduino_IDE.patch: -------------------------------------------------------------------------------- 1 | --- avrdude.conf.in.orig 2016-12-16 13:08:00.210983367 +0100 2 | +++ avrdude.conf.in 2016-12-16 13:10:44.691541657 +0100 3 | @@ -6548,6 +6548,13 @@ 4 | "x x x x x x x x i i i i i i i i"; 5 | ; 6 | 7 | + # Required for Arduino IDE 8 | + # see: https://github.com/arduino/Arduino/issues/2075 9 | + # https://github.com/arduino/Arduino/issues/2075#issuecomment-238031689 10 | + memory "efuse" 11 | + size = 0; 12 | + ; 13 | + 14 | memory "lock" 15 | size = 1; 16 | min_write_delay = 2000; 17 | -------------------------------------------------------------------------------- /avrdude-6.3-patches/60-avrdude-6.3-attiny85_delay_increase.patch: -------------------------------------------------------------------------------- 1 | --- avrdude.conf.in 2015-04-02 23:54:05.862556159 +0000 2 | +++ avrdude.conf.in 2015-04-03 00:07:02.156406668 +0000 3 | @@ -9756,7 +9756,7 @@ 4 | avr910_devcode = 0x20; 5 | signature = 0x1e 0x93 0x0b; 6 | reset = io; 7 | - chip_erase_delay = 4500; 8 | + chip_erase_delay = 400000; 9 | 10 | pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", 11 | "x x x x x x x x x x x x x x x x"; 12 | @@ -9822,7 +9822,7 @@ 13 | " x x x x x x x x"; 14 | 15 | mode = 0x41; 16 | - delay = 6; 17 | + delay = 12; 18 | blocksize = 4; 19 | readsize = 256; 20 | ; 21 | @@ -9831,8 +9831,8 @@ 22 | size = 8192; 23 | page_size = 64; 24 | num_pages = 128; 25 | - min_write_delay = 4500; 26 | - max_write_delay = 4500; 27 | + min_write_delay = 30000; 28 | + max_write_delay = 30000; 29 | readback_p1 = 0xff; 30 | readback_p2 = 0xff; 31 | read_lo = " 0 0 1 0 0 0 0 0", 32 | -------------------------------------------------------------------------------- /avrdude-6.3-patches/70-replace-AC_CHECK_LIB-with-AC_CHECK_HEADERS.patch: -------------------------------------------------------------------------------- 1 | --- configure.ac 2 | +++ configure.ac 3 | @@ -81,7 +81,7 @@ AC_CHECK_LIB([ncurses], [tputs]) 4 | AC_CHECK_LIB([readline], [readline]) 5 | AH_TEMPLATE([HAVE_LIBELF], 6 | [Define if ELF support is enabled via libelf]) 7 | -AC_CHECK_LIB([elf], [elf_getshdrstrndx], [have_libelf=yes]) 8 | +AC_CHECK_HEADERS([libelf.h libelf/libelf.h], [have_libelf=yes]) 9 | if test x$have_libelf = xyes; then 10 | case $target in 11 | *) 12 | @@ -97,7 +97,7 @@ AC_SEARCH_LIBS([gethostent], [nsl]) 13 | AC_SEARCH_LIBS([setsockopt], [socket]) 14 | AH_TEMPLATE([HAVE_LIBUSB], 15 | [Define if USB support is enabled via libusb]) 16 | -AC_CHECK_LIB([usb], [usb_get_string_simple], [have_libusb=yes]) 17 | +AC_CHECK_HEADERS([lusb0_usb.h usb.h], [have_libusb=yes]) 18 | if test x$have_libusb = xyes; then 19 | case $target in 20 | *-*-darwin*) 21 | @@ -115,7 +115,7 @@ AC_SUBST(LIBUSB, $LIBUSB) 22 | 23 | AH_TEMPLATE([HAVE_LIBUSB_1_0], 24 | [Define if USB support is enabled via libusb 1.0]) 25 | -AC_CHECK_LIB([usb-1.0], [libusb_init], [have_libusb_1_0=yes]) 26 | +AC_CHECK_HEADERS([libusb-1.0/libusb.h libusb.h], [have_libusb_1_0=yes]) 27 | if test x$have_libusb_1_0 = xyes; then 28 | case $target in 29 | *-*-darwin*) 30 | 31 | -------------------------------------------------------------------------------- /avrdude-6.3-patches/90-check-if-hidapi-from-includes.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configure.ac b/configure.ac 2 | index d422bfc..ddd9b6f 100644 3 | --- a/configure.ac 4 | +++ b/configure.ac 5 | @@ -79,7 +79,7 @@ dnl Makefile.am:77: compiling `config_gram.c' with per-target flags requires `AM 6 | AM_PROG_CC_C_O 7 | 8 | # Checks for libraries. 9 | -AC_CHECK_LIB([termcap], [tputs]) 10 | +AC_CHECK_LIB([ncurses], [tputs]) 11 | AC_CHECK_LIB([ncurses], [tputs]) 12 | AC_CHECK_LIB([readline], [readline]) 13 | AH_TEMPLATE([HAVE_LIBELF], 14 | @@ -154,7 +154,9 @@ AC_SUBST(LIBUSB_1_0, $LIBUSB_1_0) 15 | 16 | AH_TEMPLATE([HAVE_LIBHIDAPI], 17 | [Define if HID support is enabled via libhidapi]) 18 | -AC_SEARCH_LIBS([hid_init], [hidapi hidapi-libusb hidapi-hidraw], [have_libhidapi=yes]) 19 | +for _hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do 20 | + PKG_CHECK_MODULES([hidapi],[$_hidapi_lib],[have_libhidapi=yes],[true]) 21 | +done 22 | if test x$have_libhidapi = xyes; then 23 | case $target in 24 | *-*-darwin*) 25 | @@ -164,12 +166,9 @@ if test x$have_libhidapi = xyes; then 26 | LIBHIDAPI="$ac_cv_lib_hid_init" 27 | ;; 28 | esac 29 | - AC_DEFINE([HAVE_LIBHIDAPI]) 30 | - AC_CHECK_HEADERS([hidapi/hidapi.h]) 31 | fi 32 | AC_SUBST(LIBHIDAPI, $LIBHIDAPI) 33 | 34 | - 35 | AH_TEMPLATE([HAVE_LIBFTDI1], 36 | [Define if FTDI support is enabled via libftdi1]) 37 | AH_TEMPLATE([HAVE_LIBFTDI], 38 | -------------------------------------------------------------------------------- /libusb-1.0.20.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2016 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | mkdir -p objdir 19 | cd objdir 20 | PREFIX=`pwd` 21 | cd - 22 | 23 | if [[ ! -f libusb-1.0.20.tar.bz2 ]] ; 24 | then 25 | wget https://github.com/libusb/libusb/releases/download/v1.0.20/libusb-1.0.20.tar.bz2 26 | fi 27 | 28 | tar xfv libusb-1.0.20.tar.bz2 29 | 30 | cd libusb-1.0.20 31 | CONFARGS="--prefix=$PREFIX --disable-udev --enable-static --disable-shared" 32 | if [[ $CROSS_COMPILE != "" ]] ; then 33 | CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" 34 | fi 35 | CFLAGS="-w -O2 $CFLAGS" CXXFLAGS="-w -O2 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ./configure $CONFARGS 36 | make -j 1 37 | make install 38 | cd .. 39 | 40 | -------------------------------------------------------------------------------- /ncurses-patches/0001-cpp-nasty.patch: -------------------------------------------------------------------------------- 1 | diff -Naur /tmp/ncurses-5.9/c++/cursesf.h ncurses-5.9/c++/cursesf.h 2 | --- /tmp/ncurses-5.9/c++/cursesf.h 2005-08-13 20:08:24.000000000 +0200 3 | +++ ncurses-5.9/c++/cursesf.h 2017-12-18 14:50:15.358498044 +0100 4 | @@ -703,7 +703,7 @@ 5 | virtual ~NCursesUserForm() { 6 | }; 7 | 8 | - inline T* UserData (void) const { 9 | + inline T* UserData (void) { 10 | return reinterpret_cast(get_user ()); 11 | }; 12 | 13 | diff -Naur /tmp/ncurses-5.9/c++/cursesm.h ncurses-5.9/c++/cursesm.h 14 | --- /tmp/ncurses-5.9/c++/cursesm.h 2005-08-13 20:10:36.000000000 +0200 15 | +++ ncurses-5.9/c++/cursesm.h 2017-12-18 14:49:59.605164893 +0100 16 | @@ -607,7 +607,7 @@ 17 | 18 | virtual ~NCursesUserItem() {} 19 | 20 | - inline const T* UserData (void) const { 21 | + inline const T* UserData (void) { 22 | return reinterpret_cast(::item_userptr (item)); 23 | }; 24 | 25 | @@ -659,7 +659,7 @@ 26 | virtual ~NCursesUserMenu() { 27 | }; 28 | 29 | - inline T* UserData (void) const { 30 | + inline T* UserData (void) { 31 | return reinterpret_cast(get_user ()); 32 | }; 33 | 34 | diff -Naur /tmp/ncurses-5.9/c++/cursesp.h ncurses-5.9/c++/cursesp.h 35 | --- /tmp/ncurses-5.9/c++/cursesp.h 2008-08-16 19:20:23.000000000 +0200 36 | +++ ncurses-5.9/c++/cursesp.h 2017-12-18 14:48:36.728499179 +0100 37 | @@ -251,7 +251,7 @@ 38 | 39 | virtual ~NCursesUserPanel() {}; 40 | 41 | - T* UserData (void) const 42 | + T* UserData (void) 43 | { 44 | return reinterpret_cast(get_user ()); 45 | }; 46 | -------------------------------------------------------------------------------- /libelf-0.8.13.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2016 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | mkdir -p objdir 19 | cd objdir 20 | PREFIX=`pwd` 21 | cd - 22 | 23 | if [[ ! -f libelf-0.8.13.tar.gz ]] ; 24 | then 25 | wget --no-check-certificate https://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz 26 | fi 27 | 28 | tar xfv libelf-0.8.13.tar.gz 29 | 30 | cd libelf-0.8.13 31 | for p in ../libelf-0.8.13-patches/*.patch; do echo Applying $p; patch -p0 < $p; done 32 | CONFARGS="--prefix=$PREFIX --disable-shared" 33 | if [[ $CROSS_COMPILE != "" ]] ; then 34 | CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" 35 | # solve bug with --host not being effective on second level directory 36 | export CC=$CROSS_COMPILE_HOST-gcc 37 | export AR=$CROSS_COMPILE_HOST-ar 38 | export RANLIB=$CROSS_COMPILE_HOST-ranlib 39 | fi 40 | CFLAGS="-w -O2 $CFLAGS" CXXFLAGS="-w -O2 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ./configure $CONFARGS 41 | make -j 1 42 | make install 43 | cd .. 44 | 45 | -------------------------------------------------------------------------------- /avrdude-6.3-patches/02-ddk-headers.patch: -------------------------------------------------------------------------------- 1 | --- configure.ac 2 | +++ configure.ac 3 | @@ -185,6 +185,8 @@ 4 | AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h termios.h unistd.h]) 5 | AC_CHECK_HEADERS([ddk/hidsdi.h],,,[#include 6 | #include ]) 7 | +AC_CHECK_HEADERS([hidsdi.h],,,[#include 8 | +#include ]) 9 | 10 | 11 | # Checks for typedefs, structures, and compiler characteristics. 12 | @@ -202,9 +204,12 @@ 13 | case $target in 14 | *-*-mingw32* | *-*-cygwin* | *-*-windows*) 15 | LIBHID="-lhid -lsetupapi" 16 | - if test $ac_cv_header_ddk_hidsdi_h = yes 17 | + if test x$ac_cv_header_ddk_hidsdi_h = xyes 18 | then 19 | HIDINCLUDE="#include " 20 | + elif test x$ac_cv_header_hidsdi_h = xyes 21 | + then 22 | + HIDINCLUDE="#include " 23 | else 24 | HIDINCLUDE="#include \"my_ddk_hidsdi.h\"" 25 | fi 26 | --- pickit2.c 27 | +++ pickit2.c 28 | @@ -60,6 +60,8 @@ 29 | #include 30 | #if defined(HAVE_DDK_HIDSDI_H) 31 | # include 32 | +#elif defined(HAVE_HIDSDI_H) 33 | +# include 34 | #else 35 | # include "my_ddk_hidsdi.h" 36 | #endif 37 | --- ser_avrdoper.c 38 | +++ ser_avrdoper.c 39 | @@ -71,10 +71,13 @@ 40 | 41 | #if defined(HAVE_DDK_HIDSDI_H) 42 | # include 43 | +# include 44 | +#elif defined (HAVE_HIDSDI_H) 45 | +# include 46 | +# include 47 | #else 48 | # include "my_ddk_hidsdi.h" 49 | #endif 50 | -#include 51 | 52 | #ifdef USB_DEBUG 53 | #define DEBUG_PRINT(arg) printf arg 54 | --- Makefile.am 55 | +++ Makefile.am 56 | @@ -138,7 +138,6 @@ 57 | linuxgpio.h \ 58 | linux_ppdev.h \ 59 | lists.c \ 60 | - my_ddk_hidsdi.h \ 61 | par.c \ 62 | par.h \ 63 | pgm.c \ 64 | -------------------------------------------------------------------------------- /ncurses-patches/0002-clang3.patch: -------------------------------------------------------------------------------- 1 | diff -ruNp ncurses-5.9/c++/cursesf.h ncurses-5.9/c++/cursesf.h 2 | --- ncurses-5.9/c++/cursesf.h 2005-08-13 21:08:24.000000000 +0300 3 | +++ ncurses-5.9/c++/cursesf.h 2011-04-03 18:29:29.000000000 +0300 4 | @@ -681,7 +681,7 @@ public: 5 | const T* p_UserData = STATIC_CAST(T*)(0), 6 | bool with_frame=FALSE, 7 | bool autoDelete_Fields=FALSE) 8 | - : NCursesForm (Fields, with_frame, autoDelete_Fields) { 9 | + : NCursesForm (&Fields, with_frame, autoDelete_Fields) { 10 | if (form) 11 | set_user (const_cast(p_UserData)); 12 | }; 13 | @@ -694,7 +694,7 @@ public: 14 | const T* p_UserData = STATIC_CAST(T*)(0), 15 | bool with_frame=FALSE, 16 | bool autoDelete_Fields=FALSE) 17 | - : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, 18 | + : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x, 19 | with_frame, autoDelete_Fields) { 20 | if (form) 21 | set_user (const_cast(p_UserData)); 22 | diff -ruNp ncurses-5.9/c++/cursesm.h ncurses-5.9/c++/cursesm.h 23 | --- ncurses-5.9/c++/cursesm.h 2005-08-13 21:10:36.000000000 +0300 24 | +++ ncurses-5.9/c++/cursesm.h 2011-04-03 18:31:42.000000000 +0300 25 | @@ -639,7 +639,7 @@ public: 26 | const T* p_UserData = STATIC_CAST(T*)(0), 27 | bool with_frame=FALSE, 28 | bool autoDelete_Items=FALSE) 29 | - : NCursesMenu (Items, with_frame, autoDelete_Items) { 30 | + : NCursesMenu (&Items, with_frame, autoDelete_Items) { 31 | if (menu) 32 | set_user (const_cast(p_UserData)); 33 | }; 34 | @@ -651,7 +651,7 @@ public: 35 | int begin_x = 0, 36 | const T* p_UserData = STATIC_CAST(T*)(0), 37 | bool with_frame=FALSE) 38 | - : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { 39 | + : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) { 40 | if (menu) 41 | set_user (const_cast(p_UserData)); 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /avrdude-6.3.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2016 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | mkdir -p objdir 19 | cd objdir 20 | PREFIX=`pwd` 21 | cd - 22 | 23 | git clone https://github.com/facchinm/avrdude.git avrdude-6.3 --depth 1 24 | 25 | cd avrdude-6.3 26 | 27 | patch -p1 < ../avrdude-6.3-patches/90* 28 | 29 | export CFLAGS="-I$PREFIX/include -I$PREFIX/include/hidapi -I$PREFIX/include/libelf -I$PREFIX/include/ncurses -I$PREFIX/include/ncursesw -I$PREFIX/include/readline -I$PREFIX/include/libusb-1.0 $CFLAGS" 30 | export LDFLAGS="-L$PREFIX/lib $LDFLAGS" 31 | export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig 32 | 33 | autoreconf --force --install 34 | ./bootstrap 35 | if [[ $OS == "GNU/Linux" ]] ; then 36 | libtoolize 37 | fi 38 | 39 | COMMON_FLAGS="" 40 | 41 | if [[ $CROSS_COMPILE == "mingw" ]] ; then 42 | CFLAGS="-DHAVE_LIBHIDAPI $CFLAGS" 43 | LIBS="-lhidapi -lsetupapi" 44 | fi 45 | 46 | if [[ $OS == "Darwin" ]] ; then 47 | CFLAGS="-DHAVE_LIBHIDAPI $CFLAGS" 48 | LIBS="-lhidapi" 49 | fi 50 | 51 | 52 | CONFARGS="--prefix=$PREFIX --enable-linuxgpio --with-sysroot=$PREFIX" 53 | if [[ $CROSS_COMPILE != "" ]] ; then 54 | CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" 55 | fi 56 | ./configure $CONFARGS CFLAGS="-w -O2 $CFLAGS" CXXFLAGS="-w -O2 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" LIBS="$LIBS" 57 | 58 | make 59 | make install 60 | cd .. 61 | 62 | -------------------------------------------------------------------------------- /libhidapi.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2016 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | mkdir -p objdir 19 | cd objdir 20 | PREFIX=`pwd` 21 | cd - 22 | 23 | if [[ $CROSS_COMPILE != "" ]] ; then 24 | CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" 25 | fi 26 | 27 | if [[ $TARGET_OS == "GNU/Linux" ]] ; then 28 | 29 | wget https://github.com/gentoo/eudev/archive/v3.1.3.tar.gz 30 | tar xvf v3.1.3.tar.gz 31 | cd eudev-3.1.3 32 | sed -i 's|foreign 1.13|foreign 1.11|g' configure.ac 33 | ./autogen.sh 34 | ./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX $CONFARGS 35 | make clean 36 | make -j4 37 | make install 38 | cd .. 39 | rm -rf eudev 40 | 41 | fi 42 | 43 | git clone https://github.com/signal11/hidapi.git --depth 1 44 | 45 | export CFLAGS="-I$PREFIX/include -I$PREFIX/include/hidapi -I$PREFIX/include/libelf -I$PREFIX/include/ncurses -I$PREFIX/include/ncursesw -I$PREFIX/include/readline -I$PREFIX/include/libusb-1.0 $CFLAGS" 46 | export LDFLAGS="-L$PREFIX/lib $LDFLAGS" 47 | 48 | cd hidapi 49 | CONFARGS="--prefix=$PREFIX --enable-static --disable-shared" 50 | 51 | export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig 52 | 53 | if [[ $CROSS_COMPILE != "" ]] ; then 54 | CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" 55 | # solve bug with --host not being effective on second level directory 56 | export CC=$CROSS_COMPILE_HOST-gcc 57 | export AR=$CROSS_COMPILE_HOST-ar 58 | export RANLIB=$CROSS_COMPILE_HOST-ranlib 59 | fi 60 | ./bootstrap 61 | CFLAGS="-w -O2 $CFLAGS" CXXFLAGS="-w -O2 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ./configure $CONFARGS 62 | make -j 1 63 | make install 64 | cd .. 65 | -------------------------------------------------------------------------------- /libusb-compat-0.1.5.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2016 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | mkdir -p objdir 19 | cd objdir 20 | PREFIX=`pwd` 21 | cd - 22 | 23 | if [[ $OS == "Msys" || $OS == "Cygwin" || $CROSS_COMPILE_HOST == "i686-w64-mingw32" ]] ; then 24 | # libusb-compat is a mess to compile for win32 25 | # use a precompiled version from libusb-win32 project 26 | if [[ ! -f libusb-win32-bin-1.2.6.0.zip ]] ; then 27 | wget http://download.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip 28 | fi 29 | unzip libusb-win32-bin-1.2.6.0.zip 30 | #cp libusb-win32-bin-1.2.6.0/bin/x86/libusb0_x86.dll $PREFIX/bin/libusb0.dll 31 | cp libusb-win32-bin-1.2.6.0/include/lusb0_usb.h $PREFIX/include 32 | cp libusb-win32-bin-1.2.6.0/lib/gcc/libusb.a $PREFIX/lib 33 | exit 0 34 | fi 35 | 36 | if [[ ! -f libusb-compat-0.1.5.tar.bz2 ]] ; then 37 | wget http://download.sourceforge.net/project/libusb/libusb-compat-0.1/libusb-compat-0.1.5/libusb-compat-0.1.5.tar.bz2 38 | fi 39 | 40 | tar xfv libusb-compat-0.1.5.tar.bz2 41 | 42 | cd libusb-compat-0.1.5 43 | if [[ $OS == "Msys" || $OS == "Cygwin" || $CROSS_COMPILE_HOST == "i686-w64-mingw32" ]] ; then 44 | patch -p1 < ../libusb-compat-0.1.5-patches/01-mingw-build.patch 45 | autoreconf --force --install 46 | fi 47 | 48 | CONFARGS="--prefix=$PREFIX --enable-static --disable-shared" 49 | if [[ $CROSS_COMPILE != "" ]] ; then 50 | CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" 51 | fi 52 | PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" CFLAGS="-w -O2 $CFLAGS" CXXFLAGS="-w -O2 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ./configure $CONFARGS 53 | make -j 1 54 | make install 55 | cd .. 56 | 57 | -------------------------------------------------------------------------------- /libncurses-5.9.build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2016 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | mkdir -p objdir 19 | cd objdir 20 | PREFIX=`pwd` 21 | cd - 22 | 23 | if [[ $OS == "Msys" || $OS == "Cygwin" || $CROSS_COMPILE_HOST == "i686-w64-mingw32" || $CROSS_COMPILE_HOST == "aarch64-linux-gnu" ]] ; then 24 | #Avoid compiling ncurses in Windows platform 25 | exit 0 26 | fi 27 | 28 | if [[ ! -f ncurses-5.9.tar.gz ]] ; 29 | then 30 | wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz 31 | fi 32 | 33 | tar xfv ncurses-5.9.tar.gz 34 | 35 | cd ncurses-5.9 36 | 37 | for p in ../ncurses-patches/*.patch; do echo Applying $p; patch -p1 < $p; done 38 | 39 | CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --with-termlib --enable-termcap" 40 | if [[ $CROSS_COMPILE != "" ]] ; then 41 | CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" 42 | fi 43 | if [[ $MACHINE == "aarch64" ]] ; then 44 | curl "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" > config.guess 45 | fi 46 | CFLAGS="-w -O2 $CFLAGS -fPIC" CPPFLAGS="-P" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS 47 | make -j 4 48 | make install.libs 49 | cd .. 50 | 51 | if [[ ! -f readline-6.3.tar.gz ]] ; 52 | then 53 | wget https://ftp.gnu.org/gnu/readline/readline-6.3.tar.gz 54 | fi 55 | 56 | tar xfv readline-6.3.tar.gz 57 | 58 | cd readline-6.3 59 | autoconf 60 | CONFARGS="--prefix=$PREFIX --disable-shared" 61 | if [[ $CROSS_COMPILE != "" ]] ; then 62 | CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" 63 | fi 64 | CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS 65 | make -j 4 66 | make install-static 67 | cd .. 68 | 69 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ## avrdude build scripts for Arduino/Genuino 2 | 3 | This is the build script for the avrdude tool used in the [Arduino IDE](http://arduino.cc/). 4 | 5 | The latest version available is 6.3. 6 | 7 | As soon as [avrdude ships a new version](http://www.nongnu.org/avrdude/), we pull the source code, **patch it** with some user contributed patches and deliver it with the [Arduino IDE](http://arduino.cc/). 8 | Therefore, the resulting binaries may differ significantly from upstream, you should start blaming us if things are not working as expected :) 9 | 10 | ### Building 11 | 12 | Just run: 13 | 14 | ``` 15 | ./package-avrdude.bash 16 | ``` 17 | 18 | Setup has been done on partially set up development machines. 19 | If you find any package missing from the following list, please open an issue at once! 20 | 21 | #### Debian requirements 22 | 23 | ```bash 24 | sudo apt-get install build-essential bison subversion zip automake flex pkg-config 25 | ``` 26 | 27 | #### Mac OSX requirements 28 | 29 | You need to install MacPorts: https://www.macports.org/install.php. Once done, open a terminal and type: 30 | 31 | ```bash 32 | sudo port selfupdate 33 | sudo port upgrade outdated 34 | sudo port install wget +universal 35 | sudo port install automake +universal 36 | sudo port install autoconf +universal 37 | sudo port install gpatch +universal 38 | sudo port install libusb +universal 39 | ``` 40 | 41 | #### Windows cross-compile from Linux requirements 42 | 43 | ```bash 44 | sudo apt-get install gcc-mingw-w64-i686 45 | ``` 46 | 47 | When building you must set the env var `CROSS_COMPILE` to `mingw` for example: 48 | 49 | ``` 50 | CROSS_COMPILE=mingw ./package_avrdude.bash 51 | ``` 52 | 53 | cross compile with mingw has been tested on Ubuntu 14.04 (mingw-w64 4.8), different versions of mingw may behave differently and fail to build. 54 | 55 | #### Windows requirements 56 | 57 | **WARNING: the script for native Cygwin or Mingw builds has been started and abandoned in favor of cross 58 | compile with mingw (see section above). Please consider this part of the build script as a best effort 59 | bonus (it may work as it may, very probably, not work).** 60 | 61 | You need to install Cygwin: http://www.cygwin.com/. Once you have run `setup-x86.exe`, use the `Search` text field to filter and select for installation the following packages: 62 | 63 | - git 64 | - wget 65 | - unzip 66 | - zip 67 | - bison 68 | - flex 69 | - make 70 | - patch 71 | - automake 72 | - autoconf 73 | - gcc-g++ 74 | 75 | You also need to install MinGW: http://www.mingw.org/. Once you have run mingw-get-setup.exe, select and install (clicking on "Installation" -> "Apply changes") the following packages: 76 | 77 | - mingw-developer-toolkit 78 | - mingw32-base 79 | - mingw32-gcc-g++ 80 | - msys-base 81 | - msys-zip 82 | 83 | ### Upstream credits 84 | 85 | Build process ported from Debian. Thank you guys for your awesome work. 86 | 87 | ### Credits 88 | 89 | Consult the list of contributors [here](https://github.com/arduino/avrdude-build-scripts/graphs/contributors) and [here](https://github.com/arduino/toolchain-avr/graphs/contributors). 90 | 91 | ### License 92 | 93 | The bash scripts are GPLv2 licensed. Every other software used by these bash scripts has its own license. Consult them to know the terms. 94 | 95 | -------------------------------------------------------------------------------- /package-avrdude.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Copyright (c) 2014-2016 Arduino LLC 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | OUTPUT_VERSION=6.3.0-arduino18 19 | 20 | export OS=`uname -o || uname` 21 | export TARGET_OS=$OS 22 | 23 | if [[ $CROSS_COMPILE == "mingw" ]] ; then 24 | 25 | export CC="i686-w64-mingw32-gcc" 26 | export CXX="i686-w64-mingw32-g++" 27 | export CROSS_COMPILE_HOST="i686-w64-mingw32" 28 | export TARGET_OS="Windows" 29 | OUTPUT_TAG=i686-w64-mingw32 30 | 31 | elif [[ $CROSS_COMPILE == "arm64-cross" ]] ; then 32 | export CC="aarch64-linux-gnu-gcc" 33 | export CXX="aarch64-linux-gnu-g++" 34 | export CROSS_COMPILE_HOST="aarch64-linux-gnu" 35 | export TARGET_OS="GNU/Linux" 36 | OUTPUT_TAG=aarch64-linux-gnu 37 | 38 | elif [[ $CROSS_COMPILE == "arm-cross" ]] ; then 39 | export CC="arm-linux-gnueabihf-gcc" 40 | export CXX="arm-linux-gnueabihf-g++" 41 | export CROSS_COMPILE_HOST="arm-linux-gnueabihf" 42 | export TARGET_OS="GNU/Linux" 43 | OUTPUT_TAG=armhf-pc-linux-gnu 44 | 45 | elif [[ $OS == "GNU/Linux" ]] ; then 46 | 47 | export MACHINE=`uname -m` 48 | if [[ $MACHINE == "x86_64" ]] ; then 49 | OUTPUT_TAG=x86_64-pc-linux-gnu 50 | elif [[ $MACHINE == "i686" ]] ; then 51 | OUTPUT_TAG=i686-pc-linux-gnu 52 | elif [[ $MACHINE == "armv7l" ]] ; then 53 | OUTPUT_TAG=armhf-pc-linux-gnu 54 | elif [[ $MACHINE == "aarch64" ]] ; then 55 | OUTPUT_TAG=aarch64-pc-linux-gnu 56 | else 57 | echo Linux Machine not supported: $MACHINE 58 | exit 1 59 | fi 60 | 61 | elif [[ $OS == "Msys" || $OS == "Cygwin" ]] ; then 62 | 63 | echo ************************************************************* 64 | echo WARNING: Build on native Cygwin or Msys has been discontinued 65 | echo you may experience build failure or weird behaviour 66 | echo ************************************************************* 67 | 68 | export PATH=$PATH:/c/MinGW/bin/:/c/cygwin/bin/ 69 | export CC="mingw32-gcc -m32" 70 | export CXX="mingw32-g++ -m32" 71 | export TARGET_OS="Windows" 72 | OUTPUT_TAG=i686-mingw32 73 | 74 | elif [[ $OS == "Darwin" ]] ; then 75 | 76 | export PATH=/opt/local/libexec/gnubin/:/opt/local/bin:$PATH 77 | export CC="gcc -arch x86_64 -mmacosx-version-min=10.8" 78 | export CXX="g++ -arch x86_64 -mmacosx-version-min=10.8" 79 | OUTPUT_TAG=x86_64-apple-darwin12 80 | 81 | else 82 | 83 | echo OS Not supported: $OS 84 | exit 2 85 | 86 | fi 87 | 88 | rm -rf avrdude-6.3 libusb-1.0.20 libusb-compat-0.1.5 libusb-win32-bin-1.2.6.0 libelf-0.8.13 objdir ncurses-5.9 readline-6.3 hidapi 89 | 90 | ./libusb-1.0.20.build.bash 91 | ./libusb-compat-0.1.5.build.bash 92 | ./libelf-0.8.13.build.bash 93 | ./libncurses-5.9.build.bash 94 | ./libhidapi.build.bash 95 | ./avrdude-6.3.build.bash 96 | 97 | # if producing a windows build, compress as zip and 98 | # copy *toolchain-precompiled* content to any folder containing a .exe 99 | if [[ ${OUTPUT_TAG} == *"mingw"* ]] ; then 100 | 101 | cp libusb-win32-bin-1.2.6.0/bin/x86/libusb0_x86.dll objdir/bin/libusb0.dll 102 | rm -f avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip 103 | cp -a objdir avrdude 104 | zip -r avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip avrdude/bin/ avrdude/etc/avrdude.conf 105 | rm -r avrdude 106 | 107 | else 108 | 109 | rm -f avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 110 | cp -a objdir avrdude 111 | tar -cjvf avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 avrdude/bin/avrdude avrdude/etc/avrdude.conf 112 | rm -r avrdude 113 | 114 | fi 115 | 116 | -------------------------------------------------------------------------------- /avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch: -------------------------------------------------------------------------------- 1 | --- avr.c 2 | +++ avr.c 3 | @@ -1058,6 +1058,39 @@ 4 | return 0; 5 | } 6 | 7 | +uint8_t get_fuse_bitmask(AVRMEM * m) { 8 | + uint8_t bitmask_r = 0; 9 | + uint8_t bitmask_w = 0; 10 | + int i, j; 11 | + 12 | + if (m->size > 1) { 13 | + // not a fuse, compare bytes directly 14 | + return 0xFF; 15 | + } 16 | + 17 | + for (i=0; iop[i] && i == AVR_OP_READ) { 19 | + for (j=7; j>=0; j--) { 20 | + bitmask_r |= (m->op[i]->bit[j].type != AVR_CMDBIT_IGNORE) << j; 21 | + } 22 | + } 23 | + if (m->op[i] && i == AVR_OP_WRITE) { 24 | + for (j=7; j>=0; j--) { 25 | + bitmask_w |= (m->op[i]->bit[j].type != AVR_CMDBIT_VALUE && 26 | + m->op[i]->bit[j].type != AVR_CMDBIT_IGNORE) << j; 27 | + } 28 | + } 29 | + } 30 | + return bitmask_r & bitmask_w; 31 | +} 32 | + 33 | +int compare_memory_masked(AVRMEM * m, unsigned char buf1, unsigned char buf2) { 34 | + uint8_t bitmask = 0xFF; 35 | + if(m) { 36 | + bitmask = get_fuse_bitmask(m); 37 | + } 38 | + return ((buf1 & bitmask) != (buf2 & bitmask)); 39 | +} 40 | 41 | /* 42 | * Verify the memory buffer of p with that of v. The byte range of v, 43 | @@ -1104,11 +1137,18 @@ 44 | for (i=0; itags[i] & TAG_ALLOCATED) != 0 && 46 | buf1[i] != buf2[i]) { 47 | - avrdude_message(MSG_INFO, "%s: verification error, first mismatch at byte 0x%04x\n" 48 | - "%s0x%02x != 0x%02x\n", 49 | - progname, i, 50 | - progbuf, buf1[i], buf2[i]); 51 | - return -1; 52 | + if(compare_memory_masked(a , buf1[i], buf2[i])) { 53 | + avrdude_message(MSG_INFO, "%s: verification error, first mismatch at byte 0x%04x\n" 54 | + "%s0x%02x != 0x%02x\n", 55 | + progname, i, 56 | + progbuf, buf1[i], buf2[i]); 57 | + return -1; 58 | + } else { 59 | + avrdude_message(MSG_INFO, "%s: WARNING: invalid value for unused bits in fuse \"%s\", should be set to 1 according to datasheet\n" 60 | + "This behaviour is deprecated and will result in an error in future version\n" 61 | + "You probably want to use 0x%02x instead of 0x%02x (double check with your datasheet first).\n", 62 | + progname, memtype, buf1[i], buf2[i]); 63 | + } 64 | } 65 | } 66 | 67 | --- libavrdude.h 68 | +++ libavrdude.h 69 | @@ -337,6 +337,10 @@ 70 | void *cookie); 71 | void walk_avrparts(LISTID avrparts, walk_avrparts_cb cb, void *cookie); 72 | void sort_avrparts(LISTID avrparts); 73 | + 74 | +uint8_t get_fuse_bitmask(AVRMEM * m); 75 | +int compare_memory_masked(AVRMEM * m, unsigned char buf1, unsigned char buf2); 76 | + 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | --- main.c 81 | +++ main.c 82 | @@ -1264,8 +1264,11 @@ 83 | } 84 | } 85 | 86 | + AVRMEM * m; 87 | + 88 | /* Now check what fuses are against what they should be */ 89 | - if (safemodeafter_fuse != safemode_fuse) { 90 | + m = avr_locate_mem(p, "fuse"); 91 | + if (compare_memory_masked(m, safemodeafter_fuse, safemode_fuse)) { 92 | fuses_updated = 1; 93 | avrdude_message(MSG_INFO, "%s: safemode: fuse changed! Was %x, and is now %x\n", 94 | progname, safemode_fuse, safemodeafter_fuse); 95 | @@ -1293,7 +1296,8 @@ 96 | } 97 | 98 | /* Now check what fuses are against what they should be */ 99 | - if (safemodeafter_lfuse != safemode_lfuse) { 100 | + m = avr_locate_mem(p, "lfuse"); 101 | + if (compare_memory_masked(m, safemodeafter_lfuse, safemode_lfuse)) { 102 | fuses_updated = 1; 103 | avrdude_message(MSG_INFO, "%s: safemode: lfuse changed! Was %x, and is now %x\n", 104 | progname, safemode_lfuse, safemodeafter_lfuse); 105 | @@ -1321,7 +1325,8 @@ 106 | } 107 | 108 | /* Now check what fuses are against what they should be */ 109 | - if (safemodeafter_hfuse != safemode_hfuse) { 110 | + m = avr_locate_mem(p, "hfuse"); 111 | + if (compare_memory_masked(m, safemodeafter_hfuse, safemode_hfuse)) { 112 | fuses_updated = 1; 113 | avrdude_message(MSG_INFO, "%s: safemode: hfuse changed! Was %x, and is now %x\n", 114 | progname, safemode_hfuse, safemodeafter_hfuse); 115 | @@ -1346,7 +1351,8 @@ 116 | } 117 | 118 | /* Now check what fuses are against what they should be */ 119 | - if (safemodeafter_efuse != safemode_efuse) { 120 | + m = avr_locate_mem(p, "efuse"); 121 | + if (compare_memory_masked(m, safemodeafter_efuse, safemode_efuse)) { 122 | fuses_updated = 1; 123 | avrdude_message(MSG_INFO, "%s: safemode: efuse changed! Was %x, and is now %x\n", 124 | progname, safemode_efuse, safemodeafter_efuse); 125 | 126 | -------------------------------------------------------------------------------- /libusb-compat-0.1.5-patches/01-mingw-build.patch: -------------------------------------------------------------------------------- 1 | Based on the patch from Paul Fertser 2 | 3 | http://libusb.6.n5.nabble.com/libusb-PATCH-libusb-compat-mingw-cross-compilation-fixes-td5712346.html 4 | 5 | diff -ur libusb-compat-0.1.5.orig/configure.ac libusb-compat-0.1.5/configure.ac 6 | --- libusb-compat-0.1.5.orig/configure.ac 2013-05-21 01:38:16.000000000 +0200 7 | +++ libusb-compat-0.1.5/configure.ac 2016-05-12 19:10:53.607859033 +0200 8 | @@ -55,7 +55,7 @@ 9 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], inline_cflags="-fgnu89-inline", inline_cflags="") 10 | CFLAGS="$saved_cflags" 11 | 12 | -AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility]) 13 | +AC_DEFINE([DEFAULT_VISIBILITY], [__attribute__((visibility("default")))], [Default visibility]) 14 | AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow" 15 | AC_SUBST(AM_CFLAGS) 16 | 17 | diff -ur libusb-compat-0.1.5.orig/libusb/core.c libusb-compat-0.1.5/libusb/core.c 18 | --- libusb-compat-0.1.5.orig/libusb/core.c 2013-05-05 18:43:46.000000000 +0200 19 | +++ libusb-compat-0.1.5/libusb/core.c 2016-05-12 19:15:14.387849702 +0200 20 | @@ -56,7 +56,7 @@ 21 | #define usbi_warn(fmt...) _usbi_log(LOG_LEVEL_WARNING, fmt) 22 | #define usbi_err(fmt...) _usbi_log(LOG_LEVEL_ERROR, fmt) 23 | 24 | -API_EXPORTED struct usb_bus *usb_busses = NULL; 25 | +DEFAULT_VISIBILITY struct usb_bus *usb_busses = NULL; 26 | 27 | #define compat_err(e) -(errno=libusb_to_errno(e)) 28 | 29 | @@ -78,9 +78,9 @@ 30 | case LIBUSB_ERROR_BUSY: 31 | return EBUSY; 32 | case LIBUSB_ERROR_TIMEOUT: 33 | - return ETIMEDOUT; 34 | + return EIO; 35 | case LIBUSB_ERROR_OVERFLOW: 36 | - return EOVERFLOW; 37 | + return EINVAL; 38 | case LIBUSB_ERROR_PIPE: 39 | return EPIPE; 40 | case LIBUSB_ERROR_INTERRUPTED: 41 | @@ -173,7 +173,7 @@ 42 | libusb_set_debug(ctx, 3); 43 | } 44 | 45 | -API_EXPORTED char *usb_strerror(void) 46 | +DEFAULT_VISIBILITY char * LIBUSB_CALL usb_strerror(void) 47 | { 48 | return strerror(errno); 49 | } 50 | @@ -653,12 +653,12 @@ 51 | return changes; 52 | } 53 | 54 | -API_EXPORTED struct usb_bus *usb_get_busses(void) 55 | +DEFAULT_VISIBILITY struct usb_bus * LIBUSB_CALL usb_get_busses(void) 56 | { 57 | return usb_busses; 58 | } 59 | 60 | -API_EXPORTED usb_dev_handle *usb_open(struct usb_device *dev) 61 | +DEFAULT_VISIBILITY usb_dev_handle * LIBUSB_CALL usb_open(struct usb_device *dev) 62 | { 63 | int r; 64 | usbi_dbg(""); 65 | @@ -692,7 +692,7 @@ 66 | return 0; 67 | } 68 | 69 | -API_EXPORTED struct usb_device *usb_device(usb_dev_handle *dev) 70 | +DEFAULT_VISIBILITY struct usb_device * LIBUSB_CALL usb_device(usb_dev_handle *dev) 71 | { 72 | return dev->device; 73 | } 74 | @@ -918,7 +918,7 @@ 75 | snprintf(name, namelen, "dummy"); 76 | return 0; 77 | } else if (r == 0) { 78 | - return -(errno=ENODATA); 79 | + return -(errno=EINVAL); 80 | } else { 81 | return compat_err(r); 82 | } 83 | @@ -931,7 +931,7 @@ 84 | case LIBUSB_SUCCESS: 85 | return 0; 86 | case LIBUSB_ERROR_NOT_FOUND: 87 | - return -ENODATA; 88 | + return -EINVAL; 89 | case LIBUSB_ERROR_INVALID_PARAM: 90 | return -EINVAL; 91 | case LIBUSB_ERROR_NO_DEVICE: 92 | diff -ur libusb-compat-0.1.5.orig/libusb/usb.h libusb-compat-0.1.5/libusb/usb.h 93 | --- libusb-compat-0.1.5.orig/libusb/usb.h 2013-05-05 18:29:02.000000000 +0200 94 | +++ libusb-compat-0.1.5/libusb/usb.h 2016-05-12 19:19:52.811839740 +0200 95 | @@ -25,12 +25,100 @@ 96 | #ifndef __USB_H__ 97 | #define __USB_H__ 98 | 99 | +#ifdef _MSC_VER 100 | +/* on MS environments, the inline keyword is available in C++ only */ 101 | +#if !defined(__cplusplus) 102 | +#define inline __inline 103 | +#endif 104 | +/* ssize_t is also not available (copy/paste from MinGW) */ 105 | +#ifndef _SSIZE_T_DEFINED 106 | +#define _SSIZE_T_DEFINED 107 | +#undef ssize_t 108 | +#ifdef _WIN64 109 | + typedef __int64 ssize_t; 110 | +#else 111 | + typedef int ssize_t; 112 | +#endif /* _WIN64 */ 113 | +#endif /* _SSIZE_T_DEFINED */ 114 | +#endif /* _MSC_VER */ 115 | + 116 | +/* stdint.h is not available on older MSVC */ 117 | +#if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H)) 118 | +typedef unsigned __int8 uint8_t; 119 | +typedef unsigned __int16 uint16_t; 120 | +typedef unsigned __int32 uint32_t; 121 | +#else 122 | +#include 123 | +#endif 124 | + 125 | +#if !defined(_WIN32_WCE) 126 | +#include 127 | +#endif 128 | + 129 | +#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) 130 | +#include 131 | +#endif 132 | + 133 | #include 134 | #include 135 | #include 136 | 137 | #include 138 | 139 | +/* 'interface' might be defined as a macro on Windows, so we need to 140 | + * undefine it so as not to break the current libusb-compat API, because 141 | + * libusb_config_descriptor has an 'interface' member 142 | + * As this can be problematic if you include windows.h after libusb.h 143 | + * in your sources, we force windows.h to be included first. */ 144 | +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) 145 | +#include 146 | +#if defined(interface) 147 | +#undef interface 148 | +#endif 149 | +#if !defined(__CYGWIN__) 150 | +#include 151 | +#endif 152 | +#endif 153 | + 154 | +/** \def LIBUSB_CALL 155 | + * \ingroup misc 156 | + * libusb-compat's Windows calling convention. 157 | + * 158 | + * Under Windows, the selection of available compilers and configurations 159 | + * means that, unlike other platforms, there is not one true calling 160 | + * convention (calling convention: the manner in which parameters are 161 | + * passed to funcions in the generated assembly code). 162 | + * 163 | + * Matching the Windows API itself, libusb-compat uses the WINAPI convention (which 164 | + * translates to the stdcall convention) and guarantees that the 165 | + * library is compiled in this way. The public header file also includes 166 | + * appropriate annotations so that your own software will use the right 167 | + * convention, even if another convention is being used by default within 168 | + * your codebase. 169 | + * 170 | + * The one consideration that you must apply in your software is to mark 171 | + * all functions which you use as libusb-compat callbacks with this LIBUSB_CALL 172 | + * annotation, so that they too get compiled for the correct calling 173 | + * convention. 174 | + * 175 | + * On non-Windows operating systems, this macro is defined as nothing. This 176 | + * means that you can apply it to your code without worrying about 177 | + * cross-platform compatibility. 178 | + */ 179 | +/* LIBUSB_CALL must be defined on both definition and declaration of libusb-compat 180 | + * functions. You'd think that declaration would be enough, but cygwin will 181 | + * complain about conflicting types unless both are marked this way. 182 | + * The placement of this macro is important too; it must appear after the 183 | + * return type, before the function name. See internal documentation for 184 | + * API_EXPORTED. 185 | + */ 186 | +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) 187 | +#define LIBUSB_CALL WINAPI 188 | +#else 189 | +#define LIBUSB_CALL 190 | +#endif 191 | + 192 | + 193 | /* 194 | * USB spec information 195 | * 196 | @@ -78,40 +166,40 @@ 197 | 198 | /* All standard descriptors have these 2 fields in common */ 199 | struct usb_descriptor_header { 200 | - u_int8_t bLength; 201 | - u_int8_t bDescriptorType; 202 | + uint8_t bLength; 203 | + uint8_t bDescriptorType; 204 | }; 205 | 206 | /* String descriptor */ 207 | struct usb_string_descriptor { 208 | - u_int8_t bLength; 209 | - u_int8_t bDescriptorType; 210 | - u_int16_t wData[1]; 211 | + uint8_t bLength; 212 | + uint8_t bDescriptorType; 213 | + uint16_t wData[1]; 214 | }; 215 | 216 | /* HID descriptor */ 217 | struct usb_hid_descriptor { 218 | - u_int8_t bLength; 219 | - u_int8_t bDescriptorType; 220 | - u_int16_t bcdHID; 221 | - u_int8_t bCountryCode; 222 | - u_int8_t bNumDescriptors; 223 | - /* u_int8_t bReportDescriptorType; */ 224 | - /* u_int16_t wDescriptorLength; */ 225 | + uint8_t bLength; 226 | + uint8_t bDescriptorType; 227 | + uint16_t bcdHID; 228 | + uint8_t bCountryCode; 229 | + uint8_t bNumDescriptors; 230 | + /* uint8_t bReportDescriptorType; */ 231 | + /* uint16_t wDescriptorLength; */ 232 | /* ... */ 233 | }; 234 | 235 | /* Endpoint descriptor */ 236 | #define USB_MAXENDPOINTS 32 237 | struct usb_endpoint_descriptor { 238 | - u_int8_t bLength; 239 | - u_int8_t bDescriptorType; 240 | - u_int8_t bEndpointAddress; 241 | - u_int8_t bmAttributes; 242 | - u_int16_t wMaxPacketSize; 243 | - u_int8_t bInterval; 244 | - u_int8_t bRefresh; 245 | - u_int8_t bSynchAddress; 246 | + uint8_t bLength; 247 | + uint8_t bDescriptorType; 248 | + uint8_t bEndpointAddress; 249 | + uint8_t bmAttributes; 250 | + uint16_t wMaxPacketSize; 251 | + uint8_t bInterval; 252 | + uint8_t bRefresh; 253 | + uint8_t bSynchAddress; 254 | 255 | unsigned char *extra; /* Extra descriptors */ 256 | int extralen; 257 | @@ -129,15 +217,15 @@ 258 | /* Interface descriptor */ 259 | #define USB_MAXINTERFACES 32 260 | struct usb_interface_descriptor { 261 | - u_int8_t bLength; 262 | - u_int8_t bDescriptorType; 263 | - u_int8_t bInterfaceNumber; 264 | - u_int8_t bAlternateSetting; 265 | - u_int8_t bNumEndpoints; 266 | - u_int8_t bInterfaceClass; 267 | - u_int8_t bInterfaceSubClass; 268 | - u_int8_t bInterfaceProtocol; 269 | - u_int8_t iInterface; 270 | + uint8_t bLength; 271 | + uint8_t bDescriptorType; 272 | + uint8_t bInterfaceNumber; 273 | + uint8_t bAlternateSetting; 274 | + uint8_t bNumEndpoints; 275 | + uint8_t bInterfaceClass; 276 | + uint8_t bInterfaceSubClass; 277 | + uint8_t bInterfaceProtocol; 278 | + uint8_t iInterface; 279 | 280 | struct usb_endpoint_descriptor *endpoint; 281 | 282 | @@ -155,14 +243,14 @@ 283 | /* Configuration descriptor information.. */ 284 | #define USB_MAXCONFIG 8 285 | struct usb_config_descriptor { 286 | - u_int8_t bLength; 287 | - u_int8_t bDescriptorType; 288 | - u_int16_t wTotalLength; 289 | - u_int8_t bNumInterfaces; 290 | - u_int8_t bConfigurationValue; 291 | - u_int8_t iConfiguration; 292 | - u_int8_t bmAttributes; 293 | - u_int8_t MaxPower; 294 | + uint8_t bLength; 295 | + uint8_t bDescriptorType; 296 | + uint16_t wTotalLength; 297 | + uint8_t bNumInterfaces; 298 | + uint8_t bConfigurationValue; 299 | + uint8_t iConfiguration; 300 | + uint8_t bmAttributes; 301 | + uint8_t MaxPower; 302 | 303 | struct usb_interface *interface; 304 | 305 | @@ -172,28 +260,28 @@ 306 | 307 | /* Device descriptor */ 308 | struct usb_device_descriptor { 309 | - u_int8_t bLength; 310 | - u_int8_t bDescriptorType; 311 | - u_int16_t bcdUSB; 312 | - u_int8_t bDeviceClass; 313 | - u_int8_t bDeviceSubClass; 314 | - u_int8_t bDeviceProtocol; 315 | - u_int8_t bMaxPacketSize0; 316 | - u_int16_t idVendor; 317 | - u_int16_t idProduct; 318 | - u_int16_t bcdDevice; 319 | - u_int8_t iManufacturer; 320 | - u_int8_t iProduct; 321 | - u_int8_t iSerialNumber; 322 | - u_int8_t bNumConfigurations; 323 | + uint8_t bLength; 324 | + uint8_t bDescriptorType; 325 | + uint16_t bcdUSB; 326 | + uint8_t bDeviceClass; 327 | + uint8_t bDeviceSubClass; 328 | + uint8_t bDeviceProtocol; 329 | + uint8_t bMaxPacketSize0; 330 | + uint16_t idVendor; 331 | + uint16_t idProduct; 332 | + uint16_t bcdDevice; 333 | + uint8_t iManufacturer; 334 | + uint8_t iProduct; 335 | + uint8_t iSerialNumber; 336 | + uint8_t bNumConfigurations; 337 | }; 338 | 339 | struct usb_ctrl_setup { 340 | - u_int8_t bRequestType; 341 | - u_int8_t bRequest; 342 | - u_int16_t wValue; 343 | - u_int16_t wIndex; 344 | - u_int16_t wLength; 345 | + uint8_t bRequestType; 346 | + uint8_t bRequest; 347 | + uint16_t wValue; 348 | + uint16_t wIndex; 349 | + uint16_t wLength; 350 | }; 351 | 352 | /* 353 | @@ -254,7 +342,7 @@ 354 | 355 | void *dev; /* Darwin support */ 356 | 357 | - u_int8_t devnum; 358 | + uint8_t devnum; 359 | 360 | unsigned char num_children; 361 | struct usb_device **children; 362 | @@ -266,7 +354,7 @@ 363 | char dirname[PATH_MAX + 1]; 364 | 365 | struct usb_device *devices; 366 | - u_int32_t location; 367 | + uint32_t location; 368 | 369 | struct usb_device *root_dev; 370 | }; 371 | @@ -284,52 +372,52 @@ 372 | /* Function prototypes */ 373 | 374 | /* usb.c */ 375 | -usb_dev_handle *usb_open(struct usb_device *dev); 376 | -int usb_close(usb_dev_handle *dev); 377 | -int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, 378 | +usb_dev_handle * LIBUSB_CALL usb_open(struct usb_device *dev); 379 | +int LIBUSB_CALL usb_close(usb_dev_handle *dev); 380 | +int LIBUSB_CALL usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, 381 | size_t buflen); 382 | -int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, 383 | +int LIBUSB_CALL usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, 384 | size_t buflen); 385 | 386 | /* descriptors.c */ 387 | -int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, 388 | +int LIBUSB_CALL usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, 389 | unsigned char type, unsigned char index, void *buf, int size); 390 | -int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, 391 | +int LIBUSB_CALL usb_get_descriptor(usb_dev_handle *udev, unsigned char type, 392 | unsigned char index, void *buf, int size); 393 | 394 | /* .c */ 395 | -int usb_bulk_write(usb_dev_handle *dev, int ep, const char *bytes, int size, 396 | +int LIBUSB_CALL usb_bulk_write(usb_dev_handle *dev, int ep, const char *bytes, int size, 397 | int timeout); 398 | -int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, 399 | +int LIBUSB_CALL usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, 400 | int timeout); 401 | -int usb_interrupt_write(usb_dev_handle *dev, int ep, const char *bytes, 402 | +int LIBUSB_CALL usb_interrupt_write(usb_dev_handle *dev, int ep, const char *bytes, 403 | int size, int timeout); 404 | -int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, 405 | +int LIBUSB_CALL usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, 406 | int timeout); 407 | -int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, 408 | +int LIBUSB_CALL usb_control_msg(usb_dev_handle *dev, int requesttype, int request, 409 | int value, int index, char *bytes, int size, int timeout); 410 | -int usb_set_configuration(usb_dev_handle *dev, int configuration); 411 | -int usb_claim_interface(usb_dev_handle *dev, int interface); 412 | -int usb_release_interface(usb_dev_handle *dev, int interface); 413 | -int usb_set_altinterface(usb_dev_handle *dev, int alternate); 414 | -int usb_resetep(usb_dev_handle *dev, unsigned int ep); 415 | -int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); 416 | -int usb_reset(usb_dev_handle *dev); 417 | +int LIBUSB_CALL usb_set_configuration(usb_dev_handle *dev, int configuration); 418 | +int LIBUSB_CALL usb_claim_interface(usb_dev_handle *dev, int interface); 419 | +int LIBUSB_CALL usb_release_interface(usb_dev_handle *dev, int interface); 420 | +int LIBUSB_CALL usb_set_altinterface(usb_dev_handle *dev, int alternate); 421 | +int LIBUSB_CALL usb_resetep(usb_dev_handle *dev, unsigned int ep); 422 | +int LIBUSB_CALL usb_clear_halt(usb_dev_handle *dev, unsigned int ep); 423 | +int LIBUSB_CALL usb_reset(usb_dev_handle *dev); 424 | 425 | #define LIBUSB_HAS_GET_DRIVER_NP 1 426 | -int usb_get_driver_np(usb_dev_handle *dev, int interface, char *name, 427 | +int LIBUSB_CALL usb_get_driver_np(usb_dev_handle *dev, int interface, char *name, 428 | unsigned int namelen); 429 | #define LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP 1 430 | -int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface); 431 | +int LIBUSB_CALL usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface); 432 | 433 | -char *usb_strerror(void); 434 | +char * LIBUSB_CALL usb_strerror(void); 435 | 436 | -void usb_init(void); 437 | -void usb_set_debug(int level); 438 | -int usb_find_busses(void); 439 | -int usb_find_devices(void); 440 | -struct usb_device *usb_device(usb_dev_handle *dev); 441 | -struct usb_bus *usb_get_busses(void); 442 | +void LIBUSB_CALL usb_init(void); 443 | +void LIBUSB_CALL usb_set_debug(int level); 444 | +int LIBUSB_CALL usb_find_busses(void); 445 | +int LIBUSB_CALL usb_find_devices(void); 446 | +struct usb_device * LIBUSB_CALL usb_device(usb_dev_handle *dev); 447 | +struct usb_bus * LIBUSB_CALL usb_get_busses(void); 448 | 449 | #ifdef __cplusplus 450 | } 451 | diff -ur libusb-compat-0.1.5.orig/libusb/usbi.h libusb-compat-0.1.5/libusb/usbi.h 452 | --- libusb-compat-0.1.5.orig/libusb/usbi.h 2013-05-05 18:29:02.000000000 +0200 453 | +++ libusb-compat-0.1.5/libusb/usbi.h 2016-05-12 19:10:53.607859033 +0200 454 | @@ -56,5 +56,14 @@ 455 | int last_claimed_interface; 456 | }; 457 | 458 | +/* Inside the libusb-compat code, mark all public functions as follows: 459 | + * return_type API_EXPORTED function_name(params) { ... } 460 | + * But if the function returns a pointer, mark it as follows: 461 | + * DEFAULT_VISIBILITY return_type * LIBUSB_CALL function_name(params) { ... } 462 | + * In the libusb-compat public header, mark all declarations as: 463 | + * return_type LIBUSB_CALL function_name(params); 464 | + */ 465 | +#define API_EXPORTED LIBUSB_CALL DEFAULT_VISIBILITY 466 | + 467 | #endif 468 | 469 | -------------------------------------------------------------------------------- /libelf-0.8.13-patches/01-config.guess.patch: -------------------------------------------------------------------------------- 1 | --- config.guess 2005-05-21 15:28:37.000000000 +0000 2 | +++ config.guess 2018-03-08 22:19:13.118626724 +0000 3 | @@ -1,13 +1,12 @@ 4 | #! /bin/sh 5 | # Attempt to guess a canonical system name. 6 | -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 7 | -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 8 | +# Copyright 1992-2015 Free Software Foundation, Inc. 9 | 10 | -timestamp='2004-06-11' 11 | +timestamp='2015-01-01' 12 | 13 | # This file is free software; you can redistribute it and/or modify it 14 | # 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 | +# the Free Software Foundation; either version 3 of the License, or 17 | # (at your option) any later version. 18 | # 19 | # This program is distributed in the hope that it will be useful, but 20 | @@ -16,24 +15,22 @@ 21 | # General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | -# along with this program; if not, write to the Free Software 25 | -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 26 | +# along with this program; if not, see . 27 | # 28 | # As a special exception to the GNU General Public License, if you 29 | # distribute this file as part of a program that contains a 30 | # configuration script generated by Autoconf, you may include it under 31 | -# the same distribution terms that you use for the rest of that program. 32 | - 33 | -# Originally written by Per Bothner . 34 | -# Please send patches to . Submit a context 35 | -# diff and a properly formatted ChangeLog entry. 36 | +# the same distribution terms that you use for the rest of that 37 | +# program. This Exception is an additional permission under section 7 38 | +# of the GNU General Public License, version 3 ("GPLv3"). 39 | +# 40 | +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. 41 | # 42 | -# This script attempts to guess a canonical system name similar to 43 | -# config.sub. If it succeeds, it prints the system name on stdout, and 44 | -# exits with 0. Otherwise, it exits with 1. 45 | +# You can get the latest version of this script from: 46 | +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 47 | # 48 | -# The plan is that this can be called by configure scripts if you 49 | -# don't specify an explicit build system type. 50 | +# Please send patches to . 51 | + 52 | 53 | me=`echo "$0" | sed -e 's,.*/,,'` 54 | 55 | @@ -53,8 +50,7 @@ 56 | GNU config.guess ($timestamp) 57 | 58 | Originally written by Per Bothner. 59 | -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 60 | -Free Software Foundation, Inc. 61 | +Copyright 1992-2015 Free Software Foundation, Inc. 62 | 63 | This is free software; see the source for copying conditions. There is NO 64 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 65 | @@ -66,11 +62,11 @@ 66 | while test $# -gt 0 ; do 67 | case $1 in 68 | --time-stamp | --time* | -t ) 69 | - echo "$timestamp" ; exit 0 ;; 70 | + echo "$timestamp" ; exit ;; 71 | --version | -v ) 72 | - echo "$version" ; exit 0 ;; 73 | + echo "$version" ; exit ;; 74 | --help | --h* | -h ) 75 | - echo "$usage"; exit 0 ;; 76 | + echo "$usage"; exit ;; 77 | -- ) # Stop option processing 78 | shift; break ;; 79 | - ) # Use stdin as input. 80 | @@ -104,7 +100,7 @@ 81 | trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 82 | trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 83 | : ${TMPDIR=/tmp} ; 84 | - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 85 | + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 86 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 87 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 88 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 89 | @@ -123,7 +119,7 @@ 90 | ;; 91 | ,,*) CC_FOR_BUILD=$CC ;; 92 | ,*,*) CC_FOR_BUILD=$HOST_CC ;; 93 | -esac ;' 94 | +esac ; set_cc_for_build= ;' 95 | 96 | # This is needed to find uname on a Pyramid OSx when run in the BSD universe. 97 | # (ghazi@noc.rutgers.edu 1994-08-24) 98 | @@ -136,12 +132,33 @@ 99 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 100 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 101 | 102 | +case "${UNAME_SYSTEM}" in 103 | +Linux|GNU|GNU/*) 104 | + # If the system lacks a compiler, then just pick glibc. 105 | + # We could probably try harder. 106 | + LIBC=gnu 107 | + 108 | + eval $set_cc_for_build 109 | + cat <<-EOF > $dummy.c 110 | + #include 111 | + #if defined(__UCLIBC__) 112 | + LIBC=uclibc 113 | + #elif defined(__dietlibc__) 114 | + LIBC=dietlibc 115 | + #else 116 | + LIBC=gnu 117 | + #endif 118 | + EOF 119 | + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` 120 | + ;; 121 | +esac 122 | + 123 | # Note: order is significant - the case branches are not exclusive. 124 | 125 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 126 | *:NetBSD:*:*) 127 | # NetBSD (nbsd) targets should (where applicable) match one or 128 | - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 129 | + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 130 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 131 | # switched to ELF, *-*-netbsd* would select the old 132 | # object file format. This provides both forward 133 | @@ -158,6 +175,7 @@ 134 | arm*) machine=arm-unknown ;; 135 | sh3el) machine=shl-unknown ;; 136 | sh3eb) machine=sh-unknown ;; 137 | + sh5el) machine=sh5le-unknown ;; 138 | *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 139 | esac 140 | # The Operating System including object format, if it has switched 141 | @@ -166,7 +184,7 @@ 142 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) 143 | eval $set_cc_for_build 144 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 145 | - | grep __ELF__ >/dev/null 146 | + | grep -q __ELF__ 147 | then 148 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 149 | # Return netbsd for either. FIX? 150 | @@ -176,7 +194,7 @@ 151 | fi 152 | ;; 153 | *) 154 | - os=netbsd 155 | + os=netbsd 156 | ;; 157 | esac 158 | # The OS release 159 | @@ -196,71 +214,34 @@ 160 | # contains redundant information, the shorter form: 161 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 162 | echo "${machine}-${os}${release}" 163 | - exit 0 ;; 164 | - amd64:OpenBSD:*:*) 165 | - echo x86_64-unknown-openbsd${UNAME_RELEASE} 166 | - exit 0 ;; 167 | - amiga:OpenBSD:*:*) 168 | - echo m68k-unknown-openbsd${UNAME_RELEASE} 169 | - exit 0 ;; 170 | - arc:OpenBSD:*:*) 171 | - echo mipsel-unknown-openbsd${UNAME_RELEASE} 172 | - exit 0 ;; 173 | - cats:OpenBSD:*:*) 174 | - echo arm-unknown-openbsd${UNAME_RELEASE} 175 | - exit 0 ;; 176 | - hp300:OpenBSD:*:*) 177 | - echo m68k-unknown-openbsd${UNAME_RELEASE} 178 | - exit 0 ;; 179 | - luna88k:OpenBSD:*:*) 180 | - echo m88k-unknown-openbsd${UNAME_RELEASE} 181 | - exit 0 ;; 182 | - mac68k:OpenBSD:*:*) 183 | - echo m68k-unknown-openbsd${UNAME_RELEASE} 184 | - exit 0 ;; 185 | - macppc:OpenBSD:*:*) 186 | - echo powerpc-unknown-openbsd${UNAME_RELEASE} 187 | - exit 0 ;; 188 | - mvme68k:OpenBSD:*:*) 189 | - echo m68k-unknown-openbsd${UNAME_RELEASE} 190 | - exit 0 ;; 191 | - mvme88k:OpenBSD:*:*) 192 | - echo m88k-unknown-openbsd${UNAME_RELEASE} 193 | - exit 0 ;; 194 | - mvmeppc:OpenBSD:*:*) 195 | - echo powerpc-unknown-openbsd${UNAME_RELEASE} 196 | - exit 0 ;; 197 | - pmax:OpenBSD:*:*) 198 | - echo mipsel-unknown-openbsd${UNAME_RELEASE} 199 | - exit 0 ;; 200 | - sgi:OpenBSD:*:*) 201 | - echo mipseb-unknown-openbsd${UNAME_RELEASE} 202 | - exit 0 ;; 203 | - sun3:OpenBSD:*:*) 204 | - echo m68k-unknown-openbsd${UNAME_RELEASE} 205 | - exit 0 ;; 206 | - wgrisc:OpenBSD:*:*) 207 | - echo mipsel-unknown-openbsd${UNAME_RELEASE} 208 | - exit 0 ;; 209 | + exit ;; 210 | + *:Bitrig:*:*) 211 | + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 212 | + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} 213 | + exit ;; 214 | *:OpenBSD:*:*) 215 | - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} 216 | - exit 0 ;; 217 | + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 218 | + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 219 | + exit ;; 220 | *:ekkoBSD:*:*) 221 | echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 222 | - exit 0 ;; 223 | + exit ;; 224 | + *:SolidBSD:*:*) 225 | + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 226 | + exit ;; 227 | macppc:MirBSD:*:*) 228 | - echo powerppc-unknown-mirbsd${UNAME_RELEASE} 229 | - exit 0 ;; 230 | + echo powerpc-unknown-mirbsd${UNAME_RELEASE} 231 | + exit ;; 232 | *:MirBSD:*:*) 233 | echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 234 | - exit 0 ;; 235 | + exit ;; 236 | alpha:OSF1:*:*) 237 | case $UNAME_RELEASE in 238 | *4.0) 239 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 240 | ;; 241 | *5.*) 242 | - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 243 | + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 244 | ;; 245 | esac 246 | # According to Compaq, /usr/sbin/psrinfo has been available on 247 | @@ -306,40 +287,46 @@ 248 | # A Xn.n version is an unreleased experimental baselevel. 249 | # 1.2 uses "1.2" for uname -r. 250 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 251 | - exit 0 ;; 252 | - Alpha*:OpenVMS:*:*) 253 | - echo alpha-hp-vms 254 | - exit 0 ;; 255 | + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 256 | + exitcode=$? 257 | + trap '' 0 258 | + exit $exitcode ;; 259 | Alpha\ *:Windows_NT*:*) 260 | # How do we know it's Interix rather than the generic POSIX subsystem? 261 | # Should we change UNAME_MACHINE based on the output of uname instead 262 | # of the specific Alpha model? 263 | echo alpha-pc-interix 264 | - exit 0 ;; 265 | + exit ;; 266 | 21064:Windows_NT:50:3) 267 | echo alpha-dec-winnt3.5 268 | - exit 0 ;; 269 | + exit ;; 270 | Amiga*:UNIX_System_V:4.0:*) 271 | echo m68k-unknown-sysv4 272 | - exit 0;; 273 | + exit ;; 274 | *:[Aa]miga[Oo][Ss]:*:*) 275 | echo ${UNAME_MACHINE}-unknown-amigaos 276 | - exit 0 ;; 277 | + exit ;; 278 | *:[Mm]orph[Oo][Ss]:*:*) 279 | echo ${UNAME_MACHINE}-unknown-morphos 280 | - exit 0 ;; 281 | + exit ;; 282 | *:OS/390:*:*) 283 | echo i370-ibm-openedition 284 | - exit 0 ;; 285 | + exit ;; 286 | + *:z/VM:*:*) 287 | + echo s390-ibm-zvmoe 288 | + exit ;; 289 | *:OS400:*:*) 290 | - echo powerpc-ibm-os400 291 | - exit 0 ;; 292 | + echo powerpc-ibm-os400 293 | + exit ;; 294 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 295 | echo arm-acorn-riscix${UNAME_RELEASE} 296 | - exit 0;; 297 | + exit ;; 298 | + arm*:riscos:*:*|arm*:RISCOS:*:*) 299 | + echo arm-unknown-riscos 300 | + exit ;; 301 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 302 | echo hppa1.1-hitachi-hiuxmpp 303 | - exit 0;; 304 | + exit ;; 305 | Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 306 | # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 307 | if test "`(/bin/universe) 2>/dev/null`" = att ; then 308 | @@ -347,32 +334,51 @@ 309 | else 310 | echo pyramid-pyramid-bsd 311 | fi 312 | - exit 0 ;; 313 | + exit ;; 314 | NILE*:*:*:dcosx) 315 | echo pyramid-pyramid-svr4 316 | - exit 0 ;; 317 | + exit ;; 318 | DRS?6000:unix:4.0:6*) 319 | echo sparc-icl-nx6 320 | - exit 0 ;; 321 | - DRS?6000:UNIX_SV:4.2*:7*) 322 | + exit ;; 323 | + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 324 | case `/usr/bin/uname -p` in 325 | - sparc) echo sparc-icl-nx7 && exit 0 ;; 326 | + sparc) echo sparc-icl-nx7; exit ;; 327 | esac ;; 328 | + s390x:SunOS:*:*) 329 | + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 330 | + exit ;; 331 | sun4H:SunOS:5.*:*) 332 | echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 333 | - exit 0 ;; 334 | + exit ;; 335 | sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 336 | echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 337 | - exit 0 ;; 338 | - i86pc:SunOS:5.*:*) 339 | - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 340 | - exit 0 ;; 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 0 ;; 367 | + exit ;; 368 | sun4*:SunOS:*:*) 369 | case "`/usr/bin/arch -k`" in 370 | Series*|S4*) 371 | @@ -381,10 +387,10 @@ 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 0 ;; 376 | + exit ;; 377 | sun3*:SunOS:*:*) 378 | echo m68k-sun-sunos${UNAME_RELEASE} 379 | - exit 0 ;; 380 | + exit ;; 381 | sun*:*:4.2BSD:*) 382 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 383 | test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 384 | @@ -396,10 +402,10 @@ 385 | echo sparc-sun-sunos${UNAME_RELEASE} 386 | ;; 387 | esac 388 | - exit 0 ;; 389 | + exit ;; 390 | aushp:SunOS:*:*) 391 | echo sparc-auspex-sunos${UNAME_RELEASE} 392 | - exit 0 ;; 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 | @@ -409,41 +415,41 @@ 398 | # MiNT. But MiNT is downward compatible to TOS, so this should 399 | # be no problem. 400 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 401 | - echo m68k-atari-mint${UNAME_RELEASE} 402 | - exit 0 ;; 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 0 ;; 408 | + exit ;; 409 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 410 | - echo m68k-atari-mint${UNAME_RELEASE} 411 | - exit 0 ;; 412 | + echo m68k-atari-mint${UNAME_RELEASE} 413 | + exit ;; 414 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 415 | - echo m68k-milan-mint${UNAME_RELEASE} 416 | - exit 0 ;; 417 | + echo m68k-milan-mint${UNAME_RELEASE} 418 | + exit ;; 419 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 420 | - echo m68k-hades-mint${UNAME_RELEASE} 421 | - exit 0 ;; 422 | + echo m68k-hades-mint${UNAME_RELEASE} 423 | + exit ;; 424 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 425 | - echo m68k-unknown-mint${UNAME_RELEASE} 426 | - exit 0 ;; 427 | + echo m68k-unknown-mint${UNAME_RELEASE} 428 | + exit ;; 429 | m68k:machten:*:*) 430 | echo m68k-apple-machten${UNAME_RELEASE} 431 | - exit 0 ;; 432 | + exit ;; 433 | powerpc:machten:*:*) 434 | echo powerpc-apple-machten${UNAME_RELEASE} 435 | - exit 0 ;; 436 | + exit ;; 437 | RISC*:Mach:*:*) 438 | echo mips-dec-mach_bsd4.3 439 | - exit 0 ;; 440 | + exit ;; 441 | RISC*:ULTRIX:*:*) 442 | echo mips-dec-ultrix${UNAME_RELEASE} 443 | - exit 0 ;; 444 | + exit ;; 445 | VAX*:ULTRIX*:*:*) 446 | echo vax-dec-ultrix${UNAME_RELEASE} 447 | - exit 0 ;; 448 | + exit ;; 449 | 2020:CLIX:*:* | 2430:CLIX:*:*) 450 | echo clipper-intergraph-clix${UNAME_RELEASE} 451 | - exit 0 ;; 452 | + exit ;; 453 | mips:*:*:UMIPS | mips:*:*:RISCos) 454 | eval $set_cc_for_build 455 | sed 's/^ //' << EOF >$dummy.c 456 | @@ -467,35 +473,36 @@ 457 | exit (-1); 458 | } 459 | EOF 460 | - $CC_FOR_BUILD -o $dummy $dummy.c \ 461 | - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ 462 | - && exit 0 463 | + $CC_FOR_BUILD -o $dummy $dummy.c && 464 | + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 465 | + SYSTEM_NAME=`$dummy $dummyarg` && 466 | + { echo "$SYSTEM_NAME"; exit; } 467 | echo mips-mips-riscos${UNAME_RELEASE} 468 | - exit 0 ;; 469 | + exit ;; 470 | Motorola:PowerMAX_OS:*:*) 471 | echo powerpc-motorola-powermax 472 | - exit 0 ;; 473 | + exit ;; 474 | Motorola:*:4.3:PL8-*) 475 | echo powerpc-harris-powermax 476 | - exit 0 ;; 477 | + exit ;; 478 | Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 479 | echo powerpc-harris-powermax 480 | - exit 0 ;; 481 | + exit ;; 482 | Night_Hawk:Power_UNIX:*:*) 483 | echo powerpc-harris-powerunix 484 | - exit 0 ;; 485 | + exit ;; 486 | m88k:CX/UX:7*:*) 487 | echo m88k-harris-cxux7 488 | - exit 0 ;; 489 | + exit ;; 490 | m88k:*:4*:R4*) 491 | echo m88k-motorola-sysv4 492 | - exit 0 ;; 493 | + exit ;; 494 | m88k:*:3*:R3*) 495 | echo m88k-motorola-sysv3 496 | - exit 0 ;; 497 | + exit ;; 498 | AViiON:dgux:*:*) 499 | - # DG/UX returns AViiON for all architectures 500 | - UNAME_PROCESSOR=`/usr/bin/uname -p` 501 | + # DG/UX returns AViiON for all architectures 502 | + UNAME_PROCESSOR=`/usr/bin/uname -p` 503 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 504 | then 505 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 506 | @@ -508,29 +515,29 @@ 507 | else 508 | echo i586-dg-dgux${UNAME_RELEASE} 509 | fi 510 | - exit 0 ;; 511 | + exit ;; 512 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) 513 | echo m88k-dolphin-sysv3 514 | - exit 0 ;; 515 | + exit ;; 516 | M88*:*:R3*:*) 517 | # Delta 88k system running SVR3 518 | echo m88k-motorola-sysv3 519 | - exit 0 ;; 520 | + exit ;; 521 | XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 522 | echo m88k-tektronix-sysv3 523 | - exit 0 ;; 524 | + exit ;; 525 | Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 526 | echo m68k-tektronix-bsd 527 | - exit 0 ;; 528 | + exit ;; 529 | *:IRIX*:*:*) 530 | echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 531 | - exit 0 ;; 532 | + exit ;; 533 | ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 534 | - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 535 | - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 536 | + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 537 | + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 538 | i*86:AIX:*:*) 539 | echo i386-ibm-aix 540 | - exit 0 ;; 541 | + exit ;; 542 | ia64:AIX:*:*) 543 | if [ -x /usr/bin/oslevel ] ; then 544 | IBM_REV=`/usr/bin/oslevel` 545 | @@ -538,7 +545,7 @@ 546 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 547 | fi 548 | echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 549 | - exit 0 ;; 550 | + exit ;; 551 | *:AIX:2:3) 552 | if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 553 | eval $set_cc_for_build 554 | @@ -553,49 +560,54 @@ 555 | exit(0); 556 | } 557 | EOF 558 | - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 559 | - echo rs6000-ibm-aix3.2.5 560 | + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 561 | + then 562 | + echo "$SYSTEM_NAME" 563 | + else 564 | + echo rs6000-ibm-aix3.2.5 565 | + fi 566 | elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 567 | echo rs6000-ibm-aix3.2.4 568 | else 569 | echo rs6000-ibm-aix3.2 570 | fi 571 | - exit 0 ;; 572 | - *:AIX:*:[45]) 573 | + exit ;; 574 | + *:AIX:*:[4567]) 575 | IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 576 | if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 577 | IBM_ARCH=rs6000 578 | else 579 | IBM_ARCH=powerpc 580 | fi 581 | - if [ -x /usr/bin/oslevel ] ; then 582 | - IBM_REV=`/usr/bin/oslevel` 583 | + if [ -x /usr/bin/lslpp ] ; then 584 | + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | 585 | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 586 | else 587 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 588 | fi 589 | echo ${IBM_ARCH}-ibm-aix${IBM_REV} 590 | - exit 0 ;; 591 | + exit ;; 592 | *:AIX:*:*) 593 | echo rs6000-ibm-aix 594 | - exit 0 ;; 595 | + exit ;; 596 | ibmrt:4.4BSD:*|romp-ibm:BSD:*) 597 | echo romp-ibm-bsd4.4 598 | - exit 0 ;; 599 | + exit ;; 600 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 601 | echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 602 | - exit 0 ;; # report: romp-ibm BSD 4.3 603 | + exit ;; # report: romp-ibm BSD 4.3 604 | *:BOSX:*:*) 605 | echo rs6000-bull-bosx 606 | - exit 0 ;; 607 | + exit ;; 608 | DPX/2?00:B.O.S.:*:*) 609 | echo m68k-bull-sysv3 610 | - exit 0 ;; 611 | + exit ;; 612 | 9000/[34]??:4.3bsd:1.*:*) 613 | echo m68k-hp-bsd 614 | - exit 0 ;; 615 | + exit ;; 616 | hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 617 | echo m68k-hp-bsd4.4 618 | - exit 0 ;; 619 | + exit ;; 620 | 9000/[34678]??:HP-UX:*:*) 621 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 622 | case "${UNAME_MACHINE}" in 623 | @@ -604,52 +616,52 @@ 624 | 9000/[678][0-9][0-9]) 625 | if [ -x /usr/bin/getconf ]; then 626 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 627 | - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 628 | - case "${sc_cpu_version}" in 629 | - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 630 | - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 631 | - 532) # CPU_PA_RISC2_0 632 | - case "${sc_kernel_bits}" in 633 | - 32) HP_ARCH="hppa2.0n" ;; 634 | - 64) HP_ARCH="hppa2.0w" ;; 635 | + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 636 | + case "${sc_cpu_version}" in 637 | + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 638 | + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 639 | + 532) # CPU_PA_RISC2_0 640 | + case "${sc_kernel_bits}" in 641 | + 32) HP_ARCH="hppa2.0n" ;; 642 | + 64) HP_ARCH="hppa2.0w" ;; 643 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 644 | - esac ;; 645 | - esac 646 | + esac ;; 647 | + esac 648 | fi 649 | if [ "${HP_ARCH}" = "" ]; then 650 | eval $set_cc_for_build 651 | - sed 's/^ //' << EOF >$dummy.c 652 | + sed 's/^ //' << EOF >$dummy.c 653 | + 654 | + #define _HPUX_SOURCE 655 | + #include 656 | + #include 657 | + 658 | + int main () 659 | + { 660 | + #if defined(_SC_KERNEL_BITS) 661 | + long bits = sysconf(_SC_KERNEL_BITS); 662 | + #endif 663 | + long cpu = sysconf (_SC_CPU_VERSION); 664 | 665 | - #define _HPUX_SOURCE 666 | - #include 667 | - #include 668 | - 669 | - int main () 670 | - { 671 | - #if defined(_SC_KERNEL_BITS) 672 | - long bits = sysconf(_SC_KERNEL_BITS); 673 | - #endif 674 | - long cpu = sysconf (_SC_CPU_VERSION); 675 | - 676 | - switch (cpu) 677 | - { 678 | - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 679 | - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 680 | - case CPU_PA_RISC2_0: 681 | - #if defined(_SC_KERNEL_BITS) 682 | - switch (bits) 683 | - { 684 | - case 64: puts ("hppa2.0w"); break; 685 | - case 32: puts ("hppa2.0n"); break; 686 | - default: puts ("hppa2.0"); break; 687 | - } break; 688 | - #else /* !defined(_SC_KERNEL_BITS) */ 689 | - puts ("hppa2.0"); break; 690 | - #endif 691 | - default: puts ("hppa1.0"); break; 692 | - } 693 | - exit (0); 694 | - } 695 | + switch (cpu) 696 | + { 697 | + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 698 | + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 699 | + case CPU_PA_RISC2_0: 700 | + #if defined(_SC_KERNEL_BITS) 701 | + switch (bits) 702 | + { 703 | + case 64: puts ("hppa2.0w"); break; 704 | + case 32: puts ("hppa2.0n"); break; 705 | + default: puts ("hppa2.0"); break; 706 | + } break; 707 | + #else /* !defined(_SC_KERNEL_BITS) */ 708 | + puts ("hppa2.0"); break; 709 | + #endif 710 | + default: puts ("hppa1.0"); break; 711 | + } 712 | + exit (0); 713 | + } 714 | EOF 715 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 716 | test -z "$HP_ARCH" && HP_ARCH=hppa 717 | @@ -657,9 +669,19 @@ 718 | esac 719 | if [ ${HP_ARCH} = "hppa2.0w" ] 720 | then 721 | - # avoid double evaluation of $set_cc_for_build 722 | - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build 723 | - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null 724 | + eval $set_cc_for_build 725 | + 726 | + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 727 | + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 728 | + # generating 64-bit code. GNU and HP use different nomenclature: 729 | + # 730 | + # $ CC_FOR_BUILD=cc ./config.guess 731 | + # => hppa2.0w-hp-hpux11.23 732 | + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 733 | + # => hppa64-hp-hpux11.23 734 | + 735 | + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 736 | + grep -q __LP64__ 737 | then 738 | HP_ARCH="hppa2.0w" 739 | else 740 | @@ -667,11 +689,11 @@ 741 | fi 742 | fi 743 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} 744 | - exit 0 ;; 745 | + exit ;; 746 | ia64:HP-UX:*:*) 747 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 748 | echo ia64-hp-hpux${HPUX_REV} 749 | - exit 0 ;; 750 | + exit ;; 751 | 3050*:HI-UX:*:*) 752 | eval $set_cc_for_build 753 | sed 's/^ //' << EOF >$dummy.c 754 | @@ -699,340 +721,345 @@ 755 | exit (0); 756 | } 757 | EOF 758 | - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 759 | + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 760 | + { echo "$SYSTEM_NAME"; exit; } 761 | echo unknown-hitachi-hiuxwe2 762 | - exit 0 ;; 763 | + exit ;; 764 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 765 | echo hppa1.1-hp-bsd 766 | - exit 0 ;; 767 | + exit ;; 768 | 9000/8??:4.3bsd:*:*) 769 | echo hppa1.0-hp-bsd 770 | - exit 0 ;; 771 | + exit ;; 772 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 773 | echo hppa1.0-hp-mpeix 774 | - exit 0 ;; 775 | + exit ;; 776 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 777 | echo hppa1.1-hp-osf 778 | - exit 0 ;; 779 | + exit ;; 780 | hp8??:OSF1:*:*) 781 | echo hppa1.0-hp-osf 782 | - exit 0 ;; 783 | + exit ;; 784 | i*86:OSF1:*:*) 785 | if [ -x /usr/sbin/sysversion ] ; then 786 | echo ${UNAME_MACHINE}-unknown-osf1mk 787 | else 788 | echo ${UNAME_MACHINE}-unknown-osf1 789 | fi 790 | - exit 0 ;; 791 | + exit ;; 792 | parisc*:Lites*:*:*) 793 | echo hppa1.1-hp-lites 794 | - exit 0 ;; 795 | + exit ;; 796 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 797 | echo c1-convex-bsd 798 | - exit 0 ;; 799 | + exit ;; 800 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 801 | if getsysinfo -f scalar_acc 802 | then echo c32-convex-bsd 803 | else echo c2-convex-bsd 804 | fi 805 | - exit 0 ;; 806 | + exit ;; 807 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 808 | echo c34-convex-bsd 809 | - exit 0 ;; 810 | + exit ;; 811 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 812 | echo c38-convex-bsd 813 | - exit 0 ;; 814 | + exit ;; 815 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 816 | echo c4-convex-bsd 817 | - exit 0 ;; 818 | + exit ;; 819 | CRAY*Y-MP:*:*:*) 820 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 821 | - exit 0 ;; 822 | + exit ;; 823 | CRAY*[A-Z]90:*:*:*) 824 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 825 | | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 826 | -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 827 | -e 's/\.[^.]*$/.X/' 828 | - exit 0 ;; 829 | + exit ;; 830 | CRAY*TS:*:*:*) 831 | echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 832 | - exit 0 ;; 833 | + exit ;; 834 | CRAY*T3E:*:*:*) 835 | echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 836 | - exit 0 ;; 837 | + exit ;; 838 | CRAY*SV1:*:*:*) 839 | echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 840 | - exit 0 ;; 841 | + exit ;; 842 | *:UNICOS/mp:*:*) 843 | - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 844 | - exit 0 ;; 845 | + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 846 | + exit ;; 847 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 848 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 849 | - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 850 | - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 851 | - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 852 | - exit 0 ;; 853 | + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 854 | + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 855 | + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 856 | + exit ;; 857 | 5000:UNIX_System_V:4.*:*) 858 | - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 859 | - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 860 | - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 861 | - exit 0 ;; 862 | + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 863 | + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 864 | + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 865 | + exit ;; 866 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 867 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 868 | - exit 0 ;; 869 | + exit ;; 870 | sparc*:BSD/OS:*:*) 871 | echo sparc-unknown-bsdi${UNAME_RELEASE} 872 | - exit 0 ;; 873 | + exit ;; 874 | *:BSD/OS:*:*) 875 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 876 | - exit 0 ;; 877 | + exit ;; 878 | *:FreeBSD:*:*) 879 | - # Determine whether the default compiler uses glibc. 880 | - eval $set_cc_for_build 881 | - sed 's/^ //' << EOF >$dummy.c 882 | - #include 883 | - #if __GLIBC__ >= 2 884 | - LIBC=gnu 885 | - #else 886 | - LIBC= 887 | - #endif 888 | -EOF 889 | - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` 890 | - # GNU/KFreeBSD systems have a "k" prefix to indicate we are using 891 | - # FreeBSD's kernel, but not the complete OS. 892 | - case ${LIBC} in gnu) kernel_only='k' ;; esac 893 | - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} 894 | - exit 0 ;; 895 | + UNAME_PROCESSOR=`/usr/bin/uname -p` 896 | + case ${UNAME_PROCESSOR} in 897 | + amd64) 898 | + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 899 | + *) 900 | + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 901 | + esac 902 | + exit ;; 903 | i*:CYGWIN*:*) 904 | echo ${UNAME_MACHINE}-pc-cygwin 905 | - exit 0 ;; 906 | - i*:MINGW*:*) 907 | + exit ;; 908 | + *:MINGW64*:*) 909 | + echo ${UNAME_MACHINE}-pc-mingw64 910 | + exit ;; 911 | + *:MINGW*:*) 912 | echo ${UNAME_MACHINE}-pc-mingw32 913 | - exit 0 ;; 914 | + exit ;; 915 | + *:MSYS*:*) 916 | + echo ${UNAME_MACHINE}-pc-msys 917 | + exit ;; 918 | + i*:windows32*:*) 919 | + # uname -m includes "-pc" on this system. 920 | + echo ${UNAME_MACHINE}-mingw32 921 | + exit ;; 922 | i*:PW*:*) 923 | echo ${UNAME_MACHINE}-pc-pw32 924 | - exit 0 ;; 925 | - x86:Interix*:[34]*) 926 | - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' 927 | - exit 0 ;; 928 | + exit ;; 929 | + *:Interix*:*) 930 | + case ${UNAME_MACHINE} in 931 | + x86) 932 | + echo i586-pc-interix${UNAME_RELEASE} 933 | + exit ;; 934 | + authenticamd | genuineintel | EM64T) 935 | + echo x86_64-unknown-interix${UNAME_RELEASE} 936 | + exit ;; 937 | + IA64) 938 | + echo ia64-unknown-interix${UNAME_RELEASE} 939 | + exit ;; 940 | + esac ;; 941 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 942 | echo i${UNAME_MACHINE}-pc-mks 943 | - exit 0 ;; 944 | + exit ;; 945 | + 8664:Windows_NT:*) 946 | + echo x86_64-pc-mks 947 | + exit ;; 948 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 949 | # How do we know it's Interix rather than the generic POSIX subsystem? 950 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 951 | # UNAME_MACHINE based on the output of uname instead of i386? 952 | echo i586-pc-interix 953 | - exit 0 ;; 954 | + exit ;; 955 | i*:UWIN*:*) 956 | echo ${UNAME_MACHINE}-pc-uwin 957 | - exit 0 ;; 958 | + exit ;; 959 | + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 960 | + echo x86_64-unknown-cygwin 961 | + exit ;; 962 | p*:CYGWIN*:*) 963 | echo powerpcle-unknown-cygwin 964 | - exit 0 ;; 965 | + exit ;; 966 | prep*:SunOS:5.*:*) 967 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 968 | - exit 0 ;; 969 | + exit ;; 970 | *:GNU:*:*) 971 | # the GNU system 972 | - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 973 | - exit 0 ;; 974 | + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 975 | + exit ;; 976 | *:GNU/*:*:*) 977 | # other systems with GNU libc and userland 978 | - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 979 | - exit 0 ;; 980 | + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} 981 | + exit ;; 982 | i*86:Minix:*:*) 983 | echo ${UNAME_MACHINE}-pc-minix 984 | - exit 0 ;; 985 | + exit ;; 986 | + aarch64:Linux:*:*) 987 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 988 | + exit ;; 989 | + aarch64_be:Linux:*:*) 990 | + UNAME_MACHINE=aarch64_be 991 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 992 | + exit ;; 993 | + alpha:Linux:*:*) 994 | + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 995 | + EV5) UNAME_MACHINE=alphaev5 ;; 996 | + EV56) UNAME_MACHINE=alphaev56 ;; 997 | + PCA56) UNAME_MACHINE=alphapca56 ;; 998 | + PCA57) UNAME_MACHINE=alphapca56 ;; 999 | + EV6) UNAME_MACHINE=alphaev6 ;; 1000 | + EV67) UNAME_MACHINE=alphaev67 ;; 1001 | + EV68*) UNAME_MACHINE=alphaev68 ;; 1002 | + esac 1003 | + objdump --private-headers /bin/sh | grep -q ld.so.1 1004 | + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi 1005 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1006 | + exit ;; 1007 | + arc:Linux:*:* | arceb:Linux:*:*) 1008 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1009 | + exit ;; 1010 | arm*:Linux:*:*) 1011 | - echo ${UNAME_MACHINE}-unknown-linux-gnu 1012 | - exit 0 ;; 1013 | + eval $set_cc_for_build 1014 | + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 1015 | + | grep -q __ARM_EABI__ 1016 | + then 1017 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1018 | + else 1019 | + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 1020 | + | grep -q __ARM_PCS_VFP 1021 | + then 1022 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi 1023 | + else 1024 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf 1025 | + fi 1026 | + fi 1027 | + exit ;; 1028 | + avr32*:Linux:*:*) 1029 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1030 | + exit ;; 1031 | cris:Linux:*:*) 1032 | - echo cris-axis-linux-gnu 1033 | - exit 0 ;; 1034 | + echo ${UNAME_MACHINE}-axis-linux-${LIBC} 1035 | + exit ;; 1036 | + crisv32:Linux:*:*) 1037 | + echo ${UNAME_MACHINE}-axis-linux-${LIBC} 1038 | + exit ;; 1039 | + frv:Linux:*:*) 1040 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1041 | + exit ;; 1042 | + hexagon:Linux:*:*) 1043 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1044 | + exit ;; 1045 | + i*86:Linux:*:*) 1046 | + echo ${UNAME_MACHINE}-pc-linux-${LIBC} 1047 | + exit ;; 1048 | ia64:Linux:*:*) 1049 | - echo ${UNAME_MACHINE}-unknown-linux-gnu 1050 | - exit 0 ;; 1051 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1052 | + exit ;; 1053 | m32r*:Linux:*:*) 1054 | - echo ${UNAME_MACHINE}-unknown-linux-gnu 1055 | - exit 0 ;; 1056 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1057 | + exit ;; 1058 | m68*:Linux:*:*) 1059 | - echo ${UNAME_MACHINE}-unknown-linux-gnu 1060 | - exit 0 ;; 1061 | - mips:Linux:*:*) 1062 | - eval $set_cc_for_build 1063 | - sed 's/^ //' << EOF >$dummy.c 1064 | - #undef CPU 1065 | - #undef mips 1066 | - #undef mipsel 1067 | - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 1068 | - CPU=mipsel 1069 | - #else 1070 | - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 1071 | - CPU=mips 1072 | - #else 1073 | - CPU= 1074 | - #endif 1075 | - #endif 1076 | -EOF 1077 | - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` 1078 | - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 1079 | - ;; 1080 | - mips64:Linux:*:*) 1081 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1082 | + exit ;; 1083 | + mips:Linux:*:* | mips64:Linux:*:*) 1084 | eval $set_cc_for_build 1085 | sed 's/^ //' << EOF >$dummy.c 1086 | #undef CPU 1087 | - #undef mips64 1088 | - #undef mips64el 1089 | + #undef ${UNAME_MACHINE} 1090 | + #undef ${UNAME_MACHINE}el 1091 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 1092 | - CPU=mips64el 1093 | + CPU=${UNAME_MACHINE}el 1094 | #else 1095 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 1096 | - CPU=mips64 1097 | + CPU=${UNAME_MACHINE} 1098 | #else 1099 | CPU= 1100 | #endif 1101 | #endif 1102 | EOF 1103 | - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` 1104 | - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 1105 | + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 1106 | + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } 1107 | ;; 1108 | - ppc:Linux:*:*) 1109 | - echo powerpc-unknown-linux-gnu 1110 | - exit 0 ;; 1111 | - ppc64:Linux:*:*) 1112 | - echo powerpc64-unknown-linux-gnu 1113 | - exit 0 ;; 1114 | - alpha:Linux:*:*) 1115 | - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 1116 | - EV5) UNAME_MACHINE=alphaev5 ;; 1117 | - EV56) UNAME_MACHINE=alphaev56 ;; 1118 | - PCA56) UNAME_MACHINE=alphapca56 ;; 1119 | - PCA57) UNAME_MACHINE=alphapca56 ;; 1120 | - EV6) UNAME_MACHINE=alphaev6 ;; 1121 | - EV67) UNAME_MACHINE=alphaev67 ;; 1122 | - EV68*) UNAME_MACHINE=alphaev68 ;; 1123 | - esac 1124 | - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null 1125 | - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 1126 | - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 1127 | - exit 0 ;; 1128 | + openrisc*:Linux:*:*) 1129 | + echo or1k-unknown-linux-${LIBC} 1130 | + exit ;; 1131 | + or32:Linux:*:* | or1k*:Linux:*:*) 1132 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1133 | + exit ;; 1134 | + padre:Linux:*:*) 1135 | + echo sparc-unknown-linux-${LIBC} 1136 | + exit ;; 1137 | + parisc64:Linux:*:* | hppa64:Linux:*:*) 1138 | + echo hppa64-unknown-linux-${LIBC} 1139 | + exit ;; 1140 | parisc:Linux:*:* | hppa:Linux:*:*) 1141 | # Look for CPU level 1142 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 1143 | - PA7*) echo hppa1.1-unknown-linux-gnu ;; 1144 | - PA8*) echo hppa2.0-unknown-linux-gnu ;; 1145 | - *) echo hppa-unknown-linux-gnu ;; 1146 | + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; 1147 | + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; 1148 | + *) echo hppa-unknown-linux-${LIBC} ;; 1149 | esac 1150 | - exit 0 ;; 1151 | - parisc64:Linux:*:* | hppa64:Linux:*:*) 1152 | - echo hppa64-unknown-linux-gnu 1153 | - exit 0 ;; 1154 | + exit ;; 1155 | + ppc64:Linux:*:*) 1156 | + echo powerpc64-unknown-linux-${LIBC} 1157 | + exit ;; 1158 | + ppc:Linux:*:*) 1159 | + echo powerpc-unknown-linux-${LIBC} 1160 | + exit ;; 1161 | + ppc64le:Linux:*:*) 1162 | + echo powerpc64le-unknown-linux-${LIBC} 1163 | + exit ;; 1164 | + ppcle:Linux:*:*) 1165 | + echo powerpcle-unknown-linux-${LIBC} 1166 | + exit ;; 1167 | s390:Linux:*:* | s390x:Linux:*:*) 1168 | - echo ${UNAME_MACHINE}-ibm-linux 1169 | - exit 0 ;; 1170 | + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} 1171 | + exit ;; 1172 | sh64*:Linux:*:*) 1173 | - echo ${UNAME_MACHINE}-unknown-linux-gnu 1174 | - exit 0 ;; 1175 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1176 | + exit ;; 1177 | sh*:Linux:*:*) 1178 | - echo ${UNAME_MACHINE}-unknown-linux-gnu 1179 | - exit 0 ;; 1180 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1181 | + exit ;; 1182 | sparc:Linux:*:* | sparc64:Linux:*:*) 1183 | - echo ${UNAME_MACHINE}-unknown-linux-gnu 1184 | - exit 0 ;; 1185 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1186 | + exit ;; 1187 | + tile*:Linux:*:*) 1188 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1189 | + exit ;; 1190 | + vax:Linux:*:*) 1191 | + echo ${UNAME_MACHINE}-dec-linux-${LIBC} 1192 | + exit ;; 1193 | x86_64:Linux:*:*) 1194 | - echo x86_64-unknown-linux-gnu 1195 | - exit 0 ;; 1196 | - i*86:Linux:*:*) 1197 | - # The BFD linker knows what the default object file format is, so 1198 | - # first see if it will tell us. cd to the root directory to prevent 1199 | - # problems with other programs or directories called `ld' in the path. 1200 | - # Set LC_ALL=C to ensure ld outputs messages in English. 1201 | - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ 1202 | - | sed -ne '/supported targets:/!d 1203 | - s/[ ][ ]*/ /g 1204 | - s/.*supported targets: *// 1205 | - s/ .*// 1206 | - p'` 1207 | - case "$ld_supported_targets" in 1208 | - elf32-i386) 1209 | - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" 1210 | - ;; 1211 | - a.out-i386-linux) 1212 | - echo "${UNAME_MACHINE}-pc-linux-gnuaout" 1213 | - exit 0 ;; 1214 | - coff-i386) 1215 | - echo "${UNAME_MACHINE}-pc-linux-gnucoff" 1216 | - exit 0 ;; 1217 | - "") 1218 | - # Either a pre-BFD a.out linker (linux-gnuoldld) or 1219 | - # one that does not give us useful --help. 1220 | - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" 1221 | - exit 0 ;; 1222 | - esac 1223 | - # Determine whether the default compiler is a.out or elf 1224 | - eval $set_cc_for_build 1225 | - sed 's/^ //' << EOF >$dummy.c 1226 | - #include 1227 | - #ifdef __ELF__ 1228 | - # ifdef __GLIBC__ 1229 | - # if __GLIBC__ >= 2 1230 | - LIBC=gnu 1231 | - # else 1232 | - LIBC=gnulibc1 1233 | - # endif 1234 | - # else 1235 | - LIBC=gnulibc1 1236 | - # endif 1237 | - #else 1238 | - #ifdef __INTEL_COMPILER 1239 | - LIBC=gnu 1240 | - #else 1241 | - LIBC=gnuaout 1242 | - #endif 1243 | - #endif 1244 | - #ifdef __dietlibc__ 1245 | - LIBC=dietlibc 1246 | - #endif 1247 | -EOF 1248 | - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` 1249 | - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 1250 | - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 1251 | - ;; 1252 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1253 | + exit ;; 1254 | + xtensa*:Linux:*:*) 1255 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1256 | + exit ;; 1257 | i*86:DYNIX/ptx:4*:*) 1258 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1259 | # earlier versions are messed up and put the nodename in both 1260 | # sysname and nodename. 1261 | echo i386-sequent-sysv4 1262 | - exit 0 ;; 1263 | + exit ;; 1264 | i*86:UNIX_SV:4.2MP:2.*) 1265 | - # Unixware is an offshoot of SVR4, but it has its own version 1266 | - # number series starting with 2... 1267 | - # I am not positive that other SVR4 systems won't match this, 1268 | + # Unixware is an offshoot of SVR4, but it has its own version 1269 | + # number series starting with 2... 1270 | + # I am not positive that other SVR4 systems won't match this, 1271 | # I just have to hope. -- rms. 1272 | - # Use sysv4.2uw... so that sysv4* matches it. 1273 | + # Use sysv4.2uw... so that sysv4* matches it. 1274 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 1275 | - exit 0 ;; 1276 | + exit ;; 1277 | i*86:OS/2:*:*) 1278 | # If we were able to find `uname', then EMX Unix compatibility 1279 | # is probably installed. 1280 | echo ${UNAME_MACHINE}-pc-os2-emx 1281 | - exit 0 ;; 1282 | + exit ;; 1283 | i*86:XTS-300:*:STOP) 1284 | echo ${UNAME_MACHINE}-unknown-stop 1285 | - exit 0 ;; 1286 | + exit ;; 1287 | i*86:atheos:*:*) 1288 | echo ${UNAME_MACHINE}-unknown-atheos 1289 | - exit 0 ;; 1290 | - i*86:syllable:*:*) 1291 | + exit ;; 1292 | + i*86:syllable:*:*) 1293 | echo ${UNAME_MACHINE}-pc-syllable 1294 | - exit 0 ;; 1295 | - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) 1296 | + exit ;; 1297 | + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1298 | echo i386-unknown-lynxos${UNAME_RELEASE} 1299 | - exit 0 ;; 1300 | + exit ;; 1301 | i*86:*DOS:*:*) 1302 | echo ${UNAME_MACHINE}-pc-msdosdjgpp 1303 | - exit 0 ;; 1304 | + exit ;; 1305 | i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 1306 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 1307 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1308 | @@ -1040,15 +1067,16 @@ 1309 | else 1310 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 1311 | fi 1312 | - exit 0 ;; 1313 | - i*86:*:5:[78]*) 1314 | + exit ;; 1315 | + i*86:*:5:[678]*) 1316 | + # UnixWare 7.x, OpenUNIX and OpenServer 6. 1317 | case `/bin/uname -X | grep "^Machine"` in 1318 | *486*) UNAME_MACHINE=i486 ;; 1319 | *Pentium) UNAME_MACHINE=i586 ;; 1320 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1321 | esac 1322 | echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1323 | - exit 0 ;; 1324 | + exit ;; 1325 | i*86:*:3.2:*) 1326 | if test -f /usr/options/cb.name; then 1327 | UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then 1357 | echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 1358 | else # Add other i860-SVR4 vendors below as they are discovered. 1359 | echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 1360 | fi 1361 | - exit 0 ;; 1362 | + exit ;; 1363 | mini*:CTIX:SYS*5:*) 1364 | # "miniframe" 1365 | echo m68010-convergent-sysv 1366 | - exit 0 ;; 1367 | + exit ;; 1368 | mc68k:UNIX:SYSTEM5:3.51m) 1369 | echo m68k-convergent-sysv 1370 | - exit 0 ;; 1371 | + exit ;; 1372 | M680?0:D-NIX:5.3:*) 1373 | echo m68k-diab-dnix 1374 | - exit 0 ;; 1375 | + exit ;; 1376 | M68*:*:R3V[5678]*:*) 1377 | - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 1378 | - 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) 1379 | + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1380 | + 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) 1381 | OS_REL='' 1382 | test -r /etc/.relid \ 1383 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1384 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1385 | - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 1386 | + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1387 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1388 | - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 1389 | + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1390 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1391 | - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1392 | - && echo i486-ncr-sysv4 && exit 0 ;; 1393 | + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1394 | + && { echo i486-ncr-sysv4; exit; } ;; 1395 | + NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1396 | + OS_REL='.3' 1397 | + test -r /etc/.relid \ 1398 | + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1399 | + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1400 | + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1401 | + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1402 | + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 1403 | + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1404 | + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1405 | m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1406 | echo m68k-unknown-lynxos${UNAME_RELEASE} 1407 | - exit 0 ;; 1408 | + exit ;; 1409 | mc68030:UNIX_System_V:4.*:*) 1410 | echo m68k-atari-sysv4 1411 | - exit 0 ;; 1412 | + exit ;; 1413 | TSUNAMI:LynxOS:2.*:*) 1414 | echo sparc-unknown-lynxos${UNAME_RELEASE} 1415 | - exit 0 ;; 1416 | + exit ;; 1417 | rs6000:LynxOS:2.*:*) 1418 | echo rs6000-unknown-lynxos${UNAME_RELEASE} 1419 | - exit 0 ;; 1420 | - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) 1421 | + exit ;; 1422 | + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1423 | echo powerpc-unknown-lynxos${UNAME_RELEASE} 1424 | - exit 0 ;; 1425 | + exit ;; 1426 | SM[BE]S:UNIX_SV:*:*) 1427 | echo mips-dde-sysv${UNAME_RELEASE} 1428 | - exit 0 ;; 1429 | + exit ;; 1430 | RM*:ReliantUNIX-*:*:*) 1431 | echo mips-sni-sysv4 1432 | - exit 0 ;; 1433 | + exit ;; 1434 | RM*:SINIX-*:*:*) 1435 | echo mips-sni-sysv4 1436 | - exit 0 ;; 1437 | + exit ;; 1438 | *:SINIX-*:*:*) 1439 | if uname -p 2>/dev/null >/dev/null ; then 1440 | UNAME_MACHINE=`(uname -p) 2>/dev/null` 1441 | @@ -1140,68 +1181,109 @@ 1442 | else 1443 | echo ns32k-sni-sysv 1444 | fi 1445 | - exit 0 ;; 1446 | - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1447 | - # says 1448 | - echo i586-unisys-sysv4 1449 | - exit 0 ;; 1450 | + exit ;; 1451 | + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1452 | + # says 1453 | + echo i586-unisys-sysv4 1454 | + exit ;; 1455 | *:UNIX_System_V:4*:FTX*) 1456 | # From Gerald Hewes . 1457 | # How about differentiating between stratus architectures? -djm 1458 | echo hppa1.1-stratus-sysv4 1459 | - exit 0 ;; 1460 | + exit ;; 1461 | *:*:*:FTX*) 1462 | # From seanf@swdc.stratus.com. 1463 | echo i860-stratus-sysv4 1464 | - exit 0 ;; 1465 | + exit ;; 1466 | + i*86:VOS:*:*) 1467 | + # From Paul.Green@stratus.com. 1468 | + echo ${UNAME_MACHINE}-stratus-vos 1469 | + exit ;; 1470 | *:VOS:*:*) 1471 | # From Paul.Green@stratus.com. 1472 | echo hppa1.1-stratus-vos 1473 | - exit 0 ;; 1474 | + exit ;; 1475 | mc68*:A/UX:*:*) 1476 | echo m68k-apple-aux${UNAME_RELEASE} 1477 | - exit 0 ;; 1478 | + exit ;; 1479 | news*:NEWS-OS:6*:*) 1480 | echo mips-sony-newsos6 1481 | - exit 0 ;; 1482 | + exit ;; 1483 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1484 | if [ -d /usr/nec ]; then 1485 | - echo mips-nec-sysv${UNAME_RELEASE} 1486 | + echo mips-nec-sysv${UNAME_RELEASE} 1487 | else 1488 | - echo mips-unknown-sysv${UNAME_RELEASE} 1489 | + echo mips-unknown-sysv${UNAME_RELEASE} 1490 | fi 1491 | - exit 0 ;; 1492 | + exit ;; 1493 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1494 | echo powerpc-be-beos 1495 | - exit 0 ;; 1496 | + exit ;; 1497 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1498 | echo powerpc-apple-beos 1499 | - exit 0 ;; 1500 | + exit ;; 1501 | BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1502 | echo i586-pc-beos 1503 | - exit 0 ;; 1504 | + exit ;; 1505 | + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1506 | + echo i586-pc-haiku 1507 | + exit ;; 1508 | + x86_64:Haiku:*:*) 1509 | + echo x86_64-unknown-haiku 1510 | + exit ;; 1511 | SX-4:SUPER-UX:*:*) 1512 | echo sx4-nec-superux${UNAME_RELEASE} 1513 | - exit 0 ;; 1514 | + exit ;; 1515 | SX-5:SUPER-UX:*:*) 1516 | echo sx5-nec-superux${UNAME_RELEASE} 1517 | - exit 0 ;; 1518 | + exit ;; 1519 | SX-6:SUPER-UX:*:*) 1520 | echo sx6-nec-superux${UNAME_RELEASE} 1521 | - exit 0 ;; 1522 | + exit ;; 1523 | + SX-7:SUPER-UX:*:*) 1524 | + echo sx7-nec-superux${UNAME_RELEASE} 1525 | + exit ;; 1526 | + SX-8:SUPER-UX:*:*) 1527 | + echo sx8-nec-superux${UNAME_RELEASE} 1528 | + exit ;; 1529 | + SX-8R:SUPER-UX:*:*) 1530 | + echo sx8r-nec-superux${UNAME_RELEASE} 1531 | + exit ;; 1532 | Power*:Rhapsody:*:*) 1533 | echo powerpc-apple-rhapsody${UNAME_RELEASE} 1534 | - exit 0 ;; 1535 | + exit ;; 1536 | *:Rhapsody:*:*) 1537 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1538 | - exit 0 ;; 1539 | + exit ;; 1540 | *:Darwin:*:*) 1541 | - case `uname -p` in 1542 | - *86) UNAME_PROCESSOR=i686 ;; 1543 | - powerpc) UNAME_PROCESSOR=powerpc ;; 1544 | - esac 1545 | + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1546 | + eval $set_cc_for_build 1547 | + if test "$UNAME_PROCESSOR" = unknown ; then 1548 | + UNAME_PROCESSOR=powerpc 1549 | + fi 1550 | + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then 1551 | + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1552 | + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1553 | + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1554 | + grep IS_64BIT_ARCH >/dev/null 1555 | + then 1556 | + case $UNAME_PROCESSOR in 1557 | + i386) UNAME_PROCESSOR=x86_64 ;; 1558 | + powerpc) UNAME_PROCESSOR=powerpc64 ;; 1559 | + esac 1560 | + fi 1561 | + fi 1562 | + elif test "$UNAME_PROCESSOR" = i386 ; then 1563 | + # Avoid executing cc on OS X 10.9, as it ships with a stub 1564 | + # that puts up a graphical alert prompting to install 1565 | + # developer tools. Any system running Mac OS X 10.7 or 1566 | + # later (Darwin 11 and later) is required to have a 64-bit 1567 | + # processor. This is not true of the ARM version of Darwin 1568 | + # that Apple uses in portable devices. 1569 | + UNAME_PROCESSOR=x86_64 1570 | + fi 1571 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1572 | - exit 0 ;; 1573 | + exit ;; 1574 | *:procnto*:*:* | *:QNX:[0123456789]*:*) 1575 | UNAME_PROCESSOR=`uname -p` 1576 | if test "$UNAME_PROCESSOR" = "x86"; then 1577 | @@ -1209,22 +1291,28 @@ 1578 | UNAME_MACHINE=pc 1579 | fi 1580 | echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 1581 | - exit 0 ;; 1582 | + exit ;; 1583 | *:QNX:*:4*) 1584 | echo i386-pc-qnx 1585 | - exit 0 ;; 1586 | + exit ;; 1587 | + NEO-?:NONSTOP_KERNEL:*:*) 1588 | + echo neo-tandem-nsk${UNAME_RELEASE} 1589 | + exit ;; 1590 | + NSE-*:NONSTOP_KERNEL:*:*) 1591 | + echo nse-tandem-nsk${UNAME_RELEASE} 1592 | + exit ;; 1593 | NSR-?:NONSTOP_KERNEL:*:*) 1594 | echo nsr-tandem-nsk${UNAME_RELEASE} 1595 | - exit 0 ;; 1596 | + exit ;; 1597 | *:NonStop-UX:*:*) 1598 | echo mips-compaq-nonstopux 1599 | - exit 0 ;; 1600 | + exit ;; 1601 | BS2000:POSIX*:*:*) 1602 | echo bs2000-siemens-sysv 1603 | - exit 0 ;; 1604 | + exit ;; 1605 | DS/*:UNIX_System_V:*:*) 1606 | echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1607 | - exit 0 ;; 1608 | + exit ;; 1609 | *:Plan9:*:*) 1610 | # "uname -m" is not consistent, so use $cputype instead. 386 1611 | # is converted to i386 for consistency with other x86 1612 | @@ -1235,183 +1323,55 @@ 1613 | UNAME_MACHINE="$cputype" 1614 | fi 1615 | echo ${UNAME_MACHINE}-unknown-plan9 1616 | - exit 0 ;; 1617 | + exit ;; 1618 | *:TOPS-10:*:*) 1619 | echo pdp10-unknown-tops10 1620 | - exit 0 ;; 1621 | + exit ;; 1622 | *:TENEX:*:*) 1623 | echo pdp10-unknown-tenex 1624 | - exit 0 ;; 1625 | + exit ;; 1626 | KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1627 | echo pdp10-dec-tops20 1628 | - exit 0 ;; 1629 | + exit ;; 1630 | XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1631 | echo pdp10-xkl-tops20 1632 | - exit 0 ;; 1633 | + exit ;; 1634 | *:TOPS-20:*:*) 1635 | echo pdp10-unknown-tops20 1636 | - exit 0 ;; 1637 | + exit ;; 1638 | *:ITS:*:*) 1639 | echo pdp10-unknown-its 1640 | - exit 0 ;; 1641 | + exit ;; 1642 | SEI:*:*:SEIUX) 1643 | - echo mips-sei-seiux${UNAME_RELEASE} 1644 | - exit 0 ;; 1645 | + echo mips-sei-seiux${UNAME_RELEASE} 1646 | + exit ;; 1647 | *:DragonFly:*:*) 1648 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 1649 | - exit 0 ;; 1650 | + exit ;; 1651 | + *:*VMS:*:*) 1652 | + UNAME_MACHINE=`(uname -p) 2>/dev/null` 1653 | + case "${UNAME_MACHINE}" in 1654 | + A*) echo alpha-dec-vms ; exit ;; 1655 | + I*) echo ia64-dec-vms ; exit ;; 1656 | + V*) echo vax-dec-vms ; exit ;; 1657 | + esac ;; 1658 | + *:XENIX:*:SysV) 1659 | + echo i386-pc-xenix 1660 | + exit ;; 1661 | + i*86:skyos:*:*) 1662 | + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 1663 | + exit ;; 1664 | + i*86:rdos:*:*) 1665 | + echo ${UNAME_MACHINE}-pc-rdos 1666 | + exit ;; 1667 | + i*86:AROS:*:*) 1668 | + echo ${UNAME_MACHINE}-pc-aros 1669 | + exit ;; 1670 | + x86_64:VMkernel:*:*) 1671 | + echo ${UNAME_MACHINE}-unknown-esx 1672 | + exit ;; 1673 | esac 1674 | 1675 | -#echo '(No uname command or uname output not recognized.)' 1>&2 1676 | -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1677 | - 1678 | -eval $set_cc_for_build 1679 | -cat >$dummy.c < 1682 | -# include 1683 | -#endif 1684 | -main () 1685 | -{ 1686 | -#if defined (sony) 1687 | -#if defined (MIPSEB) 1688 | - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1689 | - I don't know.... */ 1690 | - printf ("mips-sony-bsd\n"); exit (0); 1691 | -#else 1692 | -#include 1693 | - printf ("m68k-sony-newsos%s\n", 1694 | -#ifdef NEWSOS4 1695 | - "4" 1696 | -#else 1697 | - "" 1698 | -#endif 1699 | - ); exit (0); 1700 | -#endif 1701 | -#endif 1702 | - 1703 | -#if defined (__arm) && defined (__acorn) && defined (__unix) 1704 | - printf ("arm-acorn-riscix"); exit (0); 1705 | -#endif 1706 | - 1707 | -#if defined (hp300) && !defined (hpux) 1708 | - printf ("m68k-hp-bsd\n"); exit (0); 1709 | -#endif 1710 | - 1711 | -#if defined (NeXT) 1712 | -#if !defined (__ARCHITECTURE__) 1713 | -#define __ARCHITECTURE__ "m68k" 1714 | -#endif 1715 | - int version; 1716 | - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1717 | - if (version < 4) 1718 | - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1719 | - else 1720 | - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1721 | - exit (0); 1722 | -#endif 1723 | - 1724 | -#if defined (MULTIMAX) || defined (n16) 1725 | -#if defined (UMAXV) 1726 | - printf ("ns32k-encore-sysv\n"); exit (0); 1727 | -#else 1728 | -#if defined (CMU) 1729 | - printf ("ns32k-encore-mach\n"); exit (0); 1730 | -#else 1731 | - printf ("ns32k-encore-bsd\n"); exit (0); 1732 | -#endif 1733 | -#endif 1734 | -#endif 1735 | - 1736 | -#if defined (__386BSD__) 1737 | - printf ("i386-pc-bsd\n"); exit (0); 1738 | -#endif 1739 | - 1740 | -#if defined (sequent) 1741 | -#if defined (i386) 1742 | - printf ("i386-sequent-dynix\n"); exit (0); 1743 | -#endif 1744 | -#if defined (ns32000) 1745 | - printf ("ns32k-sequent-dynix\n"); exit (0); 1746 | -#endif 1747 | -#endif 1748 | - 1749 | -#if defined (_SEQUENT_) 1750 | - struct utsname un; 1751 | - 1752 | - uname(&un); 1753 | - 1754 | - if (strncmp(un.version, "V2", 2) == 0) { 1755 | - printf ("i386-sequent-ptx2\n"); exit (0); 1756 | - } 1757 | - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1758 | - printf ("i386-sequent-ptx1\n"); exit (0); 1759 | - } 1760 | - printf ("i386-sequent-ptx\n"); exit (0); 1761 | - 1762 | -#endif 1763 | - 1764 | -#if defined (vax) 1765 | -# if !defined (ultrix) 1766 | -# include 1767 | -# if defined (BSD) 1768 | -# if BSD == 43 1769 | - printf ("vax-dec-bsd4.3\n"); exit (0); 1770 | -# else 1771 | -# if BSD == 199006 1772 | - printf ("vax-dec-bsd4.3reno\n"); exit (0); 1773 | -# else 1774 | - printf ("vax-dec-bsd\n"); exit (0); 1775 | -# endif 1776 | -# endif 1777 | -# else 1778 | - printf ("vax-dec-bsd\n"); exit (0); 1779 | -# endif 1780 | -# else 1781 | - printf ("vax-dec-ultrix\n"); exit (0); 1782 | -# endif 1783 | -#endif 1784 | - 1785 | -#if defined (alliant) && defined (i860) 1786 | - printf ("i860-alliant-bsd\n"); exit (0); 1787 | -#endif 1788 | - 1789 | - exit (1); 1790 | -} 1791 | -EOF 1792 | - 1793 | -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 1794 | - 1795 | -# Apollos put the system type in the environment. 1796 | - 1797 | -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } 1798 | - 1799 | -# Convex versions that predate uname can use getsysinfo(1) 1800 | - 1801 | -if [ -x /usr/convex/getsysinfo ] 1802 | -then 1803 | - case `getsysinfo -f cpu_type` in 1804 | - c1*) 1805 | - echo c1-convex-bsd 1806 | - exit 0 ;; 1807 | - c2*) 1808 | - if getsysinfo -f scalar_acc 1809 | - then echo c32-convex-bsd 1810 | - else echo c2-convex-bsd 1811 | - fi 1812 | - exit 0 ;; 1813 | - c34*) 1814 | - echo c34-convex-bsd 1815 | - exit 0 ;; 1816 | - c38*) 1817 | - echo c38-convex-bsd 1818 | - exit 0 ;; 1819 | - c4*) 1820 | - echo c4-convex-bsd 1821 | - exit 0 ;; 1822 | - esac 1823 | -fi 1824 | - 1825 | cat >&2 <