aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authornox <nox@FreeBSD.org>2011-02-06 00:27:43 +0800
committernox <nox@FreeBSD.org>2011-02-06 00:27:43 +0800
commit31adcc7593e2cc732a4f9cdf800dd75dcb85fb5b (patch)
tree2760d32d9d43b6ba3690d24ba5a5bc82e9ba95eb /devel
parentc1779aa3a4a54a427d277613e338c179ed3875e1 (diff)
downloadfreebsd-ports-gnome-31adcc7593e2cc732a4f9cdf800dd75dcb85fb5b.tar.gz
freebsd-ports-gnome-31adcc7593e2cc732a4f9cdf800dd75dcb85fb5b.tar.zst
freebsd-ports-gnome-31adcc7593e2cc732a4f9cdf800dd75dcb85fb5b.zip
MSPDebug is a free debugger for use with MSP430 MCUs. It supports
FET430UIF, eZ430, RF2500 and Olimex MSP-JTAG-TINY programmers. It can be used as a proxy for gdb or as an independent debugger with support for programming, disassembly and reverse engineering. WWW: http://mspdebug.sourceforge.net/ PR: ports/154517 Submitted by: Peter Jeremy <peterjeremy at acm.org> Feature safe: yes
Diffstat (limited to 'devel')
-rw-r--r--devel/Makefile1
-rw-r--r--devel/mspdebug/Makefile34
-rw-r--r--devel/mspdebug/distinfo2
-rw-r--r--devel/mspdebug/files/patch-Makefile47
-rw-r--r--devel/mspdebug/files/patch-bsl.c11
-rw-r--r--devel/mspdebug/files/patch-elf32.c11
-rw-r--r--devel/mspdebug/files/patch-olimex.c28
-rw-r--r--devel/mspdebug/files/patch-rf2500.c28
-rw-r--r--devel/mspdebug/files/patch-uif.c50
-rw-r--r--devel/mspdebug/files/patch-usbutil.c10
-rw-r--r--devel/mspdebug/pkg-descr6
11 files changed, 228 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 08da41b39920..be6313028bf4 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1032,6 +1032,7 @@
SUBDIR += msp430-gcc
SUBDIR += msp430-gdb
SUBDIR += msp430-libc
+ SUBDIR += mspdebug
SUBDIR += msrc0
SUBDIR += nana
SUBDIR += nant
diff --git a/devel/mspdebug/Makefile b/devel/mspdebug/Makefile
new file mode 100644
index 000000000000..22b8b5bd3b2f
--- /dev/null
+++ b/devel/mspdebug/Makefile
@@ -0,0 +1,34 @@
+# New ports collection makefile for: mspdebug
+# Date created: 30 Jan 2011
+# Whom: Peter Jeremy <peterjeremy@acm.org>
+#
+# $FreeBSD$
+#
+# Based on the OpenBSD port by: Jasper Lievisse Adriaanse <jasper@openbsd.org>
+
+PORTNAME= mspdebug
+PORTVERSION= 0.13
+CATEGORIES= devel
+MASTER_SITES= SF/${PORTNAME}
+
+MAINTAINER= peterjeremy@acm.org
+COMMENT= Debugger for use with MSP 430 MCUs
+
+LICENSE= GPLv2
+
+MAN1= mspdebug.1
+USE_GMAKE= yes
+
+PLIST_FILES= bin/mspdebug
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 800069
+LIB_DEPENDS+= usb:${PORTSDIR}/devel/libusb
+.endif
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/mspdebug ${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/mspdebug.man ${PREFIX}/man/man1/mspdebug.1
+
+.include <bsd.port.post.mk>
diff --git a/devel/mspdebug/distinfo b/devel/mspdebug/distinfo
new file mode 100644
index 000000000000..6a5845286e35
--- /dev/null
+++ b/devel/mspdebug/distinfo
@@ -0,0 +1,2 @@
+SHA256 (mspdebug-0.13.tar.gz) = 7f77cbe2bab245cf50647a2bd23e803fe22e2d21a2b0953e0551ebf3e72fc48e
+SIZE (mspdebug-0.13.tar.gz) = 91556
diff --git a/devel/mspdebug/files/patch-Makefile b/devel/mspdebug/files/patch-Makefile
new file mode 100644
index 000000000000..05afbed99c84
--- /dev/null
+++ b/devel/mspdebug/files/patch-Makefile
@@ -0,0 +1,47 @@
+--- Makefile.orig 2010-11-09 08:40:57.000000000 +1100
++++ Makefile 2011-02-05 12:36:25.710676671 +1100
+@@ -26,17 +26,27 @@
+ READLINE_LIBS =
+ else
+ READLINE_CFLAGS = -DUSE_READLINE
+- READLINE_LIBS = -lreadline
++ READLINE_LIBS = -lreadline -ltermcap
+ endif
+
+-# Mac OS X/MacPorts stuff
+ UNAME := $(shell sh -c 'uname -s')
+-ifeq ($(UNAME),Darwin)
+- MACPORTS_CFLAGS = -I/opt/local/include
+- MACPORTS_LDFLAGS = -L/opt/local/lib
++ifeq ($(UNAME),Darwin) # Mac OS X/MacPorts stuff
++ PORTS_CFLAGS = -I/opt/local/include
++ PORTS_LDFLAGS = -L/opt/local/lib
+ else
+- MACPORTS_CFLAGS =
+- MACPORTS_LDFLAGS =
++ ifeq ($(UNAME),OpenBSD) # OpenBSD Ports stuff
++ PORTS_CFLAGS = `pkg-config --cflags libelf libusb`
++ PORTS_LDFLAGS = `pkg-config --libs libelf libusb`
++ else
++ ifeq ($(UNAME),FreeBSD) # FreeBSD Ports stuff
++# This is only needed prior to FreeBSD 8.x to find libusb
++ PORTS_CFLAGS = -I${LOCALBASE}/include
++ PORTS_LDFLAGS = -L${LOCALBASE}/lib
++ else
++ PORTS_CFLAGS =
++ PORTS_LDFLAGS =
++ endif
++ endif
+ endif
+
+ MSPDEBUG_CFLAGS = -O1 -Wall -Wno-char-subscripts -ggdb
+@@ -60,7 +70,7 @@
+ reader.o vector.o output_util.o expr.o fet_error.o binfile.o \
+ fet_db.o usbutil.o titext.o srec.o device.o coff.o opdb.o output.o \
+ cmddb.o stdcmd.o prog.o flash_bsl.o
+- $(CC) $(LDFLAGS) $(MACPORTS_LDFLAGS) -o $@ $^ -lusb $(READLINE_LIBS)
++ $(CC) $(LDFLAGS) $(PORTS_LDFLAGS) -o $@ $^ -lusb $(READLINE_LIBS)
+
+ .c.o:
+- $(CC) $(CFLAGS) $(MACPORTS_CFLAGS) $(READLINE_CFLAGS) $(MSPDEBUG_CFLAGS) -o $@ -c $*.c
++ $(CC) $(CFLAGS) $(PORTS_CFLAGS) $(READLINE_CFLAGS) $(MSPDEBUG_CFLAGS) -o $@ -c $*.c
diff --git a/devel/mspdebug/files/patch-bsl.c b/devel/mspdebug/files/patch-bsl.c
new file mode 100644
index 000000000000..bda5972d68d0
--- /dev/null
+++ b/devel/mspdebug/files/patch-bsl.c
@@ -0,0 +1,11 @@
+--- bsl.c.orig Mon Nov 8 22:40:57 2010
++++ bsl.c Thu Dec 2 13:05:14 2010
+@@ -31,7 +31,7 @@
+ #include "output.h"
+ #include "fet_error.h"
+
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+ #define B460800 460800
+ #endif
+
diff --git a/devel/mspdebug/files/patch-elf32.c b/devel/mspdebug/files/patch-elf32.c
new file mode 100644
index 000000000000..495fa2b52a6a
--- /dev/null
+++ b/devel/mspdebug/files/patch-elf32.c
@@ -0,0 +1,11 @@
+--- elf32.c.orig Wed Aug 4 04:08:43 2010
++++ elf32.c Thu Aug 12 12:51:04 2010
+@@ -19,7 +19,7 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+ #include <libelf.h>
+ #else
+ #include <elf.h>
diff --git a/devel/mspdebug/files/patch-olimex.c b/devel/mspdebug/files/patch-olimex.c
new file mode 100644
index 000000000000..7d8baf177953
--- /dev/null
+++ b/devel/mspdebug/files/patch-olimex.c
@@ -0,0 +1,28 @@
+--- olimex.c.orig 2010-11-09 08:40:57.000000000 +1100
++++ olimex.c 2011-01-23 20:52:02.005008013 +1100
+@@ -20,6 +20,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <usb.h>
++#include <stdlib.h>
+
+ #include "olimex.h"
+ #include "util.h"
+@@ -66,7 +67,7 @@
+ static int open_interface(struct olimex_transport *tr,
+ struct usb_device *dev, int ino)
+ {
+-#if !(defined (__APPLE__) || defined(WIN32))
++#if defined(__linux__)
+ int drv;
+ char drName[256];
+ #endif
+@@ -82,7 +83,7 @@
+ return -1;
+ }
+
+-#if !(defined(__APPLE__) || defined(WIN32))
++#if defined(__linux__)
+ drv = usb_get_driver_np(tr->handle, tr->int_number, drName,
+ sizeof(drName));
+ printc(__FILE__" : driver %d\n", drv);
diff --git a/devel/mspdebug/files/patch-rf2500.c b/devel/mspdebug/files/patch-rf2500.c
new file mode 100644
index 000000000000..e1c90920bb3b
--- /dev/null
+++ b/devel/mspdebug/files/patch-rf2500.c
@@ -0,0 +1,28 @@
+--- rf2500.c.orig 2010-11-09 08:40:57.000000000 +1100
++++ rf2500.c 2011-01-23 20:51:40.771589070 +1100
+@@ -19,6 +19,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <usb.h>
++#include <stdlib.h>
+
+ #include "rf2500.h"
+ #include "util.h"
+@@ -67,7 +68,7 @@
+ return -1;
+ }
+
+-#if !(defined(__APPLE__) || defined(WIN32))
++#if !(defined(__APPLE__) || defined(WIN32) || defined(__OpenBSD__) || defined(__FreeBSD__))
+ if (usb_detach_kernel_driver_np(tr->handle, tr->int_number) < 0)
+ pr_error("rf2500: warning: can't "
+ "detach kernel driver");
+@@ -221,7 +222,7 @@
+ #ifndef __APPLE__
+ while (usb_bulk_read(tr->handle, USB_FET_IN_EP,
+ buf, sizeof(buf),
+- 100) >= 0);
++ 100) > 0);
+ #endif
+
+ return (transport_t)tr;
diff --git a/devel/mspdebug/files/patch-uif.c b/devel/mspdebug/files/patch-uif.c
new file mode 100644
index 000000000000..107393be56d5
--- /dev/null
+++ b/devel/mspdebug/files/patch-uif.c
@@ -0,0 +1,50 @@
+--- uif.c.orig Mon Nov 8 22:40:57 2010
++++ uif.c Thu Dec 2 13:05:36 2010
+@@ -25,7 +25,9 @@
+ #include <unistd.h>
+ #include <termios.h>
+
++#if defined(__linux__)
+ #include <linux/serial.h>
++#endif
+ #include <sys/ioctl.h>
+ #include <fcntl.h>
+
+@@ -33,7 +35,7 @@
+ #include "util.h"
+ #include "output.h"
+
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+ #define B460800 460800
+ #define B500000 500000
+ #endif
+@@ -85,6 +87,7 @@ static void serial_destroy(transport_t tr_base)
+ free(tr);
+ }
+
++#if defined(__linux__)
+ static int open_olimex_iso(const char *device)
+ {
+ int fd = open(device, O_RDWR | O_NOCTTY);
+@@ -112,6 +115,7 @@ static int open_olimex_iso(const char *device)
+
+ return fd;
+ }
++#endif
+
+ transport_t uif_open(const char *device, uif_type_t type)
+ {
+@@ -138,8 +142,12 @@ transport_t uif_open(const char *device, uif_type_t ty
+ break;
+
+ case UIF_TYPE_OLIMEX_ISO:
++#if defined(__linux__)
+ printc("Trying to open Olimex (ISO) on %s...\n", device);
+ tr->serial_fd = open_olimex_iso(device);
++#else
++ printc_err("uif_open: ioctl TIOCSSERIAL not supported on this platform\n");
++#endif
+ break;
+ }
+
diff --git a/devel/mspdebug/files/patch-usbutil.c b/devel/mspdebug/files/patch-usbutil.c
new file mode 100644
index 000000000000..de3da785c1b0
--- /dev/null
+++ b/devel/mspdebug/files/patch-usbutil.c
@@ -0,0 +1,10 @@
+--- usbutil.c.orig 2010-11-09 08:40:57.000000000 +1100
++++ usbutil.c 2011-01-23 20:53:11.561100726 +1100
+@@ -17,6 +17,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include "usbutil.h"
+ #include "util.h"
diff --git a/devel/mspdebug/pkg-descr b/devel/mspdebug/pkg-descr
new file mode 100644
index 000000000000..b2b5ff979e75
--- /dev/null
+++ b/devel/mspdebug/pkg-descr
@@ -0,0 +1,6 @@
+MSPDebug is a free debugger for use with MSP430 MCUs. It supports
+FET430UIF, eZ430, RF2500 and Olimex MSP-JTAG-TINY programmers. It can be
+used as a proxy for gdb or as an independent debugger with support for
+programming, disassembly and reverse engineering.
+
+WWW: http://mspdebug.sourceforge.net/