From: Florian Fainelli Date: Tue, 20 May 2008 11:00:58 +0000 (+0000) Subject: Add avrusbboot (#3389) X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=901632c604823df79b90afac821262ec95e37bcc Add avrusbboot (#3389) SVN-Revision: 11220 --- diff --git a/utils/avrusbboot/Makefile b/utils/avrusbboot/Makefile new file mode 100644 index 0000000000..437784214a --- /dev/null +++ b/utils/avrusbboot/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id:$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=avrusbboot +PKG_VERSION:=2006-06-25 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.fischl.de/avrusbboot/ +PKG_MD5SUM:=3e2f5e2c257918410a66c3463f583fdf + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/avrusbboot + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libusb +uclibcxx + TITLE:=USB bootloader for Atmel AVR controllers + URL:=http://www.fischl.de/avrusbboot/ +endef + +define Package/avrusbboot/description + AVRUSBBoot is a bootloader for the Atmel AVR controllers. + It uses a firmware-only USB driver to transfer binary data + from the PC to the flash of the controller. Once the AVR + is flashed with the bootloader, no other ISP programmer is + needed; then the microcontroller can be reprogrammed over USB. +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/software \ + CXX="$(TARGET_CROSS)g++ $(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++ -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/uClibc++" \ + LFLAGS="-L$(STAGING_DIR)/usr/lib -nodefaultlibs -luClibc++ -lusb" \ + all +endef + +define Package/avrusbboot/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/software/avrusbboot $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,avrusbboot)) diff --git a/utils/avrusbboot/patches/001-fix_makefile.patch b/utils/avrusbboot/patches/001-fix_makefile.patch new file mode 100644 index 0000000000..4439b62308 --- /dev/null +++ b/utils/avrusbboot/patches/001-fix_makefile.patch @@ -0,0 +1,18 @@ +diff -urN avrusbboot.2006-06-25/software/Makefile avrusbboot.2006-06-25.new/software/Makefile +--- avrusbboot.2006-06-25/software/Makefile 2006-06-25 11:09:03.000000000 +0200 ++++ avrusbboot.2006-06-25.new/software/Makefile 2008-05-20 12:54:22.000000000 +0200 +@@ -1,6 +1,5 @@ +-LIBUSB_CONFIG = libusb-config +-CFLAGS+=-g -Wall -pedantic `$(LIBUSB_CONFIG) --cflags` +-LFLAGS+=`$(LIBUSB_CONFIG) --libs` -lusb ++CFLAGS=-I$(STAGING_DIR)/usr/include ++LFLAGS=-L$(STAGING_DIR)/usr/lib -lusb + + all: + make avrusbboot +@@ -10,4 +9,4 @@ + rm avrusbboot + + avrusbboot: main.cpp cflashmem.o cpage.o cbootloader.o +- g++ $(CFLAGS) main.cpp cflashmem.o cpage.o cbootloader.o -o avrusbboot $(LFLAGS) ++ $(CXX) $(CFLAGS) main.cpp cflashmem.o cpage.o cbootloader.o -o avrusbboot $(LFLAGS) diff --git a/utils/avrusbboot/patches/002-fix_compilation.patch b/utils/avrusbboot/patches/002-fix_compilation.patch new file mode 100644 index 0000000000..bd8bcd9d29 --- /dev/null +++ b/utils/avrusbboot/patches/002-fix_compilation.patch @@ -0,0 +1,9 @@ +diff -ruN avrusbboot.2006-06-25-orig/software/main.cpp avrusbboot.2006-06-25-work/software/main.cpp +--- avrusbboot.2006-06-25-orig/software/main.cpp 2006-06-25 09:33:13.000000000 +0200 ++++ avrusbboot.2006-06-25-work/software/main.cpp 2008-05-01 17:25:30.000000000 +0200 +@@ -39,4 +39,4 @@ + } + + return 0; +-}; ++}