- add BR2_PREFER_STATIC_LIB config option to be able to select if we prefer to build static or dynamic libs/bins.
- depending on the BR2_GNU_BUILD_SUFFIX, set the respective EXEEXT, LIBEXT, SHREXT extensions for use on the target. Thanks to Tom for suplying a diff which implements these.
This commit is contained in:
parent
961229caf5
commit
3096f34d27
13
Config.in
13
Config.in
|
@ -373,6 +373,19 @@ config BR2_DEPRECATED
|
||||||
help
|
help
|
||||||
This option hides outdated/obsolete versions of packages.
|
This option hides outdated/obsolete versions of packages.
|
||||||
|
|
||||||
|
config BR2_PREFER_STATIC_LIB
|
||||||
|
bool "prefer static libraries"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Where possible, use static libraries.
|
||||||
|
This increases your code size a lot and should only be
|
||||||
|
used with a good reason why not use the default, which
|
||||||
|
is dynamic libraries.
|
||||||
|
|
||||||
|
If unsure, say No.
|
||||||
|
|
||||||
|
WARNING: This is highly experimental at the moment.
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
source "toolchain/Config.in"
|
source "toolchain/Config.in"
|
||||||
|
|
25
Makefile
25
Makefile
|
@ -66,7 +66,32 @@ include package/Makefile.in
|
||||||
#
|
#
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
|
ifneq (,$(findstring linux,$(BR2_GNU_BUILD_SUFFIX)))
|
||||||
|
EXEEXT:=
|
||||||
|
LIBEXT:=.a
|
||||||
|
SHREXT:=.so
|
||||||
|
endif
|
||||||
|
ifneq (,$(findstring apple,$(BR2_GNU_BUILD_SUFFIX)))
|
||||||
|
EXEEXT:=.pear
|
||||||
|
LIBEXT:=.dunno
|
||||||
|
SHREXT:=.dylib
|
||||||
|
endif
|
||||||
|
ifneq (,$(findstring cygwin,$(BR2_GNU_BUILD_SUFFIX)))
|
||||||
|
EXEEXT:=.exe
|
||||||
|
LIBEXT:=.lib
|
||||||
|
SHREXT:=.dll
|
||||||
|
endif
|
||||||
|
ifneq (,$(findstring mingw,$(BR2_GNU_BUILD_SUFFIX)))
|
||||||
|
EXEEXT:=.exe
|
||||||
|
LIBEXT:=.lib
|
||||||
|
SHREXT:=.dll
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PREFER_STATIC_LIB),y)
|
||||||
|
LIBTGTEXT=$(LIBEXT)
|
||||||
|
else
|
||||||
|
LIBTGTEXT=$(SHREXT)
|
||||||
|
endif
|
||||||
|
|
||||||
all: world
|
all: world
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,14 @@ else
|
||||||
GMP_BE:=no
|
GMP_BE:=no
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# this is a workaround for a bug in GMP, please see
|
||||||
|
# http://gmplib.org/list-archives/gmp-devel/2006-April/000618.html
|
||||||
|
ifeq ($(EXEEXT),.exe)
|
||||||
|
GMP_CPP_FLAGS:=-DDLL_EXPORT
|
||||||
|
else
|
||||||
|
GMP_CPP_FLAGS:=
|
||||||
|
endif
|
||||||
|
|
||||||
$(DL_DIR)/$(GMP_SOURCE):
|
$(DL_DIR)/$(GMP_SOURCE):
|
||||||
$(WGET) -P $(DL_DIR) $(GMP_SITE)/$(GMP_SOURCE)
|
$(WGET) -P $(DL_DIR) $(GMP_SITE)/$(GMP_SOURCE)
|
||||||
|
|
||||||
|
@ -35,6 +43,7 @@ $(GMP_TARGET_DIR)/.configured: $(GMP_DIR)/.unpacked
|
||||||
$(TARGET_CONFIGURE_OPTS) \
|
$(TARGET_CONFIGURE_OPTS) \
|
||||||
CFLAGS="$(TARGET_CFLAGS)" \
|
CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||||
|
CPPFLAGS="$(GMP_CPP_FLAGS)" \
|
||||||
ac_cv_c_bigendian=$(GMP_BE) \
|
ac_cv_c_bigendian=$(GMP_BE) \
|
||||||
$(GMP_DIR)/configure \
|
$(GMP_DIR)/configure \
|
||||||
--target=$(GNU_TARGET_NAME) \
|
--target=$(GNU_TARGET_NAME) \
|
||||||
|
@ -52,7 +61,7 @@ $(GMP_TARGET_DIR)/.configured: $(GMP_DIR)/.unpacked
|
||||||
--includedir=/include \
|
--includedir=/include \
|
||||||
--mandir=/usr/man \
|
--mandir=/usr/man \
|
||||||
--infodir=/usr/info \
|
--infodir=/usr/info \
|
||||||
--enable-shared \
|
$(PREFERRED_LIB_FLAGS) \
|
||||||
$(DISABLE_NLS) \
|
$(DISABLE_NLS) \
|
||||||
);
|
);
|
||||||
touch $@
|
touch $@
|
||||||
|
@ -105,12 +114,12 @@ $(GMP_DIR2)/.configured: $(GMP_DIR)/.unpacked
|
||||||
CC_FOR_BUILD="$(HOSTCC)" \
|
CC_FOR_BUILD="$(HOSTCC)" \
|
||||||
CC="$(HOSTCC)" \
|
CC="$(HOSTCC)" \
|
||||||
CFLAGS="$(HOST_CFLAGS)" \
|
CFLAGS="$(HOST_CFLAGS)" \
|
||||||
|
CPPFLAGS="$(GMP_CPP_FLAGS)" \
|
||||||
$(GMP_DIR)/configure \
|
$(GMP_DIR)/configure \
|
||||||
--prefix="$(GMP_HOST_DIR)" \
|
--prefix="$(GMP_HOST_DIR)" \
|
||||||
--build=$(GNU_HOST_NAME) \
|
--build=$(GNU_HOST_NAME) \
|
||||||
--host=$(GNU_HOST_NAME) \
|
--host=$(GNU_HOST_NAME) \
|
||||||
--enable-shared \
|
$(PREFERRED_LIB_FLAGS) \
|
||||||
--enable-static \
|
|
||||||
$(DISABLE_NLS) \
|
$(DISABLE_NLS) \
|
||||||
);
|
);
|
||||||
touch $@
|
touch $@
|
||||||
|
|
|
@ -10,6 +10,12 @@ else
|
||||||
MULTILIB:=--disable-multilib
|
MULTILIB:=--disable-multilib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PREFER_STATIC_LIB),y)
|
||||||
|
PREFERRED_LIB_FLAGS:=--enable-static --disable-shared
|
||||||
|
else
|
||||||
|
PREFERRED_LIB_FLAGS:=--disable-static --enable-shared
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
# FIXME -- this is temporary
|
# FIXME -- this is temporary
|
||||||
OPTIMIZE_FOR_CPU=$(ARCH)
|
OPTIMIZE_FOR_CPU=$(ARCH)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user