summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-07-20 12:04:17 -0700
committerKeith Packard <keithp@keithp.com>2012-07-20 12:04:52 -0700
commit38f66a31174dd367e39d717c527f555add60a9d4 (patch)
treec062f25ac21b37962e6558c2f41483539f9d883e
parente033a72d3f420e18ed24354c7dfc7e1317a03fb6 (diff)
tools: Use pkgconfig to find stlink for ao-stmload
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--ao-tools/ao-stmload/Makefile.am7
-rw-r--r--configure.ac5
2 files changed, 7 insertions, 5 deletions
diff --git a/ao-tools/ao-stmload/Makefile.am b/ao-tools/ao-stmload/Makefile.am
index 77979daf..375896ea 100644
--- a/ao-tools/ao-stmload/Makefile.am
+++ b/ao-tools/ao-stmload/Makefile.am
@@ -2,12 +2,9 @@ bin_PROGRAMS=ao-stmload
LIBSTLINKDIR=/local/src/stlink
-AM_CFLAGS=-I$(LIBSTLINKDIR)/src $(LIBUSB_CFLAGS) -I../lib
+AM_CFLAGS=$(LIBSTLINK_CFLAGS) $(LIBUSB_CFLAGS) -I../lib
-AO_STMLOAD_LIBS=$(LIBSTLINKDIR)/libstlink.a
-ao_stmload_DEPENDENCIES = $(AO_STMLOAD_LIBS)
-
-ao_stmload_LDADD=$(AO_STMLOAD_LIBS) $(LIBUSB_LIBS) -lelf
+ao_stmload_LDADD=$(LIBSTLINK_LIBS) $(LIBUSB_LIBS) -lelf
ao_stmload_SOURCES=ao-stmload.c
diff --git a/configure.ac b/configure.ac
index 10bf9abf..bcd2dcac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,6 +136,11 @@ AC_CHECK_LIB(readline, readline)
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
+AC_CHECK_HEADERS(libelf.h libelf/libelf.h, [break])
+AC_CHECK_HEADERS(gelf.h libelf/gelf.h, [break])
+
+PKG_CHECK_MODULES([LIBSTLINK], [stlink])
+
AC_OUTPUT([
Makefile
altoslib/Makefile