diff -Naur cross/openocd.orig/Portfile cross/openocd/Portfile
--- cross/openocd.orig/Portfile	2012-02-20 09:32:49.000000000 +0100
+++ cross/openocd/Portfile	2012-02-20 10:10:52.000000000 +0100
@@ -4,7 +4,7 @@
 PortSystem          1.0
 
 name                openocd
-version             0.4.0
+version             0.5.0
 revision            1
 categories          cross devel
 license             GPL
@@ -13,21 +13,127 @@
 long_description    The Open On-Chip Debugger (OpenOCD) aims to provide \
                     debugging, in-system programming and boundary-scan \
                     testing for embedded target devices. Built with support \
-                    for FT2232 based devices.
+                    for FT2232-based programmers by default. See variants for \
+                    programmer options.
 homepage            http://openocd.sourceforge.net/
 platforms           darwin
 
 master_sites        sourceforge:openocd
 
-checksums           rmd160  69ce61cec0aebce1300f44af029bf644194ebce9 \
-                    sha256  fc4b8b55c25920c0024e6e621c4127e92acbe9f6bafaf72b90fd60a5536e9194
+checksums           rmd160  552f0c498730ee9347ec6d0cda7bf7663357ef8a \
+                    sha256  efb99e0394249cbd518b51b052eea150d5f14557e9a2e0ddfae198792dca51c6
 
-depends_lib         port:libftdi
-
-patchfiles          patch-openocd-maskisr-when-stepping-after-breakpoint.diff
-
-configure.args-append   --enable-ft2232_libftdi --disable-werror
+configure.args-append  --disable-werror --enable-maintainer-mode
 
 livecheck.url       http://openocd.git.sourceforge.net/git/gitweb.cgi?p=openocd/openocd\;a=tags
 livecheck.type      regex
 livecheck.regex     v(\\d+(\\.\\d+)+)<
