Skip to content

Commit

Permalink
Fix the test build system by installing headers on a local folder
Browse files Browse the repository at this point in the history
instead of using internal headers.

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
  • Loading branch information
amorosoc committed Jul 8, 2008
1 parent 1e85d9e commit 9be4958
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
18 changes: 16 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ HEADERS_BITS_SUBARCH :=
ifneq ($(TARGET_SUBARCH),)
HEADERS_BITS_SUBARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/*.h))
endif
HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH) $(HEADERS_BITS_SUBARCH),$(HEADERS_BITS_COMMON))
HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH) $(HEADERS_BITS_SUBARCH) $(HEADERS_BITS_PTHREAD),$(HEADERS_BITS_COMMON))

HEADERS_SYS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/sys/*.h))
HEADERS_SYS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/sys/*.h))
Expand Down Expand Up @@ -152,6 +152,15 @@ include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscall_h.sh
mv -f $$tmp include/bits/sysnum.h; \
fi

$(LOCAL_INSTALL_PATH):
$(Q)$(MAKE) PREFIX=$(shell pwd)/ RUNTIME_PREFIX=./ \
DEVEL_PREFIX=$(LOCAL_INSTALL_PATH)/usr/ \
HOSTCC="$(HOSTCC)" \
install_kernel_headers
$(Q)$(MAKE) PREFIX=$(shell pwd)/ RUNTIME_PREFIX=./ \
DEVEL_PREFIX=$(LOCAL_INSTALL_PATH)/usr/ \
HOSTCC="$(HOSTCC)" \
install_dev

install: install_runtime install_dev

Expand Down Expand Up @@ -451,7 +460,8 @@ clean:
$(Q)$(RM) -r lib include/bits
$(RM) ldso/*/*.a libpthread/*/*.a libc/*.a libcrypt/*.a libintl/*.a \
libm/*.a libnsl/*.a libpthread/*.a libresolv/*.a librt/*.a \
libutil/*.a lib/*.a
libutil/*.a lib/*.a \
include/fpu_control.h include/dl-osinfo.h include/hp-timing.h
$(MAKE) objclean-y headers_clean-y
$(MAKE) -s -C test clean
$(MAKE) -C utils utils_clean
Expand All @@ -466,6 +476,7 @@ clean:
fi
@$(RM) include/linux include/asm*
$(RM) $(top_builddir)extra/scripts/unifdef
$(RM) -r $(LOCAL_INSTALL_PATH)

distclean: clean
-find . \( -name core -o -name \*.orig -o -name \*~ -o -name .\*.dep \) -exec $(RM) {} \;
Expand All @@ -481,3 +492,6 @@ dist release:

test check:
$(Q)$(MAKE) -C test

test_compile: $(LOCAL_INSTALL_PATH)
$(Q)$(MAKE) -C test compile
2 changes: 2 additions & 0 deletions Rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,5 @@ ifeq ($(UCLIBC_CTOR_DTOR),y)
SHARED_START_FILES:=$(top_builddir)lib/crti.o $(LIBGCC_DIR)crtbeginS.o
SHARED_END_FILES:=$(LIBGCC_DIR)crtendS.o $(top_builddir)lib/crtn.o
endif

LOCAL_INSTALL_PATH := install_dir
9 changes: 7 additions & 2 deletions test/Rules.mak
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ endif
XWARNINGS := $(subst ",, $(strip $(WARNINGS))) -Wstrict-prototypes
XARCH_CFLAGS := $(subst ",, $(strip $(ARCH_CFLAGS))) $(CPU_CFLAGS)
XCOMMON_CFLAGS := -D_GNU_SOURCE -I$(top_builddir)test
CFLAGS += $(XWARNINGS) $(OPTIMIZATION) $(XCOMMON_CFLAGS) $(XARCH_CFLAGS) -I$(top_builddir)include $(PTINC)
CFLAGS := $(XWARNINGS) $(OPTIMIZATION) $(XCOMMON_CFLAGS) $(XARCH_CFLAGS) -nostdinc -I$(top_builddir)$(LOCAL_INSTALL_PATH)/usr/include

CC_IPREFIX:=$(shell $(CC) --print-file-name=include)
CFLAGS += -I$(CC_IPREFIX)

HOST_CFLAGS += $(XWARNINGS) $(OPTIMIZATION) $(XCOMMON_CFLAGS)

LDFLAGS := $(CPU_LDFLAGS)
Expand All @@ -97,11 +101,12 @@ ifneq ($(strip $(HAVE_SHARED)),y)
LDFLAGS += -static
HOST_LDFLAGS += -static
endif

LDFLAGS += -B$(top_builddir)lib -Wl,-rpath,$(top_builddir)lib -Wl,-rpath-link,$(top_builddir)lib
UCLIBC_LDSO_ABSPATH=$(shell pwd)
ifdef TEST_INSTALLED_UCLIBC
LDFLAGS += -Wl,-rpath,./
UCLIBC_LDSO_ABSPATH=/lib
UCLIBC_LDSO_ABSPATH=$(SHARED_LIB_LOADER_PREFIX)
endif

ifeq ($(findstring -static,$(LDFLAGS)),)
Expand Down
4 changes: 4 additions & 0 deletions test/signal/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# uClibc signal tests
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.

ifeq ($(UCLIBC_HAS_OBSOLETE_BSD_SIGNAL),)
TESTS_DISABLED := tst-sigsimple
endif

include ../Test.mak

0 comments on commit 9be4958

Please sign in to comment.