Changeset cd7d52d in rtems-libbsd


Ignore:
Timestamp:
Oct 10, 2017, 12:35:40 PM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
c1e05b9ea378b2971e3d7704779112b4bc4296da, 4a77611a223ea883fb548679b516d326a020d447
Children:
1043048
Parents:
acf428e
git-author:
Sebastian Huber <sebastian.huber@…> (10/10/17 12:35:40)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/10/17 13:18:08)
Message:

Update CONTRIBUTING.md

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CONTRIBUTING.md

    racf428e rcd7d52d  
    160160
    161161* Import and commit the unchanged source files like described above.
    162 * Add the files to the libbsd.py and build them.
     162* Add the files to the [libbsd.py](libbsd.py) and build them.
    163163* Check the sources for everything that can be made const. This type of patches
    164164  should go back to the upstream FreeBSD sources.
    165165* Move static variables out of functions if necessary (search for
    166   "<TAB>static"). These patches most likely will not be accepted into FreeBSD.
     166  "\tstatic"). These patches most likely will not be accepted into FreeBSD.
    167167* Add a rtems_bsd_command_PROGNAME() wrapper function to the source file
    168168  containing the main function (e.g. PROGNAME = pfctl). For an example look at
    169   `rtems_bsd_command_pfctl()` in `freebsd/sbin/pfctl/pfctl.c`.
     169  `rtems_bsd_command_pfctl()` in [pfctl.c](freebsd/sbin/pfctl/pfctl.c).
    170170* You probably have to use getopt_r() instead of getopt(). Have a look at
    171   `freebsd/sbin/pfctl/pfctl.c`.
     171  [pfctl.c](freebsd/sbin/pfctl/pfctl.c).
    172172* Build the libbsd without optimization.
    173173* Use the `userspace-header-gen.py` to generate some necessary header
     
    181181* If you regenerated files that have already been generated, you may have to
    182182  remove RTEMS-specific names from the namespace. The defaults (linker set names
    183   and rtems_bsd_program_xxx) should already be filtered.
     183  and rtems_bsd_program_.*) should already be filtered.
    184184* Put the generated header files into the same folder like the source files.
    185 * Include `PROGNAME-rtems-bsd-namespace.h` at the top of each source file and
    186   the `PROGNAME-rtems-bsd-MODULE-data.h` after the include section of the
    187   corresponding source files.
    188 * Include `machine/rtems-bsd-program.h` at the top of the include block in each
    189   source file.
     185* At the top of each source file place the following right after the user-space header:
     186  ```c
     187  #ifdef __rtems__
     188  #include <machine/rtems-bsd-program.h>
     189  #include "rtems-bsd-PROGNAME-namespace.h"
     190  #endif /* __rtems__ */
     191  ```
     192  The following command may be useful:
     193  ```
     194  sed -i 's%#include <machine/rtems-bsd-user-space.h>%#include <machine/rtems-bsd-user-space.h>\n#ifdef __rtems__\n#include <machine/rtems-bsd-program.h>\n#include "rtems-bsd-PROGNAME-namespace.h"\n#endif /* __rtems__ */%' *.c
     195  ```
     196* At the bottom of each source file place the follwing:
     197  ```c
     198  #ifdef __rtems__
     199  #include "rtems-bsd-PROGNAME-FILE-data.h"
     200  #endif /* __rtems__ */
     201  ```
     202  The following command may be useful:
     203  ```
     204  for i in *.c ; do n=$(basename $i .c) ; echo -e "#ifdef __rtems__\n#include \"rtems-bsd-PROGNAME-$n-data.h\"\n#endif /* __rtems__ */" >> $i ; done
     205  ```
    190206* Create one compilable commit.
    191207
Note: See TracChangeset for help on using the changeset viewer.