1*4882a593Smuzhiyun################################################################################ 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# uclibc 4*4882a593Smuzhiyun# 5*4882a593Smuzhiyun################################################################################ 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunUCLIBC_VERSION = 1.0.39 8*4882a593SmuzhiyunUCLIBC_SOURCE = uClibc-ng-$(UCLIBC_VERSION).tar.xz 9*4882a593SmuzhiyunUCLIBC_SITE = https://downloads.uclibc-ng.org/releases/$(UCLIBC_VERSION) 10*4882a593SmuzhiyunUCLIBC_LICENSE = LGPL-2.1+ 11*4882a593SmuzhiyunUCLIBC_LICENSE_FILES = COPYING.LIB 12*4882a593SmuzhiyunUCLIBC_INSTALL_STAGING = YES 13*4882a593SmuzhiyunUCLIBC_CPE_ID_VENDOR = uclibc-ng_project 14*4882a593SmuzhiyunUCLIBC_CPE_ID_PRODUCT = uclibc-ng 15*4882a593Smuzhiyun 16*4882a593Smuzhiyun# uclibc is part of the toolchain so disable the toolchain dependency 17*4882a593SmuzhiyunUCLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun# Before uClibc is configured, we must have the first stage 20*4882a593Smuzhiyun# cross-compiler and the kernel headers 21*4882a593SmuzhiyunUCLIBC_DEPENDENCIES = host-gcc-initial linux-headers 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun# specifying UCLIBC_CONFIG_FILE on the command-line overrides the .config 24*4882a593Smuzhiyun# setting. 25*4882a593Smuzhiyunifndef UCLIBC_CONFIG_FILE 26*4882a593SmuzhiyunUCLIBC_CONFIG_FILE = $(call qstrip,$(BR2_UCLIBC_CONFIG)) 27*4882a593Smuzhiyunendif 28*4882a593Smuzhiyun 29*4882a593SmuzhiyunUCLIBC_KCONFIG_EDITORS = menuconfig nconfig 30*4882a593SmuzhiyunUCLIBC_KCONFIG_FILE = $(UCLIBC_CONFIG_FILE) 31*4882a593SmuzhiyunUCLIBC_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_UCLIBC_CONFIG_FRAGMENT_FILES)) 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun# UCLIBC_MAKE_FLAGS set HOSTCC to the default HOSTCC, which may be 34*4882a593Smuzhiyun# wrapped with ccache. However, host-ccache may not already be built 35*4882a593Smuzhiyun# and installed when we apply the configuration, so we override that 36*4882a593Smuzhiyun# to use the non-ccached host compiler. 37*4882a593SmuzhiyunUCLIBC_KCONFIG_OPTS = \ 38*4882a593Smuzhiyun $(UCLIBC_MAKE_FLAGS) \ 39*4882a593Smuzhiyun HOSTCC="$(HOSTCC_NOCCACHE)" \ 40*4882a593Smuzhiyun PREFIX=$(STAGING_DIR) \ 41*4882a593Smuzhiyun DEVEL_PREFIX=/usr/ \ 42*4882a593Smuzhiyun RUNTIME_PREFIX=$(STAGING_DIR)/ 43*4882a593Smuzhiyun 44*4882a593SmuzhiyunUCLIBC_TARGET_ARCH = $(call qstrip,$(BR2_UCLIBC_TARGET_ARCH)) 45*4882a593Smuzhiyun 46*4882a593SmuzhiyunUCLIBC_GENERATE_LOCALES = $(call qstrip,$(BR2_GENERATE_LOCALE)) 47*4882a593Smuzhiyun 48*4882a593Smuzhiyunifeq ($(UCLIBC_GENERATE_LOCALES),) 49*4882a593Smuzhiyun# We need at least one locale 50*4882a593SmuzhiyunUCLIBC_LOCALES = en_US 51*4882a593Smuzhiyunelse 52*4882a593Smuzhiyun# Strip out the encoding part of locale names, if any 53*4882a593SmuzhiyunUCLIBC_LOCALES = \ 54*4882a593Smuzhiyun $(foreach locale,$(UCLIBC_GENERATE_LOCALES),\ 55*4882a593Smuzhiyun $(firstword $(subst .,$(space),$(locale)))) 56*4882a593Smuzhiyunendif 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun# noMMU binary formats 59*4882a593Smuzhiyunifeq ($(BR2_BINFMT_FLAT_ONE),y) 60*4882a593Smuzhiyundefine UCLIBC_BINFMT_CONFIG 61*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FLAT) 62*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA) 63*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT) 64*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF) 65*4882a593Smuzhiyunendef 66*4882a593Smuzhiyunendif 67*4882a593Smuzhiyunifeq ($(BR2_BINFMT_FLAT_SHARED),y) 68*4882a593Smuzhiyundefine UCLIBC_BINFMT_CONFIG 69*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT) 70*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA) 71*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT) 72*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF) 73*4882a593Smuzhiyunendef 74*4882a593Smuzhiyunendif 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun# 77*4882a593Smuzhiyun# ARC definitions 78*4882a593Smuzhiyun# 79*4882a593Smuzhiyun 80*4882a593Smuzhiyunifeq ($(UCLIBC_TARGET_ARCH),arc) 81*4882a593SmuzhiyunUCLIBC_ARC_PAGE_SIZE = CONFIG_ARC_PAGE_SIZE_$(call qstrip,$(BR2_ARC_PAGE_SIZE)) 82*4882a593Smuzhiyundefine UCLIBC_ARC_PAGE_SIZE_CONFIG 83*4882a593Smuzhiyun $(SED) '/CONFIG_ARC_PAGE_SIZE_*/d' $(@D)/.config 84*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,$(UCLIBC_ARC_PAGE_SIZE)) 85*4882a593Smuzhiyunendef 86*4882a593Smuzhiyun 87*4882a593Smuzhiyunifeq ($(BR2_ARC_ATOMIC_EXT),) 88*4882a593Smuzhiyundefine UCLIBC_ARC_ATOMICS_CONFIG 89*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,CONFIG_ARC_HAS_ATOMICS) 90*4882a593Smuzhiyunendef 91*4882a593Smuzhiyunendif 92*4882a593Smuzhiyun 93*4882a593Smuzhiyunendif # arc 94*4882a593Smuzhiyun 95*4882a593Smuzhiyun# 96*4882a593Smuzhiyun# ARM definitions 97*4882a593Smuzhiyun# 98*4882a593Smuzhiyun 99*4882a593Smuzhiyunifeq ($(UCLIBC_TARGET_ARCH),arm) 100*4882a593Smuzhiyundefine UCLIBC_ARM_ABI_CONFIG 101*4882a593Smuzhiyun $(SED) '/CONFIG_ARM_.ABI/d' $(@D)/.config 102*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,CONFIG_ARM_EABI) 103*4882a593Smuzhiyunendef 104*4882a593Smuzhiyun 105*4882a593Smuzhiyunifeq ($(BR2_BINFMT_FLAT),y) 106*4882a593Smuzhiyundefine UCLIBC_ARM_BINFMT_FLAT 107*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,DOPIC) 108*4882a593Smuzhiyunendef 109*4882a593Smuzhiyunendif 110*4882a593Smuzhiyun 111*4882a593Smuzhiyun# context functions are written with ARM instructions. Therefore, if 112*4882a593Smuzhiyun# we are using a Thumb2-only platform (i.e, Cortex-M), they must be 113*4882a593Smuzhiyun# disabled. Thumb1 platforms are not a problem, since they all also 114*4882a593Smuzhiyun# support the ARM instructions. 115*4882a593Smuzhiyunifeq ($(BR2_ARM_INSTRUCTIONS_THUMB2):$(BR2_ARM_CPU_HAS_ARM),y:) 116*4882a593Smuzhiyundefine UCLIBC_ARM_NO_CONTEXT_FUNCS 117*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_CONTEXT_FUNCS) 118*4882a593Smuzhiyunendef 119*4882a593Smuzhiyunendif 120*4882a593Smuzhiyun 121*4882a593Smuzhiyunendif # arm 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun# 124*4882a593Smuzhiyun# m68k/coldfire definitions 125*4882a593Smuzhiyun# 126*4882a593Smuzhiyun 127*4882a593Smuzhiyunifeq ($(UCLIBC_TARGET_ARCH),m68k) 128*4882a593Smuzhiyun 129*4882a593Smuzhiyun# disable DOPIC for flat without separate data 130*4882a593Smuzhiyunifeq ($(BR2_BINFMT_FLAT_ONE),y) 131*4882a593Smuzhiyundefine UCLIBC_M68K_BINFMT_FLAT 132*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,DOPIC) 133*4882a593Smuzhiyunendef 134*4882a593Smuzhiyunendif 135*4882a593Smuzhiyun 136*4882a593Smuzhiyunendif # m68k/coldfire 137*4882a593Smuzhiyun 138*4882a593Smuzhiyun# 139*4882a593Smuzhiyun# MIPS definitions 140*4882a593Smuzhiyun# 141*4882a593Smuzhiyun 142*4882a593Smuzhiyunifeq ($(UCLIBC_TARGET_ARCH),mips) 143*4882a593SmuzhiyunUCLIBC_MIPS_ABI = CONFIG_MIPS_$(call qstrip,$(BR2_UCLIBC_MIPS_ABI))_ABI 144*4882a593Smuzhiyundefine UCLIBC_MIPS_ABI_CONFIG 145*4882a593Smuzhiyun $(SED) '/CONFIG_MIPS_[NO].._ABI/d' $(@D)/.config 146*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,$(UCLIBC_MIPS_ABI)) 147*4882a593Smuzhiyunendef 148*4882a593Smuzhiyun 149*4882a593SmuzhiyunUCLIBC_MIPS_NAN = CONFIG_MIPS_NAN_$(call qstrip,$(BR2_UCLIBC_MIPS_NAN)) 150*4882a593Smuzhiyundefine UCLIBC_MIPS_NAN_CONFIG 151*4882a593Smuzhiyun $(SED) '/CONFIG_MIPS_NAN_.*/d' $(@D)/.config 152*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,$(UCLIBC_MIPS_NAN)) 153*4882a593Smuzhiyunendef 154*4882a593Smuzhiyunendif # mips 155*4882a593Smuzhiyun 156*4882a593Smuzhiyun# 157*4882a593Smuzhiyun# SH definitions 158*4882a593Smuzhiyun# 159*4882a593Smuzhiyun 160*4882a593Smuzhiyunifeq ($(UCLIBC_TARGET_ARCH),sh) 161*4882a593SmuzhiyunUCLIBC_SH_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_SH_TYPE)) 162*4882a593Smuzhiyundefine UCLIBC_SH_TYPE_CONFIG 163*4882a593Smuzhiyun $(SED) '/CONFIG_SH[234A]*/d' $(@D)/.config 164*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,$(UCLIBC_SH_TYPE)) 165*4882a593Smuzhiyunendef 166*4882a593Smuzhiyunendif # sh 167*4882a593Smuzhiyun 168*4882a593Smuzhiyun# 169*4882a593Smuzhiyun# SPARC definitions 170*4882a593Smuzhiyun# 171*4882a593Smuzhiyun 172*4882a593Smuzhiyunifeq ($(UCLIBC_TARGET_ARCH),sparc) 173*4882a593SmuzhiyunUCLIBC_SPARC_TYPE = CONFIG_SPARC_$(call qstrip,$(BR2_UCLIBC_SPARC_TYPE)) 174*4882a593Smuzhiyundefine UCLIBC_SPARC_TYPE_CONFIG 175*4882a593Smuzhiyun $(SED) 's/^\(CONFIG_[^_]*[_]*SPARC[^=]*\)=.*/# \1 is not set/g' \ 176*4882a593Smuzhiyun $(@D)/.config 177*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,$(UCLIBC_SPARC_TYPE)) 178*4882a593Smuzhiyunendef 179*4882a593Smuzhiyunendif # sparc 180*4882a593Smuzhiyun 181*4882a593Smuzhiyun# 182*4882a593Smuzhiyun# PowerPC definitions 183*4882a593Smuzhiyun# 184*4882a593Smuzhiyun 185*4882a593Smuzhiyunifeq ($(UCLIBC_TARGET_ARCH),powerpc) 186*4882a593SmuzhiyunUCLIBC_POWERPC_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_POWERPC_TYPE)) 187*4882a593Smuzhiyundefine UCLIBC_POWERPC_TYPE_CONFIG 188*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,CONFIG_GENERIC) 189*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,CONFIG_E500) 190*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,$(UCLIBC_POWERPC_TYPE)) 191*4882a593Smuzhiyunendef 192*4882a593Smuzhiyunendif # powerpc 193*4882a593Smuzhiyun 194*4882a593Smuzhiyun# 195*4882a593Smuzhiyun# x86 definitions 196*4882a593Smuzhiyun# 197*4882a593Smuzhiyunifeq ($(UCLIBC_TARGET_ARCH),i386) 198*4882a593SmuzhiyunUCLIBC_X86_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_X86_TYPE)) 199*4882a593Smuzhiyundefine UCLIBC_X86_TYPE_CONFIG 200*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,$(UCLIBC_X86_TYPE)) 201*4882a593Smuzhiyunendef 202*4882a593Smuzhiyunendif 203*4882a593Smuzhiyun 204*4882a593Smuzhiyun# 205*4882a593Smuzhiyun# Debug 206*4882a593Smuzhiyun# 207*4882a593Smuzhiyunifeq ($(BR2_ENABLE_DEBUG),y) 208*4882a593Smuzhiyundefine UCLIBC_DEBUG_CONFIG 209*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,DODEBUG) 210*4882a593Smuzhiyunendef 211*4882a593Smuzhiyunendif 212*4882a593Smuzhiyun 213*4882a593Smuzhiyun# 214*4882a593Smuzhiyun# Endianness 215*4882a593Smuzhiyun# 216*4882a593Smuzhiyun 217*4882a593Smuzhiyunifeq ($(call qstrip,$(BR2_ENDIAN)),BIG) 218*4882a593Smuzhiyundefine UCLIBC_ENDIAN_CONFIG 219*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,ARCH_BIG_ENDIAN) 220*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,ARCH_WANTS_BIG_ENDIAN) 221*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,ARCH_LITTLE_ENDIAN) 222*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,ARCH_WANTS_LITTLE_ENDIAN) 223*4882a593Smuzhiyunendef 224*4882a593Smuzhiyunelse 225*4882a593Smuzhiyundefine UCLIBC_ENDIAN_CONFIG 226*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,ARCH_LITTLE_ENDIAN) 227*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,ARCH_WANTS_LITTLE_ENDIAN) 228*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,ARCH_BIG_ENDIAN) 229*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,ARCH_WANTS_BIG_ENDIAN) 230*4882a593Smuzhiyunendef 231*4882a593Smuzhiyunendif 232*4882a593Smuzhiyun 233*4882a593Smuzhiyun# 234*4882a593Smuzhiyun# MMU 235*4882a593Smuzhiyun# 236*4882a593Smuzhiyun 237*4882a593Smuzhiyunifeq ($(BR2_USE_MMU),y) 238*4882a593Smuzhiyundefine UCLIBC_MMU_CONFIG 239*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,ARCH_HAS_MMU) 240*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,ARCH_USE_MMU) 241*4882a593Smuzhiyunendef 242*4882a593Smuzhiyunelse 243*4882a593Smuzhiyundefine UCLIBC_MMU_CONFIG 244*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,ARCH_HAS_MMU) 245*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,ARCH_USE_MMU) 246*4882a593Smuzhiyunendef 247*4882a593Smuzhiyunendif 248*4882a593Smuzhiyun 249*4882a593Smuzhiyun# 250*4882a593Smuzhiyun# IPv6 251*4882a593Smuzhiyun# 252*4882a593Smuzhiyun 253*4882a593SmuzhiyunUCLIBC_IPV6_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_IPV6) 254*4882a593Smuzhiyun 255*4882a593Smuzhiyun# 256*4882a593Smuzhiyun# soft-float 257*4882a593Smuzhiyun# 258*4882a593Smuzhiyun 259*4882a593Smuzhiyunifeq ($(BR2_SOFT_FLOAT),y) 260*4882a593Smuzhiyundefine UCLIBC_FLOAT_CONFIG 261*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_FPU) 262*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FLOATS) 263*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,DO_C99_MATH) 264*4882a593Smuzhiyunendef 265*4882a593Smuzhiyunelse 266*4882a593Smuzhiyundefine UCLIBC_FLOAT_CONFIG 267*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FPU) 268*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FLOATS) 269*4882a593Smuzhiyunendef 270*4882a593Smuzhiyunendif 271*4882a593Smuzhiyun 272*4882a593Smuzhiyun# 273*4882a593Smuzhiyun# SSP 274*4882a593Smuzhiyun# 275*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_BUILDROOT_USE_SSP),y) 276*4882a593Smuzhiyundefine UCLIBC_SSP_CONFIG 277*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_SSP) 278*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_BUILD_SSP) 279*4882a593Smuzhiyunendef 280*4882a593Smuzhiyunelse 281*4882a593Smuzhiyundefine UCLIBC_SSP_CONFIG 282*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_SSP) 283*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_BUILD_SSP) 284*4882a593Smuzhiyunendef 285*4882a593Smuzhiyunendif 286*4882a593Smuzhiyun 287*4882a593Smuzhiyun# 288*4882a593Smuzhiyun# Threads 289*4882a593Smuzhiyun# 290*4882a593Smuzhiyunifeq ($(BR2_PTHREADS_NONE),y) 291*4882a593Smuzhiyundefine UCLIBC_THREAD_CONFIG 292*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS) 293*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LINUXTHREADS) 294*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS_NATIVE) 295*4882a593Smuzhiyunendef 296*4882a593Smuzhiyunelse ifeq ($(BR2_PTHREADS),y) 297*4882a593Smuzhiyundefine UCLIBC_THREAD_CONFIG 298*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS) 299*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_LINUXTHREADS) 300*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS_NATIVE) 301*4882a593Smuzhiyunendef 302*4882a593Smuzhiyunelse ifeq ($(BR2_PTHREADS_NATIVE),y) 303*4882a593Smuzhiyundefine UCLIBC_THREAD_CONFIG 304*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS) 305*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LINUXTHREADS) 306*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS_NATIVE) 307*4882a593Smuzhiyunendef 308*4882a593Smuzhiyunendif 309*4882a593Smuzhiyun 310*4882a593Smuzhiyun# 311*4882a593Smuzhiyun# Thread debug 312*4882a593Smuzhiyun# 313*4882a593Smuzhiyun 314*4882a593Smuzhiyunifeq ($(BR2_PTHREAD_DEBUG),y) 315*4882a593SmuzhiyunUCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_ENABLE_OPT,PTHREADS_DEBUG_SUPPORT) 316*4882a593Smuzhiyunelse 317*4882a593SmuzhiyunUCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_DISABLE_OPT,PTHREADS_DEBUG_SUPPORT) 318*4882a593Smuzhiyunendif 319*4882a593Smuzhiyun 320*4882a593Smuzhiyun# 321*4882a593Smuzhiyun# Locale 322*4882a593Smuzhiyun# 323*4882a593Smuzhiyun 324*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_BUILDROOT_LOCALE),y) 325*4882a593Smuzhiyundefine UCLIBC_LOCALE_CONFIG 326*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_LOCALE) 327*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_BUILD_ALL_LOCALE) 328*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_BUILD_MINIMAL_LOCALE) 329*4882a593Smuzhiyun $(call KCONFIG_SET_OPT,UCLIBC_BUILD_MINIMAL_LOCALES,"$(UCLIBC_LOCALES)") 330*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_PREGENERATED_LOCALE_DATA) 331*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,DOWNLOAD_PREGENERATED_LOCALE_DATA) 332*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_XLOCALE) 333*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_GLIBC_DIGIT_GROUPING) 334*4882a593Smuzhiyunendef 335*4882a593Smuzhiyunelse 336*4882a593Smuzhiyundefine UCLIBC_LOCALE_CONFIG 337*4882a593Smuzhiyun $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LOCALE) 338*4882a593Smuzhiyunendef 339*4882a593Smuzhiyunendif 340*4882a593Smuzhiyun 341*4882a593Smuzhiyun# 342*4882a593Smuzhiyun# wchar 343*4882a593Smuzhiyun# 344*4882a593Smuzhiyun 345*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_BUILDROOT_WCHAR),y) 346*4882a593SmuzhiyunUCLIBC_WCHAR_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_WCHAR) 347*4882a593Smuzhiyunelse 348*4882a593SmuzhiyunUCLIBC_WCHAR_CONFIG = $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_WCHAR) 349*4882a593Smuzhiyunendif 350*4882a593Smuzhiyun 351*4882a593Smuzhiyun# 352*4882a593Smuzhiyun# static/shared libs 353*4882a593Smuzhiyun# 354*4882a593Smuzhiyun 355*4882a593Smuzhiyunifeq ($(BR2_STATIC_LIBS),y) 356*4882a593SmuzhiyunUCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_DISABLE_OPT,HAVE_SHARED) 357*4882a593Smuzhiyunelse 358*4882a593SmuzhiyunUCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_ENABLE_OPT,HAVE_SHARED) 359*4882a593Smuzhiyunendif 360*4882a593Smuzhiyun 361*4882a593Smuzhiyun# 362*4882a593Smuzhiyun# Commands 363*4882a593Smuzhiyun# 364*4882a593Smuzhiyun 365*4882a593SmuzhiyunUCLIBC_MAKE_FLAGS = \ 366*4882a593Smuzhiyun ARCH="$(UCLIBC_TARGET_ARCH)" \ 367*4882a593Smuzhiyun CROSS_COMPILE="$(TARGET_CROSS)" \ 368*4882a593Smuzhiyun UCLIBC_EXTRA_CFLAGS="$(TARGET_ABI)" \ 369*4882a593Smuzhiyun HOSTCC="$(HOSTCC)" 370*4882a593Smuzhiyun 371*4882a593Smuzhiyunifeq ($(UCLIBC_TARGET_ARCH)|$(BR2_UCLIBC_USE_GLIBC_NEON),arm|y) 372*4882a593SmuzhiyunUCLIBC_MAKE_FLAGS += USE_GLIBC_NEON=1 373*4882a593Smuzhiyunendif 374*4882a593Smuzhiyun 375*4882a593Smuzhiyundefine UCLIBC_KCONFIG_FIXUP_CMDS 376*4882a593Smuzhiyun $(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)") 377*4882a593Smuzhiyun $(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH)) 378*4882a593Smuzhiyun $(call KCONFIG_SET_OPT,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)") 379*4882a593Smuzhiyun $(call KCONFIG_SET_OPT,KERNEL_HEADERS,"$(LINUX_HEADERS_DIR)/usr/include") 380*4882a593Smuzhiyun $(call KCONFIG_SET_OPT,RUNTIME_PREFIX,"/") 381*4882a593Smuzhiyun $(call KCONFIG_SET_OPT,DEVEL_PREFIX,"/usr") 382*4882a593Smuzhiyun $(call KCONFIG_SET_OPT,SHARED_LIB_LOADER_PREFIX,"/lib") 383*4882a593Smuzhiyun $(UCLIBC_MMU_CONFIG) 384*4882a593Smuzhiyun $(UCLIBC_BINFMT_CONFIG) 385*4882a593Smuzhiyun $(UCLIBC_ARC_PAGE_SIZE_CONFIG) 386*4882a593Smuzhiyun $(UCLIBC_ARC_ATOMICS_CONFIG) 387*4882a593Smuzhiyun $(UCLIBC_ARM_ABI_CONFIG) 388*4882a593Smuzhiyun $(UCLIBC_ARM_BINFMT_FLAT) 389*4882a593Smuzhiyun $(UCLIBC_ARM_NO_CONTEXT_FUNCS) 390*4882a593Smuzhiyun $(UCLIBC_M68K_BINFMT_FLAT) 391*4882a593Smuzhiyun $(UCLIBC_MIPS_ABI_CONFIG) 392*4882a593Smuzhiyun $(UCLIBC_MIPS_NAN_CONFIG) 393*4882a593Smuzhiyun $(UCLIBC_SH_TYPE_CONFIG) 394*4882a593Smuzhiyun $(UCLIBC_SPARC_TYPE_CONFIG) 395*4882a593Smuzhiyun $(UCLIBC_POWERPC_TYPE_CONFIG) 396*4882a593Smuzhiyun $(UCLIBC_X86_TYPE_CONFIG) 397*4882a593Smuzhiyun $(UCLIBC_DEBUG_CONFIG) 398*4882a593Smuzhiyun $(UCLIBC_ENDIAN_CONFIG) 399*4882a593Smuzhiyun $(UCLIBC_IPV6_CONFIG) 400*4882a593Smuzhiyun $(UCLIBC_FLOAT_CONFIG) 401*4882a593Smuzhiyun $(UCLIBC_SSP_CONFIG) 402*4882a593Smuzhiyun $(UCLIBC_THREAD_CONFIG) 403*4882a593Smuzhiyun $(UCLIBC_THREAD_DEBUG_CONFIG) 404*4882a593Smuzhiyun $(UCLIBC_LOCALE_CONFIG) 405*4882a593Smuzhiyun $(UCLIBC_WCHAR_CONFIG) 406*4882a593Smuzhiyun $(UCLIBC_SHARED_LIBS_CONFIG) 407*4882a593Smuzhiyunendef 408*4882a593Smuzhiyun 409*4882a593Smuzhiyundefine UCLIBC_BUILD_CMDS 410*4882a593Smuzhiyun $(MAKE) -C $(@D) $(UCLIBC_MAKE_FLAGS) headers 411*4882a593Smuzhiyun $(MAKE) -C $(@D) $(UCLIBC_MAKE_FLAGS) 412*4882a593Smuzhiyun $(MAKE) -C $(@D)/utils \ 413*4882a593Smuzhiyun PREFIX=$(HOST_DIR) \ 414*4882a593Smuzhiyun HOSTCC="$(HOSTCC)" hostutils 415*4882a593Smuzhiyunendef 416*4882a593Smuzhiyun 417*4882a593Smuzhiyunifeq ($(BR2_UCLIBC_INSTALL_UTILS),y) 418*4882a593Smuzhiyundefine UCLIBC_INSTALL_UTILS_TARGET 419*4882a593Smuzhiyun $(MAKE1) -C $(@D) \ 420*4882a593Smuzhiyun CC="$(TARGET_CC)" CPP="$(TARGET_CPP)" LD="$(TARGET_LD)" \ 421*4882a593Smuzhiyun ARCH="$(UCLIBC_TARGET_ARCH)" \ 422*4882a593Smuzhiyun PREFIX=$(TARGET_DIR) \ 423*4882a593Smuzhiyun utils install_utils 424*4882a593Smuzhiyunendef 425*4882a593Smuzhiyunendif 426*4882a593Smuzhiyun 427*4882a593Smuzhiyundefine UCLIBC_INSTALL_TARGET_CMDS 428*4882a593Smuzhiyun $(MAKE1) -C $(@D) \ 429*4882a593Smuzhiyun $(UCLIBC_MAKE_FLAGS) \ 430*4882a593Smuzhiyun PREFIX=$(TARGET_DIR) \ 431*4882a593Smuzhiyun DEVEL_PREFIX=/usr/ \ 432*4882a593Smuzhiyun RUNTIME_PREFIX=/ \ 433*4882a593Smuzhiyun install_runtime 434*4882a593Smuzhiyun $(UCLIBC_INSTALL_UTILS_TARGET) 435*4882a593Smuzhiyunendef 436*4882a593Smuzhiyun 437*4882a593Smuzhiyun# STATIC has no ld* tools, only getconf 438*4882a593Smuzhiyunifeq ($(BR2_STATIC_LIBS),) 439*4882a593Smuzhiyundefine UCLIBC_INSTALL_UTILS_STAGING 440*4882a593Smuzhiyun $(INSTALL) -D -m 0755 $(@D)/utils/ldd.host $(HOST_DIR)/bin/ldd 441*4882a593Smuzhiyun ln -sf ldd $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-ldd 442*4882a593Smuzhiyun $(INSTALL) -D -m 0755 $(@D)/utils/ldconfig.host $(HOST_DIR)/bin/ldconfig 443*4882a593Smuzhiyun ln -sf ldconfig $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-ldconfig 444*4882a593Smuzhiyunendef 445*4882a593Smuzhiyunendif 446*4882a593Smuzhiyun 447*4882a593Smuzhiyundefine UCLIBC_INSTALL_STAGING_CMDS 448*4882a593Smuzhiyun $(MAKE1) -C $(@D) \ 449*4882a593Smuzhiyun $(UCLIBC_MAKE_FLAGS) \ 450*4882a593Smuzhiyun PREFIX=$(STAGING_DIR) \ 451*4882a593Smuzhiyun DEVEL_PREFIX=/usr/ \ 452*4882a593Smuzhiyun RUNTIME_PREFIX=/ \ 453*4882a593Smuzhiyun install_runtime install_dev 454*4882a593Smuzhiyun $(UCLIBC_INSTALL_UTILS_STAGING) 455*4882a593Smuzhiyunendef 456*4882a593Smuzhiyun 457*4882a593Smuzhiyun# Checks to give errors that the user can understand 458*4882a593Smuzhiyun# Must be before we call to kconfig-package 459*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_UCLIBC)$(BR_BUILDING),yy) 460*4882a593Smuzhiyunifeq ($(call qstrip,$(BR2_UCLIBC_CONFIG)),) 461*4882a593Smuzhiyun$(error No uClibc configuration file specified, check your BR2_UCLIBC_CONFIG setting) 462*4882a593Smuzhiyunendif 463*4882a593Smuzhiyunendif 464*4882a593Smuzhiyun 465*4882a593Smuzhiyun$(eval $(kconfig-package)) 466