Browse Source

Cleanup of config/includes.

Remove a use of AH_BOTTOM from configure.ac. This macro is used by
autoheader to add '#include' of some include file to the end of
config.h.in and then to config.h. OpenOCD can be built with a custom
config.h, so it's preferable to move these '#include' statement directly
in the C files that need them dropping this unneeded dependency.

It also causes problems when I want to use the gnulib library (which
comes with its own Makefile, and does not have the same include path as
the top-level Makefile).

So this change touches a lot of files, but is actually really simple. It
does not affect functionality at all.

Change-Id: I52c70bf15eb2edc1dd10e0fde23b2bcd4caec000
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/6171
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
jim
Tim Newsome 2 years ago
committed by Antonio Borneo
parent
commit
87c90393fe
56 changed files with 81 additions and 17 deletions
  1. +0
    -5
      configure.ac
  2. +1
    -0
      src/flash/common.h
  3. +1
    -0
      src/flash/nor/bluenrg-x.c
  4. +1
    -0
      src/helper/binarybuffer.c
  5. +1
    -0
      src/helper/bits.h
  6. +2
    -0
      src/helper/configuration.c
  7. +1
    -0
      src/helper/fileio.c
  8. +2
    -0
      src/helper/fileio.h
  9. +1
    -0
      src/helper/log.c
  10. +1
    -0
      src/helper/options.c
  11. +1
    -0
      src/helper/replacements.c
  12. +1
    -0
      src/helper/replacements.h
  13. +9
    -9
      src/helper/system.h
  14. +1
    -0
      src/helper/time_support.h
  15. +2
    -0
      src/jtag/aice/aice_pipe.c
  16. +1
    -0
      src/jtag/aice/aice_transport.c
  17. +1
    -0
      src/jtag/aice/aice_usb.c
  18. +1
    -0
      src/jtag/core.c
  19. +1
    -0
      src/jtag/drivers/arm-jtag-ew.c
  20. +1
    -0
      src/jtag/drivers/cmsis_dap.c
  21. +2
    -0
      src/jtag/drivers/cmsis_dap_usb_bulk.c
  22. +1
    -0
      src/jtag/drivers/cmsis_dap_usb_hid.c
  23. +1
    -0
      src/jtag/drivers/ftdi.c
  24. +1
    -0
      src/jtag/drivers/jlink.c
  25. +1
    -0
      src/jtag/drivers/jtag_usb_common.c
  26. +3
    -0
      src/jtag/drivers/jtag_usb_common.h
  27. +1
    -1
      src/jtag/drivers/jtag_vpi.c
  28. +1
    -0
      src/jtag/drivers/mpsse.c
  29. +2
    -0
      src/jtag/drivers/remote_bitbang.c
  30. +1
    -0
      src/jtag/drivers/rlink.c
  31. +1
    -0
      src/jtag/drivers/rlink.h
  32. +1
    -0
      src/jtag/drivers/stlink_usb.c
  33. +1
    -0
      src/jtag/drivers/ulink.c
  34. +1
    -0
      src/jtag/drivers/usb_blaster/ublast2_access_libusb.c
  35. +1
    -0
      src/jtag/drivers/usb_blaster/usb_blaster.c
  36. +2
    -1
      src/jtag/drivers/versaloon/versaloon.c
  37. +1
    -0
      src/jtag/drivers/versaloon/versaloon_include.h
  38. +1
    -0
      src/jtag/jtag.h
  39. +1
    -0
      src/main.c
  40. +1
    -0
      src/pld/pld.c
  41. +1
    -1
      src/pld/xilinx_bit.c
  42. +2
    -0
      src/pld/xilinx_bit.h
  43. +1
    -0
      src/server/server.c
  44. +1
    -0
      src/server/server.h
  45. +1
    -0
      src/svf/svf.c
  46. +3
    -0
      src/target/algorithm.h
  47. +2
    -0
      src/target/armv4_5_cache.h
  48. +2
    -0
      src/target/breakpoints.h
  49. +1
    -0
      src/target/image.h
  50. +2
    -0
      src/target/nds32_edm.h
  51. +3
    -0
      src/target/register.h
  52. +1
    -0
      src/target/semihosting_common.h
  53. +2
    -0
      src/target/target.h
  54. +2
    -0
      src/target/trace.h
  55. +1
    -0
      src/transport/transport.c
  56. +1
    -0
      src/xsvf/xsvf.c

