#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:
Blocking:

Description

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/Makefile.am:libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -DRM52XX
c/src/lib/libbsp/mips/rbtx4938/Makefile.am:libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -DTX49
c/src/lib/libbsp/mips/jmr3904/Makefile.am:libbsp_a_CPPFLAGS = $(AM_CPPFLAGS) -DTX39
cpukit/pppd/Makefile.am:libpppd_a_CPPFLAGS = $(AM_CPPFLAGS) -D__BSD_VISIBLE -I$(srcdir)/../libmd
cpukit/libfs/Makefile.am:libjffs2_a_CPPFLAGS += -D__ECOS
cpukit/libfs/Makefile.am:libjffs2_a_CPPFLAGS += '-DKBUILD_MODNAME="JFFS2"'
cpukit/mghttpd/Makefile.am:# libmghttpd_a_CPPFLAGS += -DHAVE_MD5
cpukit/mghttpd/Makefile.am:libmghttpd_a_CPPFLAGS += -DNO_SSL -DNO_POPEN -DNO_CGI -DUSE_WEBSOCKET
cpukit/librpc/Makefile.am:librpc_CPPFLAGS = -D_RPC_read=read -D_RPC_write=write -D_RPC_close=close \
cpukit/libnetworking/Makefile.am:libnetworking_CPPFLAGS = -DINET -DNFS \
cpukit/libnetworking/Makefile.am:libc_CPPFLAGS = -DNOPOLL -DNOSELECT -D__BSD_VISIBLE -D_THREAD_SAFE
cpukit/libnetworking/Makefile.am:lib_CPPFLAGS = -DNOPOLL -DNOSELECT
cpukit/libnetworking/Makefile.am:lib_a_CPPFLAGS = $(AM_CPPFLAGS) $(lib_CPPFLAGS) -D__BSD_VISIBLE
cpukit/libdl/Makefile.am:libdl_a_CPPFLAGS = $(AM_CPPFLAGS) -DRTEMS_RTL_RAP_LOADER=1 -DRTEMS_RTL_ELF_LOADER=1

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 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 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 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/Makefile.am.

Update #3375.

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

In 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 06060da/rtems:

pppd: Simplify Makefile.am

Update #3375.

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

In 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 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 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 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 fb12215/rtems:

build: Remove specialized CPPFLAGS

Close #3375.

Note: See TracTickets for help on using tickets.