aboutsummaryrefslogtreecommitdiff
path: root/Makefile.flags
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-23 12:12:03 +0000
committerRon Yorston <rmy@pobox.com>2012-03-23 12:12:03 +0000
commitb0f54743e36af163ae2530c381c485bb29df13dc (patch)
treecda4cfeaae6e47fe4f14c1b566092be4da9affc4 /Makefile.flags
parent40514a0309939f2446f0d4ed9600cad5de396e7f (diff)
parentba88826c66411affc1da3614742b454654f7298a (diff)
downloadbusybox-w32-b0f54743e36af163ae2530c381c485bb29df13dc.tar.gz
busybox-w32-b0f54743e36af163ae2530c381c485bb29df13dc.tar.bz2
busybox-w32-b0f54743e36af163ae2530c381c485bb29df13dc.zip
Merge branch 'busybox' into merge
Conflicts: Makefile.flags
Diffstat (limited to 'Makefile.flags')
-rw-r--r--Makefile.flags35
1 files changed, 30 insertions, 5 deletions
diff --git a/Makefile.flags b/Makefile.flags
index b653d55c1..2a3aa5812 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -97,6 +97,13 @@ CFLAGS += $(strip $(subst ",,$(CONFIG_EXTRA_CFLAGS)))
97#")) 97#"))
98endif 98endif
99 99
100# Note: both "" (string consisting of two quote chars) and empty string
101# are possible, and should be skipped below.
102ifneq ($(subst "",,$(CONFIG_SYSROOT)),)
103CFLAGS += --sysroot=$(CONFIG_SYSROOT)
104export SYSROOT=$(CONFIG_SYSROOT)
105endif
106
100ifeq ($(CONFIG_PLATFORM_MINGW32),y) 107ifeq ($(CONFIG_PLATFORM_MINGW32),y)
101# These defintions are not strictly needed, but they help shut up fnmatch.c warnings 108# These defintions are not strictly needed, but they help shut up fnmatch.c warnings
102CFLAGS += -Iwin32 -DHAVE_STRING_H=1 -DHAVE_CONFIG_H=0 -fno-builtin-stpcpy 109CFLAGS += -Iwin32 -DHAVE_STRING_H=1 -DHAVE_CONFIG_H=0 -fno-builtin-stpcpy
@@ -104,17 +111,25 @@ EXEEXT = .exe
104ifeq ($(CONFIG_WIN32_NET),y) 111ifeq ($(CONFIG_WIN32_NET),y)
105LDLIBS += ws2_32 112LDLIBS += ws2_32
106endif 113endif
107else 114endif
108ifneq ($(CONFIG_CROSS_COMPILER_PREFIX),"arm-linux-androideabi-") 115
116# Android has no separate crypt library
117CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) -lcrypt -o /dev/null -xc - >/dev/null 2>&1 && echo "y")
118ifeq ($(CRYPT_AVAILABLE),y)
109LDLIBS += m crypt 119LDLIBS += m crypt
110else 120else
111# Android libc has no crypt. TODO: make a generic CONFIG_LINK_WITH_CRYPT option?
112LDLIBS += m 121LDLIBS += m
113endif 122endif
114endif
115 123
116ifeq ($(CONFIG_PAM),y) 124ifeq ($(CONFIG_PAM),y)
117LDLIBS += pam pam_misc 125# libpam uses libpthread, so for static builds busybox must be linked to
126# libpthread. On some platforms that requires an explicit -lpthread, so
127# it should be in LDLIBS. For non-static builds, scripts/trylink will
128# take care of removing -lpthread if possible. (Not bothering to check
129# CONFIG_STATIC because even in a non-static build it could be that the
130# only libpam available is libpam.a, so -lpthread could still be
131# needed.)
132LDLIBS += pam pam_misc pthread
118endif 133endif
119 134
120ifeq ($(CONFIG_SELINUX),y) 135ifeq ($(CONFIG_SELINUX),y)
@@ -139,6 +154,16 @@ ifneq (,$(findstring $(W_ELF2FLT),$(LDFLAGS) $(CFLAGS_busybox)))
139SKIP_STRIP = y 154SKIP_STRIP = y
140endif 155endif
141 156
157ifneq ($(CONFIG_EXTRA_LDFLAGS),)
158EXTRA_LDFLAGS += $(strip $(subst ",,$(CONFIG_EXTRA_LDFLAGS)))
159#"))
160endif
161
162ifneq ($(CONFIG_EXTRA_LDLIBS),)
163LDLIBS += $(strip $(subst ",,$(CONFIG_EXTRA_LDLIBS)))
164#"))
165endif
166
142# Busybox is a stack-fatty so make sure we increase default size 167# Busybox is a stack-fatty so make sure we increase default size
143# TODO: use "make stksizes" to find & fix big stack users 168# TODO: use "make stksizes" to find & fix big stack users
144# (we stole scripts/checkstack.pl from the kernel... thanks guys!) 169# (we stole scripts/checkstack.pl from the kernel... thanks guys!)