From a763de935e0fade325d62b04751a9bfba2c8bef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Sun, 30 Dec 2007 21:12:49 +0000 Subject: [PATCH] conditional build of SVF and BSDL components based on --enable-svf and --enable-bsdl git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@908 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 5 ++++ jtag/configure.ac | 54 +++++++++++++++++++++++++++++++++++++--- jtag/src/Makefile.am | 34 +++++++++++++++++++------ jtag/src/cmd/Makefile.am | 12 ++++++--- jtag/src/cmd/cmd.c | 8 ++++++ jtag/src/detect.c | 4 +++ 6 files changed, 102 insertions(+), 15 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 84f9541d..edd8b9d1 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,5 +1,10 @@ 2007-12-30 Arnim Laeuger + * src/detect.c (detect_parts): call bsdl_scan_file() if configure result indicates inclusion of BSDL subsystem + * src/cmd/cmd.c: include cmd_svf and cmd_bsdl based on configure result + * src/Makefile.am (jtag_DEPENDENCIES): link to libsvf.a and libbsdl.a based on configure result + * src/cmd/Makefile.am (libcmd_a_SOURCES): compile svf.c and bsdl.c based on configure result + * configure.ac: added --enable-svf and --enable-bsdl * README.svf: contents moved to doc/UrJTAG.txt, file deleted * data/Makefile.am (nobase_dist_pkgdata_DATA): fixed merge results * many files: integration of BSDL parser diff --git a/jtag/configure.ac b/jtag/configure.ac index 95659582..3f7491e6 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -305,6 +305,40 @@ AS_IF([test "x$ep9307" = xtrue], [ CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/include" + +dnl Disable SVF player? +AC_ARG_ENABLE(svf, +[ --enable-svf Enable SVF player (default is enabled)], +[case "${enableval}" in + yes) svf=true ;; + no) svf=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-svf) ;; + esac], +[svf=true]) +AS_IF([test "x$svf" = xtrue], [ + AM_CONDITIONAL(ENABLE_SVF, true) + AC_DEFINE(ENABLE_SVF, 1, [define if SVF player is enabled]) +],[ + AM_CONDITIONAL(ENABLE_SVF, false) +]) + + +dnl Disable BSDL subsystem? +AC_ARG_ENABLE(bsdl, +[ --enable-bsdl Enable BSDL subsystem (default is enabled)], +[case "${enableval}" in + yes) bsdl=true ;; + no) bsdl=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-bsdl) ;; + esac], +[bsdl=true]) +AS_IF([test "x$bsdl" = xtrue], [ + AM_CONDITIONAL(ENABLE_BSDL, true) + AC_DEFINE(ENABLE_BSDL, 1, [define if BSDL subsystem is enabled]) +],[ + AM_CONDITIONAL(ENABLE_BSDL, false) +]) + AC_OUTPUT dnl @@ -325,12 +359,24 @@ if test ${HAVELIBFTD2XX:-no} != no ; then else FLAG_HAVELIBFTD2XX=no fi +if test ${svf:-false} != false ; then + FLAG_SVF=yes +else + FLAG_SVF=no +fi +if test ${bsdl:-false} != false ; then + FLAG_BSDL=yes +else + FLAG_BSDL=no +fi AC_MSG_RESULT([ jtag is now configured for - USB cable support : $FLAG_HAVELIBUSB + USB cable support : $FLAG_HAVELIBUSB FTDI cable support - via libftdi : $FLAG_HAVELIBFTDI - via libftd2xx : $FLAG_HAVELIBFTD2XX - Parser error locations : $modern_flex ($LEX $flex_version) + via libftdi : $FLAG_HAVELIBFTDI + via libftd2xx : $FLAG_HAVELIBFTD2XX + SVF error locations : $modern_flex ($LEX $flex_version) + Build SVF player : $FLAG_SVF + Build BSDL subsystem : $FLAG_BSDL ]) diff --git a/jtag/src/Makefile.am b/jtag/src/Makefile.am index 03cb937f..156498d5 100644 --- a/jtag/src/Makefile.am +++ b/jtag/src/Makefile.am @@ -28,9 +28,15 @@ SUBDIRS = \ tap \ part \ bus \ - cmd \ - svf \ - bsdl + cmd + +if ENABLE_SVF +SUBDIRS += svf +endif + +if ENABLE_BSDL +SUBDIRS += bsdl +endif bin_PROGRAMS = \ jtag \ @@ -53,9 +59,15 @@ jtag_DEPENDENCIES = \ tap/libtap.a \ part/libpart.a \ bus/libbus.a \ - cmd/libcmd.a \ - svf/libsvf.a \ - bsdl/libbsdl.a + cmd/libcmd.a + +if ENABLE_SVF +jtag_DEPENDENCIES += svf/libsvf.a +endif + +if ENABLE_BSDL +jtag_DEPENDENCIES += bsdl/libbsdl.a +endif jtag_LDADD = \ -Ltap -ltap \ @@ -65,11 +77,17 @@ jtag_LDADD = \ -Lcmd -lcmd \ -L../libbrux -lbrux \ -Lbus -lbus \ - -Lsvf -lsvf \ - -Lbsdl -lbsdl \ -lm \ @FTD2XXLIB@ \ @LIBINTL@ +if ENABLE_SVF +jtag_LDADD += -Lsvf -lsvf +endif + +if ENABLE_BSDL +jtag_LDADD += -Lbsdl -lbsdl +endif + localedir = $(datadir)/locale INCLUDES = -DLOCALEDIR=\"$(localedir)\" diff --git a/jtag/src/cmd/Makefile.am b/jtag/src/cmd/Makefile.am index 1891beb7..eb56b687 100644 --- a/jtag/src/cmd/Makefile.am +++ b/jtag/src/cmd/Makefile.am @@ -55,8 +55,14 @@ libcmd_a_SOURCES = \ eraseflash.c \ script.c \ include.c \ - cmd.c \ - svf.c \ - bsdl.c + cmd.c + +if ENABLE_SVF +libcmd_a_SOURCES += svf.c +endif + +if ENABLE_BSDL +libcmd_a_SOURCES += bsdl.c +endif INCLUDES = -DJTAG_DATA_DIR=\"$(pkgdatadir)\" diff --git a/jtag/src/cmd/cmd.c b/jtag/src/cmd/cmd.c index 5a0f688a..25f29e35 100644 --- a/jtag/src/cmd/cmd.c +++ b/jtag/src/cmd/cmd.c @@ -63,8 +63,12 @@ extern cmd_t cmd_flashmem; extern cmd_t cmd_eraseflash; extern cmd_t cmd_script; extern cmd_t cmd_include; +#ifdef ENABLE_SVF extern cmd_t cmd_svf; +#endif +#ifdef ENABLE_BSDL extern cmd_t cmd_bsdl; +#endif extern cmd_t cmd_debug; const cmd_t *cmds[] = { @@ -100,8 +104,12 @@ const cmd_t *cmds[] = { &cmd_eraseflash, &cmd_script, &cmd_include, +#ifdef ENABLE_SVF &cmd_svf, +#endif +#ifdef ENABLE_BSDL &cmd_bsdl, +#endif &cmd_debug, NULL /* last must be NULL */ }; diff --git a/jtag/src/detect.c b/jtag/src/detect.c index 3cbae74e..0a17e4b2 100644 --- a/jtag/src/detect.c +++ b/jtag/src/detect.c @@ -276,7 +276,9 @@ detect_parts( chain_t *chain, char *db_path ) chain->active_part = ps->len - 1; +#ifdef ENABLE_BSDL if (bsdl_scan_files(register_get_string( did ), 1) <= 0) { +#endif /* find JTAG declarations for a part with id */ @@ -363,7 +365,9 @@ detect_parts( chain_t *chain, char *db_path ) strcpy( part->part, partname ); strcpy( part->stepping, stepping ); cmd_run( cmd ); +#ifdef ENABLE_BSDL } +#endif if (part->active_instruction == NULL) part->active_instruction = part_find_instruction( part, "IDCODE" );