diff options
author | Keith Packard <keithp@keithp.com> | 2013-12-08 11:07:46 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-12-08 11:07:46 -0800 |
commit | ebb36d56c732ffe9cdb8d2ea53d00e1d4ece8f97 (patch) | |
tree | 46b321232b9b56cb77d538c49293073d20bdd241 /ao-tools | |
parent | 5fd0dc6f69e7614ba71bbc215b32260a11595af3 (diff) |
ao-tools: Allow building without stlink and readline
This adds --without-stlink and --without-readline options to configure
to disable these features, and adjusts the build process and code to
handle that.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools')
-rw-r--r-- | ao-tools/Makefile.am | 5 | ||||
-rw-r--r-- | ao-tools/ao-dbg/Makefile.am | 2 | ||||
-rw-r--r-- | ao-tools/ao-dbg/ao-dbg-main.c | 11 | ||||
-rw-r--r-- | ao-tools/ao-elftohex/Makefile.am | 14 | ||||
-rw-r--r-- | ao-tools/ao-stmload/Makefile.am | 6 | ||||
-rw-r--r-- | ao-tools/ao-usbload/Makefile.am | 4 |
6 files changed, 21 insertions, 21 deletions
diff --git a/ao-tools/Makefile.am b/ao-tools/Makefile.am index 02d6c227..d40648d8 100644 --- a/ao-tools/Makefile.am +++ b/ao-tools/Makefile.am @@ -1,4 +1,7 @@ SUBDIRS=lib ao-rawload ao-dbg ao-bitbang ao-eeprom ao-list \ - ao-load ao-telem ao-stmload ao-send-telem ao-sky-flash \ + ao-load ao-telem ao-send-telem ao-sky-flash \ ao-dumpflash ao-edit-telem ao-dump-up ao-elftohex \ ao-flash +if LIBSTLINK +SUBDIRS += ao-stmload +endif diff --git a/ao-tools/ao-dbg/Makefile.am b/ao-tools/ao-dbg/Makefile.am index ad2cb280..2c33cf06 100644 --- a/ao-tools/ao-dbg/Makefile.am +++ b/ao-tools/ao-dbg/Makefile.am @@ -7,6 +7,6 @@ man_MANS = ao-dbg.1 ao_dbg_DEPENDENCIES = $(AO_DBG_LIBS) -ao_dbg_LDADD=$(AO_DBG_LIBS) $(LIBUSB_LIBS) -lreadline +ao_dbg_LDADD=$(AO_DBG_LIBS) $(LIBUSB_LIBS) $(LIBREADLINE) ao_dbg_SOURCES = ao-dbg-parse.c ao-dbg-command.c ao-dbg-main.c diff --git a/ao-tools/ao-dbg/ao-dbg-main.c b/ao-tools/ao-dbg/ao-dbg-main.c index 21b83a3d..25eca54b 100644 --- a/ao-tools/ao-dbg/ao-dbg-main.c +++ b/ao-tools/ao-dbg/ao-dbg-main.c @@ -16,6 +16,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "ao-dbg.h" #include <unistd.h> #include <sys/types.h> @@ -204,13 +208,16 @@ s51_putc(int c) putc(c, s51_output); } +#if HAVE_LIBREADLINE #include <readline/readline.h> #include <readline/history.h> +#endif int s51_read_line(char *line, int len) { int ret; +#if HAVE_LIBREADLINE if (s51_output == stdout && s51_input == stdin && s51_prompt) { char *r; @@ -221,7 +228,9 @@ s51_read_line(char *line, int len) line[len-1] = '\0'; add_history(r); return 1; - } else { + } else +#endif + { if (s51_prompt) s51_printf("%s", s51_prompt); else diff --git a/ao-tools/ao-elftohex/Makefile.am b/ao-tools/ao-elftohex/Makefile.am index 33c9923f..dd0046d7 100644 --- a/ao-tools/ao-elftohex/Makefile.am +++ b/ao-tools/ao-elftohex/Makefile.am @@ -1,18 +1,12 @@ -if LIBSTLINK - bin_PROGRAMS=ao-elftohex -LIBSTLINKDIR=/local/src/stlink - -AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBSTLINK_CFLAGS) $(LIBUSB_CFLAGS) -AO_STMLOAD_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a +AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS) +AO_ELFTOHEX_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a -ao_elftohex_DEPENDENCIES = $(AO_STMLOAD_LIBS) +ao_elftohex_DEPENDENCIES = $(AO_ELFTOHEX_LIBS) -ao_elftohex_LDADD=$(AO_STMLOAD_LIBS) $(LIBSTLINK_LIBS) $(LIBUSB_LIBS) -lelf +ao_elftohex_LDADD=$(AO_ELFTOHEX_LIBS) -lelf ao_elftohex_SOURCES=ao-elftohex.c man_MANS = ao-elftohex.1 - -endif diff --git a/ao-tools/ao-stmload/Makefile.am b/ao-tools/ao-stmload/Makefile.am index 9ed286cc..45eb6216 100644 --- a/ao-tools/ao-stmload/Makefile.am +++ b/ao-tools/ao-stmload/Makefile.am @@ -2,14 +2,12 @@ if LIBSTLINK bin_PROGRAMS=ao-stmload -LIBSTLINKDIR=/local/src/stlink - -AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBSTLINK_CFLAGS) $(LIBUSB_CFLAGS) +AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(STLINK_CFLAGS) $(LIBUSB_CFLAGS) AO_STMLOAD_LIBS=$(top_builddir)/ao-tools/lib/libao-tools.a ao_stmload_DEPENDENCIES = $(AO_STMLOAD_LIBS) -ao_stmload_LDADD=$(AO_STMLOAD_LIBS) $(LIBSTLINK_LIBS) $(LIBUSB_LIBS) -lelf +ao_stmload_LDADD=$(AO_STMLOAD_LIBS) $(STLINK_LIBS) $(LIBUSB_LIBS) -lelf ao_stmload_SOURCES=ao-stmload.c ao-stmload.h diff --git a/ao-tools/ao-usbload/Makefile.am b/ao-tools/ao-usbload/Makefile.am index 144e25df..e3b63a85 100644 --- a/ao-tools/ao-usbload/Makefile.am +++ b/ao-tools/ao-usbload/Makefile.am @@ -1,5 +1,3 @@ -if LIBSTLINK - bin_PROGRAMS=ao-usbload AM_CFLAGS=-I$(top_srcdir)/ao-tools/lib $(LIBUSB_CFLAGS) @@ -12,5 +10,3 @@ ao_usbload_LDADD=$(AO_STMLOAD_LIBS) $(LIBUSB_LIBS) -lelf ao_usbload_SOURCES=ao-usbload.c ao-usbload.h man_MANS = ao-usbload.1 - -endif |