source: drbl_ui/backup/test_busybox/busybox-1.7.2/Makefile.flags @ 59

Last change on this file since 59 was 20, checked in by chris, 17 years ago
File size: 3.0 KB
RevLine 
[20]1# ==========================================================================
2# Build system
3# ==========================================================================
4
5BB_VER = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
6SKIP_STRIP = n
7
8# -std=gnu99 needed for [U]LLONG_MAX on some systems
9CPPFLAGS += $(call cc-option,-std=gnu99,)
10
11CPPFLAGS += \
12  -Iinclude -Ilibbb \
13  $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) -I$(srctree)/libbb \
14  -include include/autoconf.h \
15  -D_GNU_SOURCE -DNDEBUG \
16  $(if $(CONFIG_LFS),-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) \
17  -D"BB_VER=KBUILD_STR($(BB_VER))" -DBB_BT=AUTOCONF_TIMESTAMP
18
19# flag checks are grouped together to speed the checks up a bit..
20CFLAGS += $(call cc-option,-Wall -Wshadow -Wwrite-strings,)
21CFLAGS += $(call cc-option,-Wundef -Wstrict-prototypes,)
22# If you want to add "-Wmissing-prototypes -Wmissing-declarations" above
23# (or anything else for that matter) make sure that it is still possible
24# to build bbox without warnings. Current offender: find.c:alloc_action().
25# Looks more like gcc bug: gcc will warn on it with or without prototype.
26# But still, warning-free compile is a must, or else we will drown
27# in warnings pretty soon.
28
29ifeq ($(CONFIG_WERROR),y)
30CFLAGS += $(call cc-option,-Werror,)
31else
32# for development, warn a little bit about unused results..
33CPPFLAGS += -D_FORTIFY_SOURCE=2
34endif
35# gcc 3.x emits bogus "old style proto" warning on find.c:alloc_action()
36CFLAGS += $(call cc-ifversion, -ge, 0400, -Wold-style-definition)
37
38# gcc emits bogus "no prev proto" warning on find.c:alloc_action()
39ifneq ($(CONFIG_WERROR),y)
40CFLAGS += $(call cc-option,-Wmissing-prototypes -Wmissing-declarations,)
41endif
42
43CFLAGS += $(call cc-option,-Os -fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections,)
44# -fno-guess-branch-probability: prohibit pseudo-random guessing
45# of branch probabilities (hopefully makes bloatcheck more stable):
46CFLAGS += $(call cc-option,-fno-guess-branch-probability,)
47CFLAGS += $(call cc-option,-funsigned-char -static-libgcc,)
48CFLAGS += $(call cc-option,-falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1,)
49
50# FIXME: These warnings are at least partially to be concerned about and should
51# be fixed..
52#CFLAGS+=$(call cc-option,-Wconversion,)
53
54ifeq ($(CONFIG_DEBUG),y)
55CFLAGS += $(call cc-option,-g)
56endif
57
58ifeq ($(CONFIG_STATIC),y)
59LDFLAGS += -static
60endif
61
62BBOX_LIB_LIST = m crypt
63
64ifeq ($(CONFIG_PAM),y)
65BBOX_LIB_LIST += pam pam_misc
66endif
67
68ifeq ($(CONFIG_SELINUX),y)
69BBOX_LIB_LIST += selinux sepol
70endif
71
72ifeq ($(CONFIG_EFENCE),y)
73BBOX_LIB_LIST += efence
74endif
75
76ifeq ($(CONFIG_DMALLOC),y)
77BBOX_LIB_LIST += dmalloc
78endif
79
80# For scripts/trylink
81export BBOX_LIB_LIST
82
83#LDFLAGS += -nostdlib
84
85LDFLAGS_ELF2FLT = -Wl,-elf2flt
86ifneq (,$(findstring $(LDFLAGS_ELF2FLT),$(LDFLAGS)))
87SKIP_STRIP = y
88endif
89
90# Busybox is a stack-fatty so make sure we increase default size
91# TODO: use "make stksizes" to find & fix big stack users
92# (we stole scripts/checkstack.pl from the kernel... thanks guys!)
93FLTFLAGS += -s 20000
Note: See TracBrowser for help on using the repository browser.