Notice: We have migrated to GitLab launching 2024-05-01 see here:

#3375 closed enhancement (fixed)

Remove command line pre-processor defines

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: build Version: 5
Severity: normal Keywords:
Cc: Blocked By:


Command line defines defined by the build system make it difficult get a consistent view of the sources from other entities, e.g. static code analysis, code editors and reviews.

Command line defines are currently used here:

c/src/lib/libbsp/mips/hurricane/ = $(AM_CPPFLAGS) -DRM52XX
c/src/lib/libbsp/mips/rbtx4938/ = $(AM_CPPFLAGS) -DTX49
c/src/lib/libbsp/mips/jmr3904/ = $(AM_CPPFLAGS) -DTX39
cpukit/pppd/ = $(AM_CPPFLAGS) -D__BSD_VISIBLE -I$(srcdir)/../libmd
cpukit/libfs/ += -D__ECOS
cpukit/libfs/ += '-DKBUILD_MODNAME="JFFS2"'
cpukit/mghttpd/ libmghttpd_a_CPPFLAGS += -DHAVE_MD5
cpukit/librpc/ = -D_RPC_read=read -D_RPC_write=write -D_RPC_close=close \
cpukit/libnetworking/ = -DINET -DNFS \
cpukit/libnetworking/ = -DNOPOLL -DNOSELECT
cpukit/libnetworking/ = $(AM_CPPFLAGS) $(lib_CPPFLAGS) -D__BSD_VISIBLE

Change History (16)

comment:1 Changed on 03/27/18 at 06:15:31 by Chris Johns

What are you thinking of doing?

comment:2 Changed on 03/27/18 at 06:18:03 by Sebastian Huber

Move the defines to a header file.

comment:3 Changed on 03/27/18 at 23:09:52 by Joel Sherrill

For places where the source comes from other places (e.g. JFFS2, etc), what's the approach that doesn't modify the upstream source?

comment:4 Changed on 03/28/18 at 05:02:03 by Sebastian Huber

We just have to be careful to avoid potential conflicts with upstream merges. JFFS2 is the only area with an active upstream.

comment:5 in reply to:  4 Changed on 03/28/18 at 23:25:38 by Chris Johns

Replying to Sebastian Huber:

We just have to be careful to avoid potential conflicts with upstream merges. JFFS2 is the only area with an active upstream.

Thank you.

comment:6 Changed on 04/04/18 at 11:51:33 by Sebastian Huber <sebastian.huber@…>

In [changeset:"4f0dca3ad265e1871f9558497647a522548f62d5/rtems" 4f0dca3a/rtems]:

bsps: Move version.c and use bspopts.h

This patch is a part of the BSP source reorganization.

Update #3285.
Update #3375.

comment:7 Changed on 04/30/18 at 06:08:38 by Sebastian Huber <sebastian.huber@…>

In [changeset:"6ac6a5c86638742f77f941f16d2db3a3377ce3e5/rtems" 6ac6a5c8/rtems]:

jffs2: Do not use command line defines

Update #3375.

comment:8 Changed on 09/10/18 at 09:36:43 by Sebastian Huber <sebastian.huber@…>

In [changeset:"cb682532cf9927619a3c8d168253187140835cc6/rtems" cb68253/rtems]:

network: Use kernel/user space header files

Add and use <machine/rtems-bsd-kernel-space.h> and
<machine/rtems-bsd-user-space.h> similar to the libbsd to avoid command
line defines and defines scattered throught the code base.

Simplify cpukit/libnetworking/

Update #3375.

comment:9 Changed on 10/04/18 at 08:50:16 by Sebastian Huber <sebastian.huber@…>

In [changeset:"e069f7fe566f93e50d2559c04ff31cc334748e51/rtems" e069f7fe/rtems]:

rpc: Use configuration header file

Update #3375.

comment:10 Changed on 10/04/18 at 08:50:27 by Sebastian Huber <sebastian.huber@…>

In [changeset:"06060da3bc4ea255210a6b0bc5e4187227bf2f95/rtems" 06060da/rtems]:

pppd: Simplify

Update #3375.

comment:11 Changed on 10/04/18 at 08:50:37 by Sebastian Huber <sebastian.huber@…>

In [changeset:"2e77151e93c4083177a398581d4365fa284fa169/rtems" 2e77151/rtems]:

mghttpd: Add configuration to source file

Update #3375.

comment:12 Changed on 10/04/18 at 08:50:47 by Sebastian Huber <sebastian.huber@…>

In [changeset:"f373bdc0876c080ca99251abd7f377c81193cee5/rtems" f373bdc0/rtems]:

libdl: Avoid command line defines

Update #3375.

comment:13 Changed on 10/04/18 at 08:50:58 by Sebastian Huber <sebastian.huber@…>

In [changeset:"2d17e8827ea9c29182e5032f7bdf7cd5b4785064/rtems" 2d17e88/rtems]:

bsps/mips: Remove unused command line defines

Update #3375.

comment:14 Changed on 10/10/18 at 11:59:34 by Sebastian Huber <sebastian.huber@…>

In [changeset:"6cdaa850c8698b0949ebc393fc2e423762e85b94/rtems" 6cdaa85/rtems]:

shell: Use #include "..." for local header files

Update #3375.

comment:15 Changed on 10/13/18 at 22:52:24 by Joel Sherrill

How much is left to do on this ticket?

comment:16 Changed on 10/15/18 at 05:29:18 by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In [changeset:"fb12215c29613d2f79f9d8515f74e1f7fc72f2d0/rtems" fb12215/rtems]:

build: Remove specialized CPPFLAGS

Close #3375.

Note: See TracTickets for help on using tickets.