📄 avrdude-usb-v2.patch
字号:
am__include=include am__quote= _am_result=GNU@@ -820,7 +752,7 @@ fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then- AC_MSG_ERROR([conditional "$1" was never defined.+ AC_MSG_ERROR([conditional \"$1\" was never defined. Usually this means the macro was only invoked conditionally.]) fi])]) @@ -847,8 +779,60 @@ # serial 6 -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])+# When config.status generates a header, we must update the stamp-h file.+# This file resides in the same directory as the config header+# that is generated. We must strip everything past the first ":",+# and everything past the last "/".++# _AM_DIRNAME(PATH)+# -----------------+# Like AS_DIRNAME, only do it during macro expansion+AC_DEFUN([_AM_DIRNAME],+ [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,+ m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,+ m4_if(regexp([$1], [^/.*]), -1,+ [.],+ patsubst([$1], [^\(/\).*], [\1])),+ patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),+ patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl+])# _AM_DIRNAME+++# The stamp files are numbered to have different names.+# We could number them on a directory basis, but that's additional+# complications, let's have a unique counter.+m4_define([_AM_STAMP_Count], [0])+++# _AM_STAMP(HEADER)+# -----------------+# The name of the stamp file for HEADER.+AC_DEFUN([_AM_STAMP],+[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl+AS_ESCAPE(_AM_DIRNAME(patsubst([$1],+ [:.*])))/stamp-h[]_AM_STAMP_Count])+++# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)+# ------------------------------------------------------------+# We used to try to get a real timestamp in stamp-h. But the fear is that+# that will cause unnecessary cvs conflicts.+AC_DEFUN([_AM_CONFIG_HEADER],+[# Add the stamp file to the list of files AC keeps track of,+# along with our hook.+AC_CONFIG_HEADERS([$1],+ [# update the timestamp+echo 'timestamp for $1' >"_AM_STAMP([$1])"+$2],+ [$3])+])# _AM_CONFIG_HEADER+++# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)+# --------------------------------------------------------------+AC_DEFUN([AM_CONFIG_HEADER],+[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])+])# AM_CONFIG_HEADER # Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.diff -ruN avrdude-4.0.0-orig/avr.c avrdude-4.0.0/avr.c--- avrdude-4.0.0-orig/avr.c 2003-03-04 22:30:20.000000000 -0600+++ avrdude-4.0.0/avr.c 2003-12-10 10:29:50.000000000 -0600@@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: avr.c,v 1.52 2003/03/05 04:30:20 bdean Exp $ */+/* $Id: avr.c,v 1.1 2003/11/26 22:24:50 jepler Exp jepler $ */ #include "ac_cfg.h" @@ -477,7 +477,7 @@ int rc; int readok=0; - if (!mem->paged) {+ if (!mem->paged && strcmp(pgm->type, "USB")) { /* * check to see if the write is necessary by reading the existing * value and only write if we are changing the value; we can't@@ -557,7 +557,8 @@ * read operation not supported for this memory type, just wait * the max programming time and then return */- usleep(mem->max_write_delay); /* maximum write delay */+ if(mem->max_write_delay > 0) + usleep(mem->max_write_delay); /* maximum write delay */ pgm->pgm_led(pgm, OFF); return 0; }diff -ruN avrdude-4.0.0-orig/avr_usb.h avrdude-4.0.0/avr_usb.h--- avrdude-4.0.0-orig/avr_usb.h 1969-12-31 18:00:00.000000000 -0600+++ avrdude-4.0.0/avr_usb.h 2003-12-10 10:29:50.000000000 -0600@@ -0,0 +1,30 @@+/*+ * avrdude - A Downloader/Uploader for AVR device programmers+ * Copyright (C) 2000, 2001, 2002, 2003 Brian S. Dean <bsd@bsdhome.com>+ *+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA+ */++/* $Id: par.h,v 1.1 2003/02/13 19:27:50 bdean Exp $ */++#ifndef __avr_usb_h__+#define __avr_usb_h__++#include "config.h"++void ausb_initpgm (PROGRAMMER * pgm);+#endif++diff -ruN avrdude-4.0.0-orig/config_gram.y avrdude-4.0.0/config_gram.y--- avrdude-4.0.0-orig/config_gram.y 2003-03-04 19:19:17.000000000 -0600+++ avrdude-4.0.0/config_gram.y 2003-12-10 10:29:50.000000000 -0600@@ -29,6 +29,7 @@ #include "config.h" #include "lists.h" #include "par.h"+#include "avr_usb.h" #include "pindefs.h" #include "ppi.h" #include "pgm.h"@@ -102,6 +103,7 @@ %token K_SIZE %token K_STK500 %token K_TYPE+%token K_USB %token K_VCC %token K_VFYLED %token K_WRITEPAGE@@ -284,6 +286,12 @@ } } | + K_TYPE TKN_EQUAL K_USB {+ {+ ausb_initpgm(current_prog);+ }+ } |+ K_DESC TKN_EQUAL TKN_STRING { strncpy(current_prog->desc, $3->value.string, PGM_DESCLEN); current_prog->desc[PGM_DESCLEN-1] = 0;diff -ruN avrdude-4.0.0-orig/configure avrdude-4.0.0/configure--- avrdude-4.0.0-orig/configure 2003-03-12 15:05:14.000000000 -0600+++ avrdude-4.0.0/configure 2003-12-10 10:32:03.000000000 -0600@@ -310,7 +310,7 @@ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP LIBOBJS DOC_INST_DIR DEFAULT_PAR_PORT DEFAULT_SER_PORT WINDOWS_DIRS LTLIBOBJS'+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP LIBOBJS DOC_INST_DIR DEFAULT_PAR_PORT DEFAULT_SER_PORT WINDOWS_DIRS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options.@@ -1394,7 +1394,7 @@ program_prefix=${target_alias}- -am__api_version="1.7"+am__api_version="1.6" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions:@@ -1613,15 +1613,6 @@ SET_MAKE="MAKE=${MAKE-make}" fi -rm -rf .tst 2>/dev/null-mkdir .tst 2>/dev/null-if test -d .tst; then- am__leading_dot=.-else- am__leading_dot=_-fi-rmdir .tst 2>/dev/null- # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then@@ -1630,19 +1621,9 @@ { (exit 1); exit 1; }; } fi -# test whether we have cygpath-if test -z "$CYGPATH_W"; then- if (cygpath --version) >/dev/null 2>/dev/null; then- CYGPATH_W='cygpath -w'- else- CYGPATH_W=echo- fi-fi-- # Define the identity of the package.- PACKAGE='avrdude'- VERSION='4.0.0'+ PACKAGE=avrdude+ VERSION=4.0.0 cat >>confdefs.h <<_ACEOF@@ -1768,9 +1749,13 @@ +# Add the stamp file to the list of files AC keeps track of,+# along with our hook. ac_config_headers="$ac_config_headers ac_cfg.h" ++ # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS'@@ -2639,7 +2624,16 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu-DEPDIR="${am__leading_dot}deps"+rm -f .deps 2>/dev/null+mkdir .deps 2>/dev/null+if test -d .deps; then+ DEPDIR=.deps+else+ # MS-DOS does not allow filenames that begin with a dot.+ DEPDIR=_deps+fi+rmdir .deps 2>/dev/null+ ac_config_commands="$ac_config_commands depfiles" @@ -2662,7 +2656,7 @@ # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'.-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then+if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU@@ -2753,17 +2747,11 @@ if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \- $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \- >/dev/null 2>conftest.err &&+ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then- # icc doesn't choke on unknown options, it will just issue warnings- # (even with -Werror). So we grep stderr for any message- # that says an option was ignored.- if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else- am_cv_CC_dependencies_compiler_type=$depmode- break- fi+ am_cv_CC_dependencies_compiler_type=$depmode+ break fi done @@ -2779,18 +2767,6 @@ CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type --if- test "x$enable_dependency_tracking" != xno \- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then- am__fastdepCC_TRUE=- am__fastdepCC_FALSE='#'-else- am__fastdepCC_TRUE='#'- am__fastdepCC_FALSE=-fi-- # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions:@@ -3287,6 +3263,70 @@ fi +echo "$as_me:$LINENO: checking for usb_open in -lusb" >&5+echo $ECHO_N "checking for usb_open in -lusb... $ECHO_C" >&6+if test "${ac_cv_lib_usb_usb_open+set}" = set; then+ echo $ECHO_N "(cached) $ECHO_C" >&6+else+ ac_check_lib_save_LIBS=$LIBS+LIBS="-lusb $LIBS"+cat >conftest.$ac_ext <<_ACEOF+#line $LINENO "configure"+/* confdefs.h. */+_ACEOF+cat confdefs.h >>conftest.$ac_ext+cat >>conftest.$ac_ext <<_ACEOF+/* end confdefs.h. */++/* Override any gcc2 internal prototype to avoid an error. */+#ifdef __cplusplus+extern "C"+#endif+/* We use char because int might match the return type of a gcc2+ builtin and then its argument prototype would still apply. */+char usb_open ();+int+main ()+{+usb_open ();+ ;+ return 0;+}+_ACEOF+rm -f conftest.$ac_objext conftest$ac_exeext+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5+ (eval $ac_link) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); } &&+ { ac_try='test -s conftest$ac_exeext'+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5+ (eval $ac_try) 2>&5+ ac_status=$?+ echo "$as_me:$LINENO: \$? = $ac_status" >&5+ (exit $ac_status); }; }; then+ ac_cv_lib_usb_usb_open=yes+else+ echo "$as_me: failed program was:" >&5+sed 's/^/| /' conftest.$ac_ext >&5++ac_cv_lib_usb_usb_open=no+fi+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext+LIBS=$ac_check_lib_save_LIBS+fi+echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_open" >&5+echo "${ECHO_T}$ac_cv_lib_usb_usb_open" >&6+if test $ac_cv_lib_usb_usb_open = yes; then+ cat >>confdefs.h <<_ACEOF+#define HAVE_LIBUSB 1+_ACEOF++ LIBS="-lusb $LIBS"++fi++ # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS'@@ -4606,13 +4646,6 @@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -