git: fix build with with no threads
[buildroot-gz.git] / package / uclibc / uclibc.mk
blob8f6035ec2fc1e2bd556d0138e05dd36e347e553b
1 ################################################################################
3 # uclibc
5 ################################################################################
7 UCLIBC_VERSION = 1.0.22
8 UCLIBC_SOURCE = uClibc-ng-$(UCLIBC_VERSION).tar.xz
9 UCLIBC_SITE = http://downloads.uclibc-ng.org/releases/$(UCLIBC_VERSION)
10 UCLIBC_LICENSE = LGPLv2.1+
11 UCLIBC_LICENSE_FILES = COPYING.LIB
12 UCLIBC_INSTALL_STAGING = YES
14 define UCLIBC_HELP_CMDS
15 @echo ' uclibc-menuconfig - Run uClibc menuconfig'
16 endef
18 # uclibc is part of the toolchain so disable the toolchain dependency
19 UCLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO
21 # Before uClibc is configured, we must have the first stage
22 # cross-compiler and the kernel headers
23 UCLIBC_DEPENDENCIES = host-gcc-initial linux-headers
25 # specifying UCLIBC_CONFIG_FILE on the command-line overrides the .config
26 # setting.
27 ifndef UCLIBC_CONFIG_FILE
28 UCLIBC_CONFIG_FILE = $(call qstrip,$(BR2_UCLIBC_CONFIG))
29 endif
31 UCLIBC_KCONFIG_FILE = $(UCLIBC_CONFIG_FILE)
32 UCLIBC_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_UCLIBC_CONFIG_FRAGMENT_FILES))
34 UCLIBC_KCONFIG_OPTS = \
35 $(UCLIBC_MAKE_FLAGS) \
36 PREFIX=$(STAGING_DIR) \
37 DEVEL_PREFIX=/usr/ \
38 RUNTIME_PREFIX=$(STAGING_DIR)/ \
40 UCLIBC_TARGET_ARCH = $(call qstrip,$(BR2_UCLIBC_TARGET_ARCH))
42 UCLIBC_GENERATE_LOCALES = $(call qstrip,$(BR2_GENERATE_LOCALE))
44 ifeq ($(UCLIBC_GENERATE_LOCALES),)
45 # We need at least one locale
46 UCLIBC_LOCALES = en_US
47 else
48 # Strip out the encoding part of locale names, if any
49 UCLIBC_LOCALES = \
50 $(foreach locale,$(UCLIBC_GENERATE_LOCALES),\
51 $(firstword $(subst .,$(space),$(locale))))
52 endif
54 # noMMU binary formats
55 ifeq ($(BR2_BINFMT_FDPIC),y)
56 define UCLIBC_BINFMT_CONFIG
57 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT,$(@D)/.config)
58 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)/.config)
59 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT,$(@D)/.config)
60 $(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config)
61 endef
62 endif
63 ifeq ($(BR2_BINFMT_FLAT_ONE),y)
64 define UCLIBC_BINFMT_CONFIG
65 $(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FLAT,$(@D)/.config)
66 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)/.config)
67 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT,$(@D)/.config)
68 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config)
69 endef
70 endif
71 ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y)
72 define UCLIBC_BINFMT_CONFIG
73 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT,$(@D)/.config)
74 $(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)/.config)
75 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT,$(@D)/.config)
76 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config)
77 endef
78 endif
79 ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
80 define UCLIBC_BINFMT_CONFIG
81 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT,$(@D)/.config)
82 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)/.config)
83 $(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT,$(@D)/.config)
84 $(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config)
85 endef
86 endif
89 # ARC definitions
92 ifeq ($(UCLIBC_TARGET_ARCH),arc)
93 UCLIBC_ARC_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_ARC_TYPE))
94 define UCLIBC_ARC_TYPE_CONFIG
95 $(call KCONFIG_ENABLE_OPT,$(UCLIBC_ARC_TYPE),$(@D)/.config)
96 endef
98 UCLIBC_ARC_PAGE_SIZE = CONFIG_ARC_PAGE_SIZE_$(call qstrip,$(BR2_ARC_PAGE_SIZE))
99 define UCLIBC_ARC_PAGE_SIZE_CONFIG
100 $(SED) '/CONFIG_ARC_PAGE_SIZE_*/d' $(@D)/.config
101 $(call KCONFIG_ENABLE_OPT,$(UCLIBC_ARC_PAGE_SIZE),$(@D)/.config)
102 endef
104 endif # arc
107 # ARM definitions
110 ifeq ($(UCLIBC_TARGET_ARCH),arm)
111 define UCLIBC_ARM_ABI_CONFIG
112 $(SED) '/CONFIG_ARM_.ABI/d' $(@D)/.config
113 $(call KCONFIG_ENABLE_OPT,CONFIG_ARM_EABI,$(@D)/.config)
114 endef
116 # Thumb1 build is broken with threads with old gcc versions (< 4.8). Since
117 # all cores supporting Thumb1 also support ARM, we use ARM code in this case.
118 ifeq ($(BR2_GCC_VERSION_4_8_X)$(BR2_ARM_INSTRUCTIONS_THUMB)$(BR2_TOOLCHAIN_HAS_THREADS),yyy)
119 UCLIBC_EXTRA_CFLAGS += -marm
120 endif
122 ifeq ($(BR2_BINFMT_FLAT),y)
123 define UCLIBC_ARM_BINFMT_FLAT
124 $(call KCONFIG_DISABLE_OPT,DOPIC,$(@D)/.config)
125 endef
126 endif
128 # context functions are written with ARM instructions. Therefore, if
129 # we are using a Thumb2-only platform (i.e, Cortex-M), they must be
130 # disabled. Thumb1 platforms are not a problem, since they all also
131 # support the ARM instructions.
132 ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB2):$(BR2_ARM_CPU_HAS_ARM),y:)
133 define UCLIBC_ARM_NO_CONTEXT_FUNCS
134 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_CONTEXT_FUNCS,$(@D)/.config)
135 endef
136 endif
138 endif # arm
141 # m68k/coldfire definitions
144 ifeq ($(UCLIBC_TARGET_ARCH),m68k)
146 # disable DOPIC for flat without separate data
147 ifeq ($(BR2_BINFMT_FLAT_ONE),y)
148 define UCLIBC_M68K_BINFMT_FLAT
149 $(call KCONFIG_DISABLE_OPT,DOPIC,$(@D)/.config)
150 endef
151 endif
153 endif # m68k/coldfire
156 # MIPS definitions
159 ifeq ($(UCLIBC_TARGET_ARCH),mips)
160 UCLIBC_MIPS_ABI = CONFIG_MIPS_$(call qstrip,$(BR2_UCLIBC_MIPS_ABI))_ABI
161 define UCLIBC_MIPS_ABI_CONFIG
162 $(SED) '/CONFIG_MIPS_[NO].._ABI/d' $(@D)/.config
163 $(call KCONFIG_ENABLE_OPT,$(UCLIBC_MIPS_ABI),$(@D)/.config)
164 endef
166 UCLIBC_MIPS_NAN = CONFIG_MIPS_NAN_$(call qstrip,$(BR2_UCLIBC_MIPS_NAN))
167 define UCLIBC_MIPS_NAN_CONFIG
168 $(SED) '/CONFIG_MIPS_NAN_.*/d' $(@D)/.config
169 $(call KCONFIG_ENABLE_OPT,$(UCLIBC_MIPS_NAN),$(@D)/.config)
170 endef
171 endif # mips
174 # SH definitions
177 ifeq ($(UCLIBC_TARGET_ARCH),sh)
178 UCLIBC_SH_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_SH_TYPE))
179 define UCLIBC_SH_TYPE_CONFIG
180 $(SED) '/CONFIG_SH[234A]*/d' $(@D)/.config
181 $(call KCONFIG_ENABLE_OPT,$(UCLIBC_SH_TYPE),$(@D)/.config)
182 endef
183 endif # sh
186 # SPARC definitions
189 ifeq ($(UCLIBC_TARGET_ARCH),sparc)
190 UCLIBC_SPARC_TYPE = CONFIG_SPARC_$(call qstrip,$(BR2_UCLIBC_SPARC_TYPE))
191 define UCLIBC_SPARC_TYPE_CONFIG
192 $(SED) 's/^\(CONFIG_[^_]*[_]*SPARC[^=]*\)=.*/# \1 is not set/g' \
193 $(@D)/.config
194 $(call KCONFIG_ENABLE_OPT,$(UCLIBC_SPARC_TYPE),$(@D)/.config)
195 endef
196 endif # sparc
199 # PowerPC definitions
202 ifeq ($(UCLIBC_TARGET_ARCH),powerpc)
203 UCLIBC_POWERPC_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_POWERPC_TYPE))
204 define UCLIBC_POWERPC_TYPE_CONFIG
205 $(call KCONFIG_DISABLE_OPT,CONFIG_GENERIC,$(@D)/.config)
206 $(call KCONFIG_DISABLE_OPT,CONFIG_E500,$(@D)/.config)
207 $(call KCONFIG_ENABLE_OPT,$(UCLIBC_POWERPC_TYPE),$(@D)/.config)
208 endef
209 endif # powerpc
212 # x86 definitions
214 ifeq ($(UCLIBC_TARGET_ARCH),i386)
215 UCLIBC_X86_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_X86_TYPE))
216 define UCLIBC_X86_TYPE_CONFIG
217 $(call KCONFIG_ENABLE_OPT,$(UCLIBC_X86_TYPE),$(@D)/.config)
218 endef
219 endif
222 # Debug
224 ifeq ($(BR2_ENABLE_DEBUG),y)
225 define UCLIBC_DEBUG_CONFIG
226 $(call KCONFIG_ENABLE_OPT,DODEBUG,$(@D)/.config)
227 endef
228 endif
231 # Endianness
234 ifeq ($(call qstrip,$(BR2_ENDIAN)),BIG)
235 define UCLIBC_ENDIAN_CONFIG
236 $(call KCONFIG_ENABLE_OPT,ARCH_BIG_ENDIAN,$(@D)/.config)
237 $(call KCONFIG_ENABLE_OPT,ARCH_WANTS_BIG_ENDIAN,$(@D)/.config)
238 $(call KCONFIG_DISABLE_OPT,ARCH_LITTLE_ENDIAN,$(@D)/.config)
239 $(call KCONFIG_DISABLE_OPT,ARCH_WANTS_LITTLE_ENDIAN,$(@D)/.config)
240 endef
241 else
242 define UCLIBC_ENDIAN_CONFIG
243 $(call KCONFIG_ENABLE_OPT,ARCH_LITTLE_ENDIAN,$(@D)/.config)
244 $(call KCONFIG_ENABLE_OPT,ARCH_WANTS_LITTLE_ENDIAN,$(@D)/.config)
245 $(call KCONFIG_DISABLE_OPT,ARCH_BIG_ENDIAN,$(@D)/.config)
246 $(call KCONFIG_DISABLE_OPT,ARCH_WANTS_BIG_ENDIAN,$(@D)/.config)
247 endef
248 endif
251 # MMU
254 ifeq ($(BR2_USE_MMU),y)
255 define UCLIBC_MMU_CONFIG
256 $(call KCONFIG_ENABLE_OPT,ARCH_USE_MMU,$(@D)/.config)
257 endef
258 else
259 define UCLIBC_MMU_CONFIG
260 $(call KCONFIG_DISABLE_OPT,ARCH_USE_MMU,$(@D)/.config)
261 endef
262 endif
265 # IPv6
268 UCLIBC_IPV6_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_IPV6,$(@D)/.config)
271 # RPC
274 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_INET_RPC),y)
275 define UCLIBC_RPC_CONFIG
276 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_RPC,$(@D)/.config)
277 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FULL_RPC,$(@D)/.config)
278 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_REENTRANT_RPC,$(@D)/.config)
279 endef
280 else
281 define UCLIBC_RPC_CONFIG
282 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_RPC,$(@D)/.config)
283 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_FULL_RPC,$(@D)/.config)
284 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_REENTRANT_RPC,$(@D)/.config)
285 endef
286 endif
289 # soft-float
292 ifeq ($(BR2_SOFT_FLOAT),y)
293 define UCLIBC_FLOAT_CONFIG
294 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_FPU,$(@D)/.config)
295 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FLOATS,$(@D)/.config)
296 $(call KCONFIG_ENABLE_OPT,DO_C99_MATH,$(@D)/.config)
297 endef
298 else
299 define UCLIBC_FLOAT_CONFIG
300 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FPU,$(@D)/.config)
301 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FLOATS,$(@D)/.config)
302 endef
303 endif
306 # SSP
308 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_USE_SSP),y)
309 define UCLIBC_SSP_CONFIG
310 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_SSP,$(@D)/.config)
311 $(call KCONFIG_ENABLE_OPT,UCLIBC_BUILD_SSP,$(@D)/.config)
312 endef
313 else
314 define UCLIBC_SSP_CONFIG
315 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_SSP,$(@D)/.config)
316 $(call KCONFIG_DISABLE_OPT,UCLIBC_BUILD_SSP,$(@D)/.config)
317 endef
318 endif
321 # Threads
323 ifeq ($(BR2_PTHREADS_NONE),y)
324 define UCLIBC_THREAD_CONFIG
325 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS,$(@D)/.config)
326 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LINUXTHREADS,$(@D)/.config)
327 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS_NATIVE,$(@D)/.config)
328 endef
329 else ifeq ($(BR2_PTHREADS),y)
330 define UCLIBC_THREAD_CONFIG
331 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS,$(@D)/.config)
332 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_LINUXTHREADS,$(@D)/.config)
333 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS_NATIVE,$(@D)/.config)
334 endef
335 else ifeq ($(BR2_PTHREADS_NATIVE),y)
336 define UCLIBC_THREAD_CONFIG
337 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS,$(@D)/.config)
338 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LINUXTHREADS,$(@D)/.config)
339 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS_NATIVE,$(@D)/.config)
340 endef
341 endif
344 # Thread debug
347 ifeq ($(BR2_PTHREAD_DEBUG),y)
348 UCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_ENABLE_OPT,PTHREADS_DEBUG_SUPPORT,$(@D)/.config)
349 else
350 UCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_DISABLE_OPT,PTHREADS_DEBUG_SUPPORT,$(@D)/.config)
351 endif
354 # Locale
357 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_LOCALE),y)
358 define UCLIBC_LOCALE_CONFIG
359 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_LOCALE,$(@D)/.config)
360 $(call KCONFIG_DISABLE_OPT,UCLIBC_BUILD_ALL_LOCALE,$(@D)/.config)
361 $(call KCONFIG_ENABLE_OPT,UCLIBC_BUILD_MINIMAL_LOCALE,$(@D)/.config)
362 $(call KCONFIG_SET_OPT,UCLIBC_BUILD_MINIMAL_LOCALES,"$(UCLIBC_LOCALES)",$(@D)/.config)
363 $(call KCONFIG_DISABLE_OPT,UCLIBC_PREGENERATED_LOCALE_DATA,$(@D)/.config)
364 $(call KCONFIG_DISABLE_OPT,DOWNLOAD_PREGENERATED_LOCALE_DATA,$(@D)/.config)
365 $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_XLOCALE,$(@D)/.config)
366 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_GLIBC_DIGIT_GROUPING,$(@D)/.config)
367 endef
368 else
369 define UCLIBC_LOCALE_CONFIG
370 $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LOCALE,$(@D)/.config)
371 endef
372 endif
375 # wchar
378 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_WCHAR),y)
379 UCLIBC_WCHAR_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_WCHAR,$(@D)/.config)
380 else
381 UCLIBC_WCHAR_CONFIG = $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_WCHAR,$(@D)/.config)
382 endif
385 # static/shared libs
388 ifeq ($(BR2_STATIC_LIBS),y)
389 UCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_DISABLE_OPT,HAVE_SHARED,$(@D)/.config)
390 else
391 UCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_ENABLE_OPT,HAVE_SHARED,$(@D)/.config)
392 endif
395 # Commands
398 UCLIBC_MAKE_FLAGS = \
399 ARCH="$(UCLIBC_TARGET_ARCH)" \
400 CROSS_COMPILE="$(TARGET_CROSS)" \
401 UCLIBC_EXTRA_CFLAGS="$(UCLIBC_EXTRA_CFLAGS) $(TARGET_ABI)" \
402 HOSTCC="$(HOSTCC)"
404 define UCLIBC_KCONFIG_FIXUP_CMDS
405 $(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D)/.config)
406 $(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH),$(@D)/.config)
407 $(call KCONFIG_SET_OPT,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D)/.config)
408 $(call KCONFIG_SET_OPT,KERNEL_HEADERS,"$(LINUX_HEADERS_DIR)/usr/include",$(@D)/.config)
409 $(call KCONFIG_SET_OPT,RUNTIME_PREFIX,"/",$(@D)/.config)
410 $(call KCONFIG_SET_OPT,DEVEL_PREFIX,"/usr",$(@D)/.config)
411 $(call KCONFIG_SET_OPT,SHARED_LIB_LOADER_PREFIX,"/lib",$(@D)/.config)
412 $(UCLIBC_MMU_CONFIG)
413 $(UCLIBC_BINFMT_CONFIG)
414 $(UCLIBC_ARC_TYPE_CONFIG)
415 $(UCLIBC_ARC_PAGE_SIZE_CONFIG)
416 $(UCLIBC_ARM_ABI_CONFIG)
417 $(UCLIBC_ARM_BINFMT_FLAT)
418 $(UCLIBC_ARM_NO_CONTEXT_FUNCS)
419 $(UCLIBC_M68K_BINFMT_FLAT)
420 $(UCLIBC_MIPS_ABI_CONFIG)
421 $(UCLIBC_MIPS_NAN_CONFIG)
422 $(UCLIBC_SH_TYPE_CONFIG)
423 $(UCLIBC_SPARC_TYPE_CONFIG)
424 $(UCLIBC_POWERPC_TYPE_CONFIG)
425 $(UCLIBC_X86_TYPE_CONFIG)
426 $(UCLIBC_DEBUG_CONFIG)
427 $(UCLIBC_ENDIAN_CONFIG)
428 $(UCLIBC_LARGEFILE_CONFIG)
429 $(UCLIBC_IPV6_CONFIG)
430 $(UCLIBC_RPC_CONFIG)
431 $(UCLIBC_FLOAT_CONFIG)
432 $(UCLIBC_SSP_CONFIG)
433 $(UCLIBC_THREAD_CONFIG)
434 $(UCLIBC_THREAD_DEBUG_CONFIG)
435 $(UCLIBC_LOCALE_CONFIG)
436 $(UCLIBC_WCHAR_CONFIG)
437 $(UCLIBC_SHARED_LIBS_CONFIG)
438 endef
440 define UCLIBC_BUILD_CMDS
441 $(MAKE) -C $(@D) $(UCLIBC_MAKE_FLAGS) headers
442 $(MAKE) -C $(@D) $(UCLIBC_MAKE_FLAGS)
443 $(MAKE) -C $(@D)/utils \
444 PREFIX=$(HOST_DIR) \
445 HOSTCC="$(HOSTCC)" hostutils
446 endef
448 ifeq ($(BR2_UCLIBC_INSTALL_UTILS),y)
449 define UCLIBC_INSTALL_UTILS_TARGET
450 $(MAKE1) -C $(@D) \
451 CC="$(TARGET_CC)" CPP="$(TARGET_CPP)" LD="$(TARGET_LD)" \
452 ARCH="$(UCLIBC_TARGET_ARCH)" \
453 PREFIX=$(TARGET_DIR) \
454 utils install_utils
455 endef
456 endif
458 define UCLIBC_INSTALL_TARGET_CMDS
459 $(MAKE1) -C $(@D) \
460 $(UCLIBC_MAKE_FLAGS) \
461 PREFIX=$(TARGET_DIR) \
462 DEVEL_PREFIX=/usr/ \
463 RUNTIME_PREFIX=/ \
464 install_runtime
465 $(UCLIBC_INSTALL_UTILS_TARGET)
466 $(UCLIBC_INSTALL_LDSO_SYMLINKS)
467 endef
469 # STATIC has no ld* tools, only getconf
470 ifeq ($(BR2_STATIC_LIBS),)
471 define UCLIBC_INSTALL_UTILS_STAGING
472 $(INSTALL) -D -m 0755 $(@D)/utils/ldd.host $(HOST_DIR)/usr/bin/ldd
473 ln -sf ldd $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-ldd
474 $(INSTALL) -D -m 0755 $(@D)/utils/ldconfig.host $(HOST_DIR)/usr/bin/ldconfig
475 ln -sf ldconfig $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-ldconfig
476 endef
477 endif
479 define UCLIBC_INSTALL_STAGING_CMDS
480 $(MAKE1) -C $(@D) \
481 $(UCLIBC_MAKE_FLAGS) \
482 PREFIX=$(STAGING_DIR) \
483 DEVEL_PREFIX=/usr/ \
484 RUNTIME_PREFIX=/ \
485 install_runtime install_dev
486 $(UCLIBC_INSTALL_UTILS_STAGING)
487 endef
489 # Checks to give errors that the user can understand
490 # Must be before we call to kconfig-package
491 ifeq ($(BR2_PACKAGE_UCLIBC)$(BR_BUILDING),yy)
492 ifeq ($(call qstrip,$(BR2_UCLIBC_CONFIG)),)
493 $(error No uClibc configuration file specified, check your BR2_UCLIBC_CONFIG setting)
494 endif
495 endif
497 $(eval $(kconfig-package))