From e4acfbce624ad73f7b6e8f26ebe435c28714a948 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Mon, 23 Apr 2018 10:28:51 +0000 Subject: [PATCH] Refs #523, #529. Added bash-script for updating the pc-lint configuration files for the installed GCC version. Replaced deprecated libusb_set_debug() with libusb_set_option() for newer versions of Libusb. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@480 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- .../BootCommander/lint/gnu/update_gcc_cfg.sh | 19 +++++++++++++++++++ .../LibOpenBLT/lint/gnu/update_gcc_cfg.sh | 19 +++++++++++++++++++ Host/Source/LibOpenBLT/port/linux/usbbulk.c | 4 ++++ .../SeedNKey/lint/gnu/update_gcc_cfg.sh | 19 +++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100755 Host/Source/BootCommander/lint/gnu/update_gcc_cfg.sh create mode 100755 Host/Source/LibOpenBLT/lint/gnu/update_gcc_cfg.sh create mode 100755 Host/Source/SeedNKey/lint/gnu/update_gcc_cfg.sh diff --git a/Host/Source/BootCommander/lint/gnu/update_gcc_cfg.sh b/Host/Source/BootCommander/lint/gnu/update_gcc_cfg.sh new file mode 100755 index 00000000..6e7333fd --- /dev/null +++ b/Host/Source/BootCommander/lint/gnu/update_gcc_cfg.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Bash script to update the lint configuration files for the installed version of GCC. +# + +# Create temporary empty source-file +touch empty.c + +# Generate header file with preprocessor configuration macros to use by lint. +gcc -E -dM empty.c >lint_cmac.h + +# Generate lint configuration file with compiler include paths. +gcc -c -v empty.c 2>&1 | awk '/#include <...> search starts here:/{flag=1;next}/End of search list./{flag=0}flag' > gcc-include-path.lnt +sed -i 's# /#--i/#g' gcc-include-path.lnt + +# Remove temporary empty source-file +rm -f empty.c +rm -f empty.o + diff --git a/Host/Source/LibOpenBLT/lint/gnu/update_gcc_cfg.sh b/Host/Source/LibOpenBLT/lint/gnu/update_gcc_cfg.sh new file mode 100755 index 00000000..6e7333fd --- /dev/null +++ b/Host/Source/LibOpenBLT/lint/gnu/update_gcc_cfg.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Bash script to update the lint configuration files for the installed version of GCC. +# + +# Create temporary empty source-file +touch empty.c + +# Generate header file with preprocessor configuration macros to use by lint. +gcc -E -dM empty.c >lint_cmac.h + +# Generate lint configuration file with compiler include paths. +gcc -c -v empty.c 2>&1 | awk '/#include <...> search starts here:/{flag=1;next}/End of search list./{flag=0}flag' > gcc-include-path.lnt +sed -i 's# /#--i/#g' gcc-include-path.lnt + +# Remove temporary empty source-file +rm -f empty.c +rm -f empty.o + diff --git a/Host/Source/LibOpenBLT/port/linux/usbbulk.c b/Host/Source/LibOpenBLT/port/linux/usbbulk.c index bb686184..07a62e7a 100644 --- a/Host/Source/LibOpenBLT/port/linux/usbbulk.c +++ b/Host/Source/LibOpenBLT/port/linux/usbbulk.c @@ -104,7 +104,11 @@ void UsbBulkInit(void) if (libUsbCtx != NULL) { /* Set the log message verbosity as advised by the documentation. */ +#if LIBUSB_API_VERSION >= 0x01000106 + (void)libusb_set_option(libUsbCtx, LIBUSB_OPTION_LOG_LEVEL, (int)LIBUSB_LOG_LEVEL_WARNING); +#else libusb_set_debug(libUsbCtx, (int)LIBUSB_LOG_LEVEL_WARNING); +#endif } } /*** end of UsbBulkInit ***/ diff --git a/Host/Source/SeedNKey/lint/gnu/update_gcc_cfg.sh b/Host/Source/SeedNKey/lint/gnu/update_gcc_cfg.sh new file mode 100755 index 00000000..6e7333fd --- /dev/null +++ b/Host/Source/SeedNKey/lint/gnu/update_gcc_cfg.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Bash script to update the lint configuration files for the installed version of GCC. +# + +# Create temporary empty source-file +touch empty.c + +# Generate header file with preprocessor configuration macros to use by lint. +gcc -E -dM empty.c >lint_cmac.h + +# Generate lint configuration file with compiler include paths. +gcc -c -v empty.c 2>&1 | awk '/#include <...> search starts here:/{flag=1;next}/End of search list./{flag=0}flag' > gcc-include-path.lnt +sed -i 's# /#--i/#g' gcc-include-path.lnt + +# Remove temporary empty source-file +rm -f empty.c +rm -f empty.o +