summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2009-01-29 13:21:57 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2009-01-29 13:21:57 +0000
commit818621617d47a302bc8977c49c093e9c1c6cc8a9 (patch)
tree23409e5b449e057e83b3a3ec8fd4b978bb74face
parent70c3594bb06a8362b10ab82f2c703dd02644d14c (diff)
downloaduClibc-alpine-818621617d47a302bc8977c49c093e9c1c6cc8a9.tar.bz2
uClibc-alpine-818621617d47a302bc8977c49c093e9c1c6cc8a9.tar.xz
Synch build system with trunk.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
-rw-r--r--Makefile.in6
-rw-r--r--Rules.mak87
-rw-r--r--libpthread/nptl/Makefile.in2
-rw-r--r--librt/Makefile.in10
-rw-r--r--utils/Makefile.in35
5 files changed, 89 insertions, 51 deletions
diff --git a/Makefile.in b/Makefile.in
index 1fd169ab4..1fc7bf2f9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -137,7 +137,7 @@ endif
$(target-headers-sysdep): | include/bits
sysdep_common_headers-clean:
- $(RM) $(ALL_HEADERS_COMMON)
+ $(Q)$(RM) $(ALL_HEADERS_COMMON)
headers_clean-y += sysdep_common_headers-clean
# The headers. Arch specific headers are specified via ARCH_HEADERS in
@@ -209,8 +209,8 @@ install_headers: headers $(top_builddir)extra/scripts/unifdef
$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
top_builddir=$(top_builddir) \
$(top_srcdir)extra/scripts/install_headers.sh include $(PREFIX)$(DEVEL_PREFIX)include
- printf '#ifndef _LIBC_INTERNAL_H\n#define _LIBC_INTERNAL_H 1\n#endif\n' > \
- $(PREFIX)$(DEVEL_PREFIX)include/libc-internal.h
+ # Disabled. If libc-internal.h is needed, document here why!
+ printf '#ifndef _LIBC_INTERNAL_H\n#define _LIBC_INTERNAL_H 1\n#endif\n' >$(PREFIX)$(DEVEL_PREFIX)include/libc-internal.h
echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
$(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
$(RM) $(PREFIX)$(DEVEL_PREFIX)include/dl-osinfo.h
diff --git a/Rules.mak b/Rules.mak
index 0a28b625b..4c2b47344 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -5,6 +5,17 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
+# make nano-doc
+# FOO = bar -- recursively expanded variable. Value is remebered verbatim.
+# If it contains references to other variables, these references
+# are expanded whenever this variable is _substituted_.
+# FOO := bar -- simply expanded variable. Right hand is expanded when
+# the variable is _defined_. Therefore faster than =.
+# FOO ?= bar -- set a value only if it is not already set
+# (behaves as =, not :=).
+# FOO += bar -- append; if FOO is not defined, acts like = (not :=).
+
+
# check for proper make version
ifneq ($(findstring x3.7,x$(MAKE_VERSION)),)
$(error Your make is too old $(MAKE_VERSION). Go get at least 3.80)
@@ -66,6 +77,7 @@ export ARCH := $(shell uname -m | $(SED) -e s/i.86/i386/ \
# mortals. Unless you hang out with the gods, you should
# probably leave all this stuff alone.
+
# Pull in the user's uClibc configuration
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
-include $(top_builddir).config
@@ -148,7 +160,9 @@ check_ld=$(shell \
ARFLAGS:=cr
+
# Flags in OPTIMIZATION are used only for non-debug builds
+
OPTIMIZATION:=
# Use '-Os' optimization if available, else use -O2, allow Config to override
OPTIMIZATION+=$(call check_gcc,-Os,-O2)
@@ -168,6 +182,37 @@ OPTIMIZATION+=$(call check_gcc,-fno-tree-dominator-opts,)
OPTIMIZATION+=$(call check_gcc,-fno-strength-reduce,)
endif
+
+# CPU_CFLAGS-y contain options which are not warnings,
+# not include or library paths, and not optimizations.
+
+# Why -funsigned-char: I hunted a bug related to incorrect
+# sign extension of 'char' type for 10 hours straight. Not fun.
+CPU_CFLAGS-y := -funsigned-char -fno-builtin
+
+CPU_CFLAGS-y += $(call check_gcc,-fno-asm,)
+
+LDADD_LIBFLOAT=
+ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
+# If -msoft-float isn't supported, we want an error anyway.
+# Hmm... might need to revisit this for arm since it has 2 different
+# soft float encodings.
+ifneq ($(TARGET_ARCH),nios)
+ifneq ($(TARGET_ARCH),nios2)
+ifneq ($(TARGET_ARCH),sh)
+CPU_CFLAGS-y += -msoft-float
+endif
+endif
+endif
+ifeq ($(TARGET_ARCH),arm)
+# No longer needed with current toolchains, but leave it here for now.
+# If anyone is actually still using gcc 2.95 (say), they can uncomment it.
+# LDADD_LIBFLOAT=-lfloat
+endif
+endif
+
+CPU_CFLAGS-y += $(call check_gcc,-std=gnu99,)
+
CPU_CFLAGS-$(UCLIBC_FORMAT_SHARED_FLAT) += -mid-shared-library
CPU_CFLAGS-$(UCLIBC_FORMAT_FLAT_SEP_DATA) += -msep-data
@@ -468,9 +513,11 @@ ifeq ($(EXTRA_WARNINGS),y)
XWARNINGS+=-Wnested-externs -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wformat=2
XWARNINGS+=-Wmissing-prototypes -Wmissing-declarations
XWARNINGS+=-Wnonnull -Wundef
-# works only w/ gcc-3.4 and up, can't be checked for gcc-3.x w/ check_gcc()
+# Works only w/ gcc-3.4 and up, can't be checked for gcc-3.x w/ check_gcc()
#XWARNINGS+=-Wdeclaration-after-statement
endif
+# Seems to be unused (no ARCH_CFLAGS anywhere), delete?
+# if yes, remove after 0.9.31
XARCH_CFLAGS=$(subst ",, $(strip $(ARCH_CFLAGS)))
CPU_CFLAGS=$(subst ",, $(strip $(CPU_CFLAGS-y)))
@@ -484,41 +531,18 @@ SSP_CFLAGS := $(SSP_DISABLE_FLAGS)
endif
NOSTDLIB_CFLAGS:=$(call check_gcc,-nostdlib,)
-# Some nice CFLAGS to work with
-# Why -funsigned-char: I hunted a bug related to incorrect
-# sign extension of 'char' type for 10 hours straight. Not fun.
+
+# Collect all CFLAGS components
CFLAGS := -include $(top_builddir)include/libc-symbols.h \
$(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
- -funsigned-char -fno-builtin -nostdinc -I$(top_builddir)include -I. \
+ -nostdinc -I$(top_builddir)include -I. \
-I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
-
-# Make sure that we can be built with non-C99 compilers, too.
-# Use __\1__ instead.
-CFLAGS += $(call check_gcc,-fno-asm,)
ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
CFLAGS += $(subst ",, $(UCLIBC_EXTRA_CFLAGS))
endif
-LDADD_LIBFLOAT=
-ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
-# If -msoft-float isn't supported, we want an error anyway.
-# Hmm... might need to revisit this for arm since it has 2 different
-# soft float encodings.
-ifneq ($(TARGET_ARCH),nios)
-ifneq ($(TARGET_ARCH),nios2)
-ifneq ($(TARGET_ARCH),sh)
-CFLAGS += -msoft-float
-endif
-endif
-endif
-ifeq ($(TARGET_ARCH),arm)
-# No longer needed with current toolchains, but leave it here for now.
-# If anyone is actually still using gcc 2.95 (say), they can uncomment it.
-# LDADD_LIBFLOAT=-lfloat
-endif
-endif
-
# Please let us see private headers' parts
+# Deprecated: _LIBC serves the same purpose
CFLAGS += -DUCLIBC_INTERNAL
# We need this to be checked within libc-symbols.h
@@ -526,8 +550,6 @@ ifneq ($(HAVE_SHARED),y)
CFLAGS += -DSTATIC
endif
-CFLAGS += $(call check_gcc,-std=gnu99,)
-
LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -Wl,-shared \
-Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc
# binutils-2.16.1 warns about ignored sections, 2.16.91.0.3 and newer are ok
@@ -639,8 +661,9 @@ endif
CFLAGS += -I$(KERNEL_HEADERS)
#CFLAGS += -iwithprefix include-fixed -iwithprefix include
-CC_IPREFIX:=$(shell $(CC) --print-file-name=include)
-CFLAGS += -I$(dir $(CC_IPREFIX))/include-fixed -I$(CC_IPREFIX)
+CC_IPREFIX := $(shell $(CC) --print-file-name=include)
+CC_INC := -I$(dir $(CC_IPREFIX))include-fixed -I$(CC_IPREFIX)
+CFLAGS += $(CC_INC)
ifneq ($(DOASSERTS),y)
CFLAGS+=-DNDEBUG
diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
index 97560468d..8e3663c62 100644
--- a/libpthread/nptl/Makefile.in
+++ b/libpthread/nptl/Makefile.in
@@ -326,4 +326,4 @@ nptl_headers_clean:
$(addprefix $(PTHREAD_OUT)/pthread-errnos., c h s)
libpthread_clean:
- $(do_rm) $(addprefix $(PTHREAD_OUT)/*., o os oS a)
+ $(do_rm) $(addprefix $(PTHREAD_OUT)/*., o os oS a)
diff --git a/librt/Makefile.in b/librt/Makefile.in
index 8fe78da5b..d67960083 100644
--- a/librt/Makefile.in
+++ b/librt/Makefile.in
@@ -7,11 +7,13 @@
CFLAGS-librt := -DNOT_IN_libc -DIS_IN_librt $(SSP_ALL_CFLAGS)
-LDFLAGS-librt.so := $(LDFLAGS)
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
-LDFLAGS-librt.so += $(LDFLAGS) $(top_builddir)lib/libdl.so \
+LDFLAGS-librt.so := $(LDFLAGS) $(top_builddir)lib/libdl.so \
$(top_builddir)lib/libpthread.so
+else
+LDFLAGS-librt.so := $(LDFLAGS)
endif
+
LIBS-librt.so := $(LIBS)
librt_FULL_NAME := librt-$(VERSION).so
@@ -28,9 +30,8 @@ librt_SSRC := $(wildcard $(librt_DIR)/*.S)
librt_OBJ := $(patsubst %.c,$(librt_OUT)/%.o,$(librt_CSRC))
librt_OBJ += $(patsubst $(librt_DIR)/%.S,$(librt_OUT)/%.o,$(librt_SSRC))
else
-librt_CSRC := $(filter-out clock_nanosleep.c clock_getcpuclockid.c, \
+librt_SRC := $(filter-out clock_nanosleep.c clock_getcpuclockid.c, \
$(notdir $(wildcard $(librt_DIR)/*.c)))
-
librt_OBJ := $(patsubst $(librt_DIR)/%.c,$(librt_OUT)/%.o,$(librt_SRC))
endif
@@ -48,6 +49,7 @@ lib-a-y += $(top_builddir)lib/librt.a
lib-so-y += $(top_builddir)lib/librt.so
endif
+
ifeq ($(DOPIC)$(UCLIBC_HAS_THREADS_NATIVE),yn)
$(top_builddir)lib/librt.so: $(top_builddir)lib/librt.a $(libc.dpend)
else
diff --git a/utils/Makefile.in b/utils/Makefile.in
index 966821e1f..8023a2843 100644
--- a/utils/Makefile.in
+++ b/utils/Makefile.in
@@ -7,8 +7,12 @@
# "make utils" flags
-CFLAGS-utils := -DNOT_IN_libc $(SSP_ALL_CFLAGS) \
- -B$(top_builddir)lib -Wl,-rpath-link,$(top_builddir)lib
+CFLAGS-utils := \
+ $(SSP_ALL_CFLAGS) \
+ -I$(top_srcdir)/$(KERNEL_HEADERS) \
+ -DNOT_IN_libc \
+ -B$(top_builddir)lib \
+ -Wl,-rpath-link,$(top_builddir)lib
ifeq ($(UCLIBC_BUILD_PIE),y)
CFLAGS-utils-shared := $(PIEFLAG) $(LDPIEFLAG)
@@ -16,22 +20,29 @@ else
CFLAGS-utils-shared :=
endif
-CFLAGS-ldconfig := -I$(top_srcdir)ldso/include \
- -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO)
+CFLAGS-ldconfig := \
+ -I$(top_srcdir)ldso/include \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
+ -DUCLIBC_LDSO=$(UCLIBC_LDSO)
ifeq ($(UCLIBC_STATIC_LDCONFIG),y)
CFLAGS-ldconfig += -static
else
CFLAGS-ldconfig += $(CFLAGS-utils-shared)
endif
-CFLAGS-ldd := -I$(top_srcdir)ldso/include \
- -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
+CFLAGS-ldd := \
+ -I$(top_srcdir)ldso/include \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
+ -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
$(CFLAGS-utils-shared)
CFLAGS-readelf := $(CFLAGS-utils-shared)
# Need CFLAGS-utils explicitly, because the source file is not located in utils
-CFLAGS-iconv := $(CFLAGS-utils) $(CFLAGS-utils-shared) -DL_iconv_main
+CFLAGS-iconv := $(CFLAGS-utils) \
+ $(CFLAGS-utils-shared) \
+ -DL_iconv_main \
+
CFLAGS-locale := $(CFLAGS-utils)
@@ -44,13 +55,15 @@ endif
BUILD_CFLAGS-ldconfig.host := -Wl,-s \
-include $(top_srcdir)include/elf.h \
-I$(top_srcdir)ldso/include \
- -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
+ -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
$(LDSO_CACHE_SUPPORT) \
BUILD_CFLAGS-ldd.host := -Wl,-s \
-include $(top_srcdir)include/elf.h \
-I$(top_srcdir)ldso/include \
- -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
+ -DUCLIBC_LDSO=$(UCLIBC_LDSO) \
$(LDSO_CACHE_SUPPORT) \
BUILD_CFLAGS-readelf.host := -Wl,-s \
@@ -70,8 +83,8 @@ ifeq ($(HAVE_SHARED),y)
utils_OBJ += ldconfig ldd
endif
-utils_ICONV_OBJ =
-utils_LOCALE_OBJ =
+utils_ICONV_OBJ :=
+utils_LOCALE_OBJ :=
ifeq ($(UCLIBC_HAS_LOCALE),y)
utils_ICONV_OBJ := $(utils_OUT)/iconv
utils_LOCALE_OBJ := $(utils_OUT)/locale