source: rtems/cpukit/include/rtems/bspcmdline.h @ 2afb22b

Last change on this file since 2afb22b was 2afb22b, checked in by Chris Johns <chrisj@…>, on Dec 23, 2017 at 7:18:56 AM

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/**
2 * @file rtems/bspcmdline.h
3 *
4 * @defgroup BSPCommandLine BSP Command Line Helpers
5 *
6 * @ingroup libmisc
7 * @brief BSP Command Line Handler
8 *
9 * This include file contains all prototypes and specifications
10 * related to the BSP Command Line String and associated helper
11 * routines. The helpers are useful for locating command line
12 * type arguments (e.g. --mode) and their associated right
13 * hand side (e.g. FAST in --mode=FAST).
14 */
15
16/*
17 *  COPYRIGHT (c) 1989-2009.
18 *  On-Line Applications Research Corporation (OAR).
19 *
20 *  The license and distribution terms for this file may be
21 *  found in the file LICENSE in this distribution or at
22 *  http://www.rtems.org/license/LICENSE.
23 */
24
25#ifndef __BSP_COMMAND_LINE_h
26#define __BSP_COMMAND_LINE_h
27
28/**
29 * @defgroup BSPCommandLine BSP Command Line Helpers
30 *
31 * The BSP Command Line Handler provides a set of routines which assist
32 * in examining and decoding the Command Line String passed to the BSP
33 * at boot time.
34 */
35/**@{*/
36
37#include <stddef.h> /* for size_t */
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43
44/**
45 * @brief Obtain Pointer to BSP Boot Command String
46 *
47 * This method returns a pointer to the BSP Boot Command String. It
48 * is as likely to be NULL as point to a string as most BSPs do not
49 * have a start environment that provides a boot string.
50 *
51 * @retval This method returns the pointer to the BSP Boot Command String.
52 */
53const char *rtems_bsp_cmdline_get(void);
54
55/**
56 * @brief Obtain COPY of the Entire Matching Argument
57 *
58 * This method searches for the argument @a name in the BSP Boot Command
59 * String and returns a copy of the entire string associated with it in
60 * @a value up to a string of @a length. This will include the argument
61 * and any right hand side portion of the string. For example, one might
62 * be returned --mode=FAST if
63 * searching for --mode.
64 *
65 * @param[in] name is the arugment to search for
66 * @param[in] value points to where the contents will
67 *            be placed if located.
68 * @param[in] length is the maximum length to copy
69 *
70 * @return This method returns NULL if not found and
71 *         @a value if found.
72 */
73const char *rtems_bsp_cmdline_get_param(
74  const char *name,
75  char       *value,
76  size_t      length
77);
78
79
80/**
81 * @brief Obtain COPY of the Right Hand Side of the Matching Argument
82 *
83 * This method searches for the argument @a name in
84 * the BSP Boot Command String and returns the right hand side
85 * associated with it in @a value up to a maximum string @a length.
86 * This will NOT include the argument but only any right hand side
87 * portion of the string. *  For example, one might be returned FAST if
88 * searching for --mode.
89 *
90 * @param[in] name is the arugment to search for
91 * @param[in] value points to where the contents will
92 *            be placed if located.
93 * @param[in] length is the maximum length to copy
94 *
95 * @retval This method returns NULL if not found and
96 *         @a value if found.
97 */
98const char *rtems_bsp_cmdline_get_param_rhs(
99  const char *name,
100  char       *value,
101  size_t      length
102);
103
104/**
105 * @brief Obtain Pointer to the Entire Matching Argument
106 *
107 * This method searches for the argument @a name in
108 * the BSP Boot Command String and returns a pointer to the
109 * entire string associated with it. This will include the
110 * argument and any right hand side portion of the string.
111 * For example, one might be returned --mode=FAST if
112 * searching for --mode.
113 *
114 * @param[in] name is the arugment to search for
115 *
116 * @retval This method returns NULL if not found and a pointer
117 *         into the BSP Boot Command String if found.
118 *
119 * @note The pointer will be to the original BSP Command
120 *       Line string. Exercise caution when using this.
121 */
122const char *rtems_bsp_cmdline_get_param_raw(
123  const char *name
124);
125
126#ifdef __cplusplus
127}
128#endif
129
130/**@}*/
131#endif
Note: See TracBrowser for help on using the repository browser.