]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/openocd/openocd.mk
package/openocd: fix fallout after no-C++ fixups
[coffee/buildroot.git] / package / openocd / openocd.mk
1 ################################################################################
2 #
3 # openocd
4 #
5 ################################################################################
6
7 OPENOCD_VERSION = 0.10.0
8 OPENOCD_SOURCE = openocd-$(OPENOCD_VERSION).tar.bz2
9 OPENOCD_SITE = http://sourceforge.net/projects/openocd/files/openocd/$(OPENOCD_VERSION)
10 OPENOCD_LICENSE = GPL-2.0+
11 OPENOCD_LICENSE_FILES = COPYING
12 # 0002-configure-enable-build-on-uclinux.patch patches configure.ac
13 OPENOCD_AUTORECONF = YES
14
15 # The bundled jimtcl really wants to find a existing $CXX, so feed it
16 # false when we do not have one.
17 OPENOCD_CONF_ENV = \
18         $(if $(BR2_INSTALL_LIBSTDCPP),,CXX=false) \
19         CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
20
21 OPENOCD_CONF_OPTS = \
22         --oldincludedir=$(STAGING_DIR)/usr/include \
23         --includedir=$(STAGING_DIR)/usr/include \
24         --disable-doxygen-html \
25         --with-jim-shared=no \
26         --disable-shared \
27         --enable-dummy \
28         --disable-werror
29
30 # Rely on the Config.in options of each individual adapter selecting
31 # the dependencies they need.
32
33 OPENOCD_DEPENDENCIES = \
34         $(if $(BR2_PACKAGE_LIBFTDI1),libftdi1) \
35         $(if $(BR2_PACKAGE_LIBUSB),libusb) \
36         $(if $(BR2_PACKAGE_LIBUSB_COMPAT),libusb-compat) \
37         $(if $(BR2_PACKAGE_LIBHID),libhid)
38
39 # Adapters
40 OPENOCD_CONF_OPTS += \
41         $(if $(BR2_PACKAGE_OPENOCD_FTDI),--enable-ftdi,--disable-ftdi) \
42         $(if $(BR2_PACKAGE_OPENOCD_STLINK),--enable-stlink,--disable-stlink) \
43         $(if $(BR2_PACKAGE_OPENOCD_TI_ICDI),--enable-ti-icdi,--disable-ti-icdi) \
44         $(if $(BR2_PACKAGE_OPENOCD_ULINK),--enable-ulink,--disable-ulink) \
45         $(if $(BR2_PACKAGE_OPENOCD_UBLASTER2),--enable-usb-blaster-2,--disable-usb-blaster-2) \
46         $(if $(BR2_PACKAGE_OPENOCD_JLINK),--enable-jlink,--disable-jlink) \
47         $(if $(BR2_PACKAGE_OPENOCD_OSDBM),--enable-osbdm,--disable-osbdm) \
48         $(if $(BR2_PACKAGE_OPENOCD_OPENDOUS),--enable-opendous,--disable-opendous) \
49         $(if $(BR2_PACKAGE_OPENOCD_AICE),--enable-aice,--disable-aice) \
50         $(if $(BR2_PACKAGE_OPENOCD_VSLLINK),--enable-vsllink,--disable-vsllink) \
51         $(if $(BR2_PACKAGE_OPENOCD_USBPROG),--enable-usbprog,--disable-usbprog) \
52         $(if $(BR2_PACKAGE_OPENOCD_RLINK),--enable-rlink,--disable-rlink) \
53         $(if $(BR2_PACKAGE_OPENOCD_ARMEW),--enable-armjtagew,--disable-armjtagew) \
54         $(if $(BR2_PACKAGE_OPENOCD_CMSIS_DAP),--enable-cmsis-dap,--disable-cmsis-dap) \
55         $(if $(BR2_PACKAGE_OPENOCD_PARPORT),--enable-parport,--disable-parport) \
56         $(if $(BR2_PACKAGE_OPENOCD_VPI),--enable-jtag_vpi,--disable-jtag_vpi) \
57         $(if $(BR2_PACKAGE_OPENOCD_UBLASTER),--enable-usb-blaster,--disable-usb-blaster) \
58         $(if $(BR2_PACKAGE_OPENOCD_AMTJT),--enable-amtjtagaccel,--disable-amjtagaccel) \
59         $(if $(BR2_PACKAGE_OPENOCD_ZY1000_MASTER),--enable-zy1000-master,--disable-zy1000-master) \
60         $(if $(BR2_PACKAGE_OPENOCD_ZY1000),--enable-zy1000,--disable-zy1000) \
61         $(if $(BR2_PACKAGE_OPENOCD_EP93XX),--enable-ep93xx,--disable-ep93xx) \
62         $(if $(BR2_PACKAGE_OPENOCD_AT91RM),--enable-at91rm9200,--disable-at91rm9200) \
63         $(if $(BR2_PACKAGE_OPENOCD_BCM2835),--enable-bcm2835gpio,--disable-bcm2835gpio) \
64         $(if $(BR2_PACKAGE_OPENOCD_GW16012),--enable-gw16012,--disable-gw16012) \
65         $(if $(BR2_PACKAGE_OPENOCD_PRESTO),--enable-presto,--disable-presto) \
66         $(if $(BR2_PACKAGE_OPENOCD_OPENJTAG),--enable-openjtag,--disable-openjtag) \
67         $(if $(BR2_PACKAGE_OPENOCD_BUSPIRATE),--enable-buspirate,--disable-buspirate) \
68         $(if $(BR2_PACKAGE_OPENOCD_SYSFS),--enable-sysfsgpio,--disable-sysfsgpio)
69
70 # Enable all configuration options for host build.
71 #
72 # Note that deprecated options have been removed. CMSIS_DAP needs
73 # hidapi (currently not included in buildroot) and zy1000 stuff fails
74 # to build, so they've been removed too.
75 #
76 HOST_OPENOCD_CONF_OPTS = \
77         --enable-ftdi \
78         --enable-stlink \
79         --enable-ti-icdi \
80         --enable-ulink \
81         --enable-usb-blaster-2 \
82         --enable-jlink \
83         --enable-osbdm \
84         --enable-opendous \
85         --enable-aice \
86         --enable-vsllink \
87         --enable-usbprog \
88         --enable-rlink \
89         --enable-armjtagew \
90         --enable-parport \
91         --enable-jtag_vpi \
92         --enable-usb-blaster \
93         --enable-amtjtagaccel \
94         --enable-gw16012 \
95         --enable-presto \
96         --enable-openjtag \
97         --enable-buspirate \
98         --enable-sysfsgpio \
99         --oldincludedir=$(HOST_DIR)/include \
100         --includedir=$(HOST_DIR)/include \
101         --disable-doxygen-html \
102         --with-jim-shared=no \
103         --disable-shared \
104         --enable-dummy \
105         --disable-werror
106
107 HOST_OPENOCD_DEPENDENCIES = host-libftdi host-libusb host-libusb-compat
108
109 # Avoid documentation rebuild. On PowerPC64(le), we patch the
110 # configure script. Due to this, the version.texi files gets
111 # regenerated, and then since it has a newer date than openocd.info,
112 # openocd build system rebuilds the documentation. Unfortunately, this
113 # documentation rebuild fails on old machines. We work around this by
114 # faking the date of the generated version.texi file, to make the
115 # build system believe the documentation doesn't need to be
116 # regenerated.
117 define OPENOCD_FIX_VERSION_TEXI
118         touch -r $(@D)/doc/openocd.info $(@D)/doc/version.texi
119 endef
120 OPENOCD_POST_BUILD_HOOKS += OPENOCD_FIX_VERSION_TEXI
121 HOST_OPENOCD_POST_BUILD_HOOKS += OPENOCD_FIX_VERSION_TEXI
122
123 $(eval $(autotools-package))
124 $(eval $(host-autotools-package))