gzip: fix a case where tar xzf fails (we use uninitialized fd)
[oweals/busybox.git] / Makefile.flags
index b54679047c86c69cfcd3caf6527310a03383d488..c023299d737be6703bfa52653917393711b9cb81 100644 (file)
@@ -3,6 +3,7 @@
 # ==========================================================================
 
 BB_VER = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+export BB_VER
 SKIP_STRIP = n
 
 # -std=gnu99 needed for [U]LLONG_MAX on some systems
@@ -55,20 +56,35 @@ ifeq ($(CONFIG_DEBUG),y)
 CFLAGS += $(call cc-option,-g)
 endif
 
+ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
+# on i386: 14% smaller libbusybox.so
+# (code itself is 9% bigger, we save on relocs/PLT/GOT)
+CFLAGS += -fpic
+# and another 4% reduction of libbusybox.so:
+# (external entry points must be marked EXTERNALLY_VISIBLE)
+CFLAGS += $(call cc-option,-fvisibility=hidden)
+endif
+
 ifeq ($(CONFIG_STATIC),y)
 LDFLAGS += -static
 endif
 
+LDLIBS += m crypt
+
+ifeq ($(CONFIG_PAM),y)
+LDLIBS += pam pam_misc
+endif
+
 ifeq ($(CONFIG_SELINUX),y)
-LDLIBS += -lselinux -lsepol
+LDLIBS += selinux sepol
 endif
 
 ifeq ($(CONFIG_EFENCE),y)
-LDLIBS += -lefence
+LDLIBS += efence
 endif
 
 ifeq ($(CONFIG_DMALLOC),y)
-LDLIBS += -ldmalloc
+LDLIBS += dmalloc
 endif
 
 #LDFLAGS += -nostdlib