| 1 | # |
| 2 | # Copyright (C) 2007-2011 OpenWrt.org |
| 3 | # Copyright (C) 2010 Vertical Communications |
| 4 | # |
| 5 | # This is free software, licensed under the GNU General Public License v2. |
| 6 | # See /LICENSE for more information. |
| 7 | # |
| 8 | |
| 9 | include $(TOPDIR)/rules.mk |
| 10 | include $(INCLUDE_DIR)/kernel.mk |
| 11 | |
| 12 | PKG_NAME:=base-files |
| 13 | PKG_RELEASE:=43.16 |
| 14 | |
| 15 | PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ |
| 16 | PKG_BUILD_DEPENDS:=opkg/host |
| 17 | |
| 18 | include $(INCLUDE_DIR)/package.mk |
| 19 | |
| 20 | ifneq ($(DUMP),1) |
| 21 | TARGET:=-$(BOARD) |
| 22 | ifneq ($(wildcard $(PLATFORM_DIR)/base-files-$(PROFILE) $(PLATFORM_SUBDIR)/base-files-$(PROFILE)),) |
| 23 | TARGET:=$(TARGET)-$(PROFILE) |
| 24 | endif |
| 25 | LIBGCC_VERSION:=$(GCC_VERSION) |
| 26 | ifneq ($(findstring $(ARCH) , mips64 x86_64 ),) |
| 27 | LIB_SUFFIX:=64 |
| 28 | endif |
| 29 | else |
| 30 | LIBC_VERSION:=<LIBC_VERSION> |
| 31 | LIBGCC_VERSION:=<LIBGCC_VERSION> |
| 32 | endif |
| 33 | |
| 34 | define Package/base-files |
| 35 | SECTION:=base |
| 36 | CATEGORY:=Base system |
| 37 | TITLE:=Base filesystem for OpenWrt |
| 38 | URL:=http://openwrt.org/ |
| 39 | VERSION:=$(PKG_RELEASE)-$(REVISION) |
| 40 | $(call Config,network.lan.proto,string,static,LAN Protocol) |
| 41 | $(call Config,network.lan.ipaddr,ip,192.168.1.1,LAN IP Address) |
| 42 | $(call Config,network.lan.netmask,netmask,255.255.255.0,LAN Network Mask) |
| 43 | $(call Config,network.lan.gateway,ip,,LAN Gateway) |
| 44 | $(call Config,network.lan.dns,ip,,LAN DNS server) |
| 45 | endef |
| 46 | |
| 47 | define Package/base-files/conffiles |
| 48 | /etc/banner |
| 49 | /etc/hosts |
| 50 | /etc/inittab |
| 51 | /etc/group |
| 52 | /etc/passwd |
| 53 | /etc/shadow |
| 54 | /etc/profile |
| 55 | /etc/shells |
| 56 | /etc/sysctl.conf |
| 57 | /etc/rc.local |
| 58 | /etc/sysupgrade.conf |
| 59 | /etc/config/ |
| 60 | /etc/dropbear/ |
| 61 | $(call $(TARGET)/conffiles) |
| 62 | endef |
| 63 | |
| 64 | define Package/base-files/description |
| 65 | This package contains a base filesystem and system scripts for OpenWrt. |
| 66 | endef |
| 67 | |
| 68 | |
| 69 | define Package/gcc/Default |
| 70 | SECTION:=libs |
| 71 | CATEGORY:=Base system |
| 72 | URL:=http://gcc.gnu.org/ |
| 73 | VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE) |
| 74 | endef |
| 75 | |
| 76 | |
| 77 | define Package/libgcc |
| 78 | $(call Package/gcc/Default) |
| 79 | TITLE:=GCC support library |
| 80 | DEPENDS+=@!(TARGET_avr32||TARGET_coldfire) |
| 81 | endef |
| 82 | |
| 83 | define Package/libgcc/config |
| 84 | menu "Configuration" |
| 85 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libgcc |
| 86 | |
| 87 | config LIBGCC_ROOT_DIR |
| 88 | string |
| 89 | prompt "libgcc shared library base directory" |
| 90 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libgcc |
| 91 | default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN |
| 92 | default "/" if NATIVE_TOOLCHAIN |
| 93 | |
| 94 | config LIBGCC_FILE_SPEC |
| 95 | string |
| 96 | prompt "libgcc shared library files (use wildcards)" |
| 97 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libgcc |
| 98 | default "./lib/libgcc_s.so.*" |
| 99 | |
| 100 | endmenu |
| 101 | endef |
| 102 | |
| 103 | define Package/libssp |
| 104 | $(call Package/gcc/Default) |
| 105 | DEPENDS+=@SSP_SUPPORT |
| 106 | TITLE:=GCC support library |
| 107 | endef |
| 108 | |
| 109 | define Package/libssp/config |
| 110 | menu "Configuration" |
| 111 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libssp |
| 112 | |
| 113 | config LIBSPP_ROOT_DIR |
| 114 | string |
| 115 | prompt "libssp shared library base directory" |
| 116 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libssp |
| 117 | default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN |
| 118 | default "/" if NATIVE_TOOLCHAIN |
| 119 | |
| 120 | config LIBSSP_FILE_SPEC |
| 121 | string |
| 122 | prompt "libssp shared library files (use wildcards)" |
| 123 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libssp |
| 124 | default "./lib/libssp.so.*" |
| 125 | |
| 126 | endmenu |
| 127 | endef |
| 128 | |
| 129 | |
| 130 | define Package/libstdcpp |
| 131 | $(call Package/gcc/Default) |
| 132 | NAME:=libstdc++ |
| 133 | TITLE:=GNU Standard C++ Library v3 |
| 134 | DEPENDS+=@INSTALL_LIBSTDCPP |
| 135 | endef |
| 136 | |
| 137 | define Package/libstdcpp/config |
| 138 | menu "Configuration" |
| 139 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp |
| 140 | |
| 141 | config LIBSTDCPP_ROOT_DIR |
| 142 | string |
| 143 | prompt "libstdcpp shared library base directory" |
| 144 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp |
| 145 | default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN |
| 146 | default "/" if NATIVE_TOOLCHAIN |
| 147 | |
| 148 | config LIBSTDCPP_FILE_SPEC |
| 149 | string |
| 150 | prompt "libstdc++ shared library files (use wildcards)" |
| 151 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libstdcpp |
| 152 | default "./lib/libstdc++.so.*" |
| 153 | |
| 154 | endmenu |
| 155 | endef |
| 156 | |
| 157 | |
| 158 | define Package/libc/Default |
| 159 | SECTION:=libs |
| 160 | CATEGORY:=Base system |
| 161 | VERSION:=$(LIBC_VERSION)-$(PKG_RELEASE) |
| 162 | ifneq ($(TARGET_avr32)$(TARGET_coldfire),) |
| 163 | DEPENDS:=+libgcc |
| 164 | endif |
| 165 | URL:=$(LIBC_URL) |
| 166 | PKG_FLAGS:=hold essential |
| 167 | endef |
| 168 | |
| 169 | |
| 170 | define Package/libc |
| 171 | $(call Package/libc/Default) |
| 172 | TITLE:=C library |
| 173 | endef |
| 174 | |
| 175 | define Package/libc/config |
| 176 | menu "Configuration" |
| 177 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libc |
| 178 | |
| 179 | config LIBC_ROOT_DIR |
| 180 | string |
| 181 | prompt "libc shared library base directory" |
| 182 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libc |
| 183 | default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN |
| 184 | default "/" if NATIVE_TOOLCHAIN |
| 185 | |
| 186 | config LIBC_FILE_SPEC |
| 187 | string |
| 188 | prompt "libc shared library files (use wildcards)" |
| 189 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libc |
| 190 | default "./lib/ld{-*.so,-linux*.so.*} ./lib/lib{anl,c,cidn,crypt,dl,m,nsl,nss_dns,nss_files,resolv,util}{-*.so,.so.*}" |
| 191 | |
| 192 | endmenu |
| 193 | endef |
| 194 | |
| 195 | |
| 196 | define Package/libpthread |
| 197 | $(call Package/libc/Default) |
| 198 | TITLE:=POSIX thread library |
| 199 | DEPENDS:= +librt |
| 200 | endef |
| 201 | |
| 202 | define Package/libpthread/config |
| 203 | menu "Configuration" |
| 204 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libpthread |
| 205 | |
| 206 | config LIBPTHREAD_ROOT_DIR |
| 207 | string |
| 208 | prompt "libpthread shared library base directory" |
| 209 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libpthread |
| 210 | default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN |
| 211 | default "/" if NATIVE_TOOLCHAIN |
| 212 | |
| 213 | config LIBPTHREAD_FILE_SPEC |
| 214 | string |
| 215 | prompt "libpthread shared library files (use wildcards)" |
| 216 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libpthread |
| 217 | default "./lib/libpthread{-*.so,.so.*}" |
| 218 | |
| 219 | endmenu |
| 220 | endef |
| 221 | |
| 222 | |
| 223 | define Package/librt |
| 224 | $(call Package/libc/Default) |
| 225 | TITLE:=POSIX.1b RealTime extension library |
| 226 | endef |
| 227 | |
| 228 | define Package/librt/config |
| 229 | menu "Configuration" |
| 230 | depends EXTERNAL_TOOLCHAIN && PACKAGE_librt |
| 231 | |
| 232 | config LIBRT_ROOT_DIR |
| 233 | string |
| 234 | prompt "librt shared library base directory" |
| 235 | depends EXTERNAL_TOOLCHAIN && PACKAGE_librt |
| 236 | default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN |
| 237 | default "/" if NATIVE_TOOLCHAIN |
| 238 | |
| 239 | config LIBRT_FILE_SPEC |
| 240 | string |
| 241 | prompt "librt shared library files (use wildcards)" |
| 242 | depends EXTERNAL_TOOLCHAIN && PACKAGE_librt |
| 243 | default "./lib/librt{-*.so,.so.*}" |
| 244 | |
| 245 | endmenu |
| 246 | endef |
| 247 | |
| 248 | |
| 249 | define Package/libgfortran |
| 250 | $(call Package/gcc/Default) |
| 251 | TITLE:=GFortran support library |
| 252 | DEPENDS+=@!(TARGET_avr32||TARGET_coldfire) @INSTALL_GFORTRAN |
| 253 | endef |
| 254 | |
| 255 | define Package/libgfortran/config |
| 256 | menu "Configuration" |
| 257 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran |
| 258 | |
| 259 | config LIBGFORTRAN_ROOT_DIR |
| 260 | string |
| 261 | prompt "libgfortran shared library base directory" |
| 262 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran |
| 263 | default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN |
| 264 | default "/" if NATIVE_TOOLCHAIN |
| 265 | |
| 266 | config LIBGFORTRAN_FILE_SPEC |
| 267 | string |
| 268 | prompt "libgcc shared library files (use wildcards)" |
| 269 | depends EXTERNAL_TOOLCHAIN && PACKAGE_libgfortran |
| 270 | default "./usr/lib/libgfortran.so.*" |
| 271 | |
| 272 | endmenu |
| 273 | endef |
| 274 | |
| 275 | define Package/ldd |
| 276 | $(call Package/libc/Default) |
| 277 | SECTION:=utils |
| 278 | CATEGORY:=Utilities |
| 279 | TITLE:=LDD trace utility |
| 280 | endef |
| 281 | |
| 282 | define Package/ldd/config |
| 283 | menu "Configuration" |
| 284 | depends EXTERNAL_TOOLCHAIN && PACKAGE_ldd |
| 285 | |
| 286 | config LDD_ROOT_DIR |
| 287 | string |
| 288 | prompt "ldd trace utility base directory" |
| 289 | depends EXTERNAL_TOOLCHAIN && PACKAGE_ldd |
| 290 | default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN |
| 291 | default "/" if NATIVE_TOOLCHAIN |
| 292 | |
| 293 | config LDD_FILE_SPEC |
| 294 | string |
| 295 | prompt "ldd trace utility file" |
| 296 | depends EXTERNAL_TOOLCHAIN && PACKAGE_ldd |
| 297 | default "./usr/bin/ldd" |
| 298 | |
| 299 | endmenu |
| 300 | endef |
| 301 | |
| 302 | |
| 303 | define Package/ldconfig |
| 304 | $(call Package/libc/Default) |
| 305 | SECTION:=utils |
| 306 | CATEGORY:=Utilities |
| 307 | TITLE:=Shared library path configuration |
| 308 | endef |
| 309 | |
| 310 | define Package/ldconfig/config |
| 311 | menu "Configuration" |
| 312 | depends EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig |
| 313 | |
| 314 | config LDCONFIG_ROOT_DIR |
| 315 | string |
| 316 | prompt "ldconfig base directory" |
| 317 | depends EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig |
| 318 | default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN |
| 319 | default "/" if NATIVE_TOOLCHAIN |
| 320 | |
| 321 | config LDCONFIG_FILE_SPEC |
| 322 | string |
| 323 | prompt "ldconfig file" |
| 324 | depends EXTERNAL_TOOLCHAIN && PACKAGE_ldconfig |
| 325 | default "./sbin/ldconfig" |
| 326 | |
| 327 | endmenu |
| 328 | endef |
| 329 | |
| 330 | |
| 331 | ifneq ($(CONFIG_PREINITOPT),) |
| 332 | define ImageConfigOptions |
| 333 | mkdir -p $(1)/lib/preinit |
| 334 | echo 'pi_suppress_stderr="$(CONFIG_TARGET_PREINIT_SUPPRESS_STDERR)"' >$(1)/lib/preinit/00_preinit.conf |
| 335 | echo 'fs_failsafe_wait_timeout=$(if $(CONFIG_TARGET_PREINIT_TIMEOUT),$(CONFIG_TARGET_PREINIT_TIMEOUT),2)' >>$(1)/lib/preinit/00_preinit.conf |
| 336 | echo 'pi_init_path=$(if $(CONFIG_TARGET_INIT_PATH),$(CONFIG_TARGET_INIT_PATH),"/bin:/sbin:/usr/bin:/usr/sbin")' >>$(1)/lib/preinit/00_preinit.conf |
| 337 | echo 'pi_init_env=$(if $(CONFIG_TARGET_INIT_ENV),$(CONFIG_TARGET_INIT_ENV),"")' >>$(1)/lib/preinit/00_preinit.conf |
| 338 | echo 'pi_init_cmd=$(if $(CONFIG_TARGET_INIT_CMD),$(CONFIG_TARGET_INIT_CMD),"/sbin/init")' >>$(1)/lib/preinit/00_preinit.conf |
| 339 | echo 'pi_init_suppress_stderr="$(CONFIG_TARGET_INIT_SUPPRESS_STDERR)"' >>$(1)/lib/preinit/00_preinit.conf |
| 340 | echo 'pi_ifname=$(if $(CONFIG_TARGET_PREINIT_IFNAME),$(CONFIG_TARGET_PREINIT_IFNAME),"")' >>$(1)/lib/preinit/00_preinit.conf |
| 341 | echo 'pi_ip=$(if $(CONFIG_TARGET_PREINIT_IP),$(CONFIG_TARGET_PREINIT_IP),"192.168.1.1")' >>$(1)/lib/preinit/00_preinit.conf |
| 342 | echo 'pi_netmask=$(if $(CONFIG_TARGET_PREINIT_NETMASK),$(CONFIG_TARGET_PREINIT_NETMASK),"255.255.255.0")' >>$(1)/lib/preinit/00_preinit.conf |
| 343 | echo 'pi_broadcast=$(if $(CONFIG_TARGET_PREINIT_BROADCAST),$(CONFIG_TARGET_PREINIT_BROADCAST),"192.168.1.255")' >>$(1)/lib/preinit/00_preinit.conf |
| 344 | echo 'pi_preinit_net_messages="$(CONFIG_TARGET_PREINIT_SHOW_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf |
| 345 | echo 'pi_preinit_no_failsafe_netmsg="$(CONFIG_TARGET_SUPPRESS_FAILSAFE_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf |
| 346 | endef |
| 347 | endif |
| 348 | |
| 349 | define Build/Prepare |
| 350 | mkdir -p $(PKG_BUILD_DIR) |
| 351 | endef |
| 352 | |
| 353 | define Build/Compile/Default |
| 354 | endef |
| 355 | |
| 356 | define Build/Compile |
| 357 | $(call Build/Compile/Default) |
| 358 | endef |
| 359 | |
| 360 | define Package/base-files/install |
| 361 | $(CP) ./files/* $(1)/ |
| 362 | if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \ |
| 363 | $(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \ |
| 364 | fi |
| 365 | if [ -d $(PLATFORM_DIR)/base-files/. ]; then \ |
| 366 | $(CP) $(PLATFORM_DIR)/base-files/* $(1)/; \ |
| 367 | fi |
| 368 | if [ -d $(PLATFORM_DIR)/base-files-$(PROFILE)/. ]; then \ |
| 369 | $(CP) $(PLATFORM_DIR)/base-files-$(PROFILE)/* $(1)/; \ |
| 370 | fi |
| 371 | if [ -d $(PLATFORM_DIR)/$(PROFILE)/base-files/. ]; then \ |
| 372 | $(CP) $(PLATFORM_DIR)/$(PROFILE)/base-files/* $(1)/; \ |
| 373 | fi |
| 374 | $(if $(filter-out $(PLATFORM_DIR),$(PLATFORM_SUBDIR)), \ |
| 375 | if [ -d $(PLATFORM_SUBDIR)/base-files/. ]; then \ |
| 376 | $(CP) $(PLATFORM_SUBDIR)/base-files/* $(1)/; \ |
| 377 | fi; \ |
| 378 | if [ -d $(PLATFORM_SUBDIR)/base-files-$(PROFILE)/. ]; then \ |
| 379 | $(CP) $(PLATFORM_SUBDIR)/base-files-$(PROFILE)/* $(1)/; \ |
| 380 | fi; \ |
| 381 | if [ -d $(PLATFORM_SUBDIR)/$(PROFILE)/base-files/. ]; then \ |
| 382 | $(CP) $(PLATFORM_SUBDIR)/$(PROFILE)/base-files/* $(1)/; \ |
| 383 | fi \ |
| 384 | ) |
| 385 | # Form valid /etc/shadow entries, by copying the user:pw pairs |
| 386 | # from /etc/passwd, and adding on pw change data |
| 387 | $(if $(CONFIG_BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS), \ |
| 388 | cut -d ':' -f 1-2 $(1)/etc/passwd > $(1)/etc/shadow; \ |
| 389 | $(SED) 's/$$$$/:13848:0:99999:7:::/' $(1)/etc/shadow \ |
| 390 | ) |
| 391 | $(SED) 's,$$$$R,$(REVISION),g' $(1)/etc/banner |
| 392 | mkdir -p $(1)/CONTROL |
| 393 | mkdir -p $(1)/dev |
| 394 | mkdir -p $(1)/etc/crontabs |
| 395 | mkdir -p $(1)/etc/rc.d |
| 396 | mkdir -p $(1)/overlay |
| 397 | mkdir -p $(1)/lib/firmware |
| 398 | $(if $(LIB_SUFFIX),-ln -s lib $(1)/lib$(LIB_SUFFIX)) |
| 399 | mkdir -p $(1)/mnt |
| 400 | mkdir -p $(1)/proc |
| 401 | mkdir -p $(1)/tmp |
| 402 | mkdir -p $(1)/usr/lib |
| 403 | $(if $(LIB_SUFFIX),-ln -s lib $(1)/usr/lib$(LIB_SUFFIX)) |
| 404 | mkdir -p $(1)/usr/bin |
| 405 | mkdir -p $(1)/sys |
| 406 | mkdir -p $(1)/www |
| 407 | mkdir -p $(1)/root |
| 408 | ln -sf /proc/mounts $(1)/etc/mtab |
| 409 | rm -f $(1)/var |
| 410 | ln -sf /tmp $(1)/var |
| 411 | mkdir -p $(1)/etc |
| 412 | ln -sf /tmp/resolv.conf /tmp/fstab /tmp/TZ $(1)/etc/ |
| 413 | $(call ImageConfigOptions,$(1)) |
| 414 | $(call Package/base-files/install-target,$(1)) |
| 415 | for conffile in $(1)/etc/config/*; do \ |
| 416 | if [ -f "$$$$conffile" ]; then \ |
| 417 | grep "$$$${conffile##$(1)}" $(1)/CONTROL/conffiles || \ |
| 418 | echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \ |
| 419 | fi \ |
| 420 | done |
| 421 | endef |
| 422 | |
| 423 | ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) |
| 424 | |
| 425 | define Package/libgcc/install |
| 426 | $(INSTALL_DIR) $(1)/lib |
| 427 | $(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/ |
| 428 | endef |
| 429 | |
| 430 | define Package/libgfortran/install |
| 431 | $(INSTALL_DIR) $(1)/usr/lib |
| 432 | $(CP) $(TOOLCHAIN_DIR)/usr/lib/libgfortran.so.* $(1)/usr/lib/ |
| 433 | endef |
| 434 | |
| 435 | define Package/libssp/install |
| 436 | $(INSTALL_DIR) $(1)/lib |
| 437 | $(CP) $(TOOLCHAIN_DIR)/lib/libssp.so.* $(1)/lib/ |
| 438 | endef |
| 439 | |
| 440 | define Package/libstdcpp/install |
| 441 | $(INSTALL_DIR) $(1)/usr/lib |
| 442 | $(CP) $(TOOLCHAIN_DIR)/usr/lib/libstdc++.so.* $(1)/usr/lib/ |
| 443 | endef |
| 444 | |
| 445 | use_libutil=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),libutil) |
| 446 | use_libnsl=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_NIS),libnsl) |
| 447 | use_nsswitch=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_NSSWITCH),libnss_dns libnss_files) |
| 448 | |
| 449 | define Package/glibc/install |
| 450 | $(INSTALL_DIR) $(1)/lib |
| 451 | $(CP) $(TOOLCHAIN_DIR)/lib/ld*.so.* $(1)/lib/ |
| 452 | $(CP) $(TOOLCHAIN_DIR)/lib/ld-$(LIBC_SO_VERSION).so $(1)/lib/ |
| 453 | for file in libanl libc libcidn libcrypt libdl libm $(use_libnsl) $(use_nsswitch) libresolv $(use_libutil); do \ |
| 454 | $(CP) $(TOOLCHAIN_DIR)/lib/$$$$file.so.* $(1)/lib/; \ |
| 455 | $(CP) $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so $(1)/lib/; \ |
| 456 | done |
| 457 | endef |
| 458 | |
| 459 | define Package/eglibc/install |
| 460 | $(call Package/glibc/install,$1) |
| 461 | endef |
| 462 | |
| 463 | define Package/uClibc/install |
| 464 | $(INSTALL_DIR) $(1)/lib |
| 465 | $(CP) \ |
| 466 | $(TOOLCHAIN_DIR)/lib/ld*-uClibc.so.* \ |
| 467 | $(TOOLCHAIN_DIR)/lib/ld*-uClibc-$(LIBC_SO_VERSION).so \ |
| 468 | $(1)/lib/ |
| 469 | $(CP) \ |
| 470 | $(TOOLCHAIN_DIR)/lib/libc.so.* \ |
| 471 | $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \ |
| 472 | $(1)/lib/ |
| 473 | for file in libcrypt libdl libm libnsl libresolv libutil; do \ |
| 474 | $(CP) \ |
| 475 | $(TOOLCHAIN_DIR)/lib/$$$$file.so.* \ |
| 476 | $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \ |
| 477 | $(1)/lib/; \ |
| 478 | done |
| 479 | endef |
| 480 | |
| 481 | define Package/libc/install |
| 482 | $(call Package/$(LIBC)/install,$1) |
| 483 | endef |
| 484 | |
| 485 | define Package/libc/install_lib |
| 486 | $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/usr/lib/lib*.a)) $(1)/lib/ |
| 487 | $(if $(wildcard $(TOOLCHAIN_DIR)/usr/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/usr/lib/libc_so.a $(1)/lib/libc_pic.a) |
| 488 | $(if $(wildcard $(TOOLCHAIN_DIR)/usr/lib/gcc/*/*/libgcc.map), \ |
| 489 | $(CP) $(TOOLCHAIN_DIR)/usr/lib/gcc/*/*/libgcc_pic.a $(1)/lib/libgcc_s_pic.a; \ |
| 490 | $(CP) $(TOOLCHAIN_DIR)/usr/lib/gcc/*/*/libgcc.map $(1)/lib/libgcc_s_pic.map \ |
| 491 | ) |
| 492 | endef |
| 493 | |
| 494 | define Package/libpthread/install |
| 495 | $(INSTALL_DIR) $(1)/lib |
| 496 | $(CP) $(TOOLCHAIN_DIR)/lib/libpthread.so.* $(1)/lib/ |
| 497 | $(CP) $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so $(1)/lib/ |
| 498 | endef |
| 499 | |
| 500 | define Package/libpthread/install_lib |
| 501 | $(if $(wildcard $(TOOLCHAIN_DIR)/usr/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/usr/lib/libpthread_so.a $(1)/lib/libpthread_pic.a) |
| 502 | endef |
| 503 | |
| 504 | define Package/librt/install |
| 505 | $(INSTALL_DIR) $(1)/lib |
| 506 | $(CP) $(TOOLCHAIN_DIR)/lib/librt.so.* $(1)/lib/ |
| 507 | $(CP) $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so $(1)/lib/ |
| 508 | endef |
| 509 | |
| 510 | define Package/ldd/install |
| 511 | $(INSTALL_DIR) $(1)/usr/bin/ |
| 512 | $(CP) $(TOOLCHAIN_DIR)/usr/bin/ldd $(1)/usr/bin/ |
| 513 | endef |
| 514 | |
| 515 | define Package/ldconfig/install |
| 516 | $(INSTALL_DIR) $(1)/sbin/ |
| 517 | $(CP) $(TOOLCHAIN_DIR)/sbin/ldconfig $(1)/sbin/ |
| 518 | endef |
| 519 | |
| 520 | else |
| 521 | |
| 522 | define Package/libgcc/install |
| 523 | for file in $(call qstrip,$(CONFIG_LIBGCC_FILE_SPEC)); do \ |
| 524 | dir=`dirname $$$$file` ; \ |
| 525 | $(INSTALL_DIR) $(1)/$$$$dir ; \ |
| 526 | $(CP) $(call qstrip,$(CONFIG_LIBGCC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \ |
| 527 | done |
| 528 | endef |
| 529 | |
| 530 | define Package/libgfortran/install |
| 531 | for file in $(call qstrip,$(CONFIG_LIBGFORTRAN_FILE_SPEC)); do \ |
| 532 | dir=`dirname $$$$file` ; \ |
| 533 | $(INSTALL_DIR) $(1)/$$$$dir ; \ |
| 534 | $(CP) $(call qstrip,$(CONFIG_LIBGFORTRAN_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \ |
| 535 | done |
| 536 | endef |
| 537 | |
| 538 | define Package/libssp/install |
| 539 | for file in $(call qstrip,$(CONFIG_LIBSSP_FILE_SPEC)); do \ |
| 540 | dir=`dirname $$$$file` ; \ |
| 541 | $(INSTALL_DIR) $(1)/$$$$dir ; \ |
| 542 | $(CP) $(call qstrip,$(CONFIG_LIBSSP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \ |
| 543 | done |
| 544 | endef |
| 545 | |
| 546 | define Package/libstdcpp/install |
| 547 | for file in $(call qstrip,$(CONFIG_LIBSTDCPP_FILE_SPEC)); do \ |
| 548 | dir=`dirname $$$$file` ; \ |
| 549 | $(INSTALL_DIR) $(1)/$$$$dir ; \ |
| 550 | $(CP) $(call qstrip,$(CONFIG_LIBSTDCPP_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \ |
| 551 | done |
| 552 | endef |
| 553 | |
| 554 | define Package/libc/install |
| 555 | for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \ |
| 556 | dir=`dirname $$$$file` ; \ |
| 557 | $(INSTALL_DIR) $(1)/$$$$dir ; \ |
| 558 | $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \ |
| 559 | done |
| 560 | endef |
| 561 | |
| 562 | define Package/libpthread/install |
| 563 | for file in $(call qstrip,$(CONFIG_LIBPTHREAD_FILE_SPEC)); do \ |
| 564 | dir=`dirname $$$$file` ; \ |
| 565 | $(INSTALL_DIR) $(1)/$$$$dir ; \ |
| 566 | $(CP) $(call qstrip,$(CONFIG_LIBPTHREAD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \ |
| 567 | done |
| 568 | endef |
| 569 | |
| 570 | define Package/librt/install |
| 571 | for file in $(call qstrip,$(CONFIG_LIBRT_FILE_SPEC)); do \ |
| 572 | dir=`dirname $$$$file` ; \ |
| 573 | $(INSTALL_DIR) $(1)/$$$$dir ; \ |
| 574 | $(CP) $(call qstrip,$(CONFIG_LIBRT_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \ |
| 575 | done |
| 576 | endef |
| 577 | |
| 578 | define Package/ldd/install |
| 579 | for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \ |
| 580 | dir=`dirname $$$$file` ; \ |
| 581 | $(INSTALL_DIR) $(1)/$$$$dir ; \ |
| 582 | $(CP) $(call qstrip,$(CONFIG_LDD_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \ |
| 583 | done |
| 584 | endef |
| 585 | |
| 586 | define Package/ldconfig/install |
| 587 | for file in $(call qstrip,$(CONFIG_LDCONFIG_FILE_SPEC)); do \ |
| 588 | dir=`dirname $$$$file` ; \ |
| 589 | $(INSTALL_DIR) $(1)/$$$$dir ; \ |
| 590 | $(CP) $(call qstrip,$(CONFIG_LDCONFIG_ROOT_DIR))/$$$$file $(1)/$$$$dir/ ; \ |
| 591 | done |
| 592 | endef |
| 593 | |
| 594 | endif |
| 595 | |
| 596 | ifneq ($(DUMP),1) |
| 597 | -include $(PLATFORM_DIR)/base-files.mk |
| 598 | endif |
| 599 | |
| 600 | $(eval $(call BuildPackage,base-files)) |
| 601 | $(eval $(call BuildPackage,libc)) |
| 602 | $(eval $(call BuildPackage,libgcc)) |
| 603 | $(eval $(call BuildPackage,libssp)) |
| 604 | $(eval $(call BuildPackage,libstdcpp)) |
| 605 | $(eval $(call BuildPackage,libpthread)) |
| 606 | $(eval $(call BuildPackage,librt)) |
| 607 | $(eval $(call BuildPackage,libgfortran)) |
| 608 | $(eval $(call BuildPackage,ldd)) |
| 609 | $(eval $(call BuildPackage,ldconfig)) |
| 610 | |