From b28aa2d5172883767be06042d234e5a29d87f358 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 13 Jun 2016 09:54:33 +0200 Subject: [PATCH 01/63] TEST: disable shared libraries --- libelf-0.8.13.build.bash | 2 +- libusb-1.0.20.build.bash | 2 +- libusb-compat-0.1.5.build.bash | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libelf-0.8.13.build.bash b/libelf-0.8.13.build.bash index f51f775..66c9258 100755 --- a/libelf-0.8.13.build.bash +++ b/libelf-0.8.13.build.bash @@ -28,7 +28,7 @@ fi tar xfv libelf-0.8.13.tar.gz cd libelf-0.8.13 -CONFARGS="--prefix=$PREFIX" +CONFARGS="--prefix=$PREFIX --disable-shared" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi diff --git a/libusb-1.0.20.build.bash b/libusb-1.0.20.build.bash index c791e9c..f04150b 100755 --- a/libusb-1.0.20.build.bash +++ b/libusb-1.0.20.build.bash @@ -28,7 +28,7 @@ fi tar xfv libusb-1.0.20.tar.bz2 cd libusb-1.0.20 -CONFARGS="--prefix=$PREFIX --disable-udev --enable-static --enable-shared" +CONFARGS="--prefix=$PREFIX --disable-udev --enable-static --disable-shared" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi diff --git a/libusb-compat-0.1.5.build.bash b/libusb-compat-0.1.5.build.bash index 73a538d..87d65a4 100755 --- a/libusb-compat-0.1.5.build.bash +++ b/libusb-compat-0.1.5.build.bash @@ -45,7 +45,7 @@ if [[ $OS == "Msys" || $OS == "Cygwin" || $CROSS_COMPILE_HOST == "i686-w64-mingw autoreconf --force --install fi -CONFARGS="--prefix=$PREFIX --enable-static --enable-shared" +CONFARGS="--prefix=$PREFIX --enable-static --disable-shared" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi From 2db1e51b87d49639615c30a662cefc1fcbbd6e35 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 13 Jun 2016 10:18:46 +0200 Subject: [PATCH 02/63] recognize libraries even if compiled statically --- ...e-AC_CHECK_LIB-with-AC_CHECK_HEADERS.patch | 30 +++++++++++++++++++ libusb-compat-0.1.5.build.bash | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 avrdude-6.3-patches/70-replace-AC_CHECK_LIB-with-AC_CHECK_HEADERS.patch diff --git a/avrdude-6.3-patches/70-replace-AC_CHECK_LIB-with-AC_CHECK_HEADERS.patch b/avrdude-6.3-patches/70-replace-AC_CHECK_LIB-with-AC_CHECK_HEADERS.patch new file mode 100644 index 0000000..c97eebb --- /dev/null +++ b/avrdude-6.3-patches/70-replace-AC_CHECK_LIB-with-AC_CHECK_HEADERS.patch @@ -0,0 +1,30 @@ +--- configure.ac ++++ configure.ac +@@ -81,7 +81,7 @@ AC_CHECK_LIB([ncurses], [tputs]) + AC_CHECK_LIB([readline], [readline]) + AH_TEMPLATE([HAVE_LIBELF], + [Define if ELF support is enabled via libelf]) +-AC_CHECK_LIB([elf], [elf_getshdrstrndx], [have_libelf=yes]) ++AC_CHECK_HEADERS([libelf.h libelf/libelf.h], [have_libelf=yes]) + if test x$have_libelf = xyes; then + case $target in + *) +@@ -97,7 +97,7 @@ AC_SEARCH_LIBS([gethostent], [nsl]) + AC_SEARCH_LIBS([setsockopt], [socket]) + AH_TEMPLATE([HAVE_LIBUSB], + [Define if USB support is enabled via libusb]) +-AC_CHECK_LIB([usb], [usb_get_string_simple], [have_libusb=yes]) ++AC_CHECK_HEADERS([lusb0_usb.h usb.h], [have_libusb=yes]) + if test x$have_libusb = xyes; then + case $target in + *-*-darwin*) +@@ -115,7 +115,7 @@ AC_SUBST(LIBUSB, $LIBUSB) + + AH_TEMPLATE([HAVE_LIBUSB_1_0], + [Define if USB support is enabled via libusb 1.0]) +-AC_CHECK_LIB([usb-1.0], [libusb_init], [have_libusb_1_0=yes]) ++AC_CHECK_HEADERS([libusb-1.0/libusb.h libusb.h], [have_libusb_1_0=yes]) + if test x$have_libusb_1_0 = xyes; then + case $target in + *-*-darwin*) + diff --git a/libusb-compat-0.1.5.build.bash b/libusb-compat-0.1.5.build.bash index 87d65a4..075edd0 100755 --- a/libusb-compat-0.1.5.build.bash +++ b/libusb-compat-0.1.5.build.bash @@ -27,7 +27,7 @@ if [[ $OS == "Msys" || $OS == "Cygwin" || $CROSS_COMPILE_HOST == "i686-w64-mingw wget http://download.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip fi unzip libusb-win32-bin-1.2.6.0.zip - cp libusb-win32-bin-1.2.6.0/bin/x86/libusb0_x86.dll $PREFIX/bin/libusb0.dll + #cp libusb-win32-bin-1.2.6.0/bin/x86/libusb0_x86.dll $PREFIX/bin/libusb0.dll cp libusb-win32-bin-1.2.6.0/include/lusb0_usb.h $PREFIX/include cp libusb-win32-bin-1.2.6.0/lib/gcc/libusb.a $PREFIX/lib exit 0 From 960dfb99e4f904fe1c0684fd0165cc25c2247562 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 14 Jun 2016 18:50:01 +0200 Subject: [PATCH 03/63] Removed no more needed wrappers to link to the correct shared libraries Since we are statically building we don't need them anymore. --- avrdude-6.3-files/avrdude | 6 ------ avrdude-6.3.build.bash | 10 ---------- 2 files changed, 16 deletions(-) delete mode 100755 avrdude-6.3-files/avrdude diff --git a/avrdude-6.3-files/avrdude b/avrdude-6.3-files/avrdude deleted file mode 100755 index 5c20264..0000000 --- a/avrdude-6.3-files/avrdude +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -export LD_LIBRARY_PATH="`dirname "$0"`/../lib/" -# Workaround for macosx gatekeeper, see https://github.com/arduino/Arduino/issues/3468 -chmod +x "`dirname "$0"`/avrdude_bin" -exec -a "$0" "`dirname "$0"`/avrdude_bin" "$@" diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index 15d4c10..9a86b86 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -45,13 +45,3 @@ make make install cd .. -if [[ $TARGET_OS == "GNU/Linux" || $TARGET_OS == "Darwin" ]] -then - mv objdir/bin/avrdude objdir/bin/avrdude_bin - cp avrdude-6.3-files/avrdude objdir/bin/ - if [[ $TARGET_OS == "Darwin" ]] - then - sed -i '' 's/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH/g' objdir/bin/avrdude - fi -fi - From f4e8a6e8c9c6cd4317ff868ef53d4d47d553785c Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 14 Jun 2016 18:54:06 +0200 Subject: [PATCH 04/63] Removed mingw .dll that is now statically linked. --- package-avrdude.bash | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index afcb86a..c4b0480 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -76,16 +76,6 @@ rm -rf avrdude-6.3 libusb-1.0.20 libusb-compat-0.1.5 libusb-win32-bin-1.2.6.0 li ./libelf-0.8.13.build.bash ./avrdude-6.3.build.bash -if [[ $CROSS_COMPILE_HOST == "i686-w64-mingw32" ]] ; then - # copy dependency libgcc_s_sjlj-1.dll into bin/ folder - - # try to detect the location of libgcc_s_sjlj-1.dll - # (maybe there is better way... feel free to submit a patch!) - LTO_PATH=`i686-w64-mingw32-gcc -v 2>&1 | grep LTO | tr '=' ' ' | awk "{ print \\\$2; }"` - DLL_PATH=`dirname $LTO_PATH`/libgcc_s_sjlj-1.dll - cp $DLL_PATH objdir/bin -fi - rm -f avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 cp -a objdir avrdude tar -cjvf avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 avrdude From aa491a8f3d6ae3cd288e6708ed10e0b76ee3c512 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 14 Jun 2016 19:06:45 +0200 Subject: [PATCH 05/63] Releasing version 6.3-arduino2 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index c4b0480..8ee0247 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3-arduino +OUTPUT_VERSION=6.3-arduino2 export OS=`uname -o || uname` export TARGET_OS=$OS From 1cefe3370d37e51659baadaf9585f61caf9f2aed Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 22 Jun 2016 16:01:07 +0200 Subject: [PATCH 06/63] zip files instead of tar.gz for windows build --- package-avrdude.bash | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 8ee0247..223c9b4 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -76,8 +76,21 @@ rm -rf avrdude-6.3 libusb-1.0.20 libusb-compat-0.1.5 libusb-win32-bin-1.2.6.0 li ./libelf-0.8.13.build.bash ./avrdude-6.3.build.bash -rm -f avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 -cp -a objdir avrdude -tar -cjvf avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 avrdude -rm -r avrdude +# if producing a windows build, compress as zip and +# copy *toolchain-precompiled* content to any folder containing a .exe +if [[ ${OUTPUT_TAG} == *"mingw"* ]] ; then + + rm -f avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip + cp -a objdir avrdude + zip -r avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip avrdude + rm -r avrdude + +else + + rm -f avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 + cp -a objdir avrdude + tar -cjvf avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 avrdude + rm -r avrdude + +fi From 8f26fd16395f2c1a0845b83f5d7bf6037e195c8a Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 5 Aug 2016 11:37:10 +0200 Subject: [PATCH 07/63] Avoid failing fuse check if different bits are masked --- ...check-if-different-bits-are-reserved.patch | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch diff --git a/avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch b/avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch new file mode 100644 index 0000000..feba92c --- /dev/null +++ b/avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch @@ -0,0 +1,88 @@ +--- avr.c ++++ avr.c +@@ -1058,6 +1058,36 @@ int avr_signature(PROGRAMMER * pgm, AVRPART * p) + return 0; + } + ++uint8_t get_fuse_bitmask(AVRMEM * m) { ++ uint8_t bitmask_r = 0; ++ uint8_t bitmask_w = 0; ++ int i, j; ++ ++ if (m->size > 1) { ++ // not a fuse, compare bytes directly ++ return 0xFF; ++ } ++ ++ for (i=0; iop[i] && i == AVR_OP_READ) { ++ for (j=7; j>=0; j--) { ++ bitmask_r |= (m->op[i]->bit[j].type != AVR_CMDBIT_IGNORE) << j; ++ } ++ } ++ if (m->op[i] && i == AVR_OP_WRITE) { ++ for (j=7; j>=0; j--) { ++ bitmask_w |= (m->op[i]->bit[j].type != AVR_CMDBIT_VALUE && ++ m->op[i]->bit[j].type != AVR_CMDBIT_IGNORE) << j; ++ } ++ } ++ } ++ return bitmask_r & bitmask_w; ++} ++ ++int compare_memory_masked(AVRMEM * m, unsigned char buf1, unsigned char buf2) { ++ uint8_t bitmask = get_fuse_bitmask(m); ++ return ((buf1 & bitmask) != (buf2 & bitmask)); ++} + + /* + * Verify the memory buffer of p with that of v. The byte range of v, +@@ -1103,7 +1133,7 @@ int avr_verify(AVRPART * p, AVRPART * v, char * memtype, int size) + + for (i=0; itags[i] & TAG_ALLOCATED) != 0 && +- buf1[i] != buf2[i]) { ++ compare_memory_masked(a , buf1[i], buf2[i])) { + avrdude_message(MSG_INFO, "%s: verification error, first mismatch at byte 0x%04x\n" + "%s0x%02x != 0x%02x\n", + progname, i, +--- libavrdude.h ++++ libavrdude.h +@@ -337,6 +337,9 @@ typedef void (*walk_avrparts_cb)(const char *name, const char *desc, + void *cookie); + void walk_avrparts(LISTID avrparts, walk_avrparts_cb cb, void *cookie); + void sort_avrparts(LISTID avrparts); ++ ++uint8_t get_fuse_bitmask(AVRMEM * m); ++ + #ifdef __cplusplus + } + #endif +--- main.c ++++ main.c +@@ -1239,6 +1239,7 @@ int main(int argc, char * argv []) + unsigned char safemodeafter_lfuse = 0xff; + unsigned char safemodeafter_hfuse = 0xff; + unsigned char safemodeafter_efuse = 0xff; ++ unsigned char safemodeafter_efuse_mask = 0xff; + unsigned char safemodeafter_fuse = 0xff; + unsigned char failures = 0; + char yes[1] = {'y'}; +@@ -1345,8 +1346,15 @@ int main(int argc, char * argv []) + } + } + ++ /* Get efuse bitmask if it exists */ ++ AVRMEM * m; ++ m = avr_locate_mem(p, "efuse"); ++ if (m != NULL) { ++ safemodeafter_efuse_mask = get_fuse_bitmask(m); ++ } ++ + /* Now check what fuses are against what they should be */ +- if (safemodeafter_efuse != safemode_efuse) { ++ if ((safemodeafter_efuse & safemodeafter_efuse_mask) != (safemode_efuse & safemodeafter_efuse_mask)) { + fuses_updated = 1; + avrdude_message(MSG_INFO, "%s: safemode: efuse changed! Was %x, and is now %x\n", + progname, safemode_efuse, safemodeafter_efuse); + From f1636d347ddabe300ac61326081d6b3663fccfdd Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 5 Aug 2016 11:38:35 +0200 Subject: [PATCH 08/63] update version to 6.3.0-arduino5 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 223c9b4..cd6278e 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3-arduino2 +OUTPUT_VERSION=6.3.0-arduino5 export OS=`uname -o || uname` export TARGET_OS=$OS From edfbcc9c110e01fb8985cef42bc83d918dabe351 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 12 Sep 2016 17:16:59 +0200 Subject: [PATCH 09/63] Modify fuse patch adding warnings --- ...check-if-different-bits-are-reserved.patch | 91 +++++++++++++------ 1 file changed, 64 insertions(+), 27 deletions(-) diff --git a/avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch b/avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch index feba92c..d63bcd3 100644 --- a/avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch +++ b/avrdude-6.3-patches/80-Avoid-failing-fuse-check-if-different-bits-are-reserved.patch @@ -1,6 +1,6 @@ --- avr.c +++ avr.c -@@ -1058,6 +1058,36 @@ int avr_signature(PROGRAMMER * pgm, AVRPART * p) +@@ -1058,6 +1058,39 @@ return 0; } @@ -31,57 +31,94 @@ +} + +int compare_memory_masked(AVRMEM * m, unsigned char buf1, unsigned char buf2) { -+ uint8_t bitmask = get_fuse_bitmask(m); ++ uint8_t bitmask = 0xFF; ++ if(m) { ++ bitmask = get_fuse_bitmask(m); ++ } + return ((buf1 & bitmask) != (buf2 & bitmask)); +} /* * Verify the memory buffer of p with that of v. The byte range of v, -@@ -1103,7 +1133,7 @@ int avr_verify(AVRPART * p, AVRPART * v, char * memtype, int size) - +@@ -1104,11 +1137,18 @@ for (i=0; itags[i] & TAG_ALLOCATED) != 0 && -- buf1[i] != buf2[i]) { -+ compare_memory_masked(a , buf1[i], buf2[i])) { - avrdude_message(MSG_INFO, "%s: verification error, first mismatch at byte 0x%04x\n" - "%s0x%02x != 0x%02x\n", - progname, i, + buf1[i] != buf2[i]) { +- avrdude_message(MSG_INFO, "%s: verification error, first mismatch at byte 0x%04x\n" +- "%s0x%02x != 0x%02x\n", +- progname, i, +- progbuf, buf1[i], buf2[i]); +- return -1; ++ if(compare_memory_masked(a , buf1[i], buf2[i])) { ++ avrdude_message(MSG_INFO, "%s: verification error, first mismatch at byte 0x%04x\n" ++ "%s0x%02x != 0x%02x\n", ++ progname, i, ++ progbuf, buf1[i], buf2[i]); ++ return -1; ++ } else { ++ avrdude_message(MSG_INFO, "%s: WARNING: invalid value for unused bits in fuse \"%s\", should be set to 1 according to datasheet\n" ++ "This behaviour is deprecated and will result in an error in future version\n" ++ "You probably want to use 0x%02x instead of 0x%02x (double check with your datasheet first).\n", ++ progname, memtype, buf1[i], buf2[i]); ++ } + } + } + --- libavrdude.h +++ libavrdude.h -@@ -337,6 +337,9 @@ typedef void (*walk_avrparts_cb)(const char *name, const char *desc, +@@ -337,6 +337,10 @@ void *cookie); void walk_avrparts(LISTID avrparts, walk_avrparts_cb cb, void *cookie); void sort_avrparts(LISTID avrparts); + +uint8_t get_fuse_bitmask(AVRMEM * m); ++int compare_memory_masked(AVRMEM * m, unsigned char buf1, unsigned char buf2); + #ifdef __cplusplus } #endif --- main.c +++ main.c -@@ -1239,6 +1239,7 @@ int main(int argc, char * argv []) - unsigned char safemodeafter_lfuse = 0xff; - unsigned char safemodeafter_hfuse = 0xff; - unsigned char safemodeafter_efuse = 0xff; -+ unsigned char safemodeafter_efuse_mask = 0xff; - unsigned char safemodeafter_fuse = 0xff; - unsigned char failures = 0; - char yes[1] = {'y'}; -@@ -1345,8 +1346,15 @@ int main(int argc, char * argv []) +@@ -1264,8 +1264,11 @@ } } - -+ /* Get efuse bitmask if it exists */ + + AVRMEM * m; -+ m = avr_locate_mem(p, "efuse"); -+ if (m != NULL) { -+ safemodeafter_efuse_mask = get_fuse_bitmask(m); -+ } -+ ++ + /* Now check what fuses are against what they should be */ +- if (safemodeafter_fuse != safemode_fuse) { ++ m = avr_locate_mem(p, "fuse"); ++ if (compare_memory_masked(m, safemodeafter_fuse, safemode_fuse)) { + fuses_updated = 1; + avrdude_message(MSG_INFO, "%s: safemode: fuse changed! Was %x, and is now %x\n", + progname, safemode_fuse, safemodeafter_fuse); +@@ -1293,7 +1296,8 @@ + } + + /* Now check what fuses are against what they should be */ +- if (safemodeafter_lfuse != safemode_lfuse) { ++ m = avr_locate_mem(p, "lfuse"); ++ if (compare_memory_masked(m, safemodeafter_lfuse, safemode_lfuse)) { + fuses_updated = 1; + avrdude_message(MSG_INFO, "%s: safemode: lfuse changed! Was %x, and is now %x\n", + progname, safemode_lfuse, safemodeafter_lfuse); +@@ -1321,7 +1325,8 @@ + } + + /* Now check what fuses are against what they should be */ +- if (safemodeafter_hfuse != safemode_hfuse) { ++ m = avr_locate_mem(p, "hfuse"); ++ if (compare_memory_masked(m, safemodeafter_hfuse, safemode_hfuse)) { + fuses_updated = 1; + avrdude_message(MSG_INFO, "%s: safemode: hfuse changed! Was %x, and is now %x\n", + progname, safemode_hfuse, safemodeafter_hfuse); +@@ -1346,7 +1351,8 @@ + } + /* Now check what fuses are against what they should be */ - if (safemodeafter_efuse != safemode_efuse) { -+ if ((safemodeafter_efuse & safemodeafter_efuse_mask) != (safemode_efuse & safemodeafter_efuse_mask)) { ++ m = avr_locate_mem(p, "efuse"); ++ if (compare_memory_masked(m, safemodeafter_efuse, safemode_efuse)) { fuses_updated = 1; avrdude_message(MSG_INFO, "%s: safemode: efuse changed! Was %x, and is now %x\n", progname, safemode_efuse, safemodeafter_efuse); From b1606c478f1d44d75d0e8d895b5e423e4a2aa9fe Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 12 Sep 2016 17:17:23 +0200 Subject: [PATCH 10/63] Fix libelf configure for newer mingw-w6 toolchains --- libelf-0.8.13.build.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libelf-0.8.13.build.bash b/libelf-0.8.13.build.bash index 66c9258..3215077 100755 --- a/libelf-0.8.13.build.bash +++ b/libelf-0.8.13.build.bash @@ -31,6 +31,10 @@ cd libelf-0.8.13 CONFARGS="--prefix=$PREFIX --disable-shared" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" + # solve bug with --host not being effective on second level directory + export CC=$CROSS_COMPILE_HOST-gcc + export AR=$CROSS_COMPILE_HOST-ar + export RANLIB=$CROSS_COMPILE_HOST-ranlib fi CFLAGS="-w -O2 $CFLAGS" CXXFLAGS="-w -O2 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ./configure $CONFARGS make -j 1 From 65a47f01048a6ff252abe44967b9646426f11dc7 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 12 Sep 2016 17:18:08 +0200 Subject: [PATCH 11/63] add libusb0 dll to bin folder --- package-avrdude.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/package-avrdude.bash b/package-avrdude.bash index cd6278e..ecd746e 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -80,6 +80,7 @@ rm -rf avrdude-6.3 libusb-1.0.20 libusb-compat-0.1.5 libusb-win32-bin-1.2.6.0 li # copy *toolchain-precompiled* content to any folder containing a .exe if [[ ${OUTPUT_TAG} == *"mingw"* ]] ; then + cp libusb-win32-bin-1.2.6.0/bin/x86/libusb0_x86.dll objdir/bin/libusb0.dll rm -f avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip cp -a objdir avrdude zip -r avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip avrdude From 1a19e62fb0cd4412d67a6a7de2efe5bdb5d0807c Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 12 Sep 2016 17:19:46 +0200 Subject: [PATCH 12/63] Update version to 6.3.0-arduino6 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index ecd746e..e934f0e 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino5 +OUTPUT_VERSION=6.3.0-arduino6 export OS=`uname -o || uname` export TARGET_OS=$OS From db5fdf32b53279e0febdeb251a40509cbe54be94 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 15 Dec 2016 17:48:02 +0100 Subject: [PATCH 13/63] Update packaged version to 6.3.0-arduino7 We fixed the jenkins setup to solve https://github.com/arduino/Arduino/issues/5430 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index e934f0e..440c8a3 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino6 +OUTPUT_VERSION=6.3.0-arduino7 export OS=`uname -o || uname` export TARGET_OS=$OS From 66056683eed72f275b710eb57a71b62fd6f9c0ac Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 16 Dec 2016 13:04:02 +0100 Subject: [PATCH 14/63] Added description to arduinoisp programmer --- avrdude-6.3-patches/30-avrdude-6.3-added_arduinoisp.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avrdude-6.3-patches/30-avrdude-6.3-added_arduinoisp.patch b/avrdude-6.3-patches/30-avrdude-6.3-added_arduinoisp.patch index 90ab9a4..e6bd0d6 100644 --- a/avrdude-6.3-patches/30-avrdude-6.3-added_arduinoisp.patch +++ b/avrdude-6.3-patches/30-avrdude-6.3-added_arduinoisp.patch @@ -5,7 +5,7 @@ programmer + id = "arduinoisp"; -+ desc = " "; ++ desc = "Arduino ISP Programmer"; + type = "usbtiny"; + connection_type = usb; + usbvid = 0x2341; From 89861c79b917cd9ede9c6b06519107034b1c9526 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 16 Dec 2016 13:04:18 +0100 Subject: [PATCH 15/63] added arduinoorgisp programmer --- .../31-avrdude-6.3-added_arduinoorgisp.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 avrdude-6.3-patches/31-avrdude-6.3-added_arduinoorgisp.patch diff --git a/avrdude-6.3-patches/31-avrdude-6.3-added_arduinoorgisp.patch b/avrdude-6.3-patches/31-avrdude-6.3-added_arduinoorgisp.patch new file mode 100644 index 0000000..62f8e2f --- /dev/null +++ b/avrdude-6.3-patches/31-avrdude-6.3-added_arduinoorgisp.patch @@ -0,0 +1,18 @@ +--- avrdude.conf.in.orig 2016-12-16 13:02:11.218301337 +0100 ++++ avrdude.conf.in 2016-12-16 13:02:13.446302698 +0100 +@@ -884,6 +884,15 @@ + ; + + programmer ++ id = "arduinoisporg"; ++ desc = "Arduino ISP Programmer"; ++ type = "usbtiny"; ++ connection_type = usb; ++ usbvid = 0x2A03; ++ usbpid = 0x0049; ++; ++ ++programmer + id = "butterfly"; + desc = "Atmel Butterfly Development Board"; + type = "butterfly"; From 0bfe2c433ffe9b0371c5ac1adf5bf9ecf812cf12 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 16 Dec 2016 13:12:50 +0100 Subject: [PATCH 16/63] Added fake EFUSE to atmega8 part. This allows to have a common platform.txt recipe for all the ATMegaXX parts in the Arduino IDE. See: https://github.com/arduino/Arduino/issues/2075#issuecomment-238031689 https://github.com/arduino/Arduino/issues/2075 --- ...d_fake_efuse_to_atmega8_for_Arduino_IDE.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 avrdude-6.3-patches/61-avrdude-6.3-add_fake_efuse_to_atmega8_for_Arduino_IDE.patch diff --git a/avrdude-6.3-patches/61-avrdude-6.3-add_fake_efuse_to_atmega8_for_Arduino_IDE.patch b/avrdude-6.3-patches/61-avrdude-6.3-add_fake_efuse_to_atmega8_for_Arduino_IDE.patch new file mode 100644 index 0000000..ad006aa --- /dev/null +++ b/avrdude-6.3-patches/61-avrdude-6.3-add_fake_efuse_to_atmega8_for_Arduino_IDE.patch @@ -0,0 +1,16 @@ +--- avrdude.conf.in.orig 2016-12-16 13:08:00.210983367 +0100 ++++ avrdude.conf.in 2016-12-16 13:10:44.691541657 +0100 +@@ -6548,6 +6548,13 @@ + "x x x x x x x x i i i i i i i i"; + ; + ++ # Required for Arduino IDE ++ # see: https://github.com/arduino/Arduino/issues/2075 ++ # https://github.com/arduino/Arduino/issues/2075#issuecomment-238031689 ++ memory "efuse" ++ size = 0; ++ ; ++ + memory "lock" + size = 1; + min_write_delay = 2000; From a5002158f48741283cfd81ebfcf2392fac35618e Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 16 Dec 2016 13:20:27 +0100 Subject: [PATCH 17/63] Updated packaged version to 6.3.0-arduino8 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 440c8a3..2722413 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino7 +OUTPUT_VERSION=6.3.0-arduino8 export OS=`uname -o || uname` export TARGET_OS=$OS From 0db27a253c86f7a0e5c85e85975505c1bf295ef5 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 2 Jan 2017 10:27:20 +0100 Subject: [PATCH 18/63] [TEST] Statically compile libncurses --- libncurses-6.0.build.bash | 64 +++++++++++++++++++++++++++++++++++++++ package-avrdude.bash | 1 + 2 files changed, 65 insertions(+) create mode 100755 libncurses-6.0.build.bash diff --git a/libncurses-6.0.build.bash b/libncurses-6.0.build.bash new file mode 100755 index 0000000..97b4c6c --- /dev/null +++ b/libncurses-6.0.build.bash @@ -0,0 +1,64 @@ +#!/bin/bash -ex +# Copyright (c) 2014-2016 Arduino LLC +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +mkdir -p objdir +cd objdir +PREFIX=`pwd` +cd - + +if [[ ! -f ncurses-6.0.tar.gz ]] ; +then + wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz +fi + +tar xfv ncurses-6.0.tar.gz + +cd ncurses-6.0 +CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --enable-widec --with-cxx-binding" +if [[ $CROSS_COMPILE != "" ]] ; then + CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" + # solve bug with --host not being effective on second level directory + export CC=$CROSS_COMPILE_HOST-gcc + export AR=$CROSS_COMPILE_HOST-ar + export RANLIB=$CROSS_COMPILE_HOST-ranlib +fi +CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS +make -j 4 +make install +cd .. + +if [[ ! -f readline-7.0.tar.gz ]] ; +then + wget https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz +fi + +tar xfv readline-7.0.tar.gz + +cd readline-7.0 +CONFARGS="--prefix=$PREFIX --disable-shared" +if [[ $CROSS_COMPILE != "" ]] ; then + CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" + # solve bug with --host not being effective on second level directory + export CC=$CROSS_COMPILE_HOST-gcc + export AR=$CROSS_COMPILE_HOST-ar + export RANLIB=$CROSS_COMPILE_HOST-ranlib +fi +CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS +make -j 4 +make install +cd .. + diff --git a/package-avrdude.bash b/package-avrdude.bash index 2722413..da2f2bd 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -74,6 +74,7 @@ rm -rf avrdude-6.3 libusb-1.0.20 libusb-compat-0.1.5 libusb-win32-bin-1.2.6.0 li ./libusb-1.0.20.build.bash ./libusb-compat-0.1.5.build.bash ./libelf-0.8.13.build.bash +./libncurses-6.0.build.bash ./avrdude-6.3.build.bash # if producing a windows build, compress as zip and From 5e76383fe0dd71ff0251bc94898d845fc95cdacc Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 2 Jan 2017 10:29:02 +0100 Subject: [PATCH 19/63] Update version to 6.3.0-arduino9 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index da2f2bd..5e4f5ed 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino8 +OUTPUT_VERSION=6.3.0-arduino9 export OS=`uname -o || uname` export TARGET_OS=$OS From 9bbff4582a50ae76ad9257751e812a44665e9b30 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 2 Jan 2017 10:47:33 +0100 Subject: [PATCH 20/63] Fix windows build --- libncurses-6.0.build.bash | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/libncurses-6.0.build.bash b/libncurses-6.0.build.bash index 97b4c6c..9a68484 100755 --- a/libncurses-6.0.build.bash +++ b/libncurses-6.0.build.bash @@ -20,6 +20,11 @@ cd objdir PREFIX=`pwd` cd - +if [[ $OS == "Msys" || $OS == "Cygwin" || $CROSS_COMPILE_HOST == "i686-w64-mingw32" ]] ; then + #Avoid compiling ncurses in Windows platform + exit 0 +fi + if [[ ! -f ncurses-6.0.tar.gz ]] ; then wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz @@ -29,13 +34,6 @@ tar xfv ncurses-6.0.tar.gz cd ncurses-6.0 CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --enable-widec --with-cxx-binding" -if [[ $CROSS_COMPILE != "" ]] ; then - CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" - # solve bug with --host not being effective on second level directory - export CC=$CROSS_COMPILE_HOST-gcc - export AR=$CROSS_COMPILE_HOST-ar - export RANLIB=$CROSS_COMPILE_HOST-ranlib -fi CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 make install @@ -50,13 +48,6 @@ tar xfv readline-7.0.tar.gz cd readline-7.0 CONFARGS="--prefix=$PREFIX --disable-shared" -if [[ $CROSS_COMPILE != "" ]] ; then - CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" - # solve bug with --host not being effective on second level directory - export CC=$CROSS_COMPILE_HOST-gcc - export AR=$CROSS_COMPILE_HOST-ar - export RANLIB=$CROSS_COMPILE_HOST-ranlib -fi CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 make install From 1a6a6b36b06c2542b3512f522073b658eb898191 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 2 Jan 2017 11:35:45 +0100 Subject: [PATCH 21/63] Fix include paths for bundled ncurses --- avrdude-6.3.build.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index 9a86b86..c3e3abd 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -32,9 +32,9 @@ for p in ../avrdude-6.3-patches/*.patch; do echo Applying $p; patch -p0 < $p; do autoreconf --force --install ./bootstrap -CFLAGS="$CFLAGS -I$PREFIX/include -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib" -CXXFLAGS="$CXXFLAGS -I$PREFIX/include -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib" -LDFLAGS="$LDFLAGS -I$PREFIX/include -I$PREFIX/include -L$PREFIX/lib" +CFLAGS="$CFLAGS -I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib" +CXXFLAGS="$CXXFLAGS -I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib" +LDFLAGS="$LDFLAGS -I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib" CONFARGS="--prefix=$PREFIX --enable-linuxgpio" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" From 7888e86f3f617e497a628f0b64f3c626e0015f9f Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 17 Jan 2017 11:58:03 +0100 Subject: [PATCH 22/63] Update to 6.3.0-arduino9 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 2722413..3aef5b1 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino8 +OUTPUT_VERSION=6.3.0-arduino9 export OS=`uname -o || uname` export TARGET_OS=$OS From cd927feca1567b23180ead889d65e104c2adca5a Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 15 Dec 2017 14:03:10 +0100 Subject: [PATCH 23/63] use git repo as source --- avrdude-6.3.build.bash | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index c3e3abd..6ae5a8b 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -20,15 +20,9 @@ cd objdir PREFIX=`pwd` cd - -if [[ ! -f avrdude-6.3.tar.gz ]] ; -then - wget http://download.savannah.gnu.org/releases/avrdude/avrdude-6.3.tar.gz -fi - -tar xfv avrdude-6.3.tar.gz +git clone https://github.com/facchinm/avrdude.git avrdude-6.3 cd avrdude-6.3 -for p in ../avrdude-6.3-patches/*.patch; do echo Applying $p; patch -p0 < $p; done autoreconf --force --install ./bootstrap From 0c1f575cc1a3422b0c31ce313931b247178ca16c Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 15 Dec 2017 14:13:53 +0100 Subject: [PATCH 24/63] update version to 6.3.0-arduino10 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 5e4f5ed..6d55cb2 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino9 +OUTPUT_VERSION=6.3.0-arduino10 export OS=`uname -o || uname` export TARGET_OS=$OS From 768b199bf4785f798ebf963b31f122fd77b6d700 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 15 Dec 2017 15:33:29 +0100 Subject: [PATCH 25/63] Try removing stray files from ncurses --- avrdude-6.3.build.bash | 6 +++--- libncurses-6.0.build.bash | 4 ++-- package-avrdude.bash | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index 6ae5a8b..bfbf739 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -26,9 +26,9 @@ cd avrdude-6.3 autoreconf --force --install ./bootstrap -CFLAGS="$CFLAGS -I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib" -CXXFLAGS="$CXXFLAGS -I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib" -LDFLAGS="$LDFLAGS -I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib" +CFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib $CFLAGS" +CXXFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib $CXXFLAGS" +LDFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib $LDFLAGS" CONFARGS="--prefix=$PREFIX --enable-linuxgpio" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" diff --git a/libncurses-6.0.build.bash b/libncurses-6.0.build.bash index 9a68484..db08441 100755 --- a/libncurses-6.0.build.bash +++ b/libncurses-6.0.build.bash @@ -36,7 +36,7 @@ cd ncurses-6.0 CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --enable-widec --with-cxx-binding" CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 -make install +make install.libs cd .. if [[ ! -f readline-7.0.tar.gz ]] ; @@ -50,6 +50,6 @@ cd readline-7.0 CONFARGS="--prefix=$PREFIX --disable-shared" CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 -make install +make install-static cd .. diff --git a/package-avrdude.bash b/package-avrdude.bash index 6d55cb2..9383464 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -69,7 +69,7 @@ else fi -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 +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-6.0 readline-7.0 ./libusb-1.0.20.build.bash ./libusb-compat-0.1.5.build.bash From ba11c7475d87c46dace64dc52511d7a21ef3ffed Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 15 Dec 2017 15:42:35 +0100 Subject: [PATCH 26/63] TEST: add arm crosscompile target --- package-avrdude.bash | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package-avrdude.bash b/package-avrdude.bash index 9383464..835c406 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -28,6 +28,13 @@ if [[ $CROSS_COMPILE == "mingw" ]] ; then export TARGET_OS="Windows" OUTPUT_TAG=i686-w64-mingw32 +elif [[ $CROSS_COMPILE == "arm-cross" ]] ; then + export CC="arm-linux-gnueabihf-gcc" + export CXX="arm-linux-gnueabihf-g++" + export CROSS_COMPILE_HOST="arm-linux-gnueabihf" + export TARGET_OS="GNU/Linux" + OUTPUT_TAG=armhf-pc-linux-gnu + elif [[ $OS == "GNU/Linux" ]] ; then export MACHINE=`uname -m` From b81d49ec15128fca59493f72bc0321b12b1f3c75 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 15 Dec 2017 15:49:00 +0100 Subject: [PATCH 27/63] Fix crosscompilation on ncurses --- libncurses-6.0.build.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libncurses-6.0.build.bash b/libncurses-6.0.build.bash index db08441..f5b517c 100755 --- a/libncurses-6.0.build.bash +++ b/libncurses-6.0.build.bash @@ -34,6 +34,9 @@ tar xfv ncurses-6.0.tar.gz cd ncurses-6.0 CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --enable-widec --with-cxx-binding" +if [[ $CROSS_COMPILE != "" ]] ; then + CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" +fi CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 make install.libs @@ -48,6 +51,9 @@ tar xfv readline-7.0.tar.gz cd readline-7.0 CONFARGS="--prefix=$PREFIX --disable-shared" +if [[ $CROSS_COMPILE != "" ]] ; then + CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" +fi CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 make install-static From 8f3a1e607b695b49ed63a884382d54d9742e695a Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 18 Dec 2017 14:54:51 +0100 Subject: [PATCH 28/63] Downgrade ncurses to 5.9 --- ....0.build.bash => libncurses-5.9.build.bash | 21 +++++---- ncurses-patches/0001-cpp-nasty.patch | 45 +++++++++++++++++++ package-avrdude.bash | 4 +- 3 files changed, 59 insertions(+), 11 deletions(-) rename libncurses-6.0.build.bash => libncurses-5.9.build.bash (75%) create mode 100644 ncurses-patches/0001-cpp-nasty.patch diff --git a/libncurses-6.0.build.bash b/libncurses-5.9.build.bash similarity index 75% rename from libncurses-6.0.build.bash rename to libncurses-5.9.build.bash index f5b517c..116f983 100755 --- a/libncurses-6.0.build.bash +++ b/libncurses-5.9.build.bash @@ -25,31 +25,34 @@ if [[ $OS == "Msys" || $OS == "Cygwin" || $CROSS_COMPILE_HOST == "i686-w64-mingw exit 0 fi -if [[ ! -f ncurses-6.0.tar.gz ]] ; +if [[ ! -f ncurses-5.9.tar.gz ]] ; then - wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.0.tar.gz + wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz fi -tar xfv ncurses-6.0.tar.gz +tar xfv ncurses-5.9.tar.gz + +cd ncurses-5.9 + +for p in ../ncurses-patches/*.patch; do echo Applying $p; patch -p1 < $p; done -cd ncurses-6.0 CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --enable-widec --with-cxx-binding" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi -CFLAGS="-w -O2 $CFLAGS -fPIC" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS +CFLAGS="-w -O2 $CFLAGS -fPIC" CPPFLAGS="-P" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 make install.libs cd .. -if [[ ! -f readline-7.0.tar.gz ]] ; +if [[ ! -f readline-6.3.tar.gz ]] ; then - wget https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz + wget https://ftp.gnu.org/gnu/readline/readline-6.3.tar.gz fi -tar xfv readline-7.0.tar.gz +tar xfv readline-6.3.tar.gz -cd readline-7.0 +cd readline-6.3 CONFARGS="--prefix=$PREFIX --disable-shared" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" diff --git a/ncurses-patches/0001-cpp-nasty.patch b/ncurses-patches/0001-cpp-nasty.patch new file mode 100644 index 0000000..7cff8b1 --- /dev/null +++ b/ncurses-patches/0001-cpp-nasty.patch @@ -0,0 +1,45 @@ +diff -Naur /tmp/ncurses-5.9/c++/cursesf.h ncurses-5.9/c++/cursesf.h +--- /tmp/ncurses-5.9/c++/cursesf.h 2005-08-13 20:08:24.000000000 +0200 ++++ ncurses-5.9/c++/cursesf.h 2017-12-18 14:50:15.358498044 +0100 +@@ -703,7 +703,7 @@ + virtual ~NCursesUserForm() { + }; + +- inline T* UserData (void) const { ++ inline T* UserData (void) { + return reinterpret_cast(get_user ()); + }; + +diff -Naur /tmp/ncurses-5.9/c++/cursesm.h ncurses-5.9/c++/cursesm.h +--- /tmp/ncurses-5.9/c++/cursesm.h 2005-08-13 20:10:36.000000000 +0200 ++++ ncurses-5.9/c++/cursesm.h 2017-12-18 14:49:59.605164893 +0100 +@@ -607,7 +607,7 @@ + + virtual ~NCursesUserItem() {} + +- inline const T* UserData (void) const { ++ inline const T* UserData (void) { + return reinterpret_cast(::item_userptr (item)); + }; + +@@ -659,7 +659,7 @@ + virtual ~NCursesUserMenu() { + }; + +- inline T* UserData (void) const { ++ inline T* UserData (void) { + return reinterpret_cast(get_user ()); + }; + +diff -Naur /tmp/ncurses-5.9/c++/cursesp.h ncurses-5.9/c++/cursesp.h +--- /tmp/ncurses-5.9/c++/cursesp.h 2008-08-16 19:20:23.000000000 +0200 ++++ ncurses-5.9/c++/cursesp.h 2017-12-18 14:48:36.728499179 +0100 +@@ -251,7 +251,7 @@ + + virtual ~NCursesUserPanel() {}; + +- T* UserData (void) const ++ T* UserData (void) + { + return reinterpret_cast(get_user ()); + }; diff --git a/package-avrdude.bash b/package-avrdude.bash index 835c406..ab284cc 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -76,12 +76,12 @@ else fi -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-6.0 readline-7.0 +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 ./libusb-1.0.20.build.bash ./libusb-compat-0.1.5.build.bash ./libelf-0.8.13.build.bash -./libncurses-6.0.build.bash +./libncurses-5.9.build.bash ./avrdude-6.3.build.bash # if producing a windows build, compress as zip and From bbc5bfce227ef6e4c57b708e6148c1603db8863f Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 18 Dec 2017 15:47:23 +0100 Subject: [PATCH 29/63] Rerun readline autoconf (too old for cross-compile) --- libncurses-5.9.build.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/libncurses-5.9.build.bash b/libncurses-5.9.build.bash index 116f983..f00aded 100755 --- a/libncurses-5.9.build.bash +++ b/libncurses-5.9.build.bash @@ -53,6 +53,7 @@ fi tar xfv readline-6.3.tar.gz cd readline-6.3 +autoconf CONFARGS="--prefix=$PREFIX --disable-shared" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" From eb50fe138f31e7fa0945261aec61181dd6aaf264 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 18 Dec 2017 16:47:26 +0100 Subject: [PATCH 30/63] Add patch for ncurses on clang3 --- ncurses-patches/0002-clang3.patch | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 ncurses-patches/0002-clang3.patch diff --git a/ncurses-patches/0002-clang3.patch b/ncurses-patches/0002-clang3.patch new file mode 100644 index 0000000..0bc6919 --- /dev/null +++ b/ncurses-patches/0002-clang3.patch @@ -0,0 +1,43 @@ +diff -ruNp ncurses-5.9/c++/cursesf.h ncurses-5.9/c++/cursesf.h +--- ncurses-5.9/c++/cursesf.h 2005-08-13 21:08:24.000000000 +0300 ++++ ncurses-5.9/c++/cursesf.h 2011-04-03 18:29:29.000000000 +0300 +@@ -681,7 +681,7 @@ public: + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) +- : NCursesForm (Fields, with_frame, autoDelete_Fields) { ++ : NCursesForm (&Fields, with_frame, autoDelete_Fields) { + if (form) + set_user (const_cast(p_UserData)); + }; +@@ -694,7 +694,7 @@ public: + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) +- : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, ++ : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x, + with_frame, autoDelete_Fields) { + if (form) + set_user (const_cast(p_UserData)); +diff -ruNp ncurses-5.9/c++/cursesm.h ncurses-5.9/c++/cursesm.h +--- ncurses-5.9/c++/cursesm.h 2005-08-13 21:10:36.000000000 +0300 ++++ ncurses-5.9/c++/cursesm.h 2011-04-03 18:31:42.000000000 +0300 +@@ -639,7 +639,7 @@ public: + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Items=FALSE) +- : NCursesMenu (Items, with_frame, autoDelete_Items) { ++ : NCursesMenu (&Items, with_frame, autoDelete_Items) { + if (menu) + set_user (const_cast(p_UserData)); + }; +@@ -651,7 +651,7 @@ public: + int begin_x = 0, + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE) +- : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { ++ : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) { + if (menu) + set_user (const_cast(p_UserData)); + }; + From 23946b7d0e3dd80d736318a38050da815d3d77c2 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 21 Dec 2017 17:20:37 +0100 Subject: [PATCH 31/63] experimental: add libhidapi --- avrdude-6.3.build.bash | 8 +++++--- libhidapi.build.bash | 38 ++++++++++++++++++++++++++++++++++++++ package-avrdude.bash | 5 +++-- 3 files changed, 46 insertions(+), 5 deletions(-) create mode 100755 libhidapi.build.bash diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index bfbf739..281b6c1 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -26,9 +26,11 @@ cd avrdude-6.3 autoreconf --force --install ./bootstrap -CFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib $CFLAGS" -CXXFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib $CXXFLAGS" -LDFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -L$PREFIX/lib $LDFLAGS" +COMMON_FLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -I$PREFIX/include/hidapi/ -L$PREFIX/lib" + +CFLAGS="$COMMON_FLAGS $CFLAGS" +CXXFLAGS="$COMMON_FLAGS $CXXFLAGS" +LDFLAGS="$COMMON_FLAGS $LDFLAGS" CONFARGS="--prefix=$PREFIX --enable-linuxgpio" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" diff --git a/libhidapi.build.bash b/libhidapi.build.bash new file mode 100755 index 0000000..5ded4b3 --- /dev/null +++ b/libhidapi.build.bash @@ -0,0 +1,38 @@ +#!/bin/bash -ex +# Copyright (c) 2014-2016 Arduino LLC +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +mkdir -p objdir +cd objdir +PREFIX=`pwd` +cd - + +git clone https://github.com/signal11/hidapi.git + +cd hidapi +CONFARGS="--prefix=$PREFIX --disable-shared" +if [[ $CROSS_COMPILE != "" ]] ; then + CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" + # solve bug with --host not being effective on second level directory + export CC=$CROSS_COMPILE_HOST-gcc + export AR=$CROSS_COMPILE_HOST-ar + export RANLIB=$CROSS_COMPILE_HOST-ranlib +fi +./bootstrap +CFLAGS="-w -O2 $CFLAGS" CXXFLAGS="-w -O2 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ./configure $CONFARGS +make -j 1 +make install +cd .. diff --git a/package-avrdude.bash b/package-avrdude.bash index ab284cc..f12ee5d 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino10 +OUTPUT_VERSION=6.3.0-arduino11 export OS=`uname -o || uname` export TARGET_OS=$OS @@ -76,12 +76,13 @@ else fi -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 +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 ./libusb-1.0.20.build.bash ./libusb-compat-0.1.5.build.bash ./libelf-0.8.13.build.bash ./libncurses-5.9.build.bash +./libhidapi.build.bash ./avrdude-6.3.build.bash # if producing a windows build, compress as zip and From 1c145e1e6f17ea769aae93f46feb12b9e1dc7895 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 22 Dec 2017 09:33:35 +0100 Subject: [PATCH 32/63] try libtoolize and udev --- avrdude-6.3.build.bash | 19 ++++++++++++++----- libhidapi.build.bash | 24 ++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index 281b6c1..7ead540 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -20,17 +20,26 @@ cd objdir PREFIX=`pwd` cd - -git clone https://github.com/facchinm/avrdude.git avrdude-6.3 +git clone https://github.com/facchinm/avrdude.git avrdude-6.3 --depth 1 cd avrdude-6.3 + +patch -p1 < ../avrdude-6.3-patches/90* + autoreconf --force --install ./bootstrap +if [[ $OS == "GNU/Linux" ]] ; then +libtoolize +fi + +COMMON_FLAGS="" -COMMON_FLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0/ -I$PREFIX/include/hidapi/ -L$PREFIX/lib" +#if [[ $CROSS_COMPILE == "mingw" ]] ; then +#CFLAGS="$CFLAGS -lhid -lsetupapi" +#fi -CFLAGS="$COMMON_FLAGS $CFLAGS" -CXXFLAGS="$COMMON_FLAGS $CXXFLAGS" -LDFLAGS="$COMMON_FLAGS $LDFLAGS" +CFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0 $CFLAGS" +LDFLAGS="-L$PREFIX/lib $LDFLAGS" CONFARGS="--prefix=$PREFIX --enable-linuxgpio" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" diff --git a/libhidapi.build.bash b/libhidapi.build.bash index 5ded4b3..ab8def3 100755 --- a/libhidapi.build.bash +++ b/libhidapi.build.bash @@ -20,10 +20,30 @@ cd objdir PREFIX=`pwd` cd - -git clone https://github.com/signal11/hidapi.git +if [[ $CROSS_COMPILE != "" ]] ; then + CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" +fi + +if [[ $TARGET_OS == "GNU/Linux" ]] ; then + +git clone https://github.com/gentoo/eudev.git --depth 1 +cd eudev +./autogen.sh +./configure --enable-static --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX +make clean +make -j4 +make install +cd .. +rm -rf eudev + +fi + +git clone https://github.com/signal11/hidapi.git --depth 1 + +CFLAGS="-I$PREFIX/include/ -L$PREFIX/lib/" cd hidapi -CONFARGS="--prefix=$PREFIX --disable-shared" +CONFARGS="--prefix=$PREFIX --enable-static --disable-shared " if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" # solve bug with --host not being effective on second level directory From 9a55ba4144c6119e11dac71f9cea61c623abb815 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 22 Dec 2017 09:35:45 +0100 Subject: [PATCH 33/63] remove patch --- avrdude-6.3.build.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index 7ead540..aa4242a 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -24,7 +24,7 @@ git clone https://github.com/facchinm/avrdude.git avrdude-6.3 --depth 1 cd avrdude-6.3 -patch -p1 < ../avrdude-6.3-patches/90* +#patch -p1 < ../avrdude-6.3-patches/90* autoreconf --force --install ./bootstrap From a1d20a150575074d87460b6926eba0db1cdf4190 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 22 Dec 2017 09:43:45 +0100 Subject: [PATCH 34/63] readd patch --- .../90-check-if-hidapi-from-includes.patch | 28 +++++++++++++++++++ avrdude-6.3.build.bash | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 avrdude-6.3-patches/90-check-if-hidapi-from-includes.patch diff --git a/avrdude-6.3-patches/90-check-if-hidapi-from-includes.patch b/avrdude-6.3-patches/90-check-if-hidapi-from-includes.patch new file mode 100644 index 0000000..6aaae90 --- /dev/null +++ b/avrdude-6.3-patches/90-check-if-hidapi-from-includes.patch @@ -0,0 +1,28 @@ +diff --git a/configure.ac b/configure.ac +index d422bfc..ddd9b6f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -154,7 +154,9 @@ AC_SUBST(LIBUSB_1_0, $LIBUSB_1_0) + + AH_TEMPLATE([HAVE_LIBHIDAPI], + [Define if HID support is enabled via libhidapi]) +-AC_SEARCH_LIBS([hid_init], [hidapi hidapi-libusb hidapi-hidraw], [have_libhidapi=yes]) ++for _hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do ++ PKG_CHECK_MODULES([hidapi],[$_hidapi_lib],[have_libhidapi=yes],[true]) ++done + if test x$have_libhidapi = xyes; then + case $target in + *-*-darwin*) +@@ -164,12 +166,9 @@ if test x$have_libhidapi = xyes; then + LIBHIDAPI="$ac_cv_lib_hid_init" + ;; + esac +- AC_DEFINE([HAVE_LIBHIDAPI]) +- AC_CHECK_HEADERS([hidapi/hidapi.h]) + fi + AC_SUBST(LIBHIDAPI, $LIBHIDAPI) + +- + AH_TEMPLATE([HAVE_LIBFTDI1], + [Define if FTDI support is enabled via libftdi1]) + AH_TEMPLATE([HAVE_LIBFTDI], diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index aa4242a..7ead540 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -24,7 +24,7 @@ git clone https://github.com/facchinm/avrdude.git avrdude-6.3 --depth 1 cd avrdude-6.3 -#patch -p1 < ../avrdude-6.3-patches/90* +patch -p1 < ../avrdude-6.3-patches/90* autoreconf --force --install ./bootstrap From e036edcb3800d3858547259e704cf2048225e392 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 22 Dec 2017 09:50:55 +0100 Subject: [PATCH 35/63] move cflags --- avrdude-6.3.build.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index 7ead540..c300863 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -26,6 +26,9 @@ cd avrdude-6.3 patch -p1 < ../avrdude-6.3-patches/90* +export CFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0 $CFLAGS" +export LDFLAGS="-L$PREFIX/lib $LDFLAGS" + autoreconf --force --install ./bootstrap if [[ $OS == "GNU/Linux" ]] ; then @@ -38,8 +41,6 @@ COMMON_FLAGS="" #CFLAGS="$CFLAGS -lhid -lsetupapi" #fi -CFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0 $CFLAGS" -LDFLAGS="-L$PREFIX/lib $LDFLAGS" CONFARGS="--prefix=$PREFIX --enable-linuxgpio" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" From 2bc9818cb113b4c8045a9c03738fe91bb774561c Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 8 Jan 2018 14:43:25 +0100 Subject: [PATCH 36/63] test1 --- avrdude-6.3.build.bash | 2 +- libhidapi.build.bash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index c300863..0aae176 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -26,7 +26,7 @@ cd avrdude-6.3 patch -p1 < ../avrdude-6.3-patches/90* -export CFLAGS="-I$PREFIX/include -I$PREFIX/ncurses -I$PREFIX/ncursesw -I$PREFIX/readline -I$PREFIX/include/libusb-1.0 $CFLAGS" +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" export LDFLAGS="-L$PREFIX/lib $LDFLAGS" autoreconf --force --install diff --git a/libhidapi.build.bash b/libhidapi.build.bash index ab8def3..f9a20c7 100755 --- a/libhidapi.build.bash +++ b/libhidapi.build.bash @@ -29,7 +29,7 @@ if [[ $TARGET_OS == "GNU/Linux" ]] ; then git clone https://github.com/gentoo/eudev.git --depth 1 cd eudev ./autogen.sh -./configure --enable-static --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX +./configure --enable-static --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX $CONFARGS make clean make -j4 make install From c073125221bf51b91d96b3c6b6e92fc75f807bc2 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 8 Jan 2018 18:34:09 +0100 Subject: [PATCH 37/63] HACK: force HID on mingw target --- avrdude-6.3.build.bash | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index 0aae176..230285d 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -37,15 +37,16 @@ fi COMMON_FLAGS="" -#if [[ $CROSS_COMPILE == "mingw" ]] ; then -#CFLAGS="$CFLAGS -lhid -lsetupapi" -#fi +if [[ $CROSS_COMPILE == "mingw" ]] ; then +CFLAGS="-DHAVE_LIBHIDAPI $CFLAGS -lhidapi -lsetupapi" +LIBS="-lhidapi -lsetupapi" +fi CONFARGS="--prefix=$PREFIX --enable-linuxgpio" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi -CFLAGS="-w -O2 $CFLAGS" CXXFLAGS="-w -O2 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" ./configure $CONFARGS +./configure $CONFARGS CFLAGS="-w -O2 $CFLAGS" CXXFLAGS="-w -O2 $CXXFLAGS" LDFLAGS="-s $LDFLAGS" LIBS="$LIBS" make make install From 55eddefeeabdc9d1f5506f6a641d2467b961217c Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 9 Jan 2018 12:08:19 +0100 Subject: [PATCH 38/63] Add hidapi to darwin build --- avrdude-6.3.build.bash | 8 +++++++- libhidapi.build.bash | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index 230285d..1317b16 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -38,10 +38,16 @@ fi COMMON_FLAGS="" if [[ $CROSS_COMPILE == "mingw" ]] ; then -CFLAGS="-DHAVE_LIBHIDAPI $CFLAGS -lhidapi -lsetupapi" +CFLAGS="-DHAVE_LIBHIDAPI $CFLAGS" LIBS="-lhidapi -lsetupapi" fi +if [[ $OS == "Darwin" ]] ; then +CFLAGS="-DHAVE_LIBHIDAPI $CFLAGS" +LIBS="-lhidapi" +fi + + CONFARGS="--prefix=$PREFIX --enable-linuxgpio" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" diff --git a/libhidapi.build.bash b/libhidapi.build.bash index f9a20c7..d29d6bc 100755 --- a/libhidapi.build.bash +++ b/libhidapi.build.bash @@ -28,8 +28,13 @@ if [[ $TARGET_OS == "GNU/Linux" ]] ; then git clone https://github.com/gentoo/eudev.git --depth 1 cd eudev -./autogen.sh -./configure --enable-static --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX $CONFARGS +#./autogen.sh +libtoolize --force +aclocal +autoheader +automake --force-missing --add-missing +autoconf +./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX $CONFARGS make clean make -j4 make install @@ -44,6 +49,11 @@ CFLAGS="-I$PREFIX/include/ -L$PREFIX/lib/" cd hidapi CONFARGS="--prefix=$PREFIX --enable-static --disable-shared " + +PKG_CONFIG_DIR= +PKG_CONFIG_LIBDIR=$PREFIX/lib/pkgconfig:$STAGING/share/pkgconfig +PKG_CONFIG_SYSROOT_DIR=$PREFIX + if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" # solve bug with --host not being effective on second level directory From 1ac3e436d9590017f35e23a5b0cc06cd2a6d4ffc Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 9 Jan 2018 12:13:46 +0100 Subject: [PATCH 39/63] add missing exports --- libhidapi.build.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libhidapi.build.bash b/libhidapi.build.bash index d29d6bc..571ccff 100755 --- a/libhidapi.build.bash +++ b/libhidapi.build.bash @@ -50,9 +50,9 @@ CFLAGS="-I$PREFIX/include/ -L$PREFIX/lib/" cd hidapi CONFARGS="--prefix=$PREFIX --enable-static --disable-shared " -PKG_CONFIG_DIR= -PKG_CONFIG_LIBDIR=$PREFIX/lib/pkgconfig:$STAGING/share/pkgconfig -PKG_CONFIG_SYSROOT_DIR=$PREFIX +export PKG_CONFIG_DIR= +export PKG_CONFIG_LIBDIR=$PREFIX/lib/pkgconfig:$STAGING/share/pkgconfig +export PKG_CONFIG_SYSROOT_DIR=$PREFIX if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" From 6e42af87a1b8ef2e4068191ced5a0b4bccec2c43 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 29 Jan 2018 19:11:45 +0100 Subject: [PATCH 40/63] test build for staging stuff --- avrdude-6.3.build.bash | 2 +- libhidapi.build.bash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index 1317b16..afce691 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -20,7 +20,7 @@ cd objdir PREFIX=`pwd` cd - -git clone https://github.com/facchinm/avrdude.git avrdude-6.3 --depth 1 +git clone https://github.com/facchinm/avrdude.git avrdude-6.3 --depth 1 -b staging cd avrdude-6.3 diff --git a/libhidapi.build.bash b/libhidapi.build.bash index 571ccff..a472fbe 100755 --- a/libhidapi.build.bash +++ b/libhidapi.build.bash @@ -26,7 +26,7 @@ fi if [[ $TARGET_OS == "GNU/Linux" ]] ; then -git clone https://github.com/gentoo/eudev.git --depth 1 +git clone https://github.com/gentoo/eudev.git --depth 1 -b v3.0 cd eudev #./autogen.sh libtoolize --force From 276773f0abb8671bdadc3e4f15dafadb94685fa7 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 31 Jan 2018 12:06:40 +0100 Subject: [PATCH 41/63] Restore udev and libhid on linux new pkg-config is needed to compile on debian7 (requires glib-2.0 > 2.16) --- libhidapi.build.bash | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/libhidapi.build.bash b/libhidapi.build.bash index a472fbe..b63b508 100755 --- a/libhidapi.build.bash +++ b/libhidapi.build.bash @@ -26,14 +26,9 @@ fi if [[ $TARGET_OS == "GNU/Linux" ]] ; then -git clone https://github.com/gentoo/eudev.git --depth 1 -b v3.0 +git clone https://github.com/gentoo/eudev.git --depth 1 cd eudev -#./autogen.sh -libtoolize --force -aclocal -autoheader -automake --force-missing --add-missing -autoconf +./autogen.sh ./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX $CONFARGS make clean make -j4 @@ -45,14 +40,13 @@ fi git clone https://github.com/signal11/hidapi.git --depth 1 -CFLAGS="-I$PREFIX/include/ -L$PREFIX/lib/" +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" +export LDFLAGS="-L$PREFIX/lib $LDFLAGS" cd hidapi -CONFARGS="--prefix=$PREFIX --enable-static --disable-shared " +CONFARGS="--prefix=$PREFIX --enable-static --disable-shared" -export PKG_CONFIG_DIR= -export PKG_CONFIG_LIBDIR=$PREFIX/lib/pkgconfig:$STAGING/share/pkgconfig -export PKG_CONFIG_SYSROOT_DIR=$PREFIX +export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" From 369160219cd38e7ec7243002b6add1833185f552 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 31 Jan 2018 14:09:39 +0100 Subject: [PATCH 42/63] fix static build on Linux --- .../90-check-if-hidapi-from-includes.patch | 9 +++++++++ avrdude-6.3.build.bash | 3 ++- libncurses-5.9.build.bash | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/avrdude-6.3-patches/90-check-if-hidapi-from-includes.patch b/avrdude-6.3-patches/90-check-if-hidapi-from-includes.patch index 6aaae90..e5fd94d 100644 --- a/avrdude-6.3-patches/90-check-if-hidapi-from-includes.patch +++ b/avrdude-6.3-patches/90-check-if-hidapi-from-includes.patch @@ -2,6 +2,15 @@ diff --git a/configure.ac b/configure.ac index d422bfc..ddd9b6f 100644 --- a/configure.ac +++ b/configure.ac +@@ -79,7 +79,7 @@ dnl Makefile.am:77: compiling `config_gram.c' with per-target flags requires `AM + AM_PROG_CC_C_O + + # Checks for libraries. +-AC_CHECK_LIB([termcap], [tputs]) ++AC_CHECK_LIB([ncurses], [tputs]) + AC_CHECK_LIB([ncurses], [tputs]) + AC_CHECK_LIB([readline], [readline]) + AH_TEMPLATE([HAVE_LIBELF], @@ -154,7 +154,9 @@ AC_SUBST(LIBUSB_1_0, $LIBUSB_1_0) AH_TEMPLATE([HAVE_LIBHIDAPI], diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index afce691..fed17dd 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -28,6 +28,7 @@ patch -p1 < ../avrdude-6.3-patches/90* 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" export LDFLAGS="-L$PREFIX/lib $LDFLAGS" +export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig autoreconf --force --install ./bootstrap @@ -48,7 +49,7 @@ LIBS="-lhidapi" fi -CONFARGS="--prefix=$PREFIX --enable-linuxgpio" +CONFARGS="--prefix=$PREFIX --enable-linuxgpio --with-sysroot=$PREFIX" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi diff --git a/libncurses-5.9.build.bash b/libncurses-5.9.build.bash index f00aded..4028e23 100755 --- a/libncurses-5.9.build.bash +++ b/libncurses-5.9.build.bash @@ -36,13 +36,13 @@ cd ncurses-5.9 for p in ../ncurses-patches/*.patch; do echo Applying $p; patch -p1 < $p; done -CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --enable-widec --with-cxx-binding" +CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --with-termlib --enable-termcap" if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi CFLAGS="-w -O2 $CFLAGS -fPIC" CPPFLAGS="-P" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 -make install.libs +make install.libs cd .. if [[ ! -f readline-6.3.tar.gz ]] ; From 6ed4a87e25ec1b6dd8652918403269342da1bb00 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 31 Jan 2018 14:10:34 +0100 Subject: [PATCH 43/63] Version is now arduino12 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index f12ee5d..fd929ae 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino11 +OUTPUT_VERSION=6.3.0-arduino12 export OS=`uname -o || uname` export TARGET_OS=$OS From b44af63ddfd74ce1e9f4a0dc50cd5f88a1162984 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 1 Feb 2018 09:49:48 +0100 Subject: [PATCH 44/63] Strip unneeded stuff from final package --- package-avrdude.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index fd929ae..af0478c 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -92,14 +92,14 @@ if [[ ${OUTPUT_TAG} == *"mingw"* ]] ; then cp libusb-win32-bin-1.2.6.0/bin/x86/libusb0_x86.dll objdir/bin/libusb0.dll rm -f avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip cp -a objdir avrdude - zip -r avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip avrdude + zip -r avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.zip avrdude/bin/ avrdude/etc/avrdude.conf rm -r avrdude else rm -f avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 cp -a objdir avrdude - tar -cjvf avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 avrdude + tar -cjvf avrdude-${OUTPUT_VERSION}-${OUTPUT_TAG}.tar.bz2 avrdude/bin/avrdude avrdude/etc/avrdude.conf rm -r avrdude fi From 3841cc22c28f8b9e792d09369b2c7c18cc000297 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 15 Feb 2018 15:13:34 +0100 Subject: [PATCH 45/63] Update version to arduino13 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index af0478c..def63cd 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino12 +OUTPUT_VERSION=6.3.0-arduino13 export OS=`uname -o || uname` export TARGET_OS=$OS From d991d9ee4d58b615552aded8acd14edbb577aee9 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 15 Feb 2018 15:18:42 +0100 Subject: [PATCH 46/63] use a stable release of eudev --- libhidapi.build.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libhidapi.build.bash b/libhidapi.build.bash index b63b508..4aae4bf 100755 --- a/libhidapi.build.bash +++ b/libhidapi.build.bash @@ -26,8 +26,9 @@ fi if [[ $TARGET_OS == "GNU/Linux" ]] ; then -git clone https://github.com/gentoo/eudev.git --depth 1 -cd eudev +wget https://github.com/gentoo/eudev/archive/v3.2.5.tar.gz +tar xvf v3.2.5.tar.gz +cd eudev-3.2.5 ./autogen.sh ./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX $CONFARGS make clean From d9af27550de3fc50f471a0e011126b8d607f9ef2 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Thu, 15 Feb 2018 15:30:13 +0100 Subject: [PATCH 47/63] Downgrade eudev --- libhidapi.build.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libhidapi.build.bash b/libhidapi.build.bash index 4aae4bf..c29bd24 100755 --- a/libhidapi.build.bash +++ b/libhidapi.build.bash @@ -26,9 +26,9 @@ fi if [[ $TARGET_OS == "GNU/Linux" ]] ; then -wget https://github.com/gentoo/eudev/archive/v3.2.5.tar.gz -tar xvf v3.2.5.tar.gz -cd eudev-3.2.5 +wget https://github.com/gentoo/eudev/archive/v3.1.3.tar.gz +tar xvf v3.1.3.tar.gz +cd eudev-3.1.3 ./autogen.sh ./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX $CONFARGS make clean From dc4491e6dcfc418b126ae9c2de615f61b82c2da3 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Sun, 4 Mar 2018 12:28:01 +0100 Subject: [PATCH 48/63] Download libusb tarball via github release --- libusb-1.0.20.build.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libusb-1.0.20.build.bash b/libusb-1.0.20.build.bash index f04150b..37d930f 100755 --- a/libusb-1.0.20.build.bash +++ b/libusb-1.0.20.build.bash @@ -22,7 +22,7 @@ cd - if [[ ! -f libusb-1.0.20.tar.bz2 ]] ; then - wget http://download.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.20/libusb-1.0.20.tar.bz2 + wget https://github.com/libusb/libusb/releases/download/v1.0.20/libusb-1.0.20.tar.bz2 fi tar xfv libusb-1.0.20.tar.bz2 From 7e2221c3b989701f0017d054485ef05df97e3459 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 8 Mar 2018 22:44:50 +0000 Subject: [PATCH 49/63] Add AArch64 build support Enhance package-avrdude.bash to know about AArch64. libelf's config.guess is too old to know about AArch64. Add a patch to replace it with the version from libusb. --- libelf-0.8.13-patches/01-config.guess.patch | 1838 +++++++++++++++++++ libelf-0.8.13.build.bash | 1 + package-avrdude.bash | 2 + 3 files changed, 1841 insertions(+) create mode 100644 libelf-0.8.13-patches/01-config.guess.patch diff --git a/libelf-0.8.13-patches/01-config.guess.patch b/libelf-0.8.13-patches/01-config.guess.patch new file mode 100644 index 0000000..9382b79 --- /dev/null +++ b/libelf-0.8.13-patches/01-config.guess.patch @@ -0,0 +1,1838 @@ +--- config.guess 2005-05-21 15:28:37.000000000 +0000 ++++ config.guess 2018-03-08 22:19:13.118626724 +0000 +@@ -1,13 +1,12 @@ + #! /bin/sh + # Attempt to guess a canonical system name. +-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++# Copyright 1992-2015 Free Software Foundation, Inc. + +-timestamp='2004-06-11' ++timestamp='2015-01-01' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or ++# the Free Software Foundation; either version 3 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, but +@@ -16,24 +15,22 @@ + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++# along with this program; if not, see . + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under +-# the same distribution terms that you use for the rest of that program. +- +-# Originally written by Per Bothner . +-# Please send patches to . Submit a context +-# diff and a properly formatted ChangeLog entry. ++# the same distribution terms that you use for the rest of that ++# program. This Exception is an additional permission under section 7 ++# of the GNU General Public License, version 3 ("GPLv3"). ++# ++# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. + # +-# This script attempts to guess a canonical system name similar to +-# config.sub. If it succeeds, it prints the system name on stdout, and +-# exits with 0. Otherwise, it exits with 1. ++# You can get the latest version of this script from: ++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + # +-# The plan is that this can be called by configure scripts if you +-# don't specify an explicit build system type. ++# Please send patches to . ++ + + me=`echo "$0" | sed -e 's,.*/,,'` + +@@ -53,8 +50,7 @@ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +-Free Software Foundation, Inc. ++Copyright 1992-2015 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -66,11 +62,11 @@ + while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) +- echo "$timestamp" ; exit 0 ;; ++ echo "$timestamp" ; exit ;; + --version | -v ) +- echo "$version" ; exit 0 ;; ++ echo "$version" ; exit ;; + --help | --h* | -h ) +- echo "$usage"; exit 0 ;; ++ echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. +@@ -104,7 +100,7 @@ + trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; + trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; + : ${TMPDIR=/tmp} ; +- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || ++ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +@@ -123,7 +119,7 @@ + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +-esac ;' ++esac ; set_cc_for_build= ;' + + # This is needed to find uname on a Pyramid OSx when run in the BSD universe. + # (ghazi@noc.rutgers.edu 1994-08-24) +@@ -136,12 +132,33 @@ + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown + UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + ++case "${UNAME_SYSTEM}" in ++Linux|GNU|GNU/*) ++ # If the system lacks a compiler, then just pick glibc. ++ # We could probably try harder. ++ LIBC=gnu ++ ++ eval $set_cc_for_build ++ cat <<-EOF > $dummy.c ++ #include ++ #if defined(__UCLIBC__) ++ LIBC=uclibc ++ #elif defined(__dietlibc__) ++ LIBC=dietlibc ++ #else ++ LIBC=gnu ++ #endif ++ EOF ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ++ ;; ++esac ++ + # Note: order is significant - the case branches are not exclusive. + + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or +- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, ++ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward +@@ -158,6 +175,7 @@ + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; ++ sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched +@@ -166,7 +184,7 @@ + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ +- | grep __ELF__ >/dev/null ++ | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? +@@ -176,7 +194,7 @@ + fi + ;; + *) +- os=netbsd ++ os=netbsd + ;; + esac + # The OS release +@@ -196,71 +214,34 @@ + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" +- exit 0 ;; +- amd64:OpenBSD:*:*) +- echo x86_64-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- amiga:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- arc:OpenBSD:*:*) +- echo mipsel-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- cats:OpenBSD:*:*) +- echo arm-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- hp300:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- luna88k:OpenBSD:*:*) +- echo m88k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mac68k:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- macppc:OpenBSD:*:*) +- echo powerpc-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mvme68k:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mvme88k:OpenBSD:*:*) +- echo m88k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mvmeppc:OpenBSD:*:*) +- echo powerpc-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- pmax:OpenBSD:*:*) +- echo mipsel-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- sgi:OpenBSD:*:*) +- echo mipseb-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- sun3:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- wgrisc:OpenBSD:*:*) +- echo mipsel-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; ++ *:Bitrig:*:*) ++ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` ++ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} ++ exit ;; + *:OpenBSD:*:*) +- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; ++ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` ++ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} ++ exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; ++ *:SolidBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} ++ exit ;; + macppc:MirBSD:*:*) +- echo powerppc-unknown-mirbsd${UNAME_RELEASE} +- exit 0 ;; ++ echo powerpc-unknown-mirbsd${UNAME_RELEASE} ++ exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) +- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on +@@ -306,40 +287,46 @@ + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` +- exit 0 ;; +- Alpha*:OpenVMS:*:*) +- echo alpha-hp-vms +- exit 0 ;; ++ # Reset EXIT trap before exiting to avoid spurious non-zero exit code. ++ exitcode=$? ++ trap '' 0 ++ exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix +- exit 0 ;; ++ exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 +- exit 0 ;; ++ exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 +- exit 0;; ++ exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos +- exit 0 ;; ++ exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos +- exit 0 ;; ++ exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition +- exit 0 ;; ++ exit ;; ++ *:z/VM:*:*) ++ echo s390-ibm-zvmoe ++ exit ;; + *:OS400:*:*) +- echo powerpc-ibm-os400 +- exit 0 ;; ++ echo powerpc-ibm-os400 ++ exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} +- exit 0;; ++ exit ;; ++ arm*:riscos:*:*|arm*:RISCOS:*:*) ++ echo arm-unknown-riscos ++ exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp +- exit 0;; ++ exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then +@@ -347,32 +334,51 @@ + else + echo pyramid-pyramid-bsd + fi +- exit 0 ;; ++ exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 +- exit 0 ;; ++ exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 +- exit 0 ;; +- DRS?6000:UNIX_SV:4.2*:7*) ++ exit ;; ++ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in +- sparc) echo sparc-icl-nx7 && exit 0 ;; ++ sparc) echo sparc-icl-nx7; exit ;; + esac ;; ++ s390x:SunOS:*:*) ++ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; +- i86pc:SunOS:5.*:*) +- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; ++ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) ++ echo i386-pc-auroraux${UNAME_RELEASE} ++ exit ;; ++ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) ++ eval $set_cc_for_build ++ SUN_ARCH="i386" ++ # If there is a compiler, see if it is configured for 64-bit objects. ++ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. ++ # This test works for both compilers. ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ SUN_ARCH="x86_64" ++ fi ++ fi ++ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) +@@ -381,10 +387,10 @@ + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` +- exit 0 ;; ++ exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 +@@ -396,10 +402,10 @@ + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac +- exit 0 ;; ++ exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor +@@ -409,41 +415,41 @@ + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) +- echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ echo m68k-atari-mint${UNAME_RELEASE} ++ exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) +- echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ echo m68k-atari-mint${UNAME_RELEASE} ++ exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) +- echo m68k-milan-mint${UNAME_RELEASE} +- exit 0 ;; ++ echo m68k-milan-mint${UNAME_RELEASE} ++ exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) +- echo m68k-hades-mint${UNAME_RELEASE} +- exit 0 ;; ++ echo m68k-hades-mint${UNAME_RELEASE} ++ exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) +- echo m68k-unknown-mint${UNAME_RELEASE} +- exit 0 ;; ++ echo m68k-unknown-mint${UNAME_RELEASE} ++ exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 +- exit 0 ;; ++ exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +@@ -467,35 +473,36 @@ + exit (-1); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c \ +- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ +- && exit 0 ++ $CC_FOR_BUILD -o $dummy $dummy.c && ++ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && ++ SYSTEM_NAME=`$dummy $dummyarg` && ++ { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax +- exit 0 ;; ++ exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax +- exit 0 ;; ++ exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax +- exit 0 ;; ++ exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix +- exit 0 ;; ++ exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 +- exit 0 ;; ++ exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 +- exit 0 ;; ++ exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 +- exit 0 ;; ++ exit ;; + AViiON:dgux:*:*) +- # DG/UX returns AViiON for all architectures +- UNAME_PROCESSOR=`/usr/bin/uname -p` ++ # DG/UX returns AViiON for all architectures ++ UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ +@@ -508,29 +515,29 @@ + else + echo i586-dg-dgux${UNAME_RELEASE} + fi +- exit 0 ;; ++ exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 +- exit 0 ;; ++ exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 +- exit 0 ;; ++ exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 +- exit 0 ;; ++ exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd +- exit 0 ;; ++ exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` +- exit 0 ;; ++ exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. +- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id +- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' ++ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id ++ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix +- exit 0 ;; ++ exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` +@@ -538,7 +545,7 @@ + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} +- exit 0 ;; ++ exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build +@@ -553,49 +560,54 @@ + exit(0); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 +- echo rs6000-ibm-aix3.2.5 ++ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` ++ then ++ echo "$SYSTEM_NAME" ++ else ++ echo rs6000-ibm-aix3.2.5 ++ fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi +- exit 0 ;; +- *:AIX:*:[45]) ++ exit ;; ++ *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi +- if [ -x /usr/bin/oslevel ] ; then +- IBM_REV=`/usr/bin/oslevel` ++ if [ -x /usr/bin/lslpp ] ; then ++ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | ++ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} +- exit 0 ;; ++ exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix +- exit 0 ;; ++ exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 +- exit 0 ;; ++ exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to +- exit 0 ;; # report: romp-ibm BSD 4.3 ++ exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx +- exit 0 ;; ++ exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 +- exit 0 ;; ++ exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd +- exit 0 ;; ++ exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 +- exit 0 ;; ++ exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in +@@ -604,52 +616,52 @@ + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` +- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` +- case "${sc_cpu_version}" in +- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 +- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 +- 532) # CPU_PA_RISC2_0 +- case "${sc_kernel_bits}" in +- 32) HP_ARCH="hppa2.0n" ;; +- 64) HP_ARCH="hppa2.0w" ;; ++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` ++ case "${sc_cpu_version}" in ++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 ++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 ++ 532) # CPU_PA_RISC2_0 ++ case "${sc_kernel_bits}" in ++ 32) HP_ARCH="hppa2.0n" ;; ++ 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 +- esac ;; +- esac ++ esac ;; ++ esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c ++ sed 's/^ //' << EOF >$dummy.c ++ ++ #define _HPUX_SOURCE ++ #include ++ #include ++ ++ int main () ++ { ++ #if defined(_SC_KERNEL_BITS) ++ long bits = sysconf(_SC_KERNEL_BITS); ++ #endif ++ long cpu = sysconf (_SC_CPU_VERSION); + +- #define _HPUX_SOURCE +- #include +- #include +- +- int main () +- { +- #if defined(_SC_KERNEL_BITS) +- long bits = sysconf(_SC_KERNEL_BITS); +- #endif +- long cpu = sysconf (_SC_CPU_VERSION); +- +- switch (cpu) +- { +- case CPU_PA_RISC1_0: puts ("hppa1.0"); break; +- case CPU_PA_RISC1_1: puts ("hppa1.1"); break; +- case CPU_PA_RISC2_0: +- #if defined(_SC_KERNEL_BITS) +- switch (bits) +- { +- case 64: puts ("hppa2.0w"); break; +- case 32: puts ("hppa2.0n"); break; +- default: puts ("hppa2.0"); break; +- } break; +- #else /* !defined(_SC_KERNEL_BITS) */ +- puts ("hppa2.0"); break; +- #endif +- default: puts ("hppa1.0"); break; +- } +- exit (0); +- } ++ switch (cpu) ++ { ++ case CPU_PA_RISC1_0: puts ("hppa1.0"); break; ++ case CPU_PA_RISC1_1: puts ("hppa1.1"); break; ++ case CPU_PA_RISC2_0: ++ #if defined(_SC_KERNEL_BITS) ++ switch (bits) ++ { ++ case 64: puts ("hppa2.0w"); break; ++ case 32: puts ("hppa2.0n"); break; ++ default: puts ("hppa2.0"); break; ++ } break; ++ #else /* !defined(_SC_KERNEL_BITS) */ ++ puts ("hppa2.0"); break; ++ #endif ++ default: puts ("hppa1.0"); break; ++ } ++ exit (0); ++ } + EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa +@@ -657,9 +669,19 @@ + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then +- # avoid double evaluation of $set_cc_for_build +- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build +- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null ++ eval $set_cc_for_build ++ ++ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating ++ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler ++ # generating 64-bit code. GNU and HP use different nomenclature: ++ # ++ # $ CC_FOR_BUILD=cc ./config.guess ++ # => hppa2.0w-hp-hpux11.23 ++ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess ++ # => hppa64-hp-hpux11.23 ++ ++ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | ++ grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else +@@ -667,11 +689,11 @@ + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} +- exit 0 ;; ++ exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} +- exit 0 ;; ++ exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +@@ -699,340 +721,345 @@ + exit (0); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 ++ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && ++ { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 +- exit 0 ;; ++ exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd +- exit 0 ;; ++ exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd +- exit 0 ;; ++ exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix +- exit 0 ;; ++ exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf +- exit 0 ;; ++ exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf +- exit 0 ;; ++ exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi +- exit 0 ;; ++ exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites +- exit 0 ;; ++ exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd +- exit 0 ;; ++ exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi +- exit 0 ;; ++ exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd +- exit 0 ;; ++ exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd +- exit 0 ;; ++ exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd +- exit 0 ;; ++ exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + *:UNICOS/mp:*:*) +- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` +- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` +- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` +- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" +- exit 0 ;; ++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` ++ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` ++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" ++ exit ;; + 5000:UNIX_System_V:4.*:*) +- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` +- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` +- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" +- exit 0 ;; ++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` ++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` ++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" ++ exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:FreeBSD:*:*) +- # Determine whether the default compiler uses glibc. +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #include +- #if __GLIBC__ >= 2 +- LIBC=gnu +- #else +- LIBC= +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` +- # GNU/KFreeBSD systems have a "k" prefix to indicate we are using +- # FreeBSD's kernel, but not the complete OS. +- case ${LIBC} in gnu) kernel_only='k' ;; esac +- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} +- exit 0 ;; ++ UNAME_PROCESSOR=`/usr/bin/uname -p` ++ case ${UNAME_PROCESSOR} in ++ amd64) ++ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ *) ++ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ esac ++ exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin +- exit 0 ;; +- i*:MINGW*:*) ++ exit ;; ++ *:MINGW64*:*) ++ echo ${UNAME_MACHINE}-pc-mingw64 ++ exit ;; ++ *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 +- exit 0 ;; ++ exit ;; ++ *:MSYS*:*) ++ echo ${UNAME_MACHINE}-pc-msys ++ exit ;; ++ i*:windows32*:*) ++ # uname -m includes "-pc" on this system. ++ echo ${UNAME_MACHINE}-mingw32 ++ exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 +- exit 0 ;; +- x86:Interix*:[34]*) +- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' +- exit 0 ;; ++ exit ;; ++ *:Interix*:*) ++ case ${UNAME_MACHINE} in ++ x86) ++ echo i586-pc-interix${UNAME_RELEASE} ++ exit ;; ++ authenticamd | genuineintel | EM64T) ++ echo x86_64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ IA64) ++ echo ia64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks +- exit 0 ;; ++ exit ;; ++ 8664:Windows_NT:*) ++ echo x86_64-pc-mks ++ exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix +- exit 0 ;; ++ exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin +- exit 0 ;; ++ exit ;; ++ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) ++ echo x86_64-unknown-cygwin ++ exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin +- exit 0 ;; ++ exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + *:GNU:*:*) + # the GNU system +- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` +- exit 0 ;; ++ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` ++ exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland +- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu +- exit 0 ;; ++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} ++ exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix +- exit 0 ;; ++ exit ;; ++ aarch64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ aarch64_be:Linux:*:*) ++ UNAME_MACHINE=aarch64_be ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ alpha:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ EV5) UNAME_MACHINE=alphaev5 ;; ++ EV56) UNAME_MACHINE=alphaev56 ;; ++ PCA56) UNAME_MACHINE=alphapca56 ;; ++ PCA57) UNAME_MACHINE=alphapca56 ;; ++ EV6) UNAME_MACHINE=alphaev6 ;; ++ EV67) UNAME_MACHINE=alphaev67 ;; ++ EV68*) UNAME_MACHINE=alphaev68 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ arc:Linux:*:* | arceb:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + arm*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ eval $set_cc_for_build ++ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_EABI__ ++ then ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ else ++ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_PCS_VFP ++ then ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi ++ else ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf ++ fi ++ fi ++ exit ;; ++ avr32*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + cris:Linux:*:*) +- echo cris-axis-linux-gnu +- exit 0 ;; ++ echo ${UNAME_MACHINE}-axis-linux-${LIBC} ++ exit ;; ++ crisv32:Linux:*:*) ++ echo ${UNAME_MACHINE}-axis-linux-${LIBC} ++ exit ;; ++ frv:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ hexagon:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ i*86:Linux:*:*) ++ echo ${UNAME_MACHINE}-pc-linux-${LIBC} ++ exit ;; + ia64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + m32r*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + m68*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; +- mips:Linux:*:*) +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #undef CPU +- #undef mips +- #undef mipsel +- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) +- CPU=mipsel +- #else +- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) +- CPU=mips +- #else +- CPU= +- #endif +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` +- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 +- ;; +- mips64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU +- #undef mips64 +- #undef mips64el ++ #undef ${UNAME_MACHINE} ++ #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) +- CPU=mips64el ++ CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) +- CPU=mips64 ++ CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif + EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` +- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` ++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; +- ppc:Linux:*:*) +- echo powerpc-unknown-linux-gnu +- exit 0 ;; +- ppc64:Linux:*:*) +- echo powerpc64-unknown-linux-gnu +- exit 0 ;; +- alpha:Linux:*:*) +- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in +- EV5) UNAME_MACHINE=alphaev5 ;; +- EV56) UNAME_MACHINE=alphaev56 ;; +- PCA56) UNAME_MACHINE=alphapca56 ;; +- PCA57) UNAME_MACHINE=alphapca56 ;; +- EV6) UNAME_MACHINE=alphaev6 ;; +- EV67) UNAME_MACHINE=alphaev67 ;; +- EV68*) UNAME_MACHINE=alphaev68 ;; +- esac +- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null +- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi +- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} +- exit 0 ;; ++ openrisc*:Linux:*:*) ++ echo or1k-unknown-linux-${LIBC} ++ exit ;; ++ or32:Linux:*:* | or1k*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ padre:Linux:*:*) ++ echo sparc-unknown-linux-${LIBC} ++ exit ;; ++ parisc64:Linux:*:* | hppa64:Linux:*:*) ++ echo hppa64-unknown-linux-${LIBC} ++ exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in +- PA7*) echo hppa1.1-unknown-linux-gnu ;; +- PA8*) echo hppa2.0-unknown-linux-gnu ;; +- *) echo hppa-unknown-linux-gnu ;; ++ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; ++ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; ++ *) echo hppa-unknown-linux-${LIBC} ;; + esac +- exit 0 ;; +- parisc64:Linux:*:* | hppa64:Linux:*:*) +- echo hppa64-unknown-linux-gnu +- exit 0 ;; ++ exit ;; ++ ppc64:Linux:*:*) ++ echo powerpc64-unknown-linux-${LIBC} ++ exit ;; ++ ppc:Linux:*:*) ++ echo powerpc-unknown-linux-${LIBC} ++ exit ;; ++ ppc64le:Linux:*:*) ++ echo powerpc64le-unknown-linux-${LIBC} ++ exit ;; ++ ppcle:Linux:*:*) ++ echo powerpcle-unknown-linux-${LIBC} ++ exit ;; + s390:Linux:*:* | s390x:Linux:*:*) +- echo ${UNAME_MACHINE}-ibm-linux +- exit 0 ;; ++ echo ${UNAME_MACHINE}-ibm-linux-${LIBC} ++ exit ;; + sh64*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + sh*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ tile*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ vax:Linux:*:*) ++ echo ${UNAME_MACHINE}-dec-linux-${LIBC} ++ exit ;; + x86_64:Linux:*:*) +- echo x86_64-unknown-linux-gnu +- exit 0 ;; +- i*86:Linux:*:*) +- # The BFD linker knows what the default object file format is, so +- # first see if it will tell us. cd to the root directory to prevent +- # problems with other programs or directories called `ld' in the path. +- # Set LC_ALL=C to ensure ld outputs messages in English. +- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ +- | sed -ne '/supported targets:/!d +- s/[ ][ ]*/ /g +- s/.*supported targets: *// +- s/ .*// +- p'` +- case "$ld_supported_targets" in +- elf32-i386) +- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" +- ;; +- a.out-i386-linux) +- echo "${UNAME_MACHINE}-pc-linux-gnuaout" +- exit 0 ;; +- coff-i386) +- echo "${UNAME_MACHINE}-pc-linux-gnucoff" +- exit 0 ;; +- "") +- # Either a pre-BFD a.out linker (linux-gnuoldld) or +- # one that does not give us useful --help. +- echo "${UNAME_MACHINE}-pc-linux-gnuoldld" +- exit 0 ;; +- esac +- # Determine whether the default compiler is a.out or elf +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #include +- #ifdef __ELF__ +- # ifdef __GLIBC__ +- # if __GLIBC__ >= 2 +- LIBC=gnu +- # else +- LIBC=gnulibc1 +- # endif +- # else +- LIBC=gnulibc1 +- # endif +- #else +- #ifdef __INTEL_COMPILER +- LIBC=gnu +- #else +- LIBC=gnuaout +- #endif +- #endif +- #ifdef __dietlibc__ +- LIBC=dietlibc +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` +- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 +- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 +- ;; ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ xtensa*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 +- exit 0 ;; ++ exit ;; + i*86:UNIX_SV:4.2MP:2.*) +- # Unixware is an offshoot of SVR4, but it has its own version +- # number series starting with 2... +- # I am not positive that other SVR4 systems won't match this, ++ # Unixware is an offshoot of SVR4, but it has its own version ++ # number series starting with 2... ++ # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. +- # Use sysv4.2uw... so that sysv4* matches it. ++ # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} +- exit 0 ;; ++ exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx +- exit 0 ;; ++ exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop +- exit 0 ;; ++ exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos +- exit 0 ;; +- i*86:syllable:*:*) ++ exit ;; ++ i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable +- exit 0 ;; +- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) ++ exit ;; ++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp +- exit 0 ;; ++ exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then +@@ -1040,15 +1067,16 @@ + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi +- exit 0 ;; +- i*86:*:5:[78]*) ++ exit ;; ++ i*86:*:5:[678]*) ++ # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} +- exit 0 ;; ++ exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi +- exit 0 ;; ++ exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv +- exit 0 ;; ++ exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv +- exit 0 ;; ++ exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix +- exit 0 ;; ++ exit ;; + M68*:*:R3V[5678]*:*) +- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; +- 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) ++ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; ++ 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) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ +- && echo i486-ncr-sysv4.3${OS_REL} && exit 0 ++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ +- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) +- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ +- && echo i486-ncr-sysv4 && exit 0 ;; ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4; exit; } ;; ++ NCR*:*:4.2:* | MPRAS*:*:4.2:*) ++ OS_REL='.3' ++ test -r /etc/.relid \ ++ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 +- exit 0 ;; ++ exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; +- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) ++ exit ;; ++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 +- exit 0 ;; ++ exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 +- exit 0 ;; ++ exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` +@@ -1140,68 +1181,109 @@ + else + echo ns32k-sni-sysv + fi +- exit 0 ;; +- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort +- # says +- echo i586-unisys-sysv4 +- exit 0 ;; ++ exit ;; ++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort ++ # says ++ echo i586-unisys-sysv4 ++ exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 +- exit 0 ;; ++ exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 +- exit 0 ;; ++ exit ;; ++ i*86:VOS:*:*) ++ # From Paul.Green@stratus.com. ++ echo ${UNAME_MACHINE}-stratus-vos ++ exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos +- exit 0 ;; ++ exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 +- exit 0 ;; ++ exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then +- echo mips-nec-sysv${UNAME_RELEASE} ++ echo mips-nec-sysv${UNAME_RELEASE} + else +- echo mips-unknown-sysv${UNAME_RELEASE} ++ echo mips-unknown-sysv${UNAME_RELEASE} + fi +- exit 0 ;; ++ exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos +- exit 0 ;; ++ exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos +- exit 0 ;; ++ exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos +- exit 0 ;; ++ exit ;; ++ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. ++ echo i586-pc-haiku ++ exit ;; ++ x86_64:Haiku:*:*) ++ echo x86_64-unknown-haiku ++ exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; ++ SX-7:SUPER-UX:*:*) ++ echo sx7-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-8:SUPER-UX:*:*) ++ echo sx8-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-8R:SUPER-UX:*:*) ++ echo sx8r-nec-superux${UNAME_RELEASE} ++ exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:Darwin:*:*) +- case `uname -p` in +- *86) UNAME_PROCESSOR=i686 ;; +- powerpc) UNAME_PROCESSOR=powerpc ;; +- esac ++ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown ++ eval $set_cc_for_build ++ if test "$UNAME_PROCESSOR" = unknown ; then ++ UNAME_PROCESSOR=powerpc ++ fi ++ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ case $UNAME_PROCESSOR in ++ i386) UNAME_PROCESSOR=x86_64 ;; ++ powerpc) UNAME_PROCESSOR=powerpc64 ;; ++ esac ++ fi ++ fi ++ elif test "$UNAME_PROCESSOR" = i386 ; then ++ # Avoid executing cc on OS X 10.9, as it ships with a stub ++ # that puts up a graphical alert prompting to install ++ # developer tools. Any system running Mac OS X 10.7 or ++ # later (Darwin 11 and later) is required to have a 64-bit ++ # processor. This is not true of the ARM version of Darwin ++ # that Apple uses in portable devices. ++ UNAME_PROCESSOR=x86_64 ++ fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then +@@ -1209,22 +1291,28 @@ + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:QNX:*:4*) + echo i386-pc-qnx +- exit 0 ;; ++ exit ;; ++ NEO-?:NONSTOP_KERNEL:*:*) ++ echo neo-tandem-nsk${UNAME_RELEASE} ++ exit ;; ++ NSE-*:NONSTOP_KERNEL:*:*) ++ echo nse-tandem-nsk${UNAME_RELEASE} ++ exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux +- exit 0 ;; ++ exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv +- exit 0 ;; ++ exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 +@@ -1235,183 +1323,55 @@ + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 +- exit 0 ;; ++ exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 +- exit 0 ;; ++ exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex +- exit 0 ;; ++ exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 +- exit 0 ;; ++ exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 +- exit 0 ;; ++ exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 +- exit 0 ;; ++ exit ;; + *:ITS:*:*) + echo pdp10-unknown-its +- exit 0 ;; ++ exit ;; + SEI:*:*:SEIUX) +- echo mips-sei-seiux${UNAME_RELEASE} +- exit 0 ;; ++ echo mips-sei-seiux${UNAME_RELEASE} ++ exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` +- exit 0 ;; ++ exit ;; ++ *:*VMS:*:*) ++ UNAME_MACHINE=`(uname -p) 2>/dev/null` ++ case "${UNAME_MACHINE}" in ++ A*) echo alpha-dec-vms ; exit ;; ++ I*) echo ia64-dec-vms ; exit ;; ++ V*) echo vax-dec-vms ; exit ;; ++ esac ;; ++ *:XENIX:*:SysV) ++ echo i386-pc-xenix ++ exit ;; ++ i*86:skyos:*:*) ++ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' ++ exit ;; ++ i*86:rdos:*:*) ++ echo ${UNAME_MACHINE}-pc-rdos ++ exit ;; ++ i*86:AROS:*:*) ++ echo ${UNAME_MACHINE}-pc-aros ++ exit ;; ++ x86_64:VMkernel:*:*) ++ echo ${UNAME_MACHINE}-unknown-esx ++ exit ;; + esac + +-#echo '(No uname command or uname output not recognized.)' 1>&2 +-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 +- +-eval $set_cc_for_build +-cat >$dummy.c < +-# include +-#endif +-main () +-{ +-#if defined (sony) +-#if defined (MIPSEB) +- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, +- I don't know.... */ +- printf ("mips-sony-bsd\n"); exit (0); +-#else +-#include +- printf ("m68k-sony-newsos%s\n", +-#ifdef NEWSOS4 +- "4" +-#else +- "" +-#endif +- ); exit (0); +-#endif +-#endif +- +-#if defined (__arm) && defined (__acorn) && defined (__unix) +- printf ("arm-acorn-riscix"); exit (0); +-#endif +- +-#if defined (hp300) && !defined (hpux) +- printf ("m68k-hp-bsd\n"); exit (0); +-#endif +- +-#if defined (NeXT) +-#if !defined (__ARCHITECTURE__) +-#define __ARCHITECTURE__ "m68k" +-#endif +- int version; +- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; +- if (version < 4) +- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); +- else +- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); +- exit (0); +-#endif +- +-#if defined (MULTIMAX) || defined (n16) +-#if defined (UMAXV) +- printf ("ns32k-encore-sysv\n"); exit (0); +-#else +-#if defined (CMU) +- printf ("ns32k-encore-mach\n"); exit (0); +-#else +- printf ("ns32k-encore-bsd\n"); exit (0); +-#endif +-#endif +-#endif +- +-#if defined (__386BSD__) +- printf ("i386-pc-bsd\n"); exit (0); +-#endif +- +-#if defined (sequent) +-#if defined (i386) +- printf ("i386-sequent-dynix\n"); exit (0); +-#endif +-#if defined (ns32000) +- printf ("ns32k-sequent-dynix\n"); exit (0); +-#endif +-#endif +- +-#if defined (_SEQUENT_) +- struct utsname un; +- +- uname(&un); +- +- if (strncmp(un.version, "V2", 2) == 0) { +- printf ("i386-sequent-ptx2\n"); exit (0); +- } +- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ +- printf ("i386-sequent-ptx1\n"); exit (0); +- } +- printf ("i386-sequent-ptx\n"); exit (0); +- +-#endif +- +-#if defined (vax) +-# if !defined (ultrix) +-# include +-# if defined (BSD) +-# if BSD == 43 +- printf ("vax-dec-bsd4.3\n"); exit (0); +-# else +-# if BSD == 199006 +- printf ("vax-dec-bsd4.3reno\n"); exit (0); +-# else +- printf ("vax-dec-bsd\n"); exit (0); +-# endif +-# endif +-# else +- printf ("vax-dec-bsd\n"); exit (0); +-# endif +-# else +- printf ("vax-dec-ultrix\n"); exit (0); +-# endif +-#endif +- +-#if defined (alliant) && defined (i860) +- printf ("i860-alliant-bsd\n"); exit (0); +-#endif +- +- exit (1); +-} +-EOF +- +-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 +- +-# Apollos put the system type in the environment. +- +-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } +- +-# Convex versions that predate uname can use getsysinfo(1) +- +-if [ -x /usr/convex/getsysinfo ] +-then +- case `getsysinfo -f cpu_type` in +- c1*) +- echo c1-convex-bsd +- exit 0 ;; +- c2*) +- if getsysinfo -f scalar_acc +- then echo c32-convex-bsd +- else echo c2-convex-bsd +- fi +- exit 0 ;; +- c34*) +- echo c34-convex-bsd +- exit 0 ;; +- c38*) +- echo c38-convex-bsd +- exit 0 ;; +- c4*) +- echo c4-convex-bsd +- exit 0 ;; +- esac +-fi +- + cat >&2 < Date: Tue, 17 Apr 2018 10:30:38 +0200 Subject: [PATCH 50/63] Update to arduino14 --- package-avrdude.bash | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index def63cd..762262d 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino13 +OUTPUT_VERSION=6.3.0-arduino14 export OS=`uname -o || uname` export TARGET_OS=$OS @@ -28,6 +28,13 @@ if [[ $CROSS_COMPILE == "mingw" ]] ; then export TARGET_OS="Windows" OUTPUT_TAG=i686-w64-mingw32 +elif [[ $CROSS_COMPILE == "arm64-cross" ]] ; then + export CC="aarch64-linux-gnu-gcc" + export CXX="aarch64-linux-gnu-g++" + export CROSS_COMPILE_HOST="aarch64-linux-gnu" + export TARGET_OS="GNU/Linux" + OUTPUT_TAG=aarch64-linux-gnu + elif [[ $CROSS_COMPILE == "arm-cross" ]] ; then export CC="arm-linux-gnueabihf-gcc" export CXX="arm-linux-gnueabihf-g++" From 5fbb83bbabbc6d1e43ca2dea37113c956a8e7263 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 17 Apr 2018 10:32:21 +0200 Subject: [PATCH 51/63] Use master branch of avrdude git repo --- avrdude-6.3.build.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avrdude-6.3.build.bash b/avrdude-6.3.build.bash index fed17dd..6eb69c9 100755 --- a/avrdude-6.3.build.bash +++ b/avrdude-6.3.build.bash @@ -20,7 +20,7 @@ cd objdir PREFIX=`pwd` cd - -git clone https://github.com/facchinm/avrdude.git avrdude-6.3 --depth 1 -b staging +git clone https://github.com/facchinm/avrdude.git avrdude-6.3 --depth 1 cd avrdude-6.3 From e22771dd9fed8edbcffb3e9f06d0a44aab467c01 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 22 May 2018 13:10:23 +0200 Subject: [PATCH 52/63] Fix aarch64 cross compilation --- libncurses-5.9.build.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libncurses-5.9.build.bash b/libncurses-5.9.build.bash index 4028e23..fff435f 100755 --- a/libncurses-5.9.build.bash +++ b/libncurses-5.9.build.bash @@ -20,7 +20,7 @@ cd objdir PREFIX=`pwd` cd - -if [[ $OS == "Msys" || $OS == "Cygwin" || $CROSS_COMPILE_HOST == "i686-w64-mingw32" ]] ; then +if [[ $OS == "Msys" || $OS == "Cygwin" || $CROSS_COMPILE_HOST == "i686-w64-mingw32" || $CROSS_COMPILE_HOST == "aarch64-linux-gnu" ]] ; then #Avoid compiling ncurses in Windows platform exit 0 fi @@ -40,6 +40,7 @@ CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --with if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi +autoconf CFLAGS="-w -O2 $CFLAGS -fPIC" CPPFLAGS="-P" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 make install.libs From dc1fcd15fa74c0c8627c7de3b2a138b977eb7a29 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 5 Apr 2019 14:54:41 +0200 Subject: [PATCH 53/63] Update version to arduino15 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 0aa8527..5077a9d 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino14 +OUTPUT_VERSION=6.3.0-arduino15 export OS=`uname -o || uname` export TARGET_OS=$OS From 3aa2f52f09537ea1f8b10a70e8408597737d6e38 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 5 Apr 2019 14:57:50 +0200 Subject: [PATCH 54/63] Change download link for libelf-0.8.13 --- libelf-0.8.13.build.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libelf-0.8.13.build.bash b/libelf-0.8.13.build.bash index 67cc8c7..1ef4818 100755 --- a/libelf-0.8.13.build.bash +++ b/libelf-0.8.13.build.bash @@ -22,7 +22,7 @@ cd - if [[ ! -f libelf-0.8.13.tar.gz ]] ; then - wget http://www.mr511.de/software/libelf-0.8.13.tar.gz + wget https://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz fi tar xfv libelf-0.8.13.tar.gz From d73a5fdb2323aff49d4b1382f65f1333c24a15fc Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 5 Apr 2019 17:32:22 +0200 Subject: [PATCH 55/63] libreadline: only call autoconf on aarch64 native build The configure script is too old but configure.in is too new and patches are distributed in a funky format (needs even more dependencies) --- libncurses-5.9.build.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libncurses-5.9.build.bash b/libncurses-5.9.build.bash index fff435f..05b2710 100755 --- a/libncurses-5.9.build.bash +++ b/libncurses-5.9.build.bash @@ -40,7 +40,9 @@ CONFARGS="--prefix=$PREFIX --disable-shared --without-debug --without-ada --with if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi +if [[ $MACHINE == "aarch64" ]] ; then autoconf +fi CFLAGS="-w -O2 $CFLAGS -fPIC" CPPFLAGS="-P" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 make install.libs From 7865ab3d4f361c0befb4aa8ba0233f2de77cbcf7 Mon Sep 17 00:00:00 2001 From: Steven Conaway Date: Sun, 10 Feb 2019 20:42:25 -0800 Subject: [PATCH 56/63] Switch MacOS to x86_64 --- package-avrdude.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 5077a9d..58450f1 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -74,8 +74,8 @@ elif [[ $OS == "Msys" || $OS == "Cygwin" ]] ; then elif [[ $OS == "Darwin" ]] ; then export PATH=/opt/local/libexec/gnubin/:/opt/local/bin:$PATH - export CC="gcc -arch i386 -mmacosx-version-min=10.5" - export CXX="g++ -arch i386 -mmacosx-version-min=10.5" + export CC="gcc -arch x86_64 -mmacosx-version-min=10.8" + export CXX="g++ -arch x86_64 -mmacosx-version-min=10.8" OUTPUT_TAG=i386-apple-darwin11 else From e962bfbd5668862a19a1ef5d0c6b38b14d8e2d8b Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 8 Apr 2019 12:53:29 +0200 Subject: [PATCH 57/63] libncurses: replace autoconf with new config.guess --- libncurses-5.9.build.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libncurses-5.9.build.bash b/libncurses-5.9.build.bash index 05b2710..3e5abe8 100755 --- a/libncurses-5.9.build.bash +++ b/libncurses-5.9.build.bash @@ -41,7 +41,7 @@ if [[ $CROSS_COMPILE != "" ]] ; then CONFARGS="$CONFARGS --host=$CROSS_COMPILE_HOST" fi if [[ $MACHINE == "aarch64" ]] ; then -autoconf +curl "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" > config.guess fi CFLAGS="-w -O2 $CFLAGS -fPIC" CPPFLAGS="-P" CXXFLAGS="-w -O2 $CXXFLAGS -fPIC" LDFLAGS="-s $LDFLAGS -fPIC" ./configure $CONFARGS make -j 4 From 5d07cacda01e15642655eb09a4054180c3c0e284 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Fri, 24 May 2019 14:36:46 +0200 Subject: [PATCH 58/63] Update version to 6.3.0-arduino16 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 58450f1..00129e5 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino15 +OUTPUT_VERSION=6.3.0-arduino16 export OS=`uname -o || uname` export TARGET_OS=$OS From 8287ed723e0fde502686cc6900ddffa4d5f801e7 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 12 Jun 2019 10:13:07 +0200 Subject: [PATCH 59/63] Update package name for macOS (64bit) --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 00129e5..70e5045 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -76,7 +76,7 @@ elif [[ $OS == "Darwin" ]] ; then export PATH=/opt/local/libexec/gnubin/:/opt/local/bin:$PATH export CC="gcc -arch x86_64 -mmacosx-version-min=10.8" export CXX="g++ -arch x86_64 -mmacosx-version-min=10.8" - OUTPUT_TAG=i386-apple-darwin11 + OUTPUT_TAG=x86_64-apple-darwin12 else From 14010f825e58e80332f638bf305d1e2f1f833b69 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 12 Jun 2019 10:13:20 +0200 Subject: [PATCH 60/63] Update version to 6.3.0-arduino17 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 70e5045..1d15dce 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino16 +OUTPUT_VERSION=6.3.0-arduino17 export OS=`uname -o || uname` export TARGET_OS=$OS From 4769f24f8a935c5abfe9b4b09548f5df1aaa6a04 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 16 Dec 2020 09:51:10 +0100 Subject: [PATCH 61/63] Update version to arduino18 --- package-avrdude.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-avrdude.bash b/package-avrdude.bash index 1d15dce..3a2e47b 100755 --- a/package-avrdude.bash +++ b/package-avrdude.bash @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -OUTPUT_VERSION=6.3.0-arduino17 +OUTPUT_VERSION=6.3.0-arduino18 export OS=`uname -o || uname` export TARGET_OS=$OS From 87714405dbc48a179b886e46f8cd167807250459 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 16 Dec 2020 09:53:29 +0100 Subject: [PATCH 62/63] Download libelf without certs --- libelf-0.8.13.build.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libelf-0.8.13.build.bash b/libelf-0.8.13.build.bash index 1ef4818..5a53949 100755 --- a/libelf-0.8.13.build.bash +++ b/libelf-0.8.13.build.bash @@ -22,7 +22,7 @@ cd - if [[ ! -f libelf-0.8.13.tar.gz ]] ; then - wget https://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz + wget --no-check-certificate https://fossies.org/linux/misc/old/libelf-0.8.13.tar.gz fi tar xfv libelf-0.8.13.tar.gz From 234005a7e53055b2ed853139fcf34e576df48a7e Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 16 Dec 2020 18:30:53 +0100 Subject: [PATCH 63/63] Force eudev to accept automake 1.11 --- libhidapi.build.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/libhidapi.build.bash b/libhidapi.build.bash index c29bd24..163f52e 100755 --- a/libhidapi.build.bash +++ b/libhidapi.build.bash @@ -29,6 +29,7 @@ if [[ $TARGET_OS == "GNU/Linux" ]] ; then wget https://github.com/gentoo/eudev/archive/v3.1.3.tar.gz tar xvf v3.1.3.tar.gz cd eudev-3.1.3 +sed -i 's|foreign 1.13|foreign 1.11|g' configure.ac ./autogen.sh ./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=$PREFIX $CONFARGS make clean