From f84c78a2e1994ef8efcdd8768dc2a6b0ee363189 Mon Sep 17 00:00:00 2001 From: zwelch Date: Mon, 8 Jun 2009 00:42:15 +0000 Subject: Finish off the dummy minidriver integration: - Try to disambiguates minidriver options from "standard" driver options. - Make minidummy symbols more explict about being a minidriver. - Move minidummy.c into minidummy directory to put it with its header. In configure.in: - Improve configuration option to allow new minidriver implementations: - Change option from --enable-minidummy to --enable-minidriver-dummy. - Move it to the end of the list of options. - Provides a clear pattern for future minidrivers. - Update handling of HAVE_JTAG_MINIDRIVER_H: - Check for external jtag_minidriver.h only with --enable-ecosboard. - Otherwise, define it when --enable-minidriver-dummy is provided. - Add check to ensure only one minidriver is enabled. - When a minidriver is enabled, warn user that standard drivers are not built. - Use proper AC_DEFINE semantics with MINIDRIVER_DUMMY. In src/jtag/Makefile.am: - Restructure handling of minidummy source files. - Include minidummy driver header in the distribution. In src/jtag/jtag.c: - Restructure preprocessor logic to include: - only one minidriver, or - all configured standard drivers. git-svn-id: svn://svn.berlios.de/openocd/trunk@2102 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- configure.in | 55 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 12 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 9cb4ef49..7dbdebc6 100644 --- a/configure.in +++ b/configure.in @@ -13,7 +13,6 @@ AC_CHECK_HEADERS(elf.h) AC_CHECK_HEADERS(dirent.h) AC_CHECK_HEADERS(fcntl.h) AC_CHECK_HEADERS(ifaddrs.h) -AC_CHECK_HEADERS(jtag_minidriver.h,[build_minidriver=yes],[build_minidriver=no]) AC_CHECK_HEADERS(malloc.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(netinet/in.h) @@ -323,10 +322,6 @@ AC_ARG_ENABLE(ecosboard, AS_HELP_STRING([--enable-ecosboard], [Enable building support for eCosBoard based JTAG debugger]), [build_ecosboard=$enableval], [build_ecosboard=no]) -AC_ARG_ENABLE(minidummy, - AS_HELP_STRING([--enable-minidummy], [Enable building support for minidummy driver]), - [build_minidummy=$enableval], [build_minidummy=no]) - AC_ARG_ENABLE(ioutil, AS_HELP_STRING([--enable-ioutil], [Enable ioutil functions - useful for standalone OpenOCD implementations]), [build_ioutil=$enableval], [build_ioutil=no]) @@ -388,6 +383,47 @@ AC_ARG_ENABLE(arm-jtag-ew, AS_HELP_STRING([--enable-arm-jtag-ew], [Enable building support for the Olimex ARM-JTAG-EW Programmer]), [build_armjtagew=$enableval], [build_armjtagew=no]) +AC_ARG_ENABLE(minidriver_dummy, + AS_HELP_STRING([--enable-minidriver-dummy], [Enable the dummy minidriver.]), + [build_minidriver_dummy=$enableval], [build_minidriver_dummy=no]) + + +build_minidriver=no +AC_MSG_CHECKING([whether to enable ZY1000 minidriver]) +if test $build_ecosboard = yes; then + # check for that project's header file in the current header search path + AC_CHECK_HEADERS(jtag_minidriver.h, [build_minidriver=yes], + AC_MSG_WARN([The --enable-ecosboard option needs the out-of-tree 'jtag_minidriver.h']) + AC_MSG_ERROR([The out-of-tree jtag_minidriver.h cannot be found.]) + ) + build_minidriver=yes + AC_DEFINE(BUILD_MINIDRIVER_DUMMY, 1, [Use the dummy minidriver.]) +fi +AC_MSG_RESULT($build_ecosboard) + + +AC_MSG_CHECKING([whether to enable dummy minidriver]) +if test $build_minidriver_dummy = yes; then + if test $build_minidriver = yes; then + AC_MSG_ERROR([Multiple minidriver options have been enabled.]) + fi + build_minidriver=yes + AC_DEFINE(BUILD_MINIDRIVER_DUMMY, 1, [Use the dummy minidriver.]) + AC_DEFINE(HAVE_JTAG_MINIDRIVER_H, 1, + [Define to 1 if you have the header file.]) +fi +AC_MSG_RESULT($build_minidriver_dummy) + +AC_MSG_CHECKING([whether standard drivers can be built]) +if test "$build_minidriver" = yes; then + AC_MSG_RESULT([no]) + AC_MSG_WARN([Using the minidriver disables all other drivers.]) + sleep 2 +else + AC_MSG_RESULT([yes]) +fi + + case $host in *-cygwin*) is_win32=yes @@ -463,12 +499,6 @@ else AC_DEFINE(BUILD_ECOSBOARD, 0, [0 if you don't want eCosBoard.]) fi -if test $build_minidummy = yes; then - AC_DEFINE(BUILD_MINIDUMMY, 1, [1 if you want minidummy.]) -else - AC_DEFINE(BUILD_MINIDUMMY, 0, [0 if you don't want minidummy.]) -fi - if test $build_ioutil = yes; then AC_DEFINE(BUILD_IOUTIL, 1, [1 if you want ioutils.]) else @@ -845,7 +875,6 @@ AM_CONDITIONAL(DUMMY, test $build_dummy = yes) AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes) AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes) AM_CONDITIONAL(ECOSBOARD, test $build_ecosboard = yes) -AM_CONDITIONAL(MINIDUMMY, test $build_minidummy = yes) AM_CONDITIONAL(IOUTIL, test $build_ioutil = yes) AM_CONDITIONAL(HTTPD, test $build_httpd = yes) AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes) @@ -867,7 +896,9 @@ AM_CONDITIONAL(IS_MINGW, test $is_mingw = yes) AM_CONDITIONAL(IS_WIN32, test $is_win32 = yes) AM_CONDITIONAL(IS_DARWIN, test $is_darwin = yes) AM_CONDITIONAL(BITQ, test $build_bitq = yes) + AM_CONDITIONAL(MINIDRIVER, test $build_minidriver = yes) +AM_CONDITIONAL(MINIDRIVER_DUMMY, test $build_minidriver_dummy = yes) AC_LANG_C AC_PROG_CC -- cgit v1.2.3