+
+default_variants +ft2232
+
+variant dummy description {Enable building the dummy port driver} {
+    configure.args-append --enable-dummy
+}
+
+variant parport description {Enable building the pc parallel port driver. WARNING: not supported on OS X.} {
+    configure.args-append --enable-parport
+}
+
+variant ft2232 conflicts ft2232_ftd2xx  description {Enable building support for FT2232 based devices using the libftdi driver, opensource alternate of FTD2XX} {
+    configure.args-append --enable-ft2232_libftdi
+	depends_lib-append port:libftdi
+}
+
+variant ft2232_ftd2xx conflicts ft2232  description {Enable building support for FT2232 based devices using the FTD2XX driver from ftdichip.com} {
+    configure.args-append --enable-ft2232_ftd2xx
+	depends_lib-append port:libftd2xx
+}
+
+variant usb_blaster conflicts usb_blaster_ftd2xx description {Enable building support for the Altera USB-Blaster using the libftdi driver, opensource alternate of FTD2XX} {
+    configure.args-append --enable-usb_blaster_libftdi
+	depends_lib-append port:libftdi
+}
+
+variant usb_blaster_ftd2xx conflicts usb_blaster description {Enable building support for the Altera USB-Blaster using the FTD2XX driver from ftdichip.com} {
+    configure.args-append --enable-usb_blaster_ftd2xx
+	depends_lib-append port:libftd2xx
+}
+
+variant amtjtagaccel description {Enable building the Amontec JTAG-Accelerator driver} {
+    configure.args-append --enable-amtjtagaccel
+}
+
+variant ecosboard description {Enable building support for eCos based JTAG debugger} {
+    configure.args-append --enable-ecosboard
+}
+
+variant zy1000_master requires zy1000 description {Use ZY1000 JTAG master registers} {
+    configure.args-append --enable-zy1000-master
+}
+
+variant zy1000 conflicts minidriver_dummy description {Enable ZY1000 interface. WARNING: Using the minidriver disables all other drivers.} {
+    configure.args-append --enable-zy1000
+}
+
+variant ioutil description {Enable ioutil functions - useful for standalone OpenOCD implementations} {
+    configure.args-append --enable-ioutil
+}
+
+variant ep93xx description {Enable building support for EP93xx based SBCs} {
+    configure.args-append --enable-ep93xx
+}
+
+variant at91rm9200 description {Enable building support for AT91RM9200 based SBCs} {
+    configure.args-append --enable-at91rm9200
+}
+
+variant gw16012 description {Enable building support for the Gateworks GW16012 JTAG Programmer} {
+    configure.args-append --enable-gw16012
+}
+
+variant presto conflicts presto_ftd2xx description {Enable building support for ASIX Presto Programmer using the libftdi driver} {
+    configure.args-append --enable-presto_libftdi
+	depends_lib-append port:libftdi
+}
+
+variant presto_ftd2xx conflicts presto description {Enable building support for ASIX Presto Programmer using the FTD2XX driver} {
+    configure.args-append --enable-presto_ftd2xx
+	depends_lib-append port:libftd2xx
+}
+
+variant usbprog description {Enable building support for the usbprog JTAG Programmer} {
+    configure.args-append --enable-usbprog
+}
+
+variant oocd_trace description {Enable building support for some prototype OpenOCD+trace ETM capture hardware} {
+    configure.args-append --enable-oocd_trace
+}
+
+variant jlink description {Enable building support for the Segger J-Link JTAG Programmer} {
+    configure.args-append --enable-jlink
+}
+
+variant vsllink description {Enable building support for the Versaloon-Link JTAG Programmer} {
+    configure.args-append --enable-vsllink
+}
+
+variant rlink description {Enable building support for the Raisonance RLink JTAG Programmer} {
+    configure.args-append --enable-rlink
+}
+
+variant ulink description {Enable building support for the Keil ULINK JTAG Programmer} {
+    configure.args-append --enable-ulink
+}
+
+variant arm_jtag_ew --enable-arm-jtag-ew description {Enable building support for the Olimex ARM-JTAG-EW Programmer} {
+    configure.args-append
+}
+
+variant buspirate description {Enable building support for the Buspirate} {
+    configure.args-append --enable-buspirate
+}
+
+variant minidriver_dummy conflicts zy1000 description {Enable the dummy minidriver} {
+    configure.args-append --enable-minidriver-dummy
+}
+
diff -Naur cross/openocd.orig/files/patch-openocd-maskisr-when-stepping-after-breakpoint.diff cross/openocd/files/patch-openocd-maskisr-when-stepping-after-breakpoint.diff
--- cross/openocd.orig/files/patch-openocd-maskisr-when-stepping-after-breakpoint.diff	2011-08-05 22:30:21.000000000 +0200
+++ cross/openocd/files/patch-openocd-maskisr-when-stepping-after-breakpoint.diff	1970-01-01 01:00:00.000000000 +0100
@@ -1,91 +0,0 @@
-http://sourceforge.net/apps/trac/openocd/ticket/22
---- src/target/cortex_m3.c	So Feb 21 11:17:08 2010
-+++ src/target/cortex_m3.c	Mo Mai  3 15:27:24 2010
-@@ -153,7 +153,7 @@
- 	return ERROR_OK;
- }
- 
--static int cortex_m3_single_step_core(struct target *target)
-+static int cortex_m3_single_step_core(struct target *target, bool mask_interrupts)
- {
- 	struct cortex_m3_common *cortex_m3 = target_to_cm3(target);
- 	struct swjdp_common *swjdp = &cortex_m3->armv7m.swjdp_info;
-@@ -162,18 +162,29 @@
- 	/* backup dhcsr reg */
- 	dhcsr_save = cortex_m3->dcb_dhcsr;
- 
--	/* Mask interrupts before clearing halt, if done already.  This avoids
--	 * Erratum 377497 (fixed in r1p0) where setting MASKINTS while clearing
--	 * HALT can put the core into an unknown state.
--	 */
--	if (!(cortex_m3->dcb_dhcsr & C_MASKINTS))
-+	if(mask_interrupts) {
-+		/* Mask interrupts before clearing halt, if not done already.  This avoids
-+		 * Erratum 377497 (fixed in r1p0) where setting MASKINTS while clearing
-+		 * HALT can put the core into an unknown state.
-+		 */
-+		if (!(cortex_m3->dcb_dhcsr & C_MASKINTS))
-+			mem_ap_write_atomic_u32(swjdp, DCB_DHCSR,
-+					DBGKEY | C_MASKINTS | C_HALT | C_DEBUGEN);
- 		mem_ap_write_atomic_u32(swjdp, DCB_DHCSR,
--				DBGKEY | C_MASKINTS | C_HALT | C_DEBUGEN);
--	mem_ap_write_atomic_u32(swjdp, DCB_DHCSR,
--				DBGKEY | C_MASKINTS | C_STEP | C_DEBUGEN);
-+					DBGKEY | C_MASKINTS | C_STEP | C_DEBUGEN);
-+	}
-+	else {
-+		mem_ap_write_atomic_u32(swjdp, DCB_DHCSR,
-+					DBGKEY | C_STEP | C_DEBUGEN);
-+	}
- 	LOG_DEBUG(" ");
- 
--	/* restore dhcsr reg */
-+	/* restore dhcsr reg
-+	 *
-+	 * FIXME Why restore cortex_m3->dcb_dhcsr? It isn't changed by above write
-+	 * operations. Don't we introduce an inconsistency between cortex_m3->dcb_dhcsr
-+	 * and the acutal register contents?
-+	 */
- 	cortex_m3->dcb_dhcsr = dhcsr_save;
- 	cortex_m3_clear_halt(target);
- 
-@@ -677,7 +688,7 @@
- 					  breakpoint->address,
- 					  breakpoint->unique_id);
- 			cortex_m3_unset_breakpoint(target, breakpoint);
--			cortex_m3_single_step_core(target);
-+			cortex_m3_single_step_core(target, 1); // Mask interrupts during step
- 			cortex_m3_set_breakpoint(target, breakpoint);
- 		}
- 	}
-@@ -716,6 +727,7 @@
- 	struct breakpoint *breakpoint = NULL;
- 	struct reg *pc = armv7m->core_cache->reg_list + 15;
- 	bool bkpt_inst_found = false;
-+	bool on_bkpt;
- 
- 	if (target->state != TARGET_HALTED)
- 	{
-@@ -723,6 +735,9 @@
- 		return ERROR_TARGET_NOT_HALTED;
- 	}
- 
-+	// We've stopped on a breakpoint
-+	on_bkpt = (target->debug_reason == DBG_REASON_BREAKPOINT);
-+
- 	/* current = 1: continue on current pc, otherwise continue at <address> */
- 	if (!current)
- 		buf_set_u32(pc->value, 0, 32, address);
-@@ -748,8 +763,10 @@
- 	 * instruction - as such simulate a step */
- 	if (bkpt_inst_found == false)
- 	{
--		/* set step and clear halt */
--		cortex_m3_write_debug_halt_mask(target, C_STEP, C_HALT);
-+		/* Disable interrupts diring step if we stopped on a break point.
-+		 * Otherwise any pending interrupt will get served next and we will
-+		 * return to the same break point after the interrupt completes. */
-+		cortex_m3_single_step_core(target, on_bkpt);
- 	}
- 
- 	mem_ap_read_atomic_u32(swjdp, DCB_DHCSR, &cortex_m3->dcb_dhcsr);
