summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomek CEDRO <cederom@tlen.pl>2011-06-22 00:47:09 +0200
committerTomek CEDRO <cederom@tlen.pl>2011-06-22 00:47:09 +0200
commit48d6ac229d331a0a1d24b11db550998f882b838a (patch)
treef7eae65c6a1c925de837a793f794897ab25ab2aa
parentc9ffe73e9a673494087a11e1d32efa1cf5a7f5da (diff)
downloadopenocd+libswd-48d6ac229d331a0a1d24b11db550998f882b838a.tar.gz
openocd+libswd-48d6ac229d331a0a1d24b11db550998f882b838a.tar.bz2
openocd+libswd-48d6ac229d331a0a1d24b11db550998f882b838a.tar.xz
openocd+libswd-48d6ac229d331a0a1d24b11db550998f882b838a.zip
SUBMODULE/LIBSWD: Integrated (conditional) libswd build into source tree configure and build process (just as JimTCL) in configure.in and Makefile.am. By default build is enabled, using switch '--disable-internal-libswd' build can be disabled and use external one. Added compilers flags to use internal libswd source tree in common.mk.
-rw-r--r--Makefile.am8
-rw-r--r--common.mk6
-rw-r--r--configure.in13
3 files changed, 24 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index b31bcea9..54528606 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,10 +9,12 @@ nobase_dist_pkgdata_DATA = \
contrib/libdcc/README \
contrib/openocd.udev
-if INTERNAL_JIMTCL
-SUBDIRS = jimtcl
-else
SUBDIRS =
+if INTERNAL_JIMTCL
+SUBDIRS += jimtcl
+endif
+if INTERNAL_LIBSWD
+SUBDIRS += submodules/libswd
endif
SUBDIRS += src doc
diff --git a/common.mk b/common.mk
index c1a5e6c6..6689ccdd 100644
--- a/common.mk
+++ b/common.mk
@@ -8,3 +8,9 @@ if INTERNAL_JIMTCL
AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \
-I$(top_builddir)/jimtcl
endif
+
+if INTERNAL_LIBSWD
+AM_CPPFLAGS += -I$(top_srcdir)/submodules/libswd/src \
+ -I$(top_builddir)/submodules/libswd/src
+endif
+
diff --git a/configure.in b/configure.in
index 090d934b..3b4a7251 100644
--- a/configure.in
+++ b/configure.in
@@ -488,6 +488,10 @@ AC_ARG_ENABLE(internal-jimtcl,
AS_HELP_STRING([--disable-internal-jimtcl], [Disable building internal jimtcl]),
[use_internal_jimtcl=$enableval], [use_internal_jimtcl=yes])
+AC_ARG_ENABLE(internal-libswd,
+ AS_HELP_STRING([--disable-internal-libswd], [Disable building internal libswd]),
+ [use_internal_libswd=$enableval], [use_internal_libswd=yes])
+
build_minidriver=no
AC_MSG_CHECKING([whether to enable ZY1000 minidriver])
if test $build_zy1000 = yes; then
@@ -770,6 +774,14 @@ if test "$use_internal_jimtcl" = yes; then
fi
fi
+if test "$use_internal_libswd" = yes; then
+ if test -f "$srcdir/submodules/libswd/configure.ac"; then
+ AX_CONFIG_SUBDIR_OPTION([submodules/libswd])
+ else
+ AC_MSG_ERROR([libswd not found, run git submodule init and git submodule update.])
+ fi
+fi
+
#-- Deal with MingW/Cygwin FTD2XX issues
if test $is_win32 = yes; then
@@ -1069,6 +1081,7 @@ AM_CONDITIONAL(MINIDRIVER, test $build_minidriver = yes)
AM_CONDITIONAL(MINIDRIVER_DUMMY, test $build_minidriver_dummy = yes)
AM_CONDITIONAL(INTERNAL_JIMTCL, test $use_internal_jimtcl = yes)
+AM_CONDITIONAL(INTERNAL_LIBSWD, test $use_internal_libswd = yes)
# Look for environ alternatives. Possibility #1: is environ in unistd.h or stdlib.h?
AC_MSG_CHECKING([for environ in unistd.h and stdlib.h])