infra.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #ifndef CYGONCE_PKGCONF_INFRA_H
  2. # define CYGONCE_PKGCONF_INFRA_H
  3. //======================================================================
  4. //
  5. // infra.h
  6. //
  7. // Host side implementation of the infrastructure configuration
  8. // header.
  9. //
  10. //======================================================================
  11. // ####ECOSHOSTGPLCOPYRIGHTBEGIN####
  12. // -------------------------------------------
  13. // This file is part of the eCos host tools.
  14. // Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
  15. //
  16. // This program is free software; you can redistribute it and/or modify
  17. // it under the terms of the GNU General Public License as published by
  18. // the Free Software Foundation; either version 2 or (at your option) any
  19. // later version.
  20. //
  21. // This program is distributed in the hope that it will be useful, but
  22. // WITHOUT ANY WARRANTY; without even the implied warranty of
  23. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  24. // General Public License for more details.
  25. //
  26. // You should have received a copy of the GNU General Public License
  27. // along with this program; if not, write to the
  28. // Free Software Foundation, Inc., 51 Franklin Street,
  29. // Fifth Floor, Boston, MA 02110-1301, USA.
  30. // -------------------------------------------
  31. // ####ECOSHOSTGPLCOPYRIGHTEND####
  32. //======================================================================
  33. //#####DESCRIPTIONBEGIN####
  34. //
  35. // Author(s): bartv
  36. // Contact(s): bartv
  37. // Date: 1998/07/13
  38. // Version: 0.01
  39. //
  40. //####DESCRIPTIONEND####
  41. //======================================================================
  42. // The purpose of this header file is to replicate appropriate
  43. // functionality from the target-side header file <pkgconf/infra.h>.
  44. // This header file is intended to contain configuration options
  45. // related to the implementation of the infrastructure, as opposed
  46. // to how that infrastructure gets used by other packages. A good
  47. // example would be a configuration option to control the size
  48. // of the circular trace buffer.
  49. //
  50. // On the host side these things are handled by autoconf, and in
  51. // particular the configure.in script will offer command-line
  52. // arguments allowing the relevant options to be controlled.
  53. // The relevant information will end up in <cyg/pkgconf/hostinfra.h>
  54. # include <pkgconf/hostinfra.h>
  55. // Some options should always be enabled in this header file.
  56. #define CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG
  57. #define CYGDBG_INFRA_DEBUG_ASSERT_MESSAGE
  58. #define CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
  59. // Other options should be decided on a package by package basis,
  60. // e.g. whether or not assertions are used. On the host side it is
  61. // not appropriate to control these globally, instead the infrastructure
  62. // always provides the necessary functionality and it is up to the
  63. // other parts of the system to decide whether or not the facilities
  64. // get used.
  65. // A third set of options deal with the environment, e.g. the sizes
  66. // of various data types. autoconf macros take care of most of the
  67. // work, but some translation is needed into eCos-style names to
  68. // avoid namespace pollution.
  69. // Process the definitions of SIZEOF_INT_P and SIZEOF_LONG to work
  70. // out a sensible data type for CYG_ADDRESS and CYG_ADDRWORD.
  71. #if (!defined(SIZEOF_INT_P) || !defined(SIZEOF_LONG))
  72. # error "Configure problem: data type sizes not set"
  73. #endif
  74. #if (SIZEOF_INT_P == 4)
  75. // The default, nothing needs to be done
  76. #elif (SIZEOF_INT_P == 8)
  77. # define cyg_haladdress cyg_halint64
  78. #else
  79. # error "Only 32 and 64 bit pointers are supported"
  80. #endif
  81. #if ((SIZEOF_INT_P == 4) && (SIZEOF_LONG == 4))
  82. // The default, nothing needs to be done
  83. #elif ((SIZEOF_INT_P <= 8) && (SIZEOF_LONG <= 8))
  84. // cyg_halint64 will have been defined appropriately.
  85. # define cyg_haladdrword cyg_halint64
  86. #else
  87. # error "Only 32 and 64 bit machine word sizes are supported"
  88. #endif
  89. // Any symbols defined in <pkgconf/hostconf.h> which have been processed
  90. // here should no longer be of any interest, and in the interests of
  91. // reducing name space pollution they get undef'ed here.
  92. // In addition there are two #define's in the config.h header file
  93. // which are always present and which have names that are rather too
  94. // generic. These get removed here as well. The version is worth
  95. // preserving under a different name.
  96. #undef SIZEOF_INT_P
  97. #undef SIZEOF_LONG
  98. #undef PACKAGE
  99. #undef VERSION
  100. #endif // CYGONCE_PKGCONF_INFRA_H
  101. // End of infra.h