#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 Mar 27, 2018 at 6:15:31 AM by Chris Johns

What are you thinking of doing?

comment:2 Changed on Mar 27, 2018 at 6:18:03 AM by Sebastian Huber

Move the defines to a header file.

comment:3 Changed on Mar 27, 2018 at 11:09:52 PM 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 Mar 28, 2018 at 5:02:03 AM 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 Mar 28, 2018 at 11:25:38 PM 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 Apr 4, 2018 at 11:51:33 AM 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 Apr 30, 2018 at 6:08:38 AM by Sebastian Huber <sebastian.huber@…>

In 6ac6a5c8/rtems:

jffs2: Do not use command line defines

Update #3375.

comment:8 Changed on Sep 10, 2018 at 9:36:43 AM 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 Oct 4, 2018 at 8:50:16 AM by Sebastian Huber <sebastian.huber@…>

In e069f7fe/rtems:

rpc: Use configuration header file

Update #3375.

comment:10 Changed on Oct 4, 2018 at 8:50:27 AM by Sebastian Huber <sebastian.huber@…>

In 06060da/rtems:

pppd: Simplify Makefile.am

Update #3375.

comment:11 Changed on Oct 4, 2018 at 8:50:37 AM by Sebastian Huber <sebastian.huber@…>

In 2e77151/rtems:

mghttpd: Add configuration to source file

Update #3375.

comment:12 Changed on Oct 4, 2018 at 8:50:47 AM by Sebastian Huber <sebastian.huber@…>

In f373bdc0/rtems:

libdl: Avoid command line defines

Update #3375.

comment:13 Changed on Oct 4, 2018 at 8:50:58 AM by Sebastian Huber <sebastian.huber@…>

In 2d17e88/rtems:

bsps/mips: Remove unused command line defines

Update #3375.

comment:14 Changed on Oct 10, 2018 at 11:59:34 AM by Sebastian Huber <sebastian.huber@…>

In 6cdaa85/rtems:

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

Update #3375.

comment:15 Changed on Oct 13, 2018 at 10:52:24 PM by Joel Sherrill

How much is left to do on this ticket?

comment:16 Changed on Oct 15, 2018 at 5:29:18 AM 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.