Update of /cvsroot/fink/dists/10.7/stable/main/finkinfo/devel In directory vz-cvs-3.sog:/tmp/cvs-serv24077
Added Files: avr-binutils.info avr-binutils.patch avr-gcc.info avr-libc.info avrdude.info avrdude.patch Log Message: copy from 10.4, use llvm-gcc for avr-binutils --- NEW FILE: avrdude.patch --- diff -w -u -r /tmp/avrdude-5.1/ser_posix.c ./ser_posix.c --- /tmp/avrdude-5.1/ser_posix.c 2005-08-29 18:30:05.000000000 -0700 +++ ./ser_posix.c 2006-04-03 09:08:25.000000000 -0700 @@ -65,6 +65,9 @@ { 0, 0 } /* Terminator. */ }; +static struct termios original_termios; +static int saved_original_termios; + static speed_t serial_baud_lookup(long baud) { struct baud_mapping *map = baud_lookup_table; @@ -75,7 +78,7 @@ map++; } - fprintf(stderr, "%s: serial_baud_lookup(): unknown baud rate: %ld", + fprintf(stderr, "%s: serial_baud_lookup(): unknown baud rate: %ld\n", progname, baud); exit(1); } @@ -87,33 +90,38 @@ speed_t speed = serial_baud_lookup (baud); if (!isatty(fd)) - return -1; + return -ENOTTY; /* * initialize terminal modes */ rc = tcgetattr(fd, &termios); if (rc < 0) { - fprintf(stderr, "%s: ser_setspeed(): tcgetattr() failed, %s", - progname, strerror(errno)); + fprintf(stderr, "%s: ser_setspeed(): tcgetattr() failed", + progname); return -errno; } - termios.c_iflag = 0; - termios.c_oflag = 0; - termios.c_cflag = 0; + /* + * copy termios for ser_close if we haven't already + */ + if (! saved_original_termios++) { + original_termios = termios; + } + + cfmakeraw(&termios); + termios.c_cflag &= ~CSIZE; termios.c_cflag |= (CS8 | CREAD | CLOCAL); - termios.c_lflag = 0; termios.c_cc[VMIN] = 1; termios.c_cc[VTIME] = 0; cfsetospeed(&termios, speed); cfsetispeed(&termios, speed); - rc = tcsetattr(fd, TCSANOW, &termios); + rc = tcsetattr(fd, TCSANOW | TCSAFLUSH, &termios); if (rc < 0) { - fprintf(stderr, "%s: ser_setspeed(): tcsetattr() failed, %s", - progname, strerror(errno)); + fprintf(stderr, "%s: ser_setspeed(): tcsetattr() failed", + progname); return -errno; } @@ -137,7 +145,7 @@ /* * open the serial port */ - fd = open(port, O_RDWR | O_NOCTTY /*| O_NONBLOCK*/); + fd = open(port, O_RDWR | O_NOCTTY | O_NONBLOCK); if (fd < 0) { fprintf(stderr, "%s: ser_open(): can't open device \"%s\": %s\n", progname, port, strerror(errno)); @@ -150,8 +158,8 @@ rc = ser_setspeed(fd, baud); if (rc) { fprintf(stderr, - "%s: ser_open(): can't set attributes for device \"%s\"\n", - progname, port); + "%s: ser_open(): can't set attributes for device \"%s\": %s\n", + progname, port, strerror(-rc)); exit(1); } @@ -161,7 +169,18 @@ static void ser_close(int fd) { - /* FIXME: Should really restore the terminal to original state here. */ + /* + * restore original termios settings from ser_open + */ + if (saved_original_termios) { + int rc = tcsetattr(fd, TCSANOW | TCSADRAIN, &original_termios); + if (rc) { + fprintf(stderr, + "%s: ser_close(): can't reset attributes for device: %s\n", + progname, strerror(errno)); + } + saved_original_termios = 0; + } close(fd); } diff -u avrdude-5.1/stk500.c avrdude-5.1-patch/stk500.c --- avrdude-5.1/stk500.c 2005-08-30 03:30:05.000000000 +0200 +++ avrdude-5.1-patch/stk500.c 2006-04-07 10:26:08.000000000 +0200 @@ -625,13 +625,14 @@ static int stk500_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, int page_size, int n_bytes) { - unsigned char buf[16]; + unsigned char buf[page_size + 16]; int memtype; unsigned int addr; int a_div; int block_size; int tries; unsigned int n; + unsigned int i; int flash; if (page_size == 0) { @@ -697,17 +698,19 @@ retry: tries++; stk500_loadaddr(pgm, addr/a_div); - buf[0] = Cmnd_STK_PROG_PAGE; - buf[1] = (block_size >> 8) & 0xff; - buf[2] = block_size & 0xff; - buf[3] = memtype; - stk500_send(pgm, buf, 4); - - stk500_send(pgm, &m->buf[addr], block_size); - - buf[0] = Sync_CRC_EOP; - stk500_send(pgm, buf, 1); - + + /* build command block and avoid multiple send commands as it leads to a crash + of the silabs usb serial driver on mac os x */ + i = 0; + buf[i++] = Cmnd_STK_PROG_PAGE; + buf[i++] = (block_size >> 8) & 0xff; + buf[i++] = block_size & 0xff; + buf[i++] = memtype; + memcpy(&buf[i], &m->buf[addr], block_size); + i += block_size; + buf[i++] = Sync_CRC_EOP; + stk500_send( pgm, buf, i); + stk500_recv(pgm, buf, 1); if (buf[0] == Resp_STK_NOSYNC) { if (tries > 33) { diff -u -r1.36 configure.ac --- avrdude-5.1/Makefile.in 2006-09-26 19:59:27.000000000 +0200 +++ avrdude-5.1-patched/Makefile.in 2006-09-26 19:59:03.000000000 +0200 @@ -100,7 +100,7 @@ avrdude-stk500v2.$(OBJEXT) avrdude-term.$(OBJEXT) \ avrdude-usb_libusb.$(OBJEXT) avrdude_OBJECTS = $(am_avrdude_OBJECTS) -avrdude_LDADD = $(LDADD) +avrdude_LDADD = $(LDADD) -framework CoreFoundation -framework IOKit DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles --- NEW FILE: avrdude.info --- Package: avrdude Version: 5.10 Revision: 1 Depends: libusb-shlibs (>= 0.1.8-14), libncurses5-shlibs BuildDepends: libusb (>= 0.1.8-14), libncurses5 Source: http://download.savannah.gnu.org/releases/%n/%n-%v.tar.gz Source-MD5: 69b082683047e054348088fd63bad2ff ConfigureParams: --mandir='${prefix}/share/man' InstallScript: << make prefix=%i install-exec install-man mkdir -p %i/share/info install doc/avrdude.info %i/share/info << InfoDocs: avrdude.info ConfFiles: %p/etc/%n.conf DocFiles: AUTHORS ChangeLog* COPYING NEWS README doc/TODO Description: Atmel AVR Microcontrollers Programmer DescDetail: << Avrdude is a tool for AVR microcontrollers which can interface to many hardware in-system programmers or bootloaders << License: GPL Homepage: http://savannah.nongnu.org/projects/avrdude Maintainer: Matthias Ringwald <frec...@users.sf.net> --- NEW FILE: avr-gcc.info --- Package: avr-gcc Version: 4.4.2 Revision: 2 Depends: avr-binutils (>= 2.15), gmp5-shlibs, libmpfr4 BuildDepends: gcc4.2, gmp5, libmpfr4 Maintainer: Matthias Ringwald <frec...@users.sf.net> Source: mirror:gnu:gcc/gcc-%v/gcc-%v.tar.bz2 Source-MD5: 70f5ac588a79e3c9901d5b34f58d896d SetCC: gcc-4.2 SetCXX: g++-4.2 ConfigureParams: --target=avr --prefix=%p/share/avr --prefix=%p/share/avr --bindir=%p/bin --mandir=%p/share/man --infodir=%p/share/info --enable-languages=c,c++ --disable-nls --disable-libssp --with-gmp=%p CompileScript: << #!/bin/bash -ev cd .. mkdir build cd build pwd ../gcc-%v/configure %c make << InstallScript: << #!/bin/bash -ev cd ../build make install DESTDIR=%d # empty rm -fr %i/share/avr/include rm -f %i/share/avr/lib/libiberty.a # provided by fink's gcc rm -fr %i/share/man/man7 rm -fr %i/share/info << Description: GNU GCC for ATMEL AVR micro controllers DescPort: << Removed libiberty.a installation of avr-gcc & avr-binutils. Avoided using /sw/avr. Its lib & include folders have been moved to /sw/share/avr and the binaries are put into /sw/bin. Removed xxx.info files to avoid clashes with other potential toolchains. TODO: Native Language Support << License: GPL Homepage: http://gcc.gnu.org/ --- NEW FILE: avr-binutils.info --- Package: avr-binutils Version: 2.19 Revision: 3 BuildDepends: fink (>= 0.24.12) Maintainer: Matthias Ringwald <frec...@users.sf.net> Source: mirror:gnu:binutils/binutils-%v.tar.bz2 Source-MD5: 17a52219dee5a76c1a9d9b0bfd337d66 PatchFile: %n.patch PatchFile-MD5: 8c24f8e7d9c7950b66dff0331b6633c4 SetCC: llvm-gcc ConfigureParams: --target=avr --prefix=%p/share/avr --bindir=%p/bin --mandir=%p/share/man --infodir=%p/share/info --disable-nls InstallScript: << make install DESTDIR=%d rm -fr %i/share/avr/lib/ rm -fr %i/share/info << DocFiles: README COPYING Description: GNU binutils for ATMEL AVR micro controllers DescPort: << Removed libiberty.a installation of avr-gcc & avr-binutils. Avoided using /sw/avr. Its lib & include folders have been moved to /sw/share/avr and the binaries are put into /sw/bin. Removed xxx.info files to avoid clashes with other potential toolchains. opcodes/avr-dis.c: uses sprintf without formats (compile error on 10.6), using strcpy insteads strings.c: uses stat64 which is deprecated in 10.6. stat64 provides 64 bit inodes which are not used anyway, use stat. TODO: Native Language Support << License: GPL Homepage: http://www.gnu.org/software/binutils/ --- NEW FILE: avr-libc.info --- Package: avr-libc Version: 1.6.5 Revision: 2 Depends: avr-binutils (>= 2.17), avr-gcc (>= 4.2.0) Maintainer: Matthias Ringwald <frec...@users.sf.net> Source: http://download.savannah.gnu.org/releases/avr/avr-libc-bin-%v.zip Source-MD5: e45ca04802b6b6ab0c87909b2c70fc3a Source2: http://download.savannah.gnu.org/releases/avr-libc/avr-libc-user-manual-%v.tar.bz2 Source2-MD5: d9c0608e9e5dd88bbd720f72a195d69b NoSourceDirectory: true CompileScript: << << InstallScript: << mkdir -p %i/share/avr cp -R %b/avr %i/share/avr/ cp -R %b/bin %i/share/avr/ mkdir -p %i/share/doc/avr-libc cp -R %b/share/doc/avr-libc-%v/* %i/share/doc/avr-libc cp -R %b/avr-libc-user-manual-%v %i/share/doc/avr-libc/avr-libc-user-manual << Description: AVR LIBC for GNU GCC & GNU binutils License: GPL DescDetail: << This is AVR-LIBC. It is a C library implementation for use with GNU GCC and GNU binutils for development of programs for Atmel's AVR mirocontrollers << DescPort: << Getting avr-libc to compile takes more effort than its worth, since they provide already built versions. This package just installs the prebuilt binaries. << --- NEW FILE: avr-binutils.patch --- --- binutils-2.19/opcodes/avr-dis.c 2007-07-05 11:49:00.000000000 +0200 +++ binutils-2.19-patched/opcodes/avr-dis.c 2009-09-12 09:34:15.000000000 +0200 @@ -109,7 +109,7 @@ case 0x100e: xyz = "-X"; break; default: xyz = "??"; ok = 0; } - sprintf (buf, xyz); + strcpy(buf, xyz); if (AVR_UNDEF_P (insn)) sprintf (comment, _("undefined")); @@ -149,7 +149,7 @@ value of the address only once, but this would mean recoding objdump_print_address() which would affect many targets. */ sprintf (buf, "%#lx", (unsigned long) *sym_addr); - sprintf (comment, comment_start); + strcpy (comment, comment_start); break; case 'L': @@ -158,7 +158,7 @@ sprintf (buf, ".%+-8d", rel_addr); *sym = 1; *sym_addr = pc + 2 + rel_addr; - sprintf (comment, comment_start); + strcpy (comment, comment_start); } break; @@ -169,7 +169,7 @@ sprintf (buf, ".%+-8d", rel_addr); *sym = 1; *sym_addr = pc + 2 + rel_addr; - sprintf (comment, comment_start); + strcpy (comment, comment_start); } break; --- binutils-2.19/binutils/strings.c 2008-08-25 06:38:13.000000000 +0200 +++ binutils-2.19-patched/binutils/strings.c 2009-09-12 09:59:00.000000000 +0200 @@ -85,13 +85,9 @@ typedef off_t file_off; #define file_open(s,m) fopen(s, m) #endif -#ifdef HAVE_STAT64 -typedef struct stat64 statbuf; -#define file_stat(f,s) stat64(f, s) -#else +// inode not used - don't try to used 64 bit inodes typedef struct stat statbuf; #define file_stat(f,s) stat(f, s) -#endif /* Radix for printing addresses (must be 8, 10 or 16). */ static int address_radix; ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos & much more. Register early & save! http://p.sf.net/sfu/rim-blackberry-1 _______________________________________________ Fink-commits mailing list Fink-commits@lists.sourceforge.net http://news.gmane.org/gmane.os.apple.fink.cvs