+ 0
- 5
configure.ac View File

@@ -17,11 +17,6 @@ AC_SUBST([MAKEINFO])
AM_INIT_AUTOMAKE([-Wall -Wno-portability dist-bzip2 dist-zip subdir-objects])

AC_CONFIG_HEADERS([config.h])
AH_BOTTOM([
#include <helper/system.h>
#include <helper/types.h>
#include <helper/replacements.h>
])

AC_LANG([C])
AC_PROG_CC


+ 1
- 0
src/flash/common.h View File

@@ -19,6 +19,7 @@
#define OPENOCD_FLASH_COMMON_H

#include <helper/log.h>
#include <helper/replacements.h>

/**
* Parses the optional '.index' portion of a flash bank identifier.


+ 1
- 0
src/flash/nor/bluenrg-x.c View File

@@ -20,6 +20,7 @@
#include "config.h"
#endif

#include "helper/types.h"
#include <target/algorithm.h>
#include <target/armv7m.h>
#include <target/cortex_m.h>


+ 1
- 0
src/helper/binarybuffer.c View File

@@ -23,6 +23,7 @@
#include "config.h"
#endif

#include "helper/replacements.h"
#include "log.h"
#include "binarybuffer.h"



+ 1
- 0
src/helper/bits.h View File

@@ -24,6 +24,7 @@
#ifndef OPENOCD_HELPER_BITS_H
#define OPENOCD_HELPER_BITS_H

#include <helper/replacements.h>
#include <helper/types.h>

#define BIT(nr) (1UL << (nr))


+ 2
- 0
src/helper/configuration.c View File

@@ -18,12 +18,14 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "configuration.h"
#include "log.h"
#include "replacements.h"

static size_t num_config_files;
static char **config_file_names;


+ 1
- 0
src/helper/fileio.c View File

@@ -29,6 +29,7 @@
#include "log.h"
#include "configuration.h"
#include "fileio.h"
#include "replacements.h"

struct fileio {
char *url;


+ 2
- 0
src/helper/fileio.h View File

@@ -25,6 +25,8 @@
#ifndef OPENOCD_HELPER_FILEIO_H
#define OPENOCD_HELPER_FILEIO_H

#include "types.h"

#define FILEIO_MAX_ERROR_STRING (128)

enum fileio_type {


+ 1
- 0
src/helper/log.c View File

@@ -28,6 +28,7 @@

#include "log.h"
#include "command.h"
#include "replacements.h"
#include "time_support.h"

#include <stdarg.h>


+ 1
- 0
src/helper/options.c View File

@@ -31,6 +31,7 @@

#include <limits.h>
#include <stdlib.h>
#include <string.h>
#if IS_DARWIN
#include <libproc.h>
#endif


+ 1
- 0
src/helper/replacements.c View File

@@ -62,6 +62,7 @@ void *fill_malloc(size_t size)

#ifdef _WIN32
#include <io.h>
#include <winsock2.h>
#endif

/* replacements for gettimeofday */


+ 1
- 0
src/helper/replacements.h View File

@@ -26,6 +26,7 @@
#define OPENOCD_HELPER_REPLACEMENTS_H

#include <stdint.h>
#include <helper/system.h>

/* MIN,MAX macros */
#ifndef MIN


+ 9
- 9
src/helper/system.h View File

@@ -21,6 +21,15 @@
#ifndef OPENOCD_HELPER_SYSTEM_H
#define OPENOCD_HELPER_SYSTEM_H

/* +++ platform specific headers +++ */
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <sys/types.h>
#include <sys/stat.h>
#endif
/* --- platform specific headers --- */

/* standard C library header files */
#include <stdio.h>
#include <stdlib.h>
@@ -34,15 +43,6 @@
#include <sys/time.h>
#endif

/* +++ platform specific headers +++ */
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <sys/types.h>
#include <sys/stat.h>
#endif
/* --- platform specific headers --- */

