summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-06-20 11:26:36 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-06-20 11:26:36 +0000
commit8027784c3589198d3ba4b9a24b26c361462f1946 (patch)
tree2a666abbe874c367997a2b4830a16225086324cc /package
parent2c649045197156221cc1d3d6328abb1c405db700 (diff)
- add full sysroot support for non-ancient toolchains.
- start to separate usr/lib and lib to match normal system-layout
Diffstat (limited to 'package')
-rw-r--r--package/Makefile.in81
-rw-r--r--package/gmp/gmp.mk70
-rw-r--r--package/mdadm/mdadm.mk2
-rw-r--r--package/mpfr/mpfr.mk65
4 files changed, 114 insertions, 104 deletions
diff --git a/package/Makefile.in b/package/Makefile.in
index 733ff16ac..b619105bf 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -20,15 +20,52 @@ TAR_OPTIONS=$(subst ",, $(BR2_TAR_OPTIONS)) -xf
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
-TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
+TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) \
+ -I$(STAGING_DIR)/usr/include
+TARGET_LDFLAGS=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
+
+ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
+TARGET_CFLAGS+= $(BR2_SYSROOT) $(BR2_ISYSROOT)
+#TARGET_LDFLAGS=-Wl,$(BR2_SYSROOT)
+endif
+
+ifneq ($(BR2_PREFER_STATIC_LIB),y)
+ifeq ($(BR2_x86_64),y)
+TARGET_CFLAGS+=-fPIC -DPIC
+endif # PIC for dynamic objects on x86_64
+endif
+# else it's an external toolchain
else
TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include -I$(TOOLCHAIN_EXTERNAL_PATH)/$(TOOLCHAIN_EXTERNAL_PREFIX)/include
TARGET_LDFLAGS=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
endif
+
+ifndef HOSTAR
+HOSTAR:=ar
+endif
+ifndef HOSTAS
+HOSTAS:=as
+endif
+ifndef HOSTCC
HOSTCC:=gcc
+endif
+ifndef HOSTCXX
HOSTCXX:=g++
+endif
+ifndef HOSTLD
+HOSTLD:=ld
+endif
+HOSTAR:=$(shell which $(HOSTAR) || type -p $(HOSTAR) || echo ar)
+HOSTAS:=$(shell which $(HOSTAS) || type -p $(HOSTAS) || echo as)
+HOSTCC:=$(shell which $(HOSTCC) || type -p $(HOSTCC) || echo gcc)
+HOSTCXX:=$(shell which $(HOSTCXX) || type -p $(HOSTCXX) || echo g++)
+HOSTLD:=$(shell which $(HOSTLD) || type -p $(HOSTLD) || echo ld)
+ifndef CFLAGS_FOR_BUILD
+CFLAGS_FOR_BUILD:="-g -O2"
+endif
-BASE_DIR:=${shell pwd}
+
+BASE_DIR:=$(shell pwd)
TOPDIR_PREFIX:=$(strip $(subst ",, $(BR2_TOPDIR_PREFIX)))_
#"))
@@ -59,12 +96,12 @@ ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
TOOL_BUILD_DIR=$(BASE_DIR)/$(TOPDIR_PREFIX)toolchain_build_$(ARCH)$(ARCH_FPU_SUFFIX)$(TOPDIR_SUFFIX)
# Quotes are needed for spaces et al in path components.
-TARGET_PATH="$(STAGING_DIR)/bin:$(TOOL_BUILD_DIR)/bin:$(STAGING_DIR)/usr/bin:$(PATH)"
+TARGET_PATH="$(TOOL_BUILD_DIR)/bin:$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/bin:$(PATH)"
IMAGE:=$(BASE_DIR)/rootfs.$(ARCH)$(ARCH_FPU_SUFFIX)
-REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)$(GNU_TARGET_SUFFIX)
GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
-KERNEL_CROSS=$(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)$(GNU_TARGET_SUFFIX)-
-TARGET_CROSS=$(STAGING_DIR)/bin/$(OPTIMIZE_FOR_CPU)$(GNU_TARGET_SUFFIX)-
+REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)$(GNU_TARGET_SUFFIX)
+TARGET_CROSS=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-
+KERNEL_CROSS=$(TARGET_CROSS)
else
TOOLCHAIN_EXTERNAL_PREFIX:=$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_PREFIX)))
#"))
@@ -111,9 +148,36 @@ TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
RANLIB=$(TARGET_CROSS)ranlib \
STRIP=$(TARGET_CROSS)strip \
OBJCOPY=$(TARGET_CROSS)objcopy \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ AR_FOR_BUILD="$(HOSTAR)" \
+ AS_FOR_BUILD="$(HOSTAS)" \
+ CC_FOR_BUILD="$(HOSTCC)" \
+ CXX_FOR_BUILD="$(HOSTCXX)" \
+ LD_FOR_BUILD="$(HOSTLD)" \
+ CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
+ LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
+ PKG_CONFIG_SYSROOT="$(STAGING_DIR)" \
+ PKG_CONFIG="$(STAGING_DIR)/usr/bin/pkg-config"
+
+HOST_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
+ AR_FOR_BUILD="$(HOSTAR)" \
+ AS_FOR_BUILD="$(HOSTAS)" \
CC_FOR_BUILD="$(HOSTCC)" \
- PKG_CONFIG_SYSROOT=$(STAGING_DIR) \
- PKG_CONFIG=$(STAGING_DIR)/usr/bin/pkg-config
+ GCC_FOR_BUILD="$(HOSTCC)" \
+ CXX_FOR_BUILD="$(HOSTCXX)" \
+ LD_FOR_BUILD="$(HOSTLD)" \
+ CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
+ CXXFLAGS_FOR_BUILD="$(HOST_CXXFLAGS)" \
+ LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
+ AR_FOR_TARGET=$(TARGET_CROSS)ar \
+ AS_FOR_TARGET=$(TARGET_CROSS)as \
+ LD_FOR_TARGET=$(TARGET_CROSS)ld \
+ NM_FOR_TARGET=$(TARGET_CROSS)nm \
+ RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib \
+ STRIP_FOR_TARGET=$(TARGET_CROSS)strip \
+ OBJCOPY_FOR_TARGET=$(TARGET_CROSS)objcopy
+
ifeq ($(BR2_ENABLE_LOCALE),y)
@@ -130,6 +194,7 @@ ifeq ($(BR2_INSTALL_LIBSTDCPP),)
TARGET_CONFIGURE_OPTS+=CXX=""
endif
+
# X Windowing system
XSERVER:=
diff --git a/package/gmp/gmp.mk b/package/gmp/gmp.mk
index a4e36e73a..d928abc26 100644
--- a/package/gmp/gmp.mk
+++ b/package/gmp/gmp.mk
@@ -22,9 +22,7 @@ endif
# this is a workaround for a bug in GMP, please see
# http://gmplib.org/list-archives/gmp-devel/2006-April/000618.html
ifeq ($(HOST_EXEEXT),.exe)
-GMP_CPP_FLAGS:=-DDLL_EXPORT
-else
-GMP_CPP_FLAGS:=
+GMP_CPP_FLAGS:=CPPFLAGS=-DDLL_EXPORT
endif
$(DL_DIR)/$(GMP_SOURCE):
@@ -42,64 +40,39 @@ $(GMP_TARGET_DIR)/.configured: $(GMP_DIR)/.unpacked
mkdir -p $(GMP_TARGET_DIR)
(cd $(GMP_TARGET_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS)" \
- CPPFLAGS="$(GMP_CPP_FLAGS)" \
+ $(GMP_CPP_FLAGS) \
ac_cv_c_bigendian=$(GMP_BE) \
$(GMP_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
--prefix=/usr \
- --exec-prefix=/usr \
- --bindir=/usr/bin \
- --sbindir=/usr/sbin \
- --libdir=/lib \
- --libexecdir=/usr/lib \
- --sysconfdir=/etc \
- --datadir=/usr/share \
- --localstatedir=/var \
- --includedir=/include \
- --mandir=/usr/man \
- --infodir=/usr/info \
$(PREFERRED_LIB_FLAGS) \
$(DISABLE_NLS) \
);
touch $@
$(GMP_TARGET_DIR)/.libs/$(GMP_BINARY): $(GMP_TARGET_DIR)/.configured
- $(MAKE) CC=$(TARGET_CC) -C $(GMP_TARGET_DIR)
-
-$(STAGING_DIR)/lib/$(GMP_BINARY): $(GMP_TARGET_DIR)/.libs/$(GMP_BINARY)
- $(MAKE) prefix=$(STAGING_DIR) \
- exec_prefix=$(STAGING_DIR) \
- bindir=$(STAGING_DIR)/bin \
- sbindir=$(STAGING_DIR)/sbin \
- libexecdir=$(STAGING_DIR)/bin \
- datadir=$(STAGING_DIR)/share \
- sysconfdir=$(STAGING_DIR)/etc \
- sharedstatedir=$(STAGING_DIR)/com \
- localstatedir=$(STAGING_DIR)/var \
- libdir=$(STAGING_DIR)/lib \
- includedir=$(STAGING_DIR)/include \
- oldincludedir=$(STAGING_DIR)/include \
- infodir=$(STAGING_DIR)/info \
- mandir=$(STAGING_DIR)/man \
- -C $(GMP_TARGET_DIR) install
- $(STRIP) --strip-unneeded $(STAGING_DIR)/lib/libgmp$(LIBTGTEXT)*
-
-$(TARGET_DIR)/lib/libgmp.so $(TARGET_DIR)/lib/libgmp.so.$(GMP_LIBVERSION) $(TARGET_DIR)/lib/libgmp.a: $(STAGING_DIR)/lib/$(GMP_BINARY)
- cp -dpf $(STAGING_DIR)/lib/libgmp$(LIBTGTEXT)* $(TARGET_DIR)/lib/
+ #$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(GMP_TARGET_DIR)
+ $(MAKE) -C $(GMP_TARGET_DIR)
+
+$(STAGING_DIR)/usr/lib/$(GMP_BINARY): $(GMP_TARGET_DIR)/.libs/$(GMP_BINARY)
+ $(MAKE) DESTDIR=$(STAGING_DIR) -C $(GMP_TARGET_DIR) install
+ $(STRIP) --strip-unneeded $(STAGING_DIR)/usr/lib/libgmp$(LIBTGTEXT)*
+
+$(TARGET_DIR)/usr/lib/libgmp.so $(TARGET_DIR)/usr/lib/libgmp.so.$(GMP_LIBVERSION) $(TARGET_DIR)/usr/lib/libgmp.a: $(STAGING_DIR)/usr/lib/$(GMP_BINARY)
+ cp -dpf $(STAGING_DIR)/usr/lib/libgmp$(LIBTGTEXT)* $(TARGET_DIR)/usr/lib/
ifeq ($(BR2_PACKAGE_LIBGMP_HEADERS),y)
test -d $(TARGET_DIR)/usr/include || mkdir -p $(TARGET_DIR)/usr/include
- cp -dpf $(STAGING_DIR)/include/gmp.h $(TARGET_DIR)/usr/include/
+ cp -dpf $(STAGING_DIR)/usr/include/gmp.h $(TARGET_DIR)/usr/include/
endif
-libgmp: uclibc $(TARGET_DIR)/lib/libgmp$(LIBTGTEXT)
-stage-libgmp: uclibc $(STAGING_DIR)/lib/$(GMP_BINARY)
+libgmp: uclibc $(TARGET_DIR)/usr/lib/libgmp$(LIBTGTEXT)
+stage-libgmp: uclibc $(STAGING_DIR)/usr/lib/$(GMP_BINARY)
libgmp-clean:
- rm -f $(TARGET_DIR)/lib/libgmp.* $(TARGET_DIR)/usr/include/gmp.h
+ rm -f $(TARGET_DIR)/usr/lib/libgmp.* $(TARGET_DIR)/usr/include/gmp.h \
+ $(STAGING_DIR)/usr/lib/libgmp* $(STAGING_DIR)/usr/include/gmp.h
-$(MAKE) -C $(GMP_TARGET_DIR) clean
libgmp-dirclean:
@@ -109,16 +82,15 @@ GMP_DIR2:=$(TOOL_BUILD_DIR)/gmp-$(GMP_VERSION)-host
GMP_HOST_DIR:=$(TOOL_BUILD_DIR)/gmp
$(GMP_DIR2)/.configured: $(GMP_DIR)/.unpacked
mkdir -p $(GMP_DIR2)
- (cd $(GMP_DIR2); \
- CC_FOR_BUILD="$(HOSTCC)" \
- CC="$(HOSTCC)" \
- CFLAGS="$(HOST_CFLAGS)" \
- CPPFLAGS="$(GMP_CPP_FLAGS)" \
+ (cd $(GMP_DIR2); rm -rf config.cache ; \
+ $(HOST_CONFIGURE_OPTS) \
+ $(GMP_CPP_FLAGS) \
$(GMP_DIR)/configure \
--prefix="$(GMP_HOST_DIR)" \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
- $(PREFERRED_LIB_FLAGS) \
+ --enable-shared \
+ --enable-static \
$(DISABLE_NLS) \
);
touch $@
diff --git a/package/mdadm/mdadm.mk b/package/mdadm/mdadm.mk
index 121b7fbf0..cc6579dad 100644
--- a/package/mdadm/mdadm.mk
+++ b/package/mdadm/mdadm.mk
@@ -3,7 +3,7 @@
# mdadm
#
#############################################################
-MDADM_VERSION:=2.6.1
+MDADM_VERSION:=2.6.2
MDADM_SOURCE:=mdadm_$(MDADM_VERSION).orig.tar.gz
MDADM_PATCH:=mdadm_$(MDADM_VERSION)-1.diff.gz
MDADM_CAT:=$(ZCAT)
diff --git a/package/mpfr/mpfr.mk b/package/mpfr/mpfr.mk
index 836d4690d..6d6afa578 100644
--- a/package/mpfr/mpfr.mk
+++ b/package/mpfr/mpfr.mk
@@ -52,70 +52,45 @@ ifneq ($(MPFR_PATCH),)
endif
touch $@
-$(MPFR_TARGET_DIR)/.configured: $(MPFR_DIR)/.unpacked $(STAGING_DIR)/lib/$(GMP_BINARY)
+$(MPFR_TARGET_DIR)/.configured: $(MPFR_DIR)/.unpacked $(STAGING_DIR)/usr/lib/$(GMP_BINARY)
mkdir -p $(MPFR_TARGET_DIR)
(cd $(MPFR_TARGET_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS)" \
ac_cv_c_bigendian=$(MPFR_BE) \
$(MPFR_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
--prefix=/usr \
- --exec-prefix=/usr \
- --bindir=/usr/bin \
- --sbindir=/usr/sbin \
- --libdir=/lib \
- --libexecdir=/usr/lib \
- --sysconfdir=/etc \
- --datadir=/usr/share \
- --localstatedir=/var \
- --includedir=/include \
- --mandir=/usr/man \
- --infodir=/usr/info \
- --enable-shared \
- --with-gmp=$(STAGING_DIR) \
+ $(PREFERRED_LIB_FLAGS) \
+ --with-gmp=$(GMP_TARGET_DIR) \
$(DISABLE_NLS) \
);
touch $@
$(MPFR_TARGET_DIR)/.libs/$(MPFR_BINARY): $(MPFR_TARGET_DIR)/.configured
- $(MAKE) CC=$(TARGET_CC) -C $(MPFR_TARGET_DIR)
-
-$(STAGING_DIR)/lib/$(MPFR_BINARY): $(MPFR_TARGET_DIR)/.libs/$(MPFR_BINARY)
- $(MAKE) prefix=$(STAGING_DIR) \
- exec_prefix=$(STAGING_DIR) \
- bindir=$(STAGING_DIR)/bin \
- sbindir=$(STAGING_DIR)/sbin \
- libexecdir=$(STAGING_DIR)/bin \
- datadir=$(STAGING_DIR)/share \
- sysconfdir=$(STAGING_DIR)/etc \
- sharedstatedir=$(STAGING_DIR)/com \
- localstatedir=$(STAGING_DIR)/var \
- libdir=$(STAGING_DIR)/lib \
- includedir=$(STAGING_DIR)/include \
- oldincludedir=$(STAGING_DIR)/include \
- infodir=$(STAGING_DIR)/info \
- mandir=$(STAGING_DIR)/man \
- -C $(MPFR_TARGET_DIR) install;
- $(STRIP) --strip-unneeded $(STAGING_DIR)/lib/libmpfr$(LIBTGTEXT)*
-
-$(TARGET_DIR)/lib/libmpfr.so $(TARGET_DIR)/lib/libmpfr.so.$(MPFR_LIBVERSION) $(TARGET_DIR)/lib/libmpfr.a: $(STAGING_DIR)/lib/$(MPFR_BINARY)
- cp -dpf $(STAGING_DIR)/lib/libmpfr$(LIBTGTEXT)* $(TARGET_DIR)/lib/
+ #$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(MPFR_TARGET_DIR)
+ $(MAKE) -C $(MPFR_TARGET_DIR)
+
+$(STAGING_DIR)/usr/lib/$(MPFR_BINARY): $(MPFR_TARGET_DIR)/.libs/$(MPFR_BINARY)
+ $(MAKE) DESTDIR=$(STAGING_DIR) -C $(MPFR_TARGET_DIR) install;
+ $(STRIP) --strip-unneeded $(STAGING_DIR)/usr/lib/libmpfr$(LIBTGTEXT)*
+
+$(TARGET_DIR)/usr/lib/libmpfr.so $(TARGET_DIR)/usr/lib/libmpfr.so.$(MPFR_LIBVERSION) $(TARGET_DIR)/usr/lib/libmpfr.a: $(STAGING_DIR)/usr/lib/$(MPFR_BINARY)
+ cp -dpf $(STAGING_DIR)/usr/lib/libmpfr$(LIBTGTEXT)* $(TARGET_DIR)/usr/lib/
ifeq ($(BR2_PACKAGE_LIBMPFR_HEADERS),y)
- cp -dpf $(STAGING_DIR)/include/mpfr.h $(STAGING_DIR)/include/mpf2mpfr.h \
+ cp -dpf $(STAGING_DIR)/usr/include/mpfr.h $(STAGING_DIR)/usr/include/mpf2mpfr.h \
$(TARGET_DIR)/usr/include/
endif
-libmpfr: uclibc $(TARGET_DIR)/lib/libmpfr$(LIBTGTEXT)
-stage-libmpfr: uclibc $(STAGING_DIR)/lib/$(MPFR_BINARY)
+libmpfr: uclibc $(TARGET_DIR)/usr/lib/libmpfr$(LIBTGTEXT)
+stage-libmpfr: uclibc $(STAGING_DIR)/usr/lib/$(MPFR_BINARY)
libmpfr-clean:
- rm -f $(TARGET_DIR)/lib/libmpfr.* \
+ rm -f $(TARGET_DIR)/usr/lib/libmpfr.* \
$(TARGET_DIR)/usr/include/mpfr.h \
- $(TARGET_DIR)/usr/include/mpf2mpfr.h
+ $(TARGET_DIR)/usr/include/mpf2mpfr.h \
+ $(STAGING_DIR)/usr/lib/libmpfr* $(STAGING_DIR)/usr/include/mpfr*
-$(MAKE) -C $(MPFR_TARGET_DIR) clean
libmpfr-dirclean:
@@ -126,13 +101,11 @@ MPFR_HOST_DIR:=$(TOOL_BUILD_DIR)/mpfr
$(MPFR_DIR2)/.configured: $(MPFR_DIR)/.unpacked $(GMP_HOST_DIR)/lib/$(GMP_HOST_BINARY)
mkdir -p $(MPFR_DIR2)
(cd $(MPFR_DIR2); \
- CC="$(HOSTCC)" CC_FOR_BUILD="$(HOSTCC)" \
- CXX="$(HOSTCXX)" \
+ $(HOST_CONFIGURE_OPTS) \
$(MPFR_DIR)/configure \
--prefix="$(MPFR_HOST_DIR)" \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
- --target=$(REAL_GNU_TARGET_NAME) \
--enable-shared \
--enable-static \
--with-gmp=$(GMP_HOST_DIR) \