reduce compare noise. If someone should be crazy enough to try to run OpenOCD under eCos, then they'v got some hooks to point them in the general direction.

git-svn-id: svn://svn.berlios.de/openocd/trunk@499 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe 2008-03-11 21:32:03 +00:00
parent b9162dcc8e
commit 0313c59555
5 changed files with 48 additions and 5 deletions

View File

@ -55,6 +55,10 @@ case "${host_cpu}" in
AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]), AS_HELP_STRING([--enable-ep93xx], [Enable building support for EP93xx based SBCs]),
[build_ep93xx=$enableval], [build_ep93xx=no]) [build_ep93xx=$enableval], [build_ep93xx=no])
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(at91rm9200, AC_ARG_ENABLE(at91rm9200,
AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]), AS_HELP_STRING([--enable-at91rm9200], [Enable building support for AT91RM9200 based SBCs]),
[build_at91rm9200=$enableval], [build_at91rm9200=no]) [build_at91rm9200=$enableval], [build_at91rm9200=no])
@ -142,6 +146,13 @@ else
AC_DEFINE(BUILD_EP93XX, 0, [0 if you don't want ep93xx.]) AC_DEFINE(BUILD_EP93XX, 0, [0 if you don't want ep93xx.])
fi fi
if test $build_ecosboard = yes; then
build_bitbang=yes
AC_DEFINE(BUILD_ECOSBOARD, 1, [1 if you want eCosBoard.])
else
AC_DEFINE(BUILD_ECOSBOARD, 0, [0 if you don't want eCosBoard.])
fi
if test $build_at91rm9200 = yes; then if test $build_at91rm9200 = yes; then
build_bitbang=yes build_bitbang=yes
AC_DEFINE(BUILD_AT91RM9200, 1, [1 if you want at91rm9200.]) AC_DEFINE(BUILD_AT91RM9200, 1, [1 if you want at91rm9200.])
@ -229,6 +240,7 @@ AM_INIT_AUTOMAKE(openocd, 1.0)
AM_CONDITIONAL(PARPORT, test $build_parport = yes) AM_CONDITIONAL(PARPORT, test $build_parport = yes)
AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes) AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes)
AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes) AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes)
AM_CONDITIONAL(ECOSBOARD, test $build_ecosboard = yes)
AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes) AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes)
AM_CONDITIONAL(BITBANG, test $build_bitbang = yes) AM_CONDITIONAL(BITBANG, test $build_bitbang = yes)
AM_CONDITIONAL(FT2232_LIBFTDI, test $build_ft2232_libftdi = yes) AM_CONDITIONAL(FT2232_LIBFTDI, test $build_ft2232_libftdi = yes)

View File

@ -1,5 +1,13 @@
bin_PROGRAMS = openocd bin_PROGRAMS = openocd
openocd_SOURCES = openocd.c
if ECOSBOARD
MAINFILE = ecosboard.c
else
MAINFILE = openocd.c
endif
openocd_SOURCES = $(MAINFILE)
# set the include path found by configure # set the include path found by configure
INCLUDES = -I$(top_srcdir)/src/helper \ INCLUDES = -I$(top_srcdir)/src/helper \

View File

@ -2,7 +2,14 @@ INCLUDES = $(all_includes)
METASOURCES = AUTO METASOURCES = AUTO
AM_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" -DPKGLIBDIR=\"$(pkglibdir)\" @CPPFLAGS@ AM_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" -DPKGLIBDIR=\"$(pkglibdir)\" @CPPFLAGS@
noinst_LIBRARIES = libhelper.a noinst_LIBRARIES = libhelper.a
libhelper_a_SOURCES = binarybuffer.c configuration.c options.c log.c interpreter.c command.c time_support.c \
if ECOSBOARD
CONFIGFILES =
else
CONFIGFILES = options.c
endif
libhelper_a_SOURCES = binarybuffer.c $(CONFIGFILES) configuration.c log.c interpreter.c command.c time_support.c \
replacements.c fileio.c replacements.c fileio.c
noinst_HEADERS = binarybuffer.h configuration.h types.h log.h command.h \ noinst_HEADERS = binarybuffer.h configuration.h types.h log.h command.h \
interpreter.h time_support.h replacements.h fileio.h interpreter.h time_support.h replacements.h fileio.h

View File

@ -26,6 +26,12 @@
#include "types.h" #include "types.h"
#if BUILD_ECOSBOARD
#include <pkgconf/system.h>
#include <stdlib.h>
#include <sys/select.h>
#endif
/* include necessary headers for socket functionality */ /* include necessary headers for socket functionality */
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
@ -112,15 +118,19 @@ extern size_t strnlen(const char *s, size_t maxlen);
#endif /* HAVE_STRNLEN */ #endif /* HAVE_STRNLEN */
#ifndef HAVE_USLEEP #ifndef HAVE_USLEEP
#ifdef _WIN32
static __inline unsigned usleep(unsigned int usecs) static __inline unsigned usleep(unsigned int usecs)
{ {
#ifdef _WIN32
Sleep((usecs/1000)); Sleep((usecs/1000));
return 0; return 0;
}
#else
#if BUILD_ECOSBOARD
void usleep(int us);
#else #else
#error no usleep defined for your platform #error no usleep defined for your platform
#endif #endif
} #endif
#endif /* HAVE_USLEEP */ #endif /* HAVE_USLEEP */
/* Windows specific */ /* Windows specific */

View File

@ -47,6 +47,12 @@ else
EP93XXFILES = EP93XXFILES =
endif endif
if ECOSBOARD
ECOSBOARDFILES = eCosBoard.c
else
ECOSBOARDFILES =
endif
if AT91RM9200 if AT91RM9200
AT91RM9200FILES = at91rm9200.c AT91RM9200FILES = at91rm9200.c
else else
@ -82,6 +88,6 @@ USBPROGFILES =
endif endif
libjtag_a_SOURCES = jtag.c $(BITBANGFILES) $(PARPORTFILES) $(FT2232FILES) $(AMTJTAGACCELFILES) $(EP93XXFILES) \ libjtag_a_SOURCES = jtag.c $(BITBANGFILES) $(PARPORTFILES) $(FT2232FILES) $(AMTJTAGACCELFILES) $(EP93XXFILES) \
$(AT91RM9200FILES) $(GW16012FILES) $(BITQFILES) $(PRESTOFILES) $(USBPROGFILES) $(AT91RM9200FILES) $(GW16012FILES) $(BITQFILES) $(PRESTOFILES) $(USBPROGFILES) $(ECOSBOARDFILES)
noinst_HEADERS = bitbang.h jtag.h noinst_HEADERS = bitbang.h jtag.h