#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif


+ 1
- 0
src/helper/time_support.h View File

@@ -26,6 +26,7 @@
#define OPENOCD_HELPER_TIME_SUPPORT_H

#include <time.h>
#include "types.h"

#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>


+ 2
- 0
src/jtag/aice/aice_pipe.c View File

@@ -19,6 +19,8 @@
#include "config.h"
#endif

#include <helper/system.h>

#ifdef _WIN32
#include <windows.h>
#else


+ 1
- 0
src/jtag/aice/aice_transport.c View File

@@ -27,6 +27,7 @@
#include <target/target.h>
#include <jtag/aice/aice_interface.h>
#include <jtag/aice/aice_transport.h>
#include <string.h>

/* */
static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,


+ 1
- 0
src/jtag/aice/aice_usb.c View File

@@ -19,6 +19,7 @@
#include "config.h"
#endif

#include <helper/system.h>
#include <jtag/drivers/libusb_helper.h>
#include <helper/log.h>
#include <helper/time_support.h>


+ 1
- 0
src/jtag/core.c View File

@@ -35,6 +35,7 @@
#include "interface.h"
#include <transport/transport.h>
#include <helper/jep106.h>
#include "helper/system.h"

#ifdef HAVE_STRINGS_H
#include <strings.h>


+ 1
- 0
src/jtag/drivers/arm-jtag-ew.c View File

@@ -22,6 +22,7 @@

#include <jtag/interface.h>
#include <jtag/commands.h>
#include "helper/system.h"
#include "libusb_helper.h"

#define USB_VID 0x15ba


+ 1
- 0
src/jtag/drivers/cmsis_dap.c View File

@@ -36,6 +36,7 @@
#endif

#include <transport/transport.h>
#include "helper/replacements.h"
#include <jtag/swd.h>
#include <jtag/interface.h>
#include <jtag/commands.h>


+ 2
- 0
src/jtag/drivers/cmsis_dap_usb_bulk.c View File

@@ -35,8 +35,10 @@
#include "config.h"
#endif

#include <helper/system.h>
#include <libusb.h>
#include <helper/log.h>
#include <helper/replacements.h>

#include "cmsis_dap.h"



+ 1
- 0
src/jtag/drivers/cmsis_dap_usb_hid.c View File

@@ -35,6 +35,7 @@
#include "config.h"
#endif

#include <string.h>
#include <hidapi.h>
#include <helper/log.h>



+ 1
- 0
src/jtag/drivers/ftdi.c View File

@@ -74,6 +74,7 @@
#include <jtag/swd.h>
#include <transport/transport.h>
#include <helper/time_support.h>
#include <helper/log.h>

#if IS_CYGWIN == 1
#include <windows.h>


+ 1
- 0
src/jtag/drivers/jlink.c View File

@@ -39,6 +39,7 @@
#include <jtag/swd.h>
#include <jtag/commands.h>
#include <jtag/drivers/jtag_usb_common.h>
#include <src/helper/replacements.h>
#include <target/cortex_m.h>

#include <libjaylink/libjaylink.h>


+ 1
- 0
src/jtag/drivers/jtag_usb_common.c View File

@@ -4,6 +4,7 @@
*/

#include <helper/log.h>
#include <string.h>

#include "jtag_usb_common.h"



+ 3
- 0
src/jtag/drivers/jtag_usb_common.h View File

@@ -6,6 +6,9 @@
#ifndef OPENOCD_JTAG_USB_COMMON_H
#define OPENOCD_JTAG_USB_COMMON_H

#include <helper/replacements.h>
#include <helper/types.h>

void jtag_usb_set_location(const char *location);
const char *jtag_usb_get_location(void);
bool jtag_usb_location_equal(uint8_t dev_bus, uint8_t *port_path,


+ 1
- 1
src/jtag/drivers/jtag_vpi.c View File

@@ -33,7 +33,7 @@
#include <netinet/tcp.h>
#endif

#include <string.h>
#include "helper/replacements.h"

#define NO_TAP_SHIFT 0
#define TAP_SHIFT 1


+ 1
- 0
src/jtag/drivers/mpsse.c View File

@@ -22,6 +22,7 @@

#include "mpsse.h"
#include "helper/log.h"
#include "helper/replacements.h"
#include "helper/time_support.h"
#include <libusb.h>



+ 2
- 0
src/jtag/drivers/remote_bitbang.c View File

@@ -24,6 +24,8 @@
#include <sys/un.h>
#include <netdb.h>
#endif
#include "helper/system.h"
#include "helper/replacements.h"
#include <jtag/interface.h>
#include "bitbang.h"



+ 1
- 0
src/jtag/drivers/rlink.c View File

@@ -29,6 +29,7 @@
/* project specific includes */
#include <jtag/interface.h>
#include <jtag/commands.h>
#include "helper/replacements.h"
#include "rlink.h"
#include "rlink_st7.h"
#include "rlink_ep1_cmd.h"


+ 1
- 0
src/jtag/drivers/rlink.h View File

@@ -19,6 +19,7 @@
#ifndef OPENOCD_JTAG_DRIVERS_RLINK_H
#define OPENOCD_JTAG_DRIVERS_RLINK_H

#include "helper/types.h"
struct rlink_speed_table {
uint8_t const *dtc;
uint16_t dtc_size;


+ 1
- 0
src/jtag/drivers/stlink_usb.c View File

@@ -35,6 +35,7 @@
/* project specific includes */
#include <helper/binarybuffer.h>
#include <helper/bits.h>
#include <helper/system.h>
#include <jtag/interface.h>
#include <jtag/hla/hla_layout.h>
#include <jtag/hla/hla_transport.h>


+ 1
- 0
src/jtag/drivers/ulink.c View File

@@ -21,6 +21,7 @@
#endif

#include <math.h>
#include "helper/system.h"
#include <jtag/interface.h>
#include <jtag/commands.h>
#include <target/image.h>


+ 1
- 0
src/jtag/drivers/usb_blaster/ublast2_access_libusb.c View File

@@ -23,6 +23,7 @@
#endif
#include <jtag/interface.h>
#include <jtag/commands.h>
#include "helper/system.h"
#include <libusb_helper.h>
#include <target/image.h>



+ 1
- 0
src/jtag/drivers/usb_blaster/usb_blaster.c View File

@@ -77,6 +77,7 @@
#include <jtag/interface.h>
#include <jtag/commands.h>
#include <helper/time_support.h>
#include <helper/replacements.h>
#include "ublast_access.h"

/* system includes */


+ 2
- 1
src/jtag/drivers/versaloon/versaloon.c View File

@@ -19,11 +19,12 @@
#include "config.h"
#endif

#include "versaloon_include.h"

#include <stdio.h>
#include <string.h>
#include <libusb.h>

#include "versaloon_include.h"
#include "versaloon.h"
#include "versaloon_internal.h"
#include "usbtoxxx/usbtoxxx.h"


+ 1
- 0
src/jtag/drivers/versaloon/versaloon_include.h View File

@@ -18,6 +18,7 @@
#ifndef OPENOCD_JTAG_DRIVERS_VERSALOON_VERSALOON_INCLUDE_H
#define OPENOCD_JTAG_DRIVERS_VERSALOON_VERSALOON_INCLUDE_H

#include "helper/system.h"
/* This file is used to include different header and macros */
/* according to different platform */
#include <jtag/interface.h>


+ 1
- 0
src/jtag/jtag.h View File

@@ -24,6 +24,7 @@

#include <helper/binarybuffer.h>
#include <helper/log.h>
#include <helper/replacements.h>

#ifndef DEBUG_JTAG_IOZ
#define DEBUG_JTAG_IOZ 64


+ 1
- 0
src/main.c View File

@@ -20,6 +20,7 @@
#include "config.h"
#endif
#include "openocd.h"
#include "helper/system.h"

/* This is the main entry for developer PC hosted OpenOCD.
*


+ 1
- 0
src/pld/pld.c View File

@@ -22,6 +22,7 @@

#include "pld.h"
#include <helper/log.h>
#include <helper/replacements.h>
#include <helper/time_support.h>




+ 1
- 1
src/pld/xilinx_bit.c View File

@@ -25,7 +25,7 @@
#include <helper/log.h>

#include <sys/stat.h>
#include <helper/system.h>

static int read_section(FILE *input_file, int length_size, char section,
uint32_t *buffer_length, uint8_t **buffer)


+ 2
- 0
src/pld/xilinx_bit.h View File

@@ -19,6 +19,8 @@
#ifndef OPENOCD_PLD_XILINX_BIT_H
#define OPENOCD_PLD_XILINX_BIT_H

#include "helper/types.h"

struct xilinx_bit_file {
uint8_t unknown_header[13];
uint8_t *source_file;


+ 1
- 0
src/server/server.c View File

@@ -33,6 +33,7 @@
#include "openocd.h"
#include "tcl_server.h"
#include "telnet_server.h"
#include "time_support.h"

#include <signal.h>



+ 1
- 0
src/server/server.h View File

@@ -30,6 +30,7 @@
#endif

#include <helper/log.h>
#include <helper/replacements.h>

#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>


+ 1
- 0
src/svf/svf.c View File

@@ -31,6 +31,7 @@

#include <jtag/jtag.h>
#include "svf.h"
#include "helper/system.h"
#include <helper/time_support.h>

/* SVF command */


+ 3
- 0
src/target/algorithm.h View File

@@ -19,6 +19,9 @@
#ifndef OPENOCD_TARGET_ALGORITHM_H
#define OPENOCD_TARGET_ALGORITHM_H

#include "helper/types.h"
#include "helper/replacements.h"

enum param_direction {
PARAM_IN,
PARAM_OUT,


+ 2
- 0
src/target/armv4_5_cache.h View File

@@ -19,6 +19,8 @@
#ifndef OPENOCD_TARGET_ARMV4_5_CACHE_H
#define OPENOCD_TARGET_ARMV4_5_CACHE_H

#include "helper/types.h"

struct command_invocation;

struct armv4_5_cachesize {


+ 2
- 0
src/target/breakpoints.h View File

@@ -21,6 +21,8 @@

#include <stdint.h>

#include "helper/types.h"

struct target;

enum breakpoint_type {


+ 1
- 0
src/target/image.h View File

@@ -29,6 +29,7 @@
#define OPENOCD_TARGET_IMAGE_H

#include <helper/fileio.h>
#include <helper/replacements.h>

#ifdef HAVE_ELF_H
#include <elf.h>


+ 2
- 0
src/target/nds32_edm.h View File

@@ -19,6 +19,8 @@
#ifndef OPENOCD_TARGET_NDS32_EDM_H
#define OPENOCD_TARGET_NDS32_EDM_H

#include "helper/types.h"

/**
* @file
* This is the interface to the Embedded Debug Module for Andes cores.


+ 3
- 0
src/target/register.h View File

@@ -22,6 +22,9 @@
#ifndef OPENOCD_TARGET_REGISTER_H
#define OPENOCD_TARGET_REGISTER_H

#include "helper/replacements.h"
#include "helper/types.h"

struct target;

enum reg_type {


+ 1
- 0
src/target/semihosting_common.h View File

@@ -25,6 +25,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <time.h>
#include "helper/replacements.h"

/*
* According to:


+ 2
- 0
src/target/target.h View File

@@ -32,6 +32,8 @@
#define OPENOCD_TARGET_TARGET_H

#include <helper/list.h>
#include "helper/replacements.h"
#include "helper/system.h"
#include <jim.h>

struct reg;


+ 2
- 0
src/target/trace.h View File

@@ -19,6 +19,8 @@
#ifndef OPENOCD_TARGET_TRACE_H
#define OPENOCD_TARGET_TRACE_H

#include "helper/types.h"

struct target;
struct command_context;



+ 1
- 0
src/transport/transport.c View File

@@ -42,6 +42,7 @@
*/

#include <helper/log.h>
#include <helper/replacements.h>
#include <transport/transport.h>

extern struct command_context *global_cmd_ctx;


+ 1
- 0
src/xsvf/xsvf.c View File

@@ -39,6 +39,7 @@
#endif

#include "xsvf.h"
#include "helper/system.h"
#include <jtag/jtag.h>
#include <svf/svf.h>



Loading…
Cancel
Save