microcom: add copyright/license info
[oweals/busybox.git] / Makefile.flags
index 988d6e708062ccdb50eb612664e714b6dcf231ba..c64a5c8389402ca63ced398f6b9ebdd0779aa27c 100644 (file)
@@ -3,6 +3,7 @@
 # ==========================================================================
 
 BB_VER = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+SKIP_STRIP = n
 
 # -std=gnu99 needed for [U]LLONG_MAX on some systems
 CPPFLAGS += $(call cc-option,-std=gnu99,)
@@ -27,6 +28,9 @@ CFLAGS += $(call cc-option,-Wundef -Wstrict-prototypes,)
 
 ifeq ($(CONFIG_WERROR),y)
 CFLAGS += $(call cc-option,-Werror,)
+else
+# for development, warn a little bit about unused results..
+CPPFLAGS += -D_FORTIFY_SOURCE=2
 endif
 # gcc 3.x emits bogus "old style proto" warning on find.c:alloc_action()
 CFLAGS += $(call cc-ifversion, -ge, 0400, -Wold-style-definition)
@@ -55,19 +59,35 @@ ifeq ($(CONFIG_STATIC),y)
 LDFLAGS += -static
 endif
 
+BBOX_LIB_LIST = m crypt
+
+ifeq ($(CONFIG_PAM),y)
+BBOX_LIB_LIST += pam pam_misc
+endif
+
 ifeq ($(CONFIG_SELINUX),y)
-LDLIBS += -lselinux -lsepol
+BBOX_LIB_LIST += selinux sepol
 endif
 
 ifeq ($(CONFIG_EFENCE),y)
-LDLIBS += -lefence
+BBOX_LIB_LIST += efence
 endif
 
 ifeq ($(CONFIG_DMALLOC),y)
-LDLIBS += -ldmalloc
+BBOX_LIB_LIST += dmalloc
 endif
 
+# For scripts/trylink
+export BBOX_LIB_LIST
+
 #LDFLAGS += -nostdlib
 
+LDFLAGS_ELF2FLT = -Wl,-elf2flt
+ifneq (,$(findstring $(LDFLAGS_ELF2FLT),$(LDFLAGS)))
+SKIP_STRIP = y
+endif
+
 # Busybox is a stack-fatty so make sure we increase default size
+# TODO: use "make stksizes" to find & fix big stack users
+# (we stole scripts/checkstack.pl from the kernel... thanks guys!)
 FLTFLAGS += -s 20000