summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-core
downloadpoky-c527fd1f14c27855a37f2e8ac5346ce8d940ced2.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/base-files/base-files/filesystems8
-rw-r--r--meta/recipes-core/base-files/base-files/fstab12
-rw-r--r--meta/recipes-core/base-files/base-files/host.conf2
-rw-r--r--meta/recipes-core/base-files/base-files/inputrc61
-rw-r--r--meta/recipes-core/base-files/base-files/issue0
-rw-r--r--meta/recipes-core/base-files/base-files/issue.net0
-rw-r--r--meta/recipes-core/base-files/base-files/licenses/GPL-2340
-rw-r--r--meta/recipes-core/base-files/base-files/motd0
-rw-r--r--meta/recipes-core/base-files/base-files/nsswitch.conf19
-rw-r--r--meta/recipes-core/base-files/base-files/profile32
-rw-r--r--meta/recipes-core/base-files/base-files/rotation1
-rw-r--r--meta/recipes-core/base-files/base-files/share/dot.bashrc16
-rw-r--r--meta/recipes-core/base-files/base-files/share/dot.profile10
-rw-r--r--meta/recipes-core/base-files/base-files/shells2
-rw-r--r--meta/recipes-core/base-files/base-files/usbd0
-rw-r--r--meta/recipes-core/base-files/base-files_3.0.14.bb148
-rw-r--r--meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch19
-rw-r--r--meta/recipes-core/base-passwd/base-passwd/disable-docs.patch24
-rw-r--r--meta/recipes-core/base-passwd/base-passwd/input.patch22
-rw-r--r--meta/recipes-core/base-passwd/base-passwd/nobash.patch15
-rw-r--r--meta/recipes-core/base-passwd/base-passwd/noshadow.patch14
-rw-r--r--meta/recipes-core/base-passwd/base-passwd_3.5.29.bb97
-rw-r--r--meta/recipes-core/busybox/busybox.inc406
-rw-r--r--meta/recipes-core/busybox/busybox/0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch40
-rw-r--r--meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch37
-rw-r--r--meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch137
-rw-r--r--meta/recipes-core/busybox/busybox/defconfig1020
-rw-r--r--meta/recipes-core/busybox/busybox/fail_on_no_media.patch31
-rw-r--r--meta/recipes-core/busybox/busybox/get_header_tar.patch22
-rw-r--r--meta/recipes-core/busybox/busybox/login-utilities.cfg13
-rw-r--r--meta/recipes-core/busybox/busybox_1.22.1.bb42
-rw-r--r--meta/recipes-core/busybox/busybox_git.bb46
-rwxr-xr-xmeta/recipes-core/busybox/files/busybox-cron39
-rwxr-xr-xmeta/recipes-core/busybox/files/busybox-httpd44
-rw-r--r--meta/recipes-core/busybox/files/busybox-klogd.service.in8
-rw-r--r--meta/recipes-core/busybox/files/busybox-syslog.default25
-rw-r--r--meta/recipes-core/busybox/files/busybox-syslog.service.in13
-rwxr-xr-xmeta/recipes-core/busybox/files/busybox-udhcpd43
-rw-r--r--meta/recipes-core/busybox/files/default.script4
-rw-r--r--meta/recipes-core/busybox/files/find-touchscreen.sh9
-rw-r--r--meta/recipes-core/busybox/files/hwclock.sh83
-rw-r--r--meta/recipes-core/busybox/files/inetd33
-rw-r--r--meta/recipes-core/busybox/files/inetd.conf20
-rwxr-xr-xmeta/recipes-core/busybox/files/mdev7
-rw-r--r--meta/recipes-core/busybox/files/mdev.conf37
-rwxr-xr-xmeta/recipes-core/busybox/files/mount.busybox3
-rw-r--r--meta/recipes-core/busybox/files/run-ptest7
-rw-r--r--meta/recipes-core/busybox/files/simple.script86
-rw-r--r--meta/recipes-core/busybox/files/syslog77
-rw-r--r--meta/recipes-core/busybox/files/syslog-startup.conf13
-rw-r--r--meta/recipes-core/busybox/files/syslog.conf1
-rwxr-xr-xmeta/recipes-core/busybox/files/umount.busybox3
-rw-r--r--meta/recipes-core/console-tools/console-tools-0.3.2/Makevars41
-rw-r--r--meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch17
-rw-r--r--meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch12
-rw-r--r--meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch29
-rw-r--r--meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch56
-rw-r--r--meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch75
-rw-r--r--meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m424
-rw-r--r--meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch22
-rw-r--r--meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch49
-rw-r--r--meta/recipes-core/console-tools/console-tools_0.3.2.bb36
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch120
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch28
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch101
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch375
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch4051
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch117
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch19
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch32
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch85
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/futimens.patch63
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch21
-rw-r--r--meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch24
-rw-r--r--meta/recipes-core/coreutils/coreutils-8.22/dummy_help2man.patch22
-rw-r--r--meta/recipes-core/coreutils/coreutils-8.22/fix-for-dummy-man-usage.patch31
-rw-r--r--meta/recipes-core/coreutils/coreutils-8.22/remove-usr-local-lib-from-m4.patch31
-rw-r--r--meta/recipes-core/coreutils/coreutils_6.9.bb106
-rw-r--r--meta/recipes-core/coreutils/coreutils_8.22.bb101
-rw-r--r--meta/recipes-core/dbus-wait/dbus-wait_git.bb17
-rw-r--r--meta/recipes-core/dbus/dbus-glib-0.100.2/no-examples.patch15
-rw-r--r--meta/recipes-core/dbus/dbus-glib-0.100.2/obsolete_automake_macros.patch15
-rw-r--r--meta/recipes-core/dbus/dbus-glib-0.100.2/test-install-makefile.patch48
-rw-r--r--meta/recipes-core/dbus/dbus-glib.inc44
-rw-r--r--meta/recipes-core/dbus/dbus-glib_0.100.2.bb5
-rw-r--r--meta/recipes-core/dbus/dbus-test_1.6.18.bb54
-rw-r--r--meta/recipes-core/dbus/dbus.inc157
-rw-r--r--meta/recipes-core/dbus/dbus/Set-correct-address-when-using-address-systemd.patch193
-rw-r--r--meta/recipes-core/dbus/dbus/avoid_parallel_tests.patch19
-rw-r--r--meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch104
-rw-r--r--meta/recipes-core/dbus/dbus/dbus-1.init123
-rw-r--r--meta/recipes-core/dbus/dbus/fixed-memory-freeing-if-error-during-listing-service.patch45
-rw-r--r--meta/recipes-core/dbus/dbus/os-test.patch35
-rw-r--r--meta/recipes-core/dbus/dbus/ptest.patch154
-rw-r--r--meta/recipes-core/dbus/dbus/python-config.patch25
-rwxr-xr-xmeta/recipes-core/dbus/dbus/run-ptest3
-rw-r--r--meta/recipes-core/dbus/dbus/tmpdir.patch44
-rw-r--r--meta/recipes-core/dbus/dbus_1.6.18.bb4
-rw-r--r--meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch229
-rw-r--r--meta/recipes-core/dropbear/dropbear.inc99
-rw-r--r--meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch23
-rw-r--r--meta/recipes-core/dropbear/dropbear/0003-configure.patch40
-rw-r--r--meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch22
-rw-r--r--meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch28
-rw-r--r--meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch22
-rw-r--r--meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch140
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbear4
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbear.socket10
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbear@.service11
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbearkey.service8
-rwxr-xr-xmeta/recipes-core/dropbear/dropbear/init113
-rw-r--r--meta/recipes-core/dropbear/dropbear/run-ptest2
-rw-r--r--meta/recipes-core/dropbear/dropbear_2014.63.bb4
-rw-r--r--meta/recipes-core/eglibc/cross-localedef-native_2.19.bb49
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch56
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch912
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch36
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch169
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch176
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch143
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch17
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch20
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch21
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch38
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf0
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch22
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch38
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch18
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch100
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk11
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch1516
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch20
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch56
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch26
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch17
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch184
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch365
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch47
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch108
-rw-r--r--meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch41
-rw-r--r--meta/recipes-core/eglibc/eglibc-collateral.inc12
-rw-r--r--meta/recipes-core/eglibc/eglibc-common.inc9
-rw-r--r--meta/recipes-core/eglibc/eglibc-initial.inc78
-rw-r--r--meta/recipes-core/eglibc/eglibc-initial_2.19.bb11
-rw-r--r--meta/recipes-core/eglibc/eglibc-ld.inc56
-rw-r--r--meta/recipes-core/eglibc/eglibc-locale.inc96
-rw-r--r--meta/recipes-core/eglibc/eglibc-locale_2.19.bb1
-rw-r--r--meta/recipes-core/eglibc/eglibc-mtrace.inc13
-rw-r--r--meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb1
-rw-r--r--meta/recipes-core/eglibc/eglibc-options.inc162
-rw-r--r--meta/recipes-core/eglibc/eglibc-package.inc155
-rw-r--r--meta/recipes-core/eglibc/eglibc-scripts.inc16
-rw-r--r--meta/recipes-core/eglibc/eglibc-scripts_2.19.bb1
-rw-r--r--meta/recipes-core/eglibc/eglibc-testing.inc79
-rw-r--r--meta/recipes-core/eglibc/eglibc.inc84
-rw-r--r--meta/recipes-core/eglibc/eglibc_2.19.bb146
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch331
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/README8
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch454
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch113
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch24
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2bin0 -> 21491 bytes
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch471
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch36
-rw-r--r--meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb30
-rw-r--r--meta/recipes-core/eglibc/site_config/funcs474
-rw-r--r--meta/recipes-core/eglibc/site_config/headers156
-rw-r--r--meta/recipes-core/eglibc/site_config/types21
-rw-r--r--meta/recipes-core/expat/expat-2.1.0/autotools.patch24
-rw-r--r--meta/recipes-core/expat/expat.inc20
-rw-r--r--meta/recipes-core/expat/expat_2.1.0.bb5
-rw-r--r--meta/recipes-core/feed-config/poky-feed-config-opkg_1.0.bb44
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch39
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch110
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch348
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch19
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/gettext-error_print_progname.patch19
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch20
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch51
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch720
-rw-r--r--meta/recipes-core/gettext/gettext-0.18.3.2/parallel.patch36
-rw-r--r--meta/recipes-core/gettext/gettext-minimal-0.18.3.2/COPYING4
-rw-r--r--meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makefile.in.in454
-rw-r--r--meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makevars.template53
-rw-r--r--meta/recipes-core/gettext/gettext-minimal-0.18.3.2/aclocal.tgzbin0 -> 37591 bytes
-rwxr-xr-xmeta/recipes-core/gettext/gettext-minimal-0.18.3.2/config.rpath690
-rw-r--r--meta/recipes-core/gettext/gettext-minimal-0.18.3.2/iconv-m4-remove-the-test-to-convert-euc-jp.patch43
-rw-r--r--meta/recipes-core/gettext/gettext-minimal-0.18.3.2/remove-potcdate.sin19
-rw-r--r--meta/recipes-core/gettext/gettext-minimal-native_0.18.3.2.bb32
-rw-r--r--meta/recipes-core/gettext/gettext_0.16.1.bb109
-rw-r--r--meta/recipes-core/gettext/gettext_0.18.3.2.bb106
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch56
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch39
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch60
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch35
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/gio-test-race.patch54
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch29
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch24
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/gtest-skip-fixes.patch197
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch65
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch30
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/run-ptest3
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch20
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0_2.38.2.bb24
-rw-r--r--meta/recipes-core/glib-2.0/glib.inc98
-rw-r--r--meta/recipes-core/glib-networking/glib-networking_2.38.0.bb32
-rw-r--r--meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx52
-rw-r--r--meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf8
-rw-r--r--meta/recipes-core/images/build-appliance-image_8.0.bb93
-rw-r--r--meta/recipes-core/images/core-image-base.bb8
-rw-r--r--meta/recipes-core/images/core-image-minimal-dev.bb7
-rw-r--r--meta/recipes-core/images/core-image-minimal-initramfs.bb21
-rw-r--r--meta/recipes-core/images/core-image-minimal-mtdutils.bb7
-rw-r--r--meta/recipes-core/images/core-image-minimal.bb12
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright11
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init90
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces31
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot39
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces5
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces5
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces5
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb39
-rw-r--r--meta/recipes-core/initrdscripts/files/init-boot.sh10
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh199
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-efi.sh197
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install-testfs.sh211
-rw-r--r--meta/recipes-core/initrdscripts/files/init-install.sh208
-rw-r--r--meta/recipes-core/initrdscripts/files/init-live.sh223
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb14
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework/debug82
-rwxr-xr-xmeta/recipes-core/initrdscripts/initramfs-framework/e2fs28
-rwxr-xr-xmeta/recipes-core/initrdscripts/initramfs-framework/finish47
-rwxr-xr-xmeta/recipes-core/initrdscripts/initramfs-framework/init140
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework/mdev30
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework/udev45
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb59
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb17
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb14
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb22
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb14
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb22
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch347
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh13
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/banner.sh24
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh71
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/checkfs.sh50
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/checkroot.sh148
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/devpts5
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/devpts.sh28
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh17
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/functions91
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/halt29
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/hostname.sh22
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf9
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/mountall.sh39
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh88
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh220
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh38
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/reboot15
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh20
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh13
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/sendsigs21
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/single24
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh23
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/umountfs24
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh33
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/urandom46
-rw-r--r--meta/recipes-core/initscripts/initscripts-1.0/volatiles36
-rw-r--r--meta/recipes-core/initscripts/initscripts_1.0.bb160
-rw-r--r--meta/recipes-core/jpeg/jpeg-8d/debian-libjpeg7_7-1.diff1070
-rw-r--r--meta/recipes-core/jpeg/jpeg-8d/fix_for_automake_1.12.1.patch44
-rw-r--r--meta/recipes-core/jpeg/jpeg_8d.bb51
-rw-r--r--meta/recipes-core/kbd/kbd/uclibc-stdarg.patch36
-rw-r--r--meta/recipes-core/kbd/kbd_2.0.1.bb35
-rw-r--r--meta/recipes-core/libcgroup/libcgroup_0.41.bb41
-rw-r--r--meta/recipes-core/libxml/libxml2.inc61
-rw-r--r--meta/recipes-core/libxml/libxml2/ansidecl.patch25
-rw-r--r--meta/recipes-core/libxml/libxml2/libxml-64bit.patch22
-rw-r--r--meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch37
-rw-r--r--meta/recipes-core/libxml/libxml2/run-ptest3
-rw-r--r--meta/recipes-core/libxml/libxml2/runtest.patch820
-rw-r--r--meta/recipes-core/libxml/libxml2_2.9.1.bb8
-rw-r--r--meta/recipes-core/meta/buildtools-tarball.bb71
-rw-r--r--meta/recipes-core/meta/meta-environment.bb51
-rw-r--r--meta/recipes-core/meta/meta-ide-support.bb18
-rw-r--r--meta/recipes-core/meta/meta-toolchain.bb9
-rw-r--r--meta/recipes-core/meta/package-index.bb29
-rw-r--r--meta/recipes-core/ncurses/ncurses-5.9/config.cache4
-rw-r--r--meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch27
-rw-r--r--meta/recipes-core/ncurses/ncurses.inc292
-rw-r--r--meta/recipes-core/ncurses/ncurses_5.9.bb10
-rw-r--r--meta/recipes-core/ncurses/site_config/headers5
-rw-r--r--meta/recipes-core/netbase/netbase/hosts2
-rw-r--r--meta/recipes-core/netbase/netbase_5.2.bb23
-rw-r--r--meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb33
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-base.bb373
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-boot.bb52
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb29
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb10
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-nfs.bb22
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-sdk.bb77
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb12
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb12
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb22
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb27
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb86
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb63
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb18
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-self-hosted.bb229
-rwxr-xr-xmeta/recipes-core/psplash/files/psplash-init29
-rw-r--r--meta/recipes-core/psplash/files/psplash-poky-img.h1259
-rw-r--r--meta/recipes-core/psplash/psplash_git.bb111
-rw-r--r--meta/recipes-core/readline/files/acinclude.m41871
-rw-r--r--meta/recipes-core/readline/files/norpath.patch21
-rw-r--r--meta/recipes-core/readline/readline-5.2/acinclude.m41815
-rw-r--r--meta/recipes-core/readline/readline-5.2/configure-fix.patch26
-rw-r--r--meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch21
-rw-r--r--meta/recipes-core/readline/readline-6.3/configure-fix.patch35
-rw-r--r--meta/recipes-core/readline/readline.inc37
-rw-r--r--meta/recipes-core/readline/readline_5.2.bb82
-rw-r--r--meta/recipes-core/readline/readline_6.3.bb5
-rw-r--r--meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch15
-rw-r--r--meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch65
-rw-r--r--meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch23
-rw-r--r--meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb29
-rw-r--r--meta/recipes-core/systemd/systemd-compat-units.bb41
-rw-r--r--meta/recipes-core/systemd/systemd-serialgetty.bb49
-rw-r--r--meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service36
-rw-r--r--meta/recipes-core/systemd/systemd-systemctl-native.bb15
-rwxr-xr-xmeta/recipes-core/systemd/systemd-systemctl/systemctl153
-rw-r--r--meta/recipes-core/systemd/systemd/00-create-volatile.conf7
-rw-r--r--meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch34
-rw-r--r--meta/recipes-core/systemd/systemd/binfmt-install.patch56
-rw-r--r--meta/recipes-core/systemd/systemd/init104
-rw-r--r--meta/recipes-core/systemd/systemd/optional_secure_getenv.patch19
-rw-r--r--meta/recipes-core/systemd/systemd/run-ptest3
-rw-r--r--meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch513
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch32
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch29
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch84
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch35
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch30
-rw-r--r--meta/recipes-core/systemd/systemd/touchscreen.rules18
-rw-r--r--meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch37
-rw-r--r--meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch19
-rw-r--r--meta/recipes-core/systemd/systemd_211.bb353
-rw-r--r--meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch25
-rw-r--r--meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch83
-rw-r--r--meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch189
-rw-r--r--meta/recipes-core/sysvinit/sysvinit-inittab/inittab30
-rw-r--r--meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb82
-rwxr-xr-xmeta/recipes-core/sysvinit/sysvinit/bootlogd.init96
-rwxr-xr-xmeta/recipes-core/sysvinit/sysvinit/rc179
-rwxr-xr-xmeta/recipes-core/sysvinit/sysvinit/rcS34
-rw-r--r--meta/recipes-core/sysvinit/sysvinit/rcS-default29
-rw-r--r--meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb97
-rw-r--r--meta/recipes-core/uclibc/site_config/funcs474
-rw-r--r--meta/recipes-core/uclibc/site_config/headers156
-rw-r--r--meta/recipes-core/uclibc/site_config/types21
-rw-r--r--meta/recipes-core/uclibc/uclibc-config.inc142
-rw-r--r--meta/recipes-core/uclibc/uclibc-git.inc29
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch120
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch319
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch44
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch33
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch28
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch74
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch68
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch377
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/0004-Add-clock_adjtime-syscall.patch73
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/argp-headers.patch583
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/argp-support.patch5192
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch21
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/locale.cfg3
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/obstack.cfg1
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/orign_path.patch186
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch113
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch140
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/uClibc.distro192
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/uClibc.machine14
-rw-r--r--meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch35
-rw-r--r--meta/recipes-core/uclibc/uclibc-initial_git.bb36
-rw-r--r--meta/recipes-core/uclibc/uclibc-package.inc37
-rw-r--r--meta/recipes-core/uclibc/uclibc.inc166
-rw-r--r--meta/recipes-core/uclibc/uclibc_git.bb22
-rw-r--r--meta/recipes-core/udev/udev-extraconf/automount.rules19
-rw-r--r--meta/recipes-core/udev/udev-extraconf/autonet.rules19
-rw-r--r--meta/recipes-core/udev/udev-extraconf/localextra.rules23
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.blacklist5
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.sh91
-rw-r--r--meta/recipes-core/udev/udev-extraconf/network.sh54
-rw-r--r--meta/recipes-core/udev/udev-extraconf_1.0.bb41
-rw-r--r--meta/recipes-core/udev/udev.inc107
-rw-r--r--meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch35
-rw-r--r--meta/recipes-core/udev/udev/add-install-ptest.patch73
-rw-r--r--meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch25
-rw-r--r--meta/recipes-core/udev/udev/devfs-udev.rules108
-rw-r--r--meta/recipes-core/udev/udev/init133
-rw-r--r--meta/recipes-core/udev/udev/links.conf21
-rw-r--r--meta/recipes-core/udev/udev/local.rules22
-rw-r--r--meta/recipes-core/udev/udev/permissions.rules131
-rw-r--r--meta/recipes-core/udev/udev/run-ptest3
-rw-r--r--meta/recipes-core/udev/udev/run.rules14
-rw-r--r--meta/recipes-core/udev/udev/udev-cache32
-rw-r--r--meta/recipes-core/udev/udev/udev-cache.default4
-rw-r--r--meta/recipes-core/udev/udev/udev.rules116
-rw-r--r--meta/recipes-core/udev/udev_182.bb9
-rw-r--r--meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch49
-rw-r--r--meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch59
-rw-r--r--meta/recipes-core/update-rc.d/update-rc.d_0.7.bb30
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc270
-rw-r--r--meta/recipes-core/util-linux/util-linux/MCONFIG223
-rw-r--r--meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch18
-rw-r--r--meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch38
-rw-r--r--meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch57
-rw-r--r--meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch20
-rw-r--r--meta/recipes-core/util-linux/util-linux/configure-sbindir.patch23
-rw-r--r--meta/recipes-core/util-linux/util-linux/defines.h10
-rw-r--r--meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch17
-rw-r--r--meta/recipes-core/util-linux/util-linux/fix-configure.patch20
-rw-r--r--meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch35
-rw-r--r--meta/recipes-core/util-linux/util-linux/make_include17
-rw-r--r--meta/recipes-core/util-linux/util-linux/ptest.patch16
-rw-r--r--meta/recipes-core/util-linux/util-linux/run-ptest10
-rw-r--r--meta/recipes-core/util-linux/util-linux/swapargs.h3
-rw-r--r--meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch32
-rw-r--r--meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch34
-rw-r--r--meta/recipes-core/util-linux/util-linux/util-linux-native.patch73
-rw-r--r--meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch27
-rw-r--r--meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch27
-rw-r--r--meta/recipes-core/util-linux/util-linux_2.24.1.bb31
-rw-r--r--meta/recipes-core/zlib/site_config/headers1
-rw-r--r--meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch38
-rw-r--r--meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch20
-rw-r--r--meta/recipes-core/zlib/zlib-1.2.8/run-ptest2
-rw-r--r--meta/recipes-core/zlib/zlib_1.2.8.bb60
442 files changed, 48288 insertions, 0 deletions
diff --git a/meta/recipes-core/base-files/base-files/filesystems b/meta/recipes-core/base-files/base-files/filesystems
new file mode 100644
index 0000000000..7e6c41c38f
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/filesystems
@@ -0,0 +1,8 @@
1ext4
2ext3
3ext2
4vfat
5fat
6btrfs
7minix
8*
diff --git a/meta/recipes-core/base-files/base-files/fstab b/meta/recipes-core/base-files/base-files/fstab
new file mode 100644
index 0000000000..739b844bfc
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/fstab
@@ -0,0 +1,12 @@
1# stock fstab - you probably want to override this with a machine specific one
2
3/dev/root / auto defaults 1 1
4proc /proc proc defaults 0 0
5devpts /dev/pts devpts mode=0620,gid=5 0 0
6usbdevfs /proc/bus/usb usbdevfs noauto 0 0
7tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
8tmpfs /var/volatile tmpfs defaults 0 0
9
10# uncomment this if your device has a SD/MMC/Transflash slot
11#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0
12
diff --git a/meta/recipes-core/base-files/base-files/host.conf b/meta/recipes-core/base-files/base-files/host.conf
new file mode 100644
index 0000000000..1a8c1e1517
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/host.conf
@@ -0,0 +1,2 @@
1order hosts,bind
2multi on
diff --git a/meta/recipes-core/base-files/base-files/inputrc b/meta/recipes-core/base-files/base-files/inputrc
new file mode 100644
index 0000000000..b5c4c8af24
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/inputrc
@@ -0,0 +1,61 @@
1# /etc/inputrc - global inputrc for libreadline
2# See readline(3readline) and `info rluserman' for more information.
3
4# Be 8 bit clean.
5set input-meta on
6set output-meta on
7
8# To allow the use of 8bit-characters like the german umlauts, comment out
9# the line below. However this makes the meta key not work as a meta key,
10# which is annoying to those which don't need to type in 8-bit characters.
11
12# set convert-meta off
13
14# try to enable the application keypad when it is called. Some systems
15# need this to enable the arrow keys.
16# set enable-keypad on
17
18# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
19
20# do not bell on tab-completion
21# set bell-style none
22
23# some defaults / modifications for the emacs mode
24$if mode=emacs
25
26# allow the use of the Home/End keys
27# "\e[1~": beginning-of-line
28# "\e[4~": end-of-line
29
30# allow the use of the Delete/Insert keys
31# "\e[3~": delete-char
32# "\e[2~": quoted-insert
33
34# mappings for "page up" and "page down" to step to the beginning/end
35# of the history
36# "\e[5~": beginning-of-history
37# "\e[6~": end-of-history
38
39# alternate mappings for "page up" and "page down" to search the history
40# "\e[5~": history-search-backward
41# "\e[6~": history-search-forward
42
43# # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
44# "\e[5C": forward-word
45# "\e[5D": backward-word
46# "\e\e[C": forward-word
47# "\e\e[D": backward-word
48
49# $if term=rxvt
50# "\e[8~": end-of-line
51# $endif
52
53# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
54# "\eOH": beginning-of-line
55# "\eOF": end-of-line
56
57# for freebsd console
58# "\e[H": beginning-of-line
59# "\e[F": end-of-line
60
61$endif
diff --git a/meta/recipes-core/base-files/base-files/issue b/meta/recipes-core/base-files/base-files/issue
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/issue
diff --git a/meta/recipes-core/base-files/base-files/issue.net b/meta/recipes-core/base-files/base-files/issue.net
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/issue.net
diff --git a/meta/recipes-core/base-files/base-files/licenses/GPL-2 b/meta/recipes-core/base-files/base-files/licenses/GPL-2
new file mode 100644
index 0000000000..d60c31a97a
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/licenses/GPL-2
@@ -0,0 +1,340 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The licenses for most software are designed to take away your
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Library General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in new free programs; and that you know you can do these things.
27
28 To protect your rights, we need to make restrictions that forbid
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
38
39 We protect your rights with two steps: (1) copyright the software, and
40(2) offer you this license which gives you legal permission to copy,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification follow.
58
59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62 0. This License applies to any program or other work which contains
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you may at your option offer warranty protection in exchange for a fee.
89
90 2. You may modify your copy or copies of the Program or any portion
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, provided that you also meet all of these conditions:
94
95 a) You must cause the modified files to carry prominent notices
96 stating that you changed the files and the date of any change.
97
98 b) You must cause any work that you distribute or publish, that in
99 whole or in part contains or is derived from the Program or any
100 part thereof, to be licensed as a whole at no charge to all third
101 parties under the terms of this License.
102
103 c) If the modified program normally reads commands interactively
104 when run, you must cause it, when started running for such
105 interactive use in the most ordinary way, to print or display an
106 announcement including an appropriate copyright notice and a
107 notice that there is no warranty (or else, saying that you provide
108 a warranty) and that users may redistribute the program under
109 these conditions, and telling the user how to view a copy of this
110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.)
113
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 1 and 2 above provided that you also do one of the following:
137
138 a) Accompany it with the complete corresponding machine-readable
139 source code, which must be distributed under the terms of Sections
140 1 and 2 above on a medium customarily used for software interchange; or,
141
142 b) Accompany it with a written offer, valid for at least three
143 years, to give any third party, for a charge no more than your
144 cost of physically performing source distribution, a complete
145 machine-readable copy of the corresponding source code, to be
146 distributed under the terms of Sections 1 and 2 above on a medium
147 customarily used for software interchange; or,
148
149 c) Accompany it with the information you received as to the offer
150 to distribute corresponding source code. (This alternative is
151 allowed only for noncommercial distribution and only if you
152 received the program in object code or executable form with such
153 an offer, in accord with Subsection b above.)
154
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of promoting the sharing and reuse of software generally.
257
258 NO WARRANTY
259
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY OF SUCH DAMAGES.
279
280 END OF TERMS AND CONDITIONS
281
282 How to Apply These Terms to Your New Programs
283
284 If you develop a new program, and you want it to be of the greatest
285possible use to the public, the best way to achieve this is to make it
286free software which everyone can redistribute and change under these terms.
287
288 To do so, attach the following notices to the program. It is safest
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "copyright" line and a pointer to where the full notice is found.
292
293 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author>
295
296 This program is free software; you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; either version 2 of the License, or
299 (at your option) any later version.
300
301 This program is distributed in the hope that it will be useful,
302 but WITHOUT ANY WARRANTY; without even the implied warranty of
303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 GNU General Public License for more details.
305
306 You should have received a copy of the GNU General Public License
307 along with this program; if not, write to the Free Software
308 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
309
310
311Also add information on how to contact you by electronic and paper mail.
312
313If the program is interactive, make it output a short notice like this
314when it starts in an interactive mode:
315
316 Gnomovision version 69, Copyright (C) year name of author
317 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318 This is free software, and you are welcome to redistribute it
319 under certain conditions; type `show c' for details.
320
321The hypothetical commands `show w' and `show c' should show the appropriate
322parts of the General Public License. Of course, the commands you use may
323be called something other than `show w' and `show c'; they could even be
324mouse-clicks or menu items--whatever suits your program.
325
326You should also get your employer (if you work as a programmer) or your
327school, if any, to sign a "copyright disclaimer" for the program, if
328necessary. Here is a sample; alter the names:
329
330 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331 `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
333 <signature of Ty Coon>, 1 April 1989
334 Ty Coon, President of Vice
335
336This General Public License does not permit incorporating your program into
337proprietary programs. If your program is a subroutine library, you may
338consider it more useful to permit linking proprietary applications with the
339library. If this is what you want to do, use the GNU Library General
340Public License instead of this License.
diff --git a/meta/recipes-core/base-files/base-files/motd b/meta/recipes-core/base-files/base-files/motd
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/motd
diff --git a/meta/recipes-core/base-files/base-files/nsswitch.conf b/meta/recipes-core/base-files/base-files/nsswitch.conf
new file mode 100644
index 0000000000..06f03d22a6
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/nsswitch.conf
@@ -0,0 +1,19 @@
1# /etc/nsswitch.conf
2#
3# Example configuration of GNU Name Service Switch functionality.
4# If you have the `glibc-doc' and `info' packages installed, try:
5# `info libc "Name Service Switch"' for information about this file.
6
7passwd: compat
8group: compat
9shadow: compat
10
11hosts: files dns
12networks: files
13
14protocols: db files
15services: db files
16ethers: db files
17rpc: db files
18
19netgroup: nis
diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
new file mode 100644
index 0000000000..8eeaac3693
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -0,0 +1,32 @@
1# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
2# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
3
4PATH="/usr/local/bin:/usr/bin:/bin"
5EDITOR="/bin/vi" # needed for packages like cron
6test -z "$TERM" && TERM="vt100" # Basic terminal capab. For screen etc.
7
8if [ ! -e /etc/localtime ]; then
9 TZ="UTC" # Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html
10 # for an explanation of how to set this to your local timezone.
11 export TZ
12fi
13
14if [ "$HOME" = "ROOTHOME" ]; then
15 PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
16fi
17if [ "$PS1" ]; then
18# works for bash and ash (no other shells known to be in use here)
19 PS1='\u@\h:\w\$ '
20fi
21
22if [ -d /etc/profile.d ]; then
23 for i in /etc/profile.d/* ; do
24 . $i
25 done
26 unset i
27fi
28
29export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
30
31umask 022
32
diff --git a/meta/recipes-core/base-files/base-files/rotation b/meta/recipes-core/base-files/base-files/rotation
new file mode 100644
index 0000000000..c227083464
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/rotation
@@ -0,0 +1 @@
0 \ No newline at end of file
diff --git a/meta/recipes-core/base-files/base-files/share/dot.bashrc b/meta/recipes-core/base-files/base-files/share/dot.bashrc
new file mode 100644
index 0000000000..4be63686c2
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/share/dot.bashrc
@@ -0,0 +1,16 @@
1# ~/.bashrc: executed by bash(1) for non-login shells.
2
3export PS1='\h:\w\$ '
4umask 022
5
6# You may uncomment the following lines if you want `ls' to be colorized:
7# export LS_OPTIONS='--color=auto'
8# eval `dircolors`
9# alias ls='ls $LS_OPTIONS'
10# alias ll='ls $LS_OPTIONS -l'
11# alias l='ls $LS_OPTIONS -lA'
12#
13# Some more alias to avoid making mistakes:
14# alias rm='rm -i'
15# alias cp='cp -i'
16# alias mv='mv -i'
diff --git a/meta/recipes-core/base-files/base-files/share/dot.profile b/meta/recipes-core/base-files/base-files/share/dot.profile
new file mode 100644
index 0000000000..979793e8b5
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/share/dot.profile
@@ -0,0 +1,10 @@
1# ~/.profile: executed by Bourne-compatible login shells.
2
3if [ -f ~/.bashrc ]; then
4 . ~/.bashrc
5fi
6
7# path set by /etc/profile
8# export PATH
9
10mesg n
diff --git a/meta/recipes-core/base-files/base-files/shells b/meta/recipes-core/base-files/base-files/shells
new file mode 100644
index 0000000000..3f639874d8
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/shells
@@ -0,0 +1,2 @@
1# /etc/shells: valid login shells
2/bin/sh
diff --git a/meta/recipes-core/base-files/base-files/usbd b/meta/recipes-core/base-files/base-files/usbd
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/usbd
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
new file mode 100644
index 0000000000..9699e31625
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -0,0 +1,148 @@
1SUMMARY = "Miscellaneous files for the base system"
2DESCRIPTION = "The base-files package creates the basic system directory structure and provides a small set of key configuration files for the system."
3SECTION = "base"
4PR = "r86"
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f"
7# Removed all license related tasks in this recipe as license.bbclass
8# now deals with this. In order to get accurate licensing on to the image:
9# Set COPY_LIC_MANIFEST to just copy just the license.manifest to the image
10# For the manifest and the license text for each package:
11# Set COPY_LIC_MANIFEST and COPY_LIC_DIRS
12
13SRC_URI = "file://rotation \
14 file://nsswitch.conf \
15 file://motd \
16 file://inputrc \
17 file://host.conf \
18 file://profile \
19 file://shells \
20 file://fstab \
21 file://filesystems \
22 file://issue.net \
23 file://issue \
24 file://usbd \
25 file://share/dot.bashrc \
26 file://share/dot.profile \
27 file://licenses/GPL-2 \
28 "
29S = "${WORKDIR}"
30
31INHIBIT_DEFAULT_DEPS = "1"
32
33docdir_append = "/${P}"
34dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
35dirs2775 = "/home ${prefix}/src ${localstatedir}/local"
36dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
37 ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
38 ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
39 ${libdir} ${sbindir} ${datadir} \
40 ${datadir}/common-licenses ${datadir}/dict ${infodir} \
41 ${mandir} ${datadir}/misc ${localstatedir} \
42 ${localstatedir}/backups ${localstatedir}/lib \
43 /sys ${localstatedir}/lib/misc ${localstatedir}/spool \
44 ${localstatedir}/volatile \
45 ${localstatedir}/volatile/log \
46 /media"
47dirs3755 = "/srv \
48 ${prefix}/local ${prefix}/local/bin ${prefix}/local/games \
49 ${prefix}/local/include ${prefix}/local/lib ${prefix}/local/sbin \
50 ${prefix}/local/share ${prefix}/local/src \
51 ${prefix}/lib/locale"
52dirs4775 = "/var/mail"
53
54volatiles = "log tmp"
55conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
56 ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \
57 ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
58 ${sysconfdir}/default"
59
60#
61# set standard hostname, might be a candidate for a DISTRO variable? :M:
62#
63hostname = "openembedded"
64
65BASEFILESISSUEINSTALL ?= "do_install_basefilesissue"
66
67do_install () {
68 for d in ${dirs755}; do
69 install -m 0755 -d ${D}$d
70 done
71 for d in ${dirs1777}; do
72 install -m 1777 -d ${D}$d
73 done
74 for d in ${dirs2775}; do
75 install -m 2755 -d ${D}$d
76 done
77 for d in ${volatiles}; do
78 ln -sf volatile/$d ${D}${localstatedir}/$d
79 done
80 ln -snf ../run ${D}${localstatedir}/run
81 ln -snf ../run/lock ${D}${localstatedir}/lock
82
83 ${BASEFILESISSUEINSTALL}
84
85 rotation=`cat ${WORKDIR}/rotation`
86 if [ "$rotation" != "0" ]; then
87 install -m 0644 ${WORKDIR}/rotation ${D}${sysconfdir}/rotation
88 fi
89
90 install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab
91 install -m 0644 ${WORKDIR}/filesystems ${D}${sysconfdir}/filesystems
92 install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
93 install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
94 sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
95 install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
96 install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
97 install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc
98 install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc
99 install -m 0644 ${WORKDIR}/nsswitch.conf ${D}${sysconfdir}/nsswitch.conf
100 install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf
101 install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd
102
103 ln -sf /proc/mounts ${D}${sysconfdir}/mtab
104}
105
106DISTRO_VERSION[vardepsexclude] += "DATE"
107do_install_basefilesissue () {
108 if [ "${hostname}" != "" ]; then
109 if [ -n "${MACHINE}" -a "${hostname}" = "openembedded" ]; then
110 echo ${MACHINE} > ${D}${sysconfdir}/hostname
111 else
112 echo ${hostname} > ${D}${sysconfdir}/hostname
113 fi
114 fi
115
116 install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir}
117 if [ -n "${DISTRO_NAME}" ]; then
118 printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
119 printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
120 if [ -n "${DISTRO_VERSION}" ]; then
121 printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue
122 printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net
123 fi
124 printf "\\\n \\\l\n" >> ${D}${sysconfdir}/issue
125 echo >> ${D}${sysconfdir}/issue
126 echo "%h" >> ${D}${sysconfdir}/issue.net
127 echo >> ${D}${sysconfdir}/issue.net
128 fi
129}
130
131do_install_append_linuxstdbase() {
132 for d in ${dirs3755}; do
133 install -m 0755 -d ${D}$d
134 done
135
136 for d in ${dirs4775}; do
137 install -m 2755 -d ${D}$d
138 done
139}
140
141PACKAGES = "${PN}-doc ${PN} ${PN}-dev ${PN}-dbg"
142FILES_${PN} = "/"
143FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
144
145PACKAGE_ARCH = "${MACHINE_ARCH}"
146
147CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname', True) != '')]} ${sysconfdir}/shells"
148
diff --git a/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch b/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch
new file mode 100644
index 0000000000..eb75559c49
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch
@@ -0,0 +1,19 @@
1
2We need to have a shutdown group to allow the shutdown icon
3to work correctly. Any users that want to use shutdown like
4the xuser should be added to this group.
5
6Upstream-Status: Inapporpriate [Embedded]
7
8Signed-off-by: Saul Wold <sgw@linux.intel.com>
9Index: base-passwd-3.5.26/group.master
10===================================================================
11--- base-passwd-3.5.26.orig/group.master
12+++ base-passwd-3.5.26/group.master
13@@ -36,5 +36,6 @@ sasl:*:45:
14 plugdev:*:46:
15 staff:*:50:
16 games:*:60:
17+shutdown:*:70:
18 users:*:100:
19 nogroup:*:65534:
diff --git a/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch b/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch
new file mode 100644
index 0000000000..14c08b7484
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch
@@ -0,0 +1,24 @@
1Disable documentation for now as it uses tools currently not supported
2by OE-Core. It uses sgmltools and po4a.
3
4Upstream-Status: Inappropriate [OE-Core specific]
5Signed-off-by: Saul Wold <sgw@linux.intel.com>
6
7Index: base-passwd-3.5.28/Makefile.in
8===================================================================
9--- base-passwd-3.5.28.orig/Makefile.in
10+++ base-passwd-3.5.28/Makefile.in
11@@ -25,13 +25,10 @@ gen_configure = config.cache config.stat
12 confdefhs.h config.h Makefile
13
14 all: update-passwd
15- $(MAKE) -C doc all
16- $(MAKE) -C man all
17
18 install: all
19 mkdir -p $(DESTDIR)$(sbindir)
20 $(INSTALL) update-passwd $(DESTDIR)$(sbindir)/
21- $(MAKE) -C man install
22
23 update-passwd.o: version.h
24
diff --git a/meta/recipes-core/base-passwd/base-passwd/input.patch b/meta/recipes-core/base-passwd/base-passwd/input.patch
new file mode 100644
index 0000000000..f1bfc2f604
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/input.patch
@@ -0,0 +1,22 @@
1Add an input group for the /dev/input/* devices.
2
3Upstream-Status: Invalid [configuration]
4
5Signed-off-by: Darren Hart <dvhart@linux.intel.com>
6
7---
8 group.master | 1 +
9 1 file changed, 1 insertion(+)
10
11Index: base-passwd-3.5.26/group.master
12===================================================================
13--- base-passwd-3.5.26.orig/group.master
14+++ base-passwd-3.5.26/group.master
15@@ -12,6 +12,7 @@ uucp:*:10:
16 man:*:12:
17 proxy:*:13:
18 kmem:*:15:
19+input:*:19:
20 dialout:*:20:
21 fax:*:21:
22 voice:*:22:
diff --git a/meta/recipes-core/base-passwd/base-passwd/nobash.patch b/meta/recipes-core/base-passwd/base-passwd/nobash.patch
new file mode 100644
index 0000000000..eed87db6cb
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/nobash.patch
@@ -0,0 +1,15 @@
1use /bin/sh instead of /bin/bash, since the latter may not be included in
2some images such as minimal
3
4Upstream-Status: Invalid [configuration]
5
6Signed-off-by: Scott Garman <scott.a.garman@intel.com>
7
8--- base-passwd/passwd.master~nobash
9+++ base-passwd/passwd.master
10@@ -1,4 +1,4 @@
11-root:*:0:0:root:/root:/bin/bash
12+root:*:0:0:root:/root:/bin/sh
13 daemon:*:1:1:daemon:/usr/sbin:/bin/sh
14 bin:*:2:2:bin:/bin:/bin/sh
15 sys:*:3:3:sys:/dev:/bin/sh
diff --git a/meta/recipes-core/base-passwd/base-passwd/noshadow.patch b/meta/recipes-core/base-passwd/base-passwd/noshadow.patch
new file mode 100644
index 0000000000..e1cded61d6
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/noshadow.patch
@@ -0,0 +1,14 @@
1remove "*" for root since we don't have a /etc/shadow so far.
2
3Upstream-Status: Invalid [configuration]
4
5Signed-off-by: Scott Garman <scott.a.garman@intel.com>
6
7--- base-passwd/passwd.master~nobash
8+++ base-passwd/passwd.master
9@@ -1,4 +1,4 @@
10-root:*:0:0:root:/root:/bin/sh
11+root::0:0:root:/root:/bin/sh
12 daemon:*:1:1:daemon:/usr/sbin:/bin/sh
13 bin:*:2:2:bin:/bin:/bin/sh
14 sys:*:3:3:sys:/dev:/bin/sh
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
new file mode 100644
index 0000000000..59bd413b49
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -0,0 +1,97 @@
1SUMMARY = "Base system master password/group files"
2DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group). The update-passwd tool is also provided to keep the system databases synchronized with these master files."
3SECTION = "base"
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
6
7SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \
8 file://add_shutdown.patch \
9 file://nobash.patch \
10 file://noshadow.patch \
11 file://input.patch \
12 file://disable-docs.patch \
13 "
14
15SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421"
16SRC_URI[sha256sum] = "f0b66388b2c8e49c15692439d2bee63bcdd4bbbf7a782c7f64accc55986b6a36"
17
18inherit autotools
19
20SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst"
21
22do_install () {
23 install -d -m 755 ${D}${sbindir}
24 install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/
25 install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8
26 install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/
27 install -p -m 644 ${S}/man/update-passwd.pl.8 \
28 ${D}${mandir}/pl/man8/update-passwd.8
29 gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/*
30 install -d -m 755 ${D}${datadir}/base-passwd
31 install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/
32 sed -i 's#:/root:#:${ROOT_HOME}:#' ${D}${datadir}/base-passwd/passwd.master
33 install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/
34
35 install -d -m 755 ${D}${docdir}/${BPN}
36 install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/
37 gzip -9 ${D}${docdir}/${BPN}/*
38 install -p -m 644 ${S}/README ${D}${docdir}/${BPN}/
39 install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/
40}
41
42base_passwd_sstate_postinst() {
43 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
44 then
45 # Staging does not copy ${sysconfdir} files into the
46 # target sysroot, so we need to do so manually. We
47 # put these files in the target sysroot so they can
48 # be used by recipes which use custom user/group
49 # permissions.
50 install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
51 install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/passwd.master ${STAGING_DIR_TARGET}${sysconfdir}/passwd
52 install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/group.master ${STAGING_DIR_TARGET}${sysconfdir}/group
53 fi
54}
55
56python populate_packages_prepend() {
57 # Add in the preinst function for ${PN}
58 # We have to do this here as prior to this, passwd/group.master
59 # would be unavailable. We need to create these files at preinst
60 # time before the files from the package may be available, hence
61 # storing the data from the files in the preinst directly.
62
63 f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r')
64 passwd = "".join(f.readlines())
65 f.close()
66 f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r')
67 group = "".join(f.readlines())
68 f.close()
69
70 preinst = """#!/bin/sh
71mkdir -p $D${sysconfdir}
72if [ ! -e $D${sysconfdir}/passwd ]; then
73\tcat << EOF > $D${sysconfdir}/passwd
74""" + passwd + """EOF
75fi
76if [ ! -e $D${sysconfdir}/group ]; then
77\tcat << EOF > $D${sysconfdir}/group
78""" + group + """EOF
79fi
80"""
81 d.setVar('pkg_preinst_${PN}', preinst)
82}
83
84addtask do_package after do_populate_sysroot
85
86ALLOW_EMPTY_${PN} = "1"
87
88PACKAGES =+ "${PN}-update"
89FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}"
90
91pkg_postinst_${PN}-update () {
92#!/bin/sh
93if [ -n "$D" ]; then
94 exit 0
95fi
96${sbindir}/update-passwd
97}
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
new file mode 100644
index 0000000000..e59afe67bc
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -0,0 +1,406 @@
1SUMMARY = "Tiny versions of many common UNIX utilities in a single small executable"
2DESCRIPTION = "BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete POSIX environment for any small or embedded system."
3HOMEPAGE = "http://www.busybox.net"
4BUGTRACKER = "https://bugs.busybox.net/"
5
6DEPENDS += "kern-tools-native"
7
8# bzip2 applet in busybox is based on lightly-modified bzip2 source
9# the GPL is version 2 only
10LICENSE = "GPLv2 & bzip2"
11LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb"
12
13SECTION = "base"
14
15# Whether to split the suid apps into a seperate binary
16BUSYBOX_SPLIT_SUID ?= "1"
17
18export EXTRA_CFLAGS = "${CFLAGS}"
19export EXTRA_LDFLAGS = "${LDFLAGS}"
20export EXTRA_OEMAKE += "'LD=${CCLD}'"
21
22PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
23
24FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
25FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog"
26FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf"
27FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
28FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
29FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
30
31INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
32
33INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
34INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
35INITSCRIPT_NAME_${PN}-mdev = "mdev"
36INITSCRIPT_PARAMS_${PN}-mdev = "start 03 S ."
37INITSCRIPT_NAME_${PN}-syslog = "syslog"
38INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
39
40SYSTEMD_PACKAGES = "${PN}-syslog"
41SYSTEMD_SERVICE_${PN}-syslog = "busybox-syslog.service"
42
43CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf.${BPN}"
44CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
45
46RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
47
48inherit cml1 systemd update-rc.d ptest
49
50# internal helper
51def busybox_cfg(feature, tokens, cnf, rem):
52 if type(tokens) == type(""):
53 tokens = [tokens]
54 rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
55 if feature:
56 cnf.extend([token + '=y' for token in tokens])
57 else:
58 cnf.extend(['# ' + token + ' is not set' for token in tokens])
59
60# Map distro features to config settings
61def features_to_busybox_settings(d):
62 cnf, rem = ([], [])
63 busybox_cfg(base_contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IPV6', cnf, rem)
64 busybox_cfg(base_contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_LFS', cnf, rem)
65 busybox_cfg(base_contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem)
66 busybox_cfg(base_contains('DISTRO_FEATURES', 'nls', True, False, d), 'CONFIG_LOCALE_SUPPORT', cnf, rem)
67 busybox_cfg(base_contains('DISTRO_FEATURES', 'ipv4', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
68 busybox_cfg(base_contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
69 busybox_cfg(base_contains('DISTRO_FEATURES', 'wifi', True, False, d), 'CONFIG_RFKILL', cnf, rem)
70 busybox_cfg(base_contains('DISTRO_FEATURES', 'bluetooth', True, False, d), 'CONFIG_RFKILL', cnf, rem)
71 return "\n".join(cnf), "\n".join(rem)
72
73# X, Y = ${@features_to_uclibc_settings(d)}
74# unfortunately doesn't seem to work with bitbake, workaround:
75def features_to_busybox_conf(d):
76 cnf, rem = features_to_busybox_settings(d)
77 return cnf
78def features_to_busybox_del(d):
79 cnf, rem = features_to_busybox_settings(d)
80 return rem
81
82configmangle = '/CROSS_COMPILER_PREFIX/d; \
83 /CONFIG_EXTRA_CFLAGS/d; \
84 '
85OE_FEATURES := "${@features_to_busybox_conf(d)}"
86OE_DEL := "${@features_to_busybox_del(d)}"
87DO_IPv4 := "${@base_contains('DISTRO_FEATURES', 'ipv4', 1, 0, d)}"
88DO_IPv6 := "${@base_contains('DISTRO_FEATURES', 'ipv6', 1, 0, d)}"
89
90python () {
91 if "${OE_DEL}":
92 d.setVar('configmangle_append', "${OE_DEL}" + "\n")
93 if "${OE_FEATURES}":
94 d.setVar('configmangle_append',
95 "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
96 ("\\n".join((d.expand("${OE_FEATURES}").split("\n")))))
97 d.setVar('configmangle_append',
98 "/^### CROSS$/a\\\n%s\n" %
99 ("\\n".join(["CONFIG_CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"",
100 "CONFIG_EXTRA_CFLAGS=\"${CFLAGS}\" \"${HOST_CC_ARCH}\""
101 ])
102 ))
103}
104
105do_prepare_config () {
106 sed -e 's#@DATADIR@#${datadir}#g' \
107 < ${WORKDIR}/defconfig > ${S}/.config
108 sed -i -e '/CONFIG_STATIC/d' .config
109 echo "# CONFIG_STATIC is not set" >> .config
110 for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
111 ${S}/.config
112 sed -i -e '${configmangle}' ${S}/.config
113 if test ${DO_IPv4} -eq 0 && test ${DO_IPv6} -eq 0; then
114 # disable networking applets
115 mv ${S}/.config ${S}/.config.oe-tmp
116 awk 'BEGIN{net=0}
117 /^# Networking Utilities/{net=1}
118 /^#$/{if(net){net=net+1}}
119 {if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \
120 ${S}/.config.oe-tmp > ${S}/.config
121 fi
122}
123
124# returns all the elements from the src uri that are .cfg files
125def find_cfgs(d):
126 sources=src_patches(d, True)
127 sources_list=[]
128 for s in sources:
129 if s.endswith('.cfg'):
130 sources_list.append(s)
131
132 return sources_list
133
134do_configure () {
135 do_prepare_config
136 merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
137 cml1_do_configure
138}
139
140do_compile() {
141 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
142 if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
143 # split the .config into two parts, and make two busybox binaries
144 cp .config .config.orig
145 oe_runmake busybox.cfg.suid
146 oe_runmake busybox.cfg.nosuid
147 for i in `cat busybox.cfg.suid busybox.cfg.nosuid`; do
148 echo "# $i is not set" >> .config.disable.apps
149 done
150 merge_config.sh -m .config.orig .config.disable.apps
151 cp .config .config.nonapps
152 for s in suid nosuid; do
153 cat busybox.cfg.$s | while read item; do
154 grep -w "$item" .config.orig
155 done > .config.app.$s
156 merge_config.sh -m .config.nonapps .config.app.$s
157 oe_runmake busybox_unstripped
158 mv busybox_unstripped busybox.$s
159 oe_runmake busybox.links
160 mv busybox.links busybox.links.$s
161 done
162 # copy .config.orig back to .config, because the install process may check this file
163 cp .config.orig .config
164 # cleanup
165 rm .config.orig .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
166 else
167 oe_runmake busybox_unstripped
168 cp busybox_unstripped busybox
169 oe_runmake busybox.links
170 fi
171}
172
173do_install () {
174 if [ "${prefix}" != "/usr" ]; then
175 sed -i "s:^/usr/:${prefix}/:" busybox.links*
176 fi
177 if [ "${base_sbindir}" != "/sbin" ]; then
178 sed -i "s:^/sbin/:${base_sbindir}/:" busybox.links*
179 fi
180
181 install -d ${D}${sysconfdir}/init.d
182
183 if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then
184 # Install /bin/busybox, and the /bin/sh link so the postinst script
185 # can run. Let update-alternatives handle the rest.
186 install -d ${D}${base_bindir}
187 if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then
188 install -m 4755 ${B}/busybox.suid ${D}${base_bindir}
189 install -m 0755 ${B}/busybox.nosuid ${D}${base_bindir}
190 install -m 0644 ${S}/busybox.links.suid ${D}${sysconfdir}
191 install -m 0644 ${S}/busybox.links.nosuid ${D}${sysconfdir}
192 if grep -q "CONFIG_FEATURE_SH_IS_ASH=y" ${B}/.config; then
193 ln -sf busybox.nosuid ${D}${base_bindir}/sh
194 fi
195 # Keep a default busybox for people who want to invoke busybox directly.
196 # This is also useful for the on device upgrade. Because we want
197 # to use the busybox command in postinst.
198 ln -sf busybox.nosuid ${D}${base_bindir}/busybox
199 else
200 if grep -q "CONFIG_FEATURE_SUID=y" ${B}/.config; then
201 install -m 4755 ${B}/busybox ${D}${base_bindir}
202 else
203 install -m 0755 ${B}/busybox ${D}${base_bindir}
204 fi
205 install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
206 if grep -q "CONFIG_FEATURE_SH_IS_ASH=y" ${B}/.config; then
207 ln -sf busybox ${D}${base_bindir}/sh
208 fi
209 # We make this symlink here to eliminate the error when upgrading together
210 # with busybox-syslog. Without this symlink, the opkg may think of the
211 # busybox.nosuid as obsolete and remove it, resulting in dead links like
212 # /bin/sed -> /bin/busybox.nosuid. This will make upgrading busybox-syslog fail.
213 # This symlink will be safely deleted in postinst, thus no negative effect.
214 ln -sf busybox ${D}${base_bindir}/busybox.nosuid
215 fi
216 else
217 install -d ${D}${base_bindir} ${D}${base_sbindir}
218 install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir}
219 cat busybox.links | while read FILE; do
220 NAME=`basename "$FILE"`
221 install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}"
222 done
223 # add suid bit where needed
224 for i in `grep -E "APPLET.*BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do
225 find ${D} -name $i.${BPN} -exec chmod a+s {} \;
226 done
227 install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
228 ln -sf sh.${BPN} ${D}${base_bindir}/sh
229 ln -sf ln.${BPN} ${D}${base_bindir}/ln
230 ln -sf test.${BPN} ${D}${bindir}/test
231 if [ -f ${D}/linuxrc.${BPN} ]; then
232 mv ${D}/linuxrc.${BPN} ${D}/linuxrc
233 fi
234 install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
235 fi
236
237 if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
238 install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${BPN}
239 install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf.${BPN}
240 install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${BPN}
241 fi
242 if grep "CONFIG_CROND=y" ${B}/.config; then
243 install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
244 fi
245 if grep "CONFIG_HTTPD=y" ${B}/.config; then
246 install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
247 install -d ${D}/srv/www
248 fi
249 if grep "CONFIG_UDHCPD=y" ${B}/.config; then
250 install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
251 fi
252 if grep "CONFIG_HWCLOCK=y" ${B}/.config; then
253 install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
254 fi
255 if grep "CONFIG_UDHCPC=y" ${B}/.config; then
256 install -d ${D}${sysconfdir}/udhcpc.d
257 install -d ${D}${datadir}/udhcpc
258 install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default
259 install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
260 fi
261 if grep "CONFIG_INETD=y" ${B}/.config; then
262 install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${BPN}
263 sed -i "s:/usr/sbin/:${sbindir}/:" ${D}${sysconfdir}/init.d/inetd.${BPN}
264 install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/
265 fi
266 if grep "CONFIG_MDEV=y" ${B}/.config; then
267 install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev
268 if grep "CONFIG_FEATURE_MDEV_CONF=y" ${B}/.config; then
269 install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
270 fi
271 fi
272
273 if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
274 install -d ${D}${systemd_unitdir}/system
275 sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
276 > ${D}${systemd_unitdir}/system/busybox-syslog.service
277 sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \
278 > ${D}${systemd_unitdir}/system/busybox-klogd.service
279
280 if [ -f ${WORKDIR}/busybox-syslog.default ] ; then
281 install -d ${D}${sysconfdir}/default
282 install -m 0644 ${WORKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog
283 fi
284
285 ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service
286 fi
287
288 # Remove the sysvinit specific configuration file for systemd systems to avoid confusion
289 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then
290 rm -f ${D}${sysconfdir}/syslog-startup.conf.${BPN}
291 fi
292}
293
294inherit update-alternatives
295
296ALTERNATIVE_PRIORITY = "50"
297
298ALTERNATIVE_${PN}-syslog += "syslog-conf"
299ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
300
301python () {
302 if base_contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
303 pn = d.getVar('PN', True)
304 d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init')
305 d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir', True)))
306 d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
307 d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-startup-conf')
308 d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-startup-conf', '%s/syslog-startup.conf' % (d.getVar('sysconfdir', True)))
309 d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-startup-conf', '%s/syslog-startup.conf.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
310}
311
312python do_package_prepend () {
313 # We need to load the full set of busybox provides from the /etc/busybox.links
314 # Use this to see the update-alternatives with the right information
315
316 dvar = d.getVar('D', True)
317 pn = d.getVar('PN', True)
318 def set_alternative_vars(links, target):
319 f = open('%s%s' % (dvar, links), 'r')
320 for alt_link_name in f:
321 alt_link_name = alt_link_name.strip()
322 alt_name = os.path.basename(alt_link_name)
323 # Match coreutils
324 if alt_name == '[':
325 alt_name = 'lbracket'
326 d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
327 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
328 if os.path.exists('%s%s' % (dvar, target)):
329 d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
330 f.close()
331 return
332
333 if os.path.exists('%s/etc/busybox.links' % (dvar)):
334 set_alternative_vars("/etc/busybox.links", "/bin/busybox")
335 else:
336 set_alternative_vars("/etc/busybox.links.nosuid", "/bin/busybox.nosuid")
337 set_alternative_vars("/etc/busybox.links.suid", "/bin/busybox.suid")
338}
339
340pkg_postinst_${PN} () {
341 # This part of code is dedicated to the on target upgrade problem.
342 # It's known that if we don't make appropriate symlinks before update-alternatives calls,
343 # there will be errors indicating missing commands such as 'sed'.
344 # These symlinks will later be updated by update-alternatives calls.
345 test -n 2 > /dev/null || alias test='busybox test'
346 if test "x$D" = "x"; then
347 # Remove busybox.nosuid if it's a symlink, because this situation indicates
348 # that we're installing or upgrading to a one-binary busybox.
349 if test -h /bin/busybox.nosuid; then
350 rm -f /bin/busybox.nosuid
351 fi
352 for suffix in "" ".nosuid" ".suid"; do
353 if test -e /etc/busybox.links$suffix; then
354 while read link; do
355 if test ! -e "$link"; then
356 case "$link" in
357 /*/*/*)
358 to="../../bin/busybox$suffix"
359 ;;
360 /bin/*)
361 to="busybox$suffix"
362 ;;
363 /*/*)
364 to="../bin/busybox$suffix"
365 ;;
366 esac
367 # we can use busybox here because even if we are using splitted busybox
368 # we've made a symlink from /bin/busybox to /bin/busybox.nosuid.
369 busybox rm -f $link
370 busybox ln -s $to $link
371 fi
372 done < /etc/busybox.links$suffix
373 fi
374 done
375 fi
376}
377
378pkg_prerm_${PN} () {
379 # This is so you can make busybox commit suicide - removing busybox with no other packages
380 # providing its files, this will make update-alternatives work, but the update-rc.d part
381 # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
382 tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
383 ln -s /bin/busybox $tmpdir/[
384 ln -s /bin/busybox $tmpdir/test
385 ln -s /bin/busybox $tmpdir/head
386 ln -s /bin/busybox $tmpdir/sh
387 ln -s /bin/busybox $tmpdir/basename
388 ln -s /bin/busybox $tmpdir/echo
389 ln -s /bin/busybox $tmpdir/mv
390 ln -s /bin/busybox $tmpdir/ln
391 ln -s /bin/busybox $tmpdir/dirname
392 ln -s /bin/busybox $tmpdir/rm
393 ln -s /bin/busybox $tmpdir/sed
394 ln -s /bin/busybox $tmpdir/sort
395 ln -s /bin/busybox $tmpdir/grep
396 export PATH=$PATH:$tmpdir
397}
398
399pkg_prerm_${PN}-syslog () {
400 # remove syslog
401 if test "x$D" = "x"; then
402 if test "$1" = "upgrade" -o "$1" = "remove"; then
403 /etc/init.d/syslog stop
404 fi
405 fi
406}
diff --git a/meta/recipes-core/busybox/busybox/0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch b/meta/recipes-core/busybox/busybox/0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch
new file mode 100644
index 0000000000..3da38bb4ca
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch
@@ -0,0 +1,40 @@
1From 28389e59701c2408e87e886c358f8e1766c677f7 Mon Sep 17 00:00:00 2001
2From: Drew Moseley <drew_moseley@mentor.com>
3Date: Sat, 29 Mar 2014 11:13:16 -0400
4Subject: [PATCH] build system: Specify '-nostldlib' when linking to .o files.
5
6For certain cross build scenarios the LD variable is overridden
7to use the gcc executive to ensure all the target tuning parameters
8are used. In these cases, the executive errors out as shown below
9but since this step is only linking to a .o file the standard libs
10are not needed.
11
12 $ make LD=gcc applets/built-in.o
13 LD applets/built-in.o
14 /usr/bin/ld: cannot find -lgcc_s
15 /usr/bin/ld: cannot find -lgcc_s
16 collect2: ld returned 1 exit status
17 make[1]: *** [applets/built-in.o] Error 1
18 make: *** [applets_dir] Error 2
19
20Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
21---
22 scripts/Makefile.build | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25diff --git a/scripts/Makefile.build b/scripts/Makefile.build
26index 5685b5b..eba69f6 100644
27--- a/scripts/Makefile.build
28+++ b/scripts/Makefile.build
29@@ -256,7 +256,7 @@ ifdef builtin-target
30 quiet_cmd_link_o_target = LD $@
31 # If the list of objects to link is empty, just create an empty built-in.o
32 cmd_link_o_target = $(if $(strip $(obj-y)),\
33- $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
34+ $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
35 rm -f $@; $(AR) rcs $@)
36
37 $(builtin-target): $(obj-y) FORCE
38--
391.7.9.5
40
diff --git a/meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch b/meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch
new file mode 100644
index 0000000000..de2dbcceb1
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch
@@ -0,0 +1,37 @@
1Upstream-Status: Pending
2
3# copy commit message from OE as the patch comment:
4# commit 98c24291aa165f53423c27ae033831ce0b3bb676
5# Author: Roman I Khimov <khimov@altell.ru>
6# Date: Thu Mar 26 23:03:58 2009 +0000
7#
8# busybox: update appletlib dependency patch
9#
10# Previous version still failed from time to time on clean-start builds
11# with 4 bitbake threads and '-j16'. Building busybox as sole target worked
12# well.
13#
14# The reason is that previous version introduced a race between applets make
15# processes spawned from top-level Makefile and from libbb Makefile.
16#
17# Fix it with high-level dependency that doesn't create races.
18#
19# Signed-off-by: Koen Kooi <koen@openembedded.org>
20#
21# above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
22
23Index: busybox-1.13.2/Makefile
24===================================================================
25--- busybox-1.13.2.orig/Makefile 2009-03-19 15:44:37.419270265 +0300
26+++ busybox-1.13.2/Makefile 2009-03-19 15:45:57.737521296 +0300
27@@ -471,6 +471,10 @@
28 util-linux/ \
29 util-linux/volume_id/ \
30
31+# Lib interdeps
32+# libbb uses headers generated in applets
33+libbb: applets
34+
35 endif # KBUILD_EXTMOD
36
37 ifeq ($(dot-config),1)
diff --git a/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
new file mode 100644
index 0000000000..4c9ce3b711
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
@@ -0,0 +1,137 @@
1From 53626cd06a3ef05ed847daea802ef0aa9661caa7 Mon Sep 17 00:00:00 2001
2From: Anders Darander <anders@chargestorm.se>
3Date: Thu, 3 Nov 2011 08:51:31 +0100
4Subject: [PATCH] busybox-udhcpc-no_deconfig.patch
5
6Upstream-Status: Pending
7
8Add a new option -D to the udhcpc client that allows for
9dhcp renewal to occur without having to down the interface
10in the process.
11
12Signed-off-by: Greg Moffatt <greg.moffatt@windriver.com>
13
14Updated to latest Busybox 1.17.3
15
16Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
17
18Updated to Busybox 1.18.4
19option spec is changed
20
21Signed-off-by: Qing He <qing.he@intel.com>
22
23Updated to Busybox 1.19.3
24
25Signed-off-by: Anders Darander <anders@chargestorm.se>
26
27Fixed options -b, -a and -P.
28
29Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
30---
31 networking/udhcp/dhcpc.c | 29 +++++++++++++++++++++--------
32 1 files changed, 21 insertions(+), 8 deletions(-)
33
34Index: busybox-1.20.2/networking/udhcp/dhcpc.c
35===================================================================
36--- busybox-1.20.2.orig/networking/udhcp/dhcpc.c
37+++ busybox-1.20.2/networking/udhcp/dhcpc.c
38@@ -29,6 +29,9 @@
39 #include <netpacket/packet.h>
40 #include <linux/filter.h>
41
42+/* option whether to down the interface when reconfiguring */
43+static int allow_deconfig = 1;
44+
45 /* "struct client_config_t client_config" is in bb_common_bufsiz1 */
46
47
48@@ -81,8 +84,9 @@ enum {
49 OPT_x = 1 << 18,
50 OPT_f = 1 << 19,
51 OPT_B = 1 << 20,
52+ OPT_D = 1 << 21,
53 /* The rest has variable bit positions, need to be clever */
54- OPTBIT_B = 20,
55+ OPTBIT_D = 21,
56 USE_FOR_MMU( OPTBIT_b,)
57 IF_FEATURE_UDHCPC_ARPING(OPTBIT_a,)
58 IF_FEATURE_UDHCP_PORT( OPTBIT_P,)
59@@ -1040,7 +1044,8 @@ static void perform_renew(void)
60 state = RENEW_REQUESTED;
61 break;
62 case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
63- udhcp_run_script(NULL, "deconfig");
64+ if (allow_deconfig)
65+ udhcp_run_script(NULL, "deconfig");
66 case REQUESTING:
67 case RELEASED:
68 change_listen_mode(LISTEN_RAW);
69@@ -1064,7 +1069,8 @@ static void perform_release(uint32_t ser
70 bb_info_msg("Unicasting a release of %s to %s",
71 inet_ntoa(temp_addr), buffer);
72 send_release(server_addr, requested_ip); /* unicast */
73- udhcp_run_script(NULL, "deconfig");
74+ if (allow_deconfig)
75+ udhcp_run_script(NULL, "deconfig");
76 }
77 bb_info_msg("Entering released state");
78
79@@ -1215,7 +1221,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c
80 /* O,x: list; -T,-t,-A take numeric param */
81 opt_complementary = "O::x::T+:t+:A+" IF_UDHCP_VERBOSE(":vv") ;
82 IF_LONG_OPTS(applet_long_options = udhcpc_longopts;)
83- opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fB"
84+ opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fBD"
85 USE_FOR_MMU("b")
86 IF_FEATURE_UDHCPC_ARPING("a")
87 IF_FEATURE_UDHCP_PORT("P:")
88@@ -1316,6 +1322,9 @@ int udhcpc_main(int argc UNUSED_PARAM, c
89 logmode |= LOGMODE_SYSLOG;
90 }
91
92+ if (opt & OPT_D)
93+ allow_deconfig = 0;
94+
95 /* Make sure fd 0,1,2 are open */
96 bb_sanitize_stdio();
97 /* Equivalent of doing a fflush after every \n */
98@@ -1330,7 +1339,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
99 srand(monotonic_us());
100
101 state = INIT_SELECTING;
102- udhcp_run_script(NULL, "deconfig");
103+ if (allow_deconfig)
104+ udhcp_run_script(NULL, "deconfig");
105 change_listen_mode(LISTEN_RAW);
106 packet_num = 0;
107 timeout = 0;
108@@ -1484,7 +1494,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
109 }
110 /* Timed out, enter init state */
111 bb_info_msg("Lease lost, entering init state");
112- udhcp_run_script(NULL, "deconfig");
113+ if (allow_deconfig)
114+ udhcp_run_script(NULL, "deconfig");
115 state = INIT_SELECTING;
116 client_config.first_secs = 0; /* make secs field count from 0 */
117 /*timeout = 0; - already is */
118@@ -1667,7 +1678,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
119 send_decline(/*xid,*/ server_addr, packet.yiaddr);
120
121 if (state != REQUESTING)
122- udhcp_run_script(NULL, "deconfig");
123+ if (allow_deconfig)
124+ udhcp_run_script(NULL, "deconfig");
125 change_listen_mode(LISTEN_RAW);
126 state = INIT_SELECTING;
127 client_config.first_secs = 0; /* make secs field count from 0 */
128@@ -1711,7 +1723,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
129 bb_info_msg("Received DHCP NAK");
130 udhcp_run_script(&packet, "nak");
131 if (state != REQUESTING)
132- udhcp_run_script(NULL, "deconfig");
133+ if (allow_deconfig)
134+ udhcp_run_script(NULL, "deconfig");
135 change_listen_mode(LISTEN_RAW);
136 sleep(3); /* avoid excessive network traffic */
137 state = INIT_SELECTING;
diff --git a/meta/recipes-core/busybox/busybox/defconfig b/meta/recipes-core/busybox/busybox/defconfig
new file mode 100644
index 0000000000..47eca212db
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/defconfig
@@ -0,0 +1,1020 @@
1#
2# Automatically generated make config: don't edit
3# Busybox version: 1.20.2
4# Mon Aug 20 17:01:45 2012
5#
6CONFIG_HAVE_DOT_CONFIG=y
7
8#
9# Busybox Settings
10#
11
12#
13# General Configuration
14#
15# CONFIG_DESKTOP is not set
16# CONFIG_EXTRA_COMPAT is not set
17# CONFIG_INCLUDE_SUSv2 is not set
18# CONFIG_USE_PORTABLE_CODE is not set
19CONFIG_PLATFORM_LINUX=y
20CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
21# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
22# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
23CONFIG_SHOW_USAGE=y
24# CONFIG_FEATURE_VERBOSE_USAGE is not set
25CONFIG_FEATURE_COMPRESS_USAGE=y
26# CONFIG_FEATURE_INSTALLER is not set
27# CONFIG_INSTALL_NO_USR is not set
28# CONFIG_LOCALE_SUPPORT is not set
29# CONFIG_UNICODE_SUPPORT is not set
30# CONFIG_UNICODE_USING_LOCALE is not set
31# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
32CONFIG_SUBST_WCHAR=0
33CONFIG_LAST_SUPPORTED_WCHAR=0
34# CONFIG_UNICODE_COMBINING_WCHARS is not set
35# CONFIG_UNICODE_WIDE_WCHARS is not set
36# CONFIG_UNICODE_BIDI_SUPPORT is not set
37# CONFIG_UNICODE_NEUTRAL_TABLE is not set
38# CONFIG_UNICODE_PRESERVE_BROKEN is not set
39CONFIG_LONG_OPTS=y
40CONFIG_FEATURE_DEVPTS=y
41# CONFIG_FEATURE_CLEAN_UP is not set
42CONFIG_FEATURE_UTMP=y
43# CONFIG_FEATURE_WTMP is not set
44CONFIG_FEATURE_PIDFILE=y
45CONFIG_FEATURE_SUID=y
46CONFIG_FEATURE_SUID_CONFIG=y
47CONFIG_FEATURE_SUID_CONFIG_QUIET=y
48# CONFIG_SELINUX is not set
49# CONFIG_FEATURE_PREFER_APPLETS is not set
50CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
51CONFIG_FEATURE_SYSLOG=y
52CONFIG_FEATURE_HAVE_RPC=y
53
54#
55# Build Options
56#
57# CONFIG_STATIC is not set
58# CONFIG_PIE is not set
59# CONFIG_NOMMU is not set
60# CONFIG_BUILD_LIBBUSYBOX is not set
61# CONFIG_FEATURE_INDIVIDUAL is not set
62# CONFIG_FEATURE_SHARED_BUSYBOX is not set
63CONFIG_LFS=y
64# CONFIG_CROSS_COMPILER_PREFIX is not set
65CONFIG_SYSROOT=""
66# CONFIG_EXTRA_CFLAGS is not set
67CONFIG_EXTRA_LDFLAGS=""
68CONFIG_EXTRA_LDLIBS=""
69
70#
71# Debugging Options
72#
73# CONFIG_DEBUG is not set
74# CONFIG_DEBUG_PESSIMIZE is not set
75# CONFIG_WERROR is not set
76CONFIG_NO_DEBUG_LIB=y
77# CONFIG_DMALLOC is not set
78# CONFIG_EFENCE is not set
79
80#
81# Installation Options ("make install" behavior)
82#
83CONFIG_INSTALL_APPLET_SYMLINKS=y
84# CONFIG_INSTALL_APPLET_HARDLINKS is not set
85# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
86# CONFIG_INSTALL_APPLET_DONT is not set
87# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
88# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
89# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
90CONFIG_PREFIX="./_install"
91
92#
93# Busybox Library Tuning
94#
95CONFIG_FEATURE_SYSTEMD=y
96CONFIG_FEATURE_RTMINMAX=y
97CONFIG_PASSWORD_MINLEN=6
98CONFIG_MD5_SMALL=1
99CONFIG_FEATURE_FAST_TOP=y
100# CONFIG_FEATURE_ETC_NETWORKS is not set
101CONFIG_FEATURE_USE_TERMIOS=y
102CONFIG_FEATURE_EDITING=y
103CONFIG_FEATURE_EDITING_MAX_LEN=1024
104# CONFIG_FEATURE_EDITING_VI is not set
105CONFIG_FEATURE_EDITING_HISTORY=15
106CONFIG_FEATURE_EDITING_SAVEHISTORY=y
107# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
108# CONFIG_FEATURE_REVERSE_SEARCH is not set
109CONFIG_FEATURE_TAB_COMPLETION=y
110CONFIG_FEATURE_USERNAME_COMPLETION=y
111CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
112# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
113CONFIG_FEATURE_NON_POSIX_CP=y
114# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
115CONFIG_FEATURE_COPYBUF_KB=4
116CONFIG_FEATURE_SKIP_ROOTFS=y
117CONFIG_MONOTONIC_SYSCALL=y
118CONFIG_IOCTL_HEX2STR_ERROR=y
119CONFIG_FEATURE_HWIB=y
120
121#
122# Applets
123#
124
125#
126# Archival Utilities
127#
128CONFIG_FEATURE_SEAMLESS_XZ=y
129CONFIG_FEATURE_SEAMLESS_LZMA=y
130CONFIG_FEATURE_SEAMLESS_BZ2=y
131CONFIG_FEATURE_SEAMLESS_GZ=y
132CONFIG_FEATURE_SEAMLESS_Z=y
133CONFIG_AR=y
134# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
135# CONFIG_FEATURE_AR_CREATE is not set
136CONFIG_BUNZIP2=y
137# CONFIG_BZIP2 is not set
138CONFIG_CPIO=y
139# CONFIG_FEATURE_CPIO_O is not set
140# CONFIG_FEATURE_CPIO_P is not set
141# CONFIG_DPKG is not set
142# CONFIG_DPKG_DEB is not set
143# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
144CONFIG_GUNZIP=y
145CONFIG_GZIP=y
146# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
147CONFIG_GZIP_FAST=0
148# CONFIG_LZOP is not set
149# CONFIG_LZOP_COMPR_HIGH is not set
150# CONFIG_RPM2CPIO is not set
151# CONFIG_RPM is not set
152CONFIG_TAR=y
153CONFIG_FEATURE_TAR_CREATE=y
154CONFIG_FEATURE_TAR_AUTODETECT=y
155CONFIG_FEATURE_TAR_FROM=y
156CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
157# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
158CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
159# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
160# CONFIG_FEATURE_TAR_TO_COMMAND is not set
161# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
162# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set
163# CONFIG_FEATURE_TAR_SELINUX is not set
164# CONFIG_UNCOMPRESS is not set
165# CONFIG_UNLZMA is not set
166# CONFIG_FEATURE_LZMA_FAST is not set
167# CONFIG_LZMA is not set
168# CONFIG_UNXZ is not set
169# CONFIG_XZ is not set
170CONFIG_UNZIP=y
171
172#
173# Coreutils
174#
175CONFIG_BASENAME=y
176CONFIG_CAT=y
177CONFIG_DATE=y
178# CONFIG_FEATURE_DATE_ISOFMT is not set
179# CONFIG_FEATURE_DATE_NANO is not set
180CONFIG_FEATURE_DATE_COMPAT=y
181# CONFIG_HOSTID is not set
182CONFIG_ID=y
183CONFIG_GROUPS=y
184CONFIG_TEST=y
185CONFIG_FEATURE_TEST_64=y
186CONFIG_TOUCH=y
187CONFIG_FEATURE_TOUCH_SUSV3=y
188CONFIG_TR=y
189CONFIG_FEATURE_TR_CLASSES=y
190# CONFIG_FEATURE_TR_EQUIV is not set
191# CONFIG_BASE64 is not set
192CONFIG_WHO=y
193CONFIG_USERS=y
194# CONFIG_CAL is not set
195# CONFIG_CATV is not set
196CONFIG_CHGRP=y
197CONFIG_CHMOD=y
198CONFIG_CHOWN=y
199# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
200CONFIG_CHROOT=y
201# CONFIG_CKSUM is not set
202# CONFIG_COMM is not set
203CONFIG_CP=y
204# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
205CONFIG_CUT=y
206CONFIG_DD=y
207CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
208# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
209# CONFIG_FEATURE_DD_IBS_OBS is not set
210CONFIG_DF=y
211# CONFIG_FEATURE_DF_FANCY is not set
212CONFIG_DIRNAME=y
213# CONFIG_DOS2UNIX is not set
214# CONFIG_UNIX2DOS is not set
215CONFIG_DU=y
216CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
217CONFIG_ECHO=y
218CONFIG_FEATURE_FANCY_ECHO=y
219CONFIG_ENV=y
220CONFIG_FEATURE_ENV_LONG_OPTIONS=y
221# CONFIG_EXPAND is not set
222# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
223CONFIG_EXPR=y
224CONFIG_EXPR_MATH_SUPPORT_64=y
225CONFIG_FALSE=y
226# CONFIG_FOLD is not set
227# CONFIG_FSYNC is not set
228CONFIG_HEAD=y
229# CONFIG_FEATURE_FANCY_HEAD is not set
230# CONFIG_INSTALL is not set
231# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
232CONFIG_LN=y
233CONFIG_LOGNAME=y
234CONFIG_LS=y
235CONFIG_FEATURE_LS_FILETYPES=y
236CONFIG_FEATURE_LS_FOLLOWLINKS=y
237CONFIG_FEATURE_LS_RECURSIVE=y
238CONFIG_FEATURE_LS_SORTFILES=y
239CONFIG_FEATURE_LS_TIMESTAMPS=y
240CONFIG_FEATURE_LS_USERNAME=y
241CONFIG_FEATURE_LS_COLOR=y
242# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
243CONFIG_MD5SUM=y
244CONFIG_MKDIR=y
245CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
246CONFIG_MKFIFO=y
247CONFIG_MKNOD=y
248CONFIG_MV=y
249# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
250# CONFIG_NICE is not set
251CONFIG_NOHUP=y
252CONFIG_OD=y
253# CONFIG_PRINTENV is not set
254CONFIG_PRINTF=y
255CONFIG_PWD=y
256CONFIG_READLINK=y
257CONFIG_FEATURE_READLINK_FOLLOW=y
258CONFIG_REALPATH=y
259CONFIG_RM=y
260CONFIG_RMDIR=y
261# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
262CONFIG_SEQ=y
263# CONFIG_SHA1SUM is not set
264# CONFIG_SHA256SUM is not set
265# CONFIG_SHA512SUM is not set
266CONFIG_SLEEP=y
267CONFIG_FEATURE_FANCY_SLEEP=y
268# CONFIG_FEATURE_FLOAT_SLEEP is not set
269CONFIG_SORT=y
270CONFIG_FEATURE_SORT_BIG=y
271# CONFIG_SPLIT is not set
272# CONFIG_FEATURE_SPLIT_FANCY is not set
273CONFIG_STAT=y
274CONFIG_FEATURE_STAT_FORMAT=y
275CONFIG_STTY=y
276# CONFIG_SUM is not set
277CONFIG_SYNC=y
278# CONFIG_TAC is not set
279CONFIG_TAIL=y
280CONFIG_FEATURE_FANCY_TAIL=y
281CONFIG_TEE=y
282# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
283CONFIG_TRUE=y
284CONFIG_TTY=y
285CONFIG_UNAME=y
286# CONFIG_UNEXPAND is not set
287# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
288CONFIG_UNIQ=y
289CONFIG_USLEEP=y
290# CONFIG_UUDECODE is not set
291# CONFIG_UUENCODE is not set
292CONFIG_WC=y
293# CONFIG_FEATURE_WC_LARGE is not set
294CONFIG_WHOAMI=y
295CONFIG_YES=y
296
297#
298# Common options for cp and mv
299#
300# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
301
302#
303# Common options for ls, more and telnet
304#
305CONFIG_FEATURE_AUTOWIDTH=y
306
307#
308# Common options for df, du, ls
309#
310CONFIG_FEATURE_HUMAN_READABLE=y
311
312#
313# Common options for md5sum, sha1sum, sha256sum, sha512sum
314#
315CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
316
317#
318# Console Utilities
319#
320CONFIG_CHVT=y
321# CONFIG_FGCONSOLE is not set
322CONFIG_CLEAR=y
323CONFIG_DEALLOCVT=y
324CONFIG_DUMPKMAP=y
325# CONFIG_KBD_MODE is not set
326CONFIG_LOADFONT=y
327CONFIG_LOADKMAP=y
328CONFIG_OPENVT=y
329CONFIG_RESET=y
330# CONFIG_RESIZE is not set
331# CONFIG_FEATURE_RESIZE_PRINT is not set
332CONFIG_SETCONSOLE=y
333# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
334# CONFIG_SETFONT is not set
335# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
336CONFIG_DEFAULT_SETFONT_DIR=""
337# CONFIG_SETKEYCODES is not set
338# CONFIG_SETLOGCONS is not set
339# CONFIG_SHOWKEY is not set
340
341#
342# Common options for loadfont and setfont
343#
344# CONFIG_FEATURE_LOADFONT_PSF2 is not set
345# CONFIG_FEATURE_LOADFONT_RAW is not set
346
347#
348# Debian Utilities
349#
350CONFIG_MKTEMP=y
351# CONFIG_PIPE_PROGRESS is not set
352CONFIG_RUN_PARTS=y
353CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
354# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
355CONFIG_START_STOP_DAEMON=y
356CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
357CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
358CONFIG_WHICH=y
359
360#
361# Editors
362#
363CONFIG_PATCH=y
364CONFIG_VI=y
365CONFIG_FEATURE_VI_MAX_LEN=1024
366CONFIG_FEATURE_VI_8BIT=y
367CONFIG_FEATURE_VI_COLON=y
368CONFIG_FEATURE_VI_YANKMARK=y
369CONFIG_FEATURE_VI_SEARCH=y
370# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
371CONFIG_FEATURE_VI_USE_SIGNALS=y
372# CONFIG_FEATURE_VI_DOT_CMD is not set
373# CONFIG_FEATURE_VI_READONLY is not set
374# CONFIG_FEATURE_VI_SETOPTS is not set
375# CONFIG_FEATURE_VI_SET is not set
376CONFIG_FEATURE_VI_WIN_RESIZE=y
377# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
378CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
379CONFIG_AWK=y
380# CONFIG_FEATURE_AWK_LIBM is not set
381CONFIG_CMP=y
382CONFIG_DIFF=y
383# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
384CONFIG_FEATURE_DIFF_DIR=y
385# CONFIG_ED is not set
386CONFIG_SED=y
387CONFIG_FEATURE_ALLOW_EXEC=y
388
389#
390# Finding Utilities
391#
392CONFIG_FIND=y
393CONFIG_FEATURE_FIND_PRINT0=y
394CONFIG_FEATURE_FIND_MTIME=y
395CONFIG_FEATURE_FIND_MMIN=y
396CONFIG_FEATURE_FIND_PERM=y
397CONFIG_FEATURE_FIND_TYPE=y
398CONFIG_FEATURE_FIND_XDEV=y
399CONFIG_FEATURE_FIND_MAXDEPTH=y
400CONFIG_FEATURE_FIND_NEWER=y
401# CONFIG_FEATURE_FIND_INUM is not set
402CONFIG_FEATURE_FIND_EXEC=y
403CONFIG_FEATURE_FIND_USER=y
404CONFIG_FEATURE_FIND_GROUP=y
405CONFIG_FEATURE_FIND_NOT=y
406CONFIG_FEATURE_FIND_DEPTH=y
407CONFIG_FEATURE_FIND_PAREN=y
408CONFIG_FEATURE_FIND_SIZE=y
409CONFIG_FEATURE_FIND_PRUNE=y
410# CONFIG_FEATURE_FIND_DELETE is not set
411CONFIG_FEATURE_FIND_PATH=y
412CONFIG_FEATURE_FIND_REGEX=y
413# CONFIG_FEATURE_FIND_CONTEXT is not set
414# CONFIG_FEATURE_FIND_LINKS is not set
415CONFIG_GREP=y
416CONFIG_FEATURE_GREP_EGREP_ALIAS=y
417CONFIG_FEATURE_GREP_FGREP_ALIAS=y
418CONFIG_FEATURE_GREP_CONTEXT=y
419CONFIG_XARGS=y
420# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
421# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
422# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
423# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
424
425#
426# Init Utilities
427#
428# CONFIG_BOOTCHARTD is not set
429# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
430# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
431CONFIG_HALT=y
432# CONFIG_FEATURE_CALL_TELINIT is not set
433CONFIG_TELINIT_PATH=""
434# CONFIG_INIT is not set
435# CONFIG_FEATURE_USE_INITTAB is not set
436# CONFIG_FEATURE_KILL_REMOVED is not set
437CONFIG_FEATURE_KILL_DELAY=0
438# CONFIG_FEATURE_INIT_SCTTY is not set
439# CONFIG_FEATURE_INIT_SYSLOG is not set
440# CONFIG_FEATURE_EXTRA_QUIET is not set
441# CONFIG_FEATURE_INIT_COREDUMPS is not set
442# CONFIG_FEATURE_INITRD is not set
443CONFIG_INIT_TERMINAL_TYPE=""
444# CONFIG_MESG is not set
445# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set
446
447#
448# Login/Password Management Utilities
449#
450# CONFIG_ADD_SHELL is not set
451# CONFIG_REMOVE_SHELL is not set
452# CONFIG_FEATURE_SHADOWPASSWDS is not set
453# CONFIG_USE_BB_PWD_GRP is not set
454# CONFIG_USE_BB_SHADOW is not set
455CONFIG_USE_BB_CRYPT=y
456# CONFIG_USE_BB_CRYPT_SHA is not set
457# CONFIG_ADDUSER is not set
458# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
459# CONFIG_FEATURE_CHECK_NAMES is not set
460CONFIG_FIRST_SYSTEM_ID=100
461CONFIG_LAST_SYSTEM_ID=999
462# CONFIG_ADDGROUP is not set
463# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
464# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
465# CONFIG_DELUSER is not set
466# CONFIG_DELGROUP is not set
467# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
468# CONFIG_GETTY is not set
469# CONFIG_LOGIN is not set
470# CONFIG_LOGIN_SESSION_AS_CHILD is not set
471# CONFIG_PAM is not set
472# CONFIG_LOGIN_SCRIPTS is not set
473# CONFIG_FEATURE_NOLOGIN is not set
474# CONFIG_FEATURE_SECURETTY is not set
475# CONFIG_PASSWD is not set
476# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
477# CONFIG_CRYPTPW is not set
478# CONFIG_CHPASSWD is not set
479CONFIG_FEATURE_DEFAULT_PASSWD_ALGO=""
480# CONFIG_SU is not set
481# CONFIG_FEATURE_SU_SYSLOG is not set
482# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
483# CONFIG_SULOGIN is not set
484# CONFIG_VLOCK is not set
485
486#
487# Linux Ext2 FS Progs
488#
489CONFIG_CHATTR=y
490CONFIG_FSCK=y
491# CONFIG_LSATTR is not set
492# CONFIG_TUNE2FS is not set
493
494#
495# Linux Module Utilities
496#
497# CONFIG_MODINFO is not set
498# CONFIG_MODPROBE_SMALL is not set
499# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set
500# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
501CONFIG_INSMOD=y
502CONFIG_RMMOD=y
503CONFIG_LSMOD=y
504# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
505CONFIG_MODPROBE=y
506# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
507CONFIG_DEPMOD=y
508
509#
510# Options common to multiple modutils
511#
512# CONFIG_FEATURE_2_4_MODULES is not set
513# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
514# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
515# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
516# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
517# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
518# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
519CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
520CONFIG_FEATURE_MODUTILS_ALIAS=y
521CONFIG_FEATURE_MODUTILS_SYMBOLS=y
522CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
523CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
524
525#
526# Linux System Utilities
527#
528# CONFIG_BLOCKDEV is not set
529# CONFIG_MDEV is not set
530# CONFIG_FEATURE_MDEV_CONF is not set
531# CONFIG_FEATURE_MDEV_RENAME is not set
532# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
533# CONFIG_FEATURE_MDEV_EXEC is not set
534# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
535# CONFIG_REV is not set
536# CONFIG_ACPID is not set
537# CONFIG_FEATURE_ACPID_COMPAT is not set
538# CONFIG_BLKID is not set
539# CONFIG_FEATURE_BLKID_TYPE is not set
540CONFIG_DMESG=y
541CONFIG_FEATURE_DMESG_PRETTY=y
542CONFIG_FBSET=y
543CONFIG_FEATURE_FBSET_FANCY=y
544CONFIG_FEATURE_FBSET_READMODE=y
545# CONFIG_FDFLUSH is not set
546# CONFIG_FDFORMAT is not set
547CONFIG_FDISK=y
548# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
549CONFIG_FEATURE_FDISK_WRITABLE=y
550# CONFIG_FEATURE_AIX_LABEL is not set
551# CONFIG_FEATURE_SGI_LABEL is not set
552# CONFIG_FEATURE_SUN_LABEL is not set
553# CONFIG_FEATURE_OSF_LABEL is not set
554# CONFIG_FEATURE_GPT_LABEL is not set
555# CONFIG_FEATURE_FDISK_ADVANCED is not set
556# CONFIG_FINDFS is not set
557CONFIG_FLOCK=y
558# CONFIG_FREERAMDISK is not set
559# CONFIG_FSCK_MINIX is not set
560# CONFIG_MKFS_EXT2 is not set
561# CONFIG_MKFS_MINIX is not set
562# CONFIG_FEATURE_MINIX2 is not set
563# CONFIG_MKFS_REISER is not set
564# CONFIG_MKFS_VFAT is not set
565# CONFIG_GETOPT is not set
566# CONFIG_FEATURE_GETOPT_LONG is not set
567CONFIG_HEXDUMP=y
568# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
569# CONFIG_HD is not set
570CONFIG_HWCLOCK=y
571CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
572CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y
573# CONFIG_IPCRM is not set
574# CONFIG_IPCS is not set
575CONFIG_LOSETUP=y
576# CONFIG_LSPCI is not set
577# CONFIG_LSUSB is not set
578CONFIG_MKSWAP=y
579# CONFIG_FEATURE_MKSWAP_UUID is not set
580CONFIG_MORE=y
581CONFIG_MOUNT=y
582# CONFIG_FEATURE_MOUNT_FAKE is not set
583# CONFIG_FEATURE_MOUNT_VERBOSE is not set
584# CONFIG_FEATURE_MOUNT_HELPERS is not set
585# CONFIG_FEATURE_MOUNT_LABEL is not set
586CONFIG_FEATURE_MOUNT_NFS=y
587# CONFIG_FEATURE_MOUNT_CIFS is not set
588CONFIG_FEATURE_MOUNT_FLAGS=y
589CONFIG_FEATURE_MOUNT_FSTAB=y
590CONFIG_PIVOT_ROOT=y
591CONFIG_RDATE=y
592# CONFIG_RDEV is not set
593# CONFIG_READPROFILE is not set
594# CONFIG_RTCWAKE is not set
595# CONFIG_SCRIPT is not set
596# CONFIG_SCRIPTREPLAY is not set
597# CONFIG_SETARCH is not set
598CONFIG_SWAPONOFF=y
599CONFIG_FEATURE_SWAPON_PRI=y
600CONFIG_SWITCH_ROOT=y
601CONFIG_UMOUNT=y
602CONFIG_FEATURE_UMOUNT_ALL=y
603
604#
605# Common options for mount/umount
606#
607CONFIG_FEATURE_MOUNT_LOOP=y
608CONFIG_FEATURE_MOUNT_LOOP_CREATE=y
609# CONFIG_FEATURE_MTAB_SUPPORT is not set
610# CONFIG_VOLUMEID is not set
611# CONFIG_FEATURE_VOLUMEID_EXT is not set
612# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
613# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
614# CONFIG_FEATURE_VOLUMEID_FAT is not set
615# CONFIG_FEATURE_VOLUMEID_HFS is not set
616# CONFIG_FEATURE_VOLUMEID_JFS is not set
617# CONFIG_FEATURE_VOLUMEID_XFS is not set
618# CONFIG_FEATURE_VOLUMEID_NTFS is not set
619# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
620# CONFIG_FEATURE_VOLUMEID_UDF is not set
621# CONFIG_FEATURE_VOLUMEID_LUKS is not set
622# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
623# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
624# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
625# CONFIG_FEATURE_VOLUMEID_SYSV is not set
626# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
627# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set
628
629#
630# Miscellaneous Utilities
631#
632# CONFIG_CONSPY is not set
633CONFIG_LESS=y
634CONFIG_FEATURE_LESS_MAXLINES=9999999
635CONFIG_FEATURE_LESS_BRACKETS=y
636CONFIG_FEATURE_LESS_FLAGS=y
637# CONFIG_FEATURE_LESS_MARKS is not set
638# CONFIG_FEATURE_LESS_REGEXP is not set
639# CONFIG_FEATURE_LESS_WINCH is not set
640# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set
641# CONFIG_FEATURE_LESS_DASHCMD is not set
642# CONFIG_FEATURE_LESS_LINENUMS is not set
643# CONFIG_NANDWRITE is not set
644# CONFIG_NANDDUMP is not set
645# CONFIG_SETSERIAL is not set
646# CONFIG_UBIATTACH is not set
647# CONFIG_UBIDETACH is not set
648# CONFIG_UBIMKVOL is not set
649# CONFIG_UBIRMVOL is not set
650# CONFIG_UBIRSVOL is not set
651# CONFIG_UBIUPDATEVOL is not set
652# CONFIG_ADJTIMEX is not set
653# CONFIG_BBCONFIG is not set
654# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
655# CONFIG_BEEP is not set
656CONFIG_FEATURE_BEEP_FREQ=0
657CONFIG_FEATURE_BEEP_LENGTH_MS=0
658# CONFIG_CHAT is not set
659# CONFIG_FEATURE_CHAT_NOFAIL is not set
660# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
661# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
662# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
663# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
664# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
665# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
666# CONFIG_CHRT is not set
667# CONFIG_CROND is not set
668# CONFIG_FEATURE_CROND_D is not set
669# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
670CONFIG_FEATURE_CROND_DIR=""
671# CONFIG_CRONTAB is not set
672CONFIG_DC=y
673# CONFIG_FEATURE_DC_LIBM is not set
674# CONFIG_DEVFSD is not set
675# CONFIG_DEVFSD_MODLOAD is not set
676# CONFIG_DEVFSD_FG_NP is not set
677# CONFIG_DEVFSD_VERBOSE is not set
678# CONFIG_FEATURE_DEVFS is not set
679# CONFIG_DEVMEM is not set
680# CONFIG_EJECT is not set
681# CONFIG_FEATURE_EJECT_SCSI is not set
682# CONFIG_FBSPLASH is not set
683# CONFIG_FLASHCP is not set
684# CONFIG_FLASH_LOCK is not set
685# CONFIG_FLASH_UNLOCK is not set
686# CONFIG_FLASH_ERASEALL is not set
687# CONFIG_IONICE is not set
688# CONFIG_INOTIFYD is not set
689# CONFIG_LAST is not set
690# CONFIG_FEATURE_LAST_SMALL is not set
691# CONFIG_FEATURE_LAST_FANCY is not set
692# CONFIG_HDPARM is not set
693# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
694# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
695# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
696# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
697# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
698# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
699# CONFIG_MAKEDEVS is not set
700# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
701# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
702# CONFIG_MAN is not set
703CONFIG_MICROCOM=y
704# CONFIG_MOUNTPOINT is not set
705# CONFIG_MT is not set
706# CONFIG_RAIDAUTORUN is not set
707# CONFIG_READAHEAD is not set
708CONFIG_RFKILL=y
709# CONFIG_RUNLEVEL is not set
710# CONFIG_RX is not set
711# CONFIG_SETSID is not set
712CONFIG_STRINGS=y
713# CONFIG_TASKSET is not set
714# CONFIG_FEATURE_TASKSET_FANCY is not set
715CONFIG_TIME=y
716# CONFIG_TIMEOUT is not set
717# CONFIG_TTYSIZE is not set
718# CONFIG_VOLNAME is not set
719# CONFIG_WALL is not set
720# CONFIG_WATCHDOG is not set
721
722#
723# Networking Utilities
724#
725# CONFIG_NAMEIF is not set
726# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
727# CONFIG_NBDCLIENT is not set
728CONFIG_NC=y
729# CONFIG_NC_SERVER is not set
730# CONFIG_NC_EXTRA is not set
731# CONFIG_NC_110_COMPAT is not set
732CONFIG_PING=y
733CONFIG_PING6=y
734CONFIG_FEATURE_FANCY_PING=y
735# CONFIG_WHOIS is not set
736CONFIG_FEATURE_IPV6=y
737# CONFIG_FEATURE_UNIX_LOCAL is not set
738CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
739# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
740# CONFIG_ARP is not set
741# CONFIG_ARPING is not set
742# CONFIG_BRCTL is not set
743# CONFIG_FEATURE_BRCTL_FANCY is not set
744# CONFIG_FEATURE_BRCTL_SHOW is not set
745# CONFIG_DNSD is not set
746# CONFIG_ETHER_WAKE is not set
747# CONFIG_FAKEIDENTD is not set
748# CONFIG_FTPD is not set
749# CONFIG_FEATURE_FTP_WRITE is not set
750# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
751# CONFIG_FTPGET is not set
752# CONFIG_FTPPUT is not set
753# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
754CONFIG_HOSTNAME=y
755# CONFIG_HTTPD is not set
756# CONFIG_FEATURE_HTTPD_RANGES is not set
757# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set
758# CONFIG_FEATURE_HTTPD_SETUID is not set
759# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
760# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
761# CONFIG_FEATURE_HTTPD_CGI is not set
762# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
763# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
764# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
765# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
766# CONFIG_FEATURE_HTTPD_PROXY is not set
767# CONFIG_FEATURE_HTTPD_GZIP is not set
768CONFIG_IFCONFIG=y
769CONFIG_FEATURE_IFCONFIG_STATUS=y
770# CONFIG_FEATURE_IFCONFIG_SLIP is not set
771# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
772CONFIG_FEATURE_IFCONFIG_HW=y
773# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
774# CONFIG_IFENSLAVE is not set
775# CONFIG_IFPLUGD is not set
776CONFIG_IFUPDOWN=y
777CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
778# CONFIG_FEATURE_IFUPDOWN_IP is not set
779# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
780CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN=y
781CONFIG_FEATURE_IFUPDOWN_IPV4=y
782CONFIG_FEATURE_IFUPDOWN_IPV6=y
783CONFIG_FEATURE_IFUPDOWN_MAPPING=y
784# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
785# CONFIG_INETD is not set
786# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
787# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
788# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
789# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
790# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
791# CONFIG_FEATURE_INETD_RPC is not set
792CONFIG_IP=y
793CONFIG_FEATURE_IP_ADDRESS=y
794CONFIG_FEATURE_IP_LINK=y
795CONFIG_FEATURE_IP_ROUTE=y
796CONFIG_FEATURE_IP_TUNNEL=y
797# CONFIG_FEATURE_IP_RULE is not set
798# CONFIG_FEATURE_IP_SHORT_FORMS is not set
799# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
800# CONFIG_IPADDR is not set
801# CONFIG_IPLINK is not set
802# CONFIG_IPROUTE is not set
803# CONFIG_IPTUNNEL is not set
804# CONFIG_IPRULE is not set
805# CONFIG_IPCALC is not set
806# CONFIG_FEATURE_IPCALC_FANCY is not set
807# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
808CONFIG_NETSTAT=y
809# CONFIG_FEATURE_NETSTAT_WIDE is not set
810# CONFIG_FEATURE_NETSTAT_PRG is not set
811CONFIG_NSLOOKUP=y
812# CONFIG_NTPD is not set
813# CONFIG_FEATURE_NTPD_SERVER is not set
814# CONFIG_PSCAN is not set
815CONFIG_ROUTE=y
816# CONFIG_SLATTACH is not set
817# CONFIG_TCPSVD is not set
818CONFIG_TELNET=y
819# CONFIG_FEATURE_TELNET_TTYPE is not set
820CONFIG_FEATURE_TELNET_AUTOLOGIN=y
821# CONFIG_TELNETD is not set
822# CONFIG_FEATURE_TELNETD_STANDALONE is not set
823# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
824CONFIG_TFTP=y
825# CONFIG_TFTPD is not set
826
827#
828# Common options for tftp/tftpd
829#
830CONFIG_FEATURE_TFTP_GET=y
831CONFIG_FEATURE_TFTP_PUT=y
832# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
833# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
834# CONFIG_TFTP_DEBUG is not set
835CONFIG_TRACEROUTE=y
836# CONFIG_TRACEROUTE6 is not set
837# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
838# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
839# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
840# CONFIG_TUNCTL is not set
841# CONFIG_FEATURE_TUNCTL_UG is not set
842# CONFIG_UDHCPC6 is not set
843CONFIG_UDHCPD=y
844# CONFIG_DHCPRELAY is not set
845CONFIG_DUMPLEASES=y
846# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
847# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
848CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases"
849CONFIG_UDHCPC=y
850CONFIG_FEATURE_UDHCPC_ARPING=y
851# CONFIG_FEATURE_UDHCP_PORT is not set
852CONFIG_UDHCP_DEBUG=0
853# CONFIG_FEATURE_UDHCP_RFC3397 is not set
854# CONFIG_FEATURE_UDHCP_8021Q is not set
855CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
856CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
857CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"
858# CONFIG_UDPSVD is not set
859# CONFIG_VCONFIG is not set
860CONFIG_WGET=y
861CONFIG_FEATURE_WGET_STATUSBAR=y
862CONFIG_FEATURE_WGET_AUTHENTICATION=y
863CONFIG_FEATURE_WGET_LONG_OPTIONS=y
864CONFIG_FEATURE_WGET_TIMEOUT=y
865# CONFIG_ZCIP is not set
866
867#
868# Print Utilities
869#
870# CONFIG_LPD is not set
871# CONFIG_LPR is not set
872# CONFIG_LPQ is not set
873
874#
875# Mail Utilities
876#
877# CONFIG_MAKEMIME is not set
878CONFIG_FEATURE_MIME_CHARSET=""
879# CONFIG_POPMAILDIR is not set
880# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
881# CONFIG_REFORMIME is not set
882# CONFIG_FEATURE_REFORMIME_COMPAT is not set
883# CONFIG_SENDMAIL is not set
884
885#
886# Process Utilities
887#
888# CONFIG_IOSTAT is not set
889# CONFIG_LSOF is not set
890# CONFIG_MPSTAT is not set
891# CONFIG_NMETER is not set
892# CONFIG_PMAP is not set
893# CONFIG_POWERTOP is not set
894# CONFIG_PSTREE is not set
895# CONFIG_PWDX is not set
896# CONFIG_SMEMCAP is not set
897CONFIG_UPTIME=y
898# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
899CONFIG_FREE=y
900CONFIG_FUSER=y
901CONFIG_KILL=y
902CONFIG_KILLALL=y
903# CONFIG_KILLALL5 is not set
904# CONFIG_PGREP is not set
905CONFIG_PIDOF=y
906# CONFIG_FEATURE_PIDOF_SINGLE is not set
907# CONFIG_FEATURE_PIDOF_OMIT is not set
908# CONFIG_PKILL is not set
909CONFIG_PS=y
910CONFIG_FEATURE_PS_WIDE=y
911CONFIG_FEATURE_PS_LONG=y
912# CONFIG_FEATURE_PS_TIME is not set
913# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
914# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
915CONFIG_RENICE=y
916CONFIG_BB_SYSCTL=y
917CONFIG_TOP=y
918CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
919CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
920# CONFIG_FEATURE_TOP_SMP_CPU is not set
921# CONFIG_FEATURE_TOP_DECIMALS is not set
922# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
923# CONFIG_FEATURE_TOPMEM is not set
924# CONFIG_FEATURE_SHOW_THREADS is not set
925CONFIG_WATCH=y
926
927#
928# Runit Utilities
929#
930# CONFIG_RUNSV is not set
931# CONFIG_RUNSVDIR is not set
932# CONFIG_FEATURE_RUNSVDIR_LOG is not set
933# CONFIG_SV is not set
934CONFIG_SV_DEFAULT_SERVICE_DIR=""
935# CONFIG_SVLOGD is not set
936# CONFIG_CHPST is not set
937# CONFIG_SETUIDGID is not set
938# CONFIG_ENVUIDGID is not set
939# CONFIG_ENVDIR is not set
940# CONFIG_SOFTLIMIT is not set
941# CONFIG_CHCON is not set
942# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
943# CONFIG_GETENFORCE is not set
944# CONFIG_GETSEBOOL is not set
945# CONFIG_LOAD_POLICY is not set
946# CONFIG_MATCHPATHCON is not set
947# CONFIG_RESTORECON is not set
948# CONFIG_RUNCON is not set
949# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
950# CONFIG_SELINUXENABLED is not set
951# CONFIG_SETENFORCE is not set
952# CONFIG_SETFILES is not set
953# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
954# CONFIG_SETSEBOOL is not set
955# CONFIG_SESTATUS is not set
956
957#
958# Shells
959#
960CONFIG_ASH=y
961CONFIG_ASH_BASH_COMPAT=y
962# CONFIG_ASH_IDLE_TIMEOUT is not set
963CONFIG_ASH_JOB_CONTROL=y
964CONFIG_ASH_ALIAS=y
965CONFIG_ASH_GETOPTS=y
966CONFIG_ASH_BUILTIN_ECHO=y
967CONFIG_ASH_BUILTIN_PRINTF=y
968CONFIG_ASH_BUILTIN_TEST=y
969# CONFIG_ASH_CMDCMD is not set
970# CONFIG_ASH_MAIL is not set
971CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
972# CONFIG_ASH_RANDOM_SUPPORT is not set
973CONFIG_ASH_EXPAND_PRMT=y
974# CONFIG_CTTYHACK is not set
975# CONFIG_HUSH is not set
976# CONFIG_HUSH_BASH_COMPAT is not set
977# CONFIG_HUSH_BRACE_EXPANSION is not set
978# CONFIG_HUSH_HELP is not set
979# CONFIG_HUSH_INTERACTIVE is not set
980# CONFIG_HUSH_SAVEHISTORY is not set
981# CONFIG_HUSH_JOB is not set
982# CONFIG_HUSH_TICK is not set
983# CONFIG_HUSH_IF is not set
984# CONFIG_HUSH_LOOPS is not set
985# CONFIG_HUSH_CASE is not set
986# CONFIG_HUSH_FUNCTIONS is not set
987# CONFIG_HUSH_LOCAL is not set
988# CONFIG_HUSH_RANDOM_SUPPORT is not set
989# CONFIG_HUSH_EXPORT_N is not set
990# CONFIG_HUSH_MODE_X is not set
991# CONFIG_MSH is not set
992CONFIG_FEATURE_SH_IS_ASH=y
993# CONFIG_FEATURE_SH_IS_HUSH is not set
994# CONFIG_FEATURE_SH_IS_NONE is not set
995# CONFIG_FEATURE_BASH_IS_ASH is not set
996# CONFIG_FEATURE_BASH_IS_HUSH is not set
997CONFIG_FEATURE_BASH_IS_NONE=y
998CONFIG_SH_MATH_SUPPORT=y
999# CONFIG_SH_MATH_SUPPORT_64 is not set
1000CONFIG_FEATURE_SH_EXTRA_QUIET=y
1001# CONFIG_FEATURE_SH_STANDALONE is not set
1002# CONFIG_FEATURE_SH_NOFORK is not set
1003CONFIG_FEATURE_SH_HISTFILESIZE=y
1004
1005#
1006# System Logging Utilities
1007#
1008CONFIG_SYSLOGD=y
1009CONFIG_FEATURE_ROTATE_LOGFILE=y
1010CONFIG_FEATURE_REMOTE_LOG=y
1011CONFIG_FEATURE_SYSLOGD_DUP=y
1012CONFIG_FEATURE_SYSLOGD_CFG=y
1013CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
1014CONFIG_FEATURE_IPC_SYSLOG=y
1015CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=64
1016CONFIG_LOGREAD=y
1017CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
1018CONFIG_KLOGD=y
1019CONFIG_FEATURE_KLOGD_KLOGCTL=y
1020CONFIG_LOGGER=y
diff --git a/meta/recipes-core/busybox/busybox/fail_on_no_media.patch b/meta/recipes-core/busybox/busybox/fail_on_no_media.patch
new file mode 100644
index 0000000000..6745f169fe
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/fail_on_no_media.patch
@@ -0,0 +1,31 @@
1Upstream-Status: Pending
2
3The current behaviour of busybox is to try all fstype when automounting
4even when no media exists. The util-linux mount command bails when no
5media exists, so change the behaviour of busybox to do the same.
6
7It could also be argued that the KERN_INFO message from btrfs could be
8removed, but that would be harder to accomplish.
9
10Signed-off-by: Saul Wold <sgw@linux.intel.com>
11
12
13Index: busybox-1.20.2/util-linux/mount.c
14===================================================================
15--- busybox-1.20.2.orig/util-linux/mount.c
16+++ busybox-1.20.2/util-linux/mount.c
17@@ -598,7 +598,13 @@ static int mount_it_now(struct mntent *m
18 break;
19 errno = errno_save;
20 }
21-
22+ /*
23+ * Break if there is no media, no point retrying for all
24+ * fs types since there is no media available
25+ */
26+ if (rc == -1 && errno == ENOMEDIUM) {
27+ bb_perror_msg_and_die("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
28+ }
29 if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS))
30 break;
31 if (!(vfsflags & MS_SILENT))
diff --git a/meta/recipes-core/busybox/busybox/get_header_tar.patch b/meta/recipes-core/busybox/busybox/get_header_tar.patch
new file mode 100644
index 0000000000..0e528ff91f
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/get_header_tar.patch
@@ -0,0 +1,22 @@
1Upstream-Status: Pending
2
3# copy commit message from OE as the patch comment:
4# commit 5a0e1d473ca7aca5ffefffe9a2ec44ae7a1f35bc
5# Author: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
6# Date: Wed Feb 11 22:40:21 2009 +0100
7#
8# busybox: fix tar problem with filenames that are exactly 100 bytes
9#
10# above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
11
12--- busybox-1.13.2/archival/libarchive/get_header_tar.c.orig 2008-11-09 18:28:02.000000000 +0100
13+++ busybox-1.13.2/archival/libarchive/get_header_tar.c 2009-02-11 22:34:52.000000000 +0100
14@@ -252,6 +252,8 @@
15 file_header->name = concat_path_file(tar.prefix, tar.name);
16 } else
17 file_header->name = xstrdup(tar.name);
18+ if (strlen(file_header->name) > 100)
19+ file_header->name[100] = 0;
20 }
21
22 /* Set bits 12-15 of the files mode */
diff --git a/meta/recipes-core/busybox/busybox/login-utilities.cfg b/meta/recipes-core/busybox/busybox/login-utilities.cfg
new file mode 100644
index 0000000000..cc9b2db502
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/login-utilities.cfg
@@ -0,0 +1,13 @@
1CONFIG_FEATURE_SHADOWPASSWDS=y
2CONFIG_ADDUSER=y
3CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y
4CONFIG_ADDGROUP=y
5CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS=y
6CONFIG_DELUSER=y
7CONFIG_DELGROUP=y
8CONFIG_GETTY=y
9CONFIG_LOGIN=y
10CONFIG_PASSWD=y
11CONFIG_SU=y
12CONFIG_SULOGIN=y
13CONFIG_VLOCK=y
diff --git a/meta/recipes-core/busybox/busybox_1.22.1.bb b/meta/recipes-core/busybox/busybox_1.22.1.bb
new file mode 100644
index 0000000000..782752c2aa
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox_1.22.1.bb
@@ -0,0 +1,42 @@
1require busybox.inc
2
3SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
4 file://get_header_tar.patch \
5 file://busybox-appletlib-dependency.patch \
6 file://busybox-udhcpc-no_deconfig.patch \
7 file://find-touchscreen.sh \
8 file://busybox-cron \
9 file://busybox-httpd \
10 file://busybox-udhcpd \
11 file://default.script \
12 file://simple.script \
13 file://hwclock.sh \
14 file://mount.busybox \
15 file://syslog \
16 file://syslog-startup.conf \
17 file://syslog.conf \
18 file://busybox-syslog.default \
19 file://mdev \
20 file://mdev.conf \
21 file://umount.busybox \
22 file://defconfig \
23 file://busybox-syslog.service.in \
24 file://busybox-klogd.service.in \
25 file://fail_on_no_media.patch \
26 file://run-ptest \
27 file://inetd.conf \
28 file://inetd \
29 file://login-utilities.cfg \
30 file://0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch \
31"
32
33SRC_URI[tarball.md5sum] = "337d1a15ab1cb1d4ed423168b1eb7d7e"
34SRC_URI[tarball.sha256sum] = "ae0b029d0a9e4dd71a077a790840e496dd838998e4571b87b60fed7462b6678b"
35
36EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
37
38do_install_ptest () {
39 cp -r ${B}/testsuite ${D}${PTEST_PATH}/
40 cp ${B}/.config ${D}${PTEST_PATH}/
41 ln -s /bin/busybox ${D}${PTEST_PATH}/busybox
42}
diff --git a/meta/recipes-core/busybox/busybox_git.bb b/meta/recipes-core/busybox/busybox_git.bb
new file mode 100644
index 0000000000..f2cc119400
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox_git.bb
@@ -0,0 +1,46 @@
1require busybox.inc
2
3SRCREV = "d9e0c438e10e2155513e5d26498af472c5137d65"
4# Lookout for PV bump too when SRCREV is changed
5PV = "1.22.1+git${SRCPV}"
6
7S = "${WORKDIR}/git"
8
9SRC_URI = "git://busybox.net/busybox.git \
10 file://get_header_tar.patch \
11 file://busybox-appletlib-dependency.patch \
12 file://busybox-udhcpc-no_deconfig.patch \
13 file://find-touchscreen.sh \
14 file://busybox-cron \
15 file://busybox-httpd \
16 file://busybox-udhcpd \
17 file://default.script \
18 file://simple.script \
19 file://hwclock.sh \
20 file://mount.busybox \
21 file://syslog \
22 file://syslog-startup.conf \
23 file://syslog.conf \
24 file://busybox-syslog.default \
25 file://mdev \
26 file://mdev.conf \
27 file://umount.busybox \
28 file://defconfig \
29 file://busybox-syslog.service.in \
30 file://busybox-klogd.service.in \
31 file://fail_on_no_media.patch \
32 file://run-ptest \
33 file://inetd.conf \
34 file://inetd \
35 file://login-utilities.cfg \
36"
37
38EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
39
40do_install_ptest () {
41 cp -r ${B}/testsuite ${D}${PTEST_PATH}/
42 cp ${B}/.config ${D}${PTEST_PATH}/
43 ln -s /bin/busybox ${D}${PTEST_PATH}/busybox
44}
45
46DEFAULT_PREFERENCE = "-1"
diff --git a/meta/recipes-core/busybox/files/busybox-cron b/meta/recipes-core/busybox/files/busybox-cron
new file mode 100755
index 0000000000..f0e6b15629
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-cron
@@ -0,0 +1,39 @@
1#!/bin/sh
2DAEMON=/usr/sbin/crond
3NAME=crond
4DESC="Busybox Periodic Command Scheduler"
5ARGS="-c /etc/cron/crontabs"
6
7test -f $DAEMON || exit 0
8
9set -e
10
11case "$1" in
12 start)
13 echo -n "starting $DESC: $NAME... "
14 start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
15 echo "done."
16 ;;
17 stop)
18 echo -n "stopping $DESC: $NAME... "
19 start-stop-daemon -K -n $NAME
20 echo "done."
21 ;;
22 restart)
23 echo -n "restarting $DESC: $NAME... "
24 $0 stop
25 $0 start
26 echo "done."
27 ;;
28 reload)
29 echo -n "reloading $DESC: $NAME... "
30 killall -HUP $(basename ${DAEMON})
31 echo "done."
32 ;;
33 *)
34 echo "Usage: $0 {start|stop|restart|reload}"
35 exit 1
36 ;;
37esac
38
39exit 0
diff --git a/meta/recipes-core/busybox/files/busybox-httpd b/meta/recipes-core/busybox/files/busybox-httpd
new file mode 100755
index 0000000000..c8348e54a7
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-httpd
@@ -0,0 +1,44 @@
1#!/bin/sh
2DAEMON=/usr/sbin/httpd
3NAME=httpd
4DESC="Busybox HTTP Daemon"
5HTTPROOT="/srv/www"
6ARGS="-h $HTTPROOT"
7
8test -f $DAEMON || exit 0
9
10set -e
11
12case "$1" in
13 start)
14 echo -n "starting $DESC: $NAME... "
15 if [ ! -d $HTTPROOT ]; then
16 echo "$HTTPROOT is missing."
17 exit 1
18 fi
19 start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
20 echo "done."
21 ;;
22 stop)
23 echo -n "stopping $DESC: $NAME... "
24 start-stop-daemon -K -n $NAME
25 echo "done."
26 ;;
27 restart)
28 echo "restarting $DESC: $NAME... "
29 $0 stop
30 $0 start
31 echo "done."
32 ;;
33 reload)
34 echo -n "reloading $DESC: $NAME... "
35 killall -HUP $(basename ${DAEMON})
36 echo "done."
37 ;;
38 *)
39 echo "Usage: $0 {start|stop|restart|reload}"
40 exit 1
41 ;;
42esac
43
44exit 0
diff --git a/meta/recipes-core/busybox/files/busybox-klogd.service.in b/meta/recipes-core/busybox/files/busybox-klogd.service.in
new file mode 100644
index 0000000000..d7c77558f3
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-klogd.service.in
@@ -0,0 +1,8 @@
1[Unit]
2Description=Kernel Logging Service
3
4[Service]
5ExecStart=@base_sbindir@/klogd -n
6
7[Install]
8WantedBy=multi-user.target
diff --git a/meta/recipes-core/busybox/files/busybox-syslog.default b/meta/recipes-core/busybox/files/busybox-syslog.default
new file mode 100644
index 0000000000..e516caf518
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-syslog.default
@@ -0,0 +1,25 @@
1OPTIONS="-C"
2# The above option means syslogd will log to 16K shm circular buffer.
3# You could use `logread' to read it.
4
5# All available options are:
6# -O FILE : Log to FILE (default:/var/log/messages)
7# -l N : Log only messages more urgent than prio N (1-8)
8# -S : Smaller output
9# -s SIZE : Max size (KB) before rotation (default:200KB, 0=off)
10# -b N : N rotated logs to keep (default:1, max=99, 0=purge)
11# -R HOST[:PORT]: Log to HOST:PORT (default PORT:514)
12# -L : Log locally and via network
13# -D : Drop duplicates
14# -C[size_kb] : Log to shared mem buffer (use logread to read it)
15# -f FILE : Use FILE as config (default:/etc/syslog.conf)
16# -m MIN : Minutes between mark lines (default:20, 0=off)
17# -K : Log to kernel printk buffer (use dmesg to read it)
18
19# Example 1:
20# Log to local file /var/log/mylog
21# OPTIONS="-O /var/log/mylog"
22#
23# Example 2:
24# Log to remote host
25# OPTIONS="-R 192.168.1.1:601"
diff --git a/meta/recipes-core/busybox/files/busybox-syslog.service.in b/meta/recipes-core/busybox/files/busybox-syslog.service.in
new file mode 100644
index 0000000000..2e04321385
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-syslog.service.in
@@ -0,0 +1,13 @@
1[Unit]
2Description=System Logging Service
3Wants=busybox-klogd.service
4
5[Service]
6EnvironmentFile=-/etc/default/busybox-syslog
7ExecStart=@base_sbindir@/syslogd -n $OPTIONS
8Sockets=syslog.socket
9
10[Install]
11WantedBy=multi-user.target
12Also=busybox-klogd.service
13Alias=syslog.service
diff --git a/meta/recipes-core/busybox/files/busybox-udhcpd b/meta/recipes-core/busybox/files/busybox-udhcpd
new file mode 100755
index 0000000000..c43903e8dc
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-udhcpd
@@ -0,0 +1,43 @@
1#!/bin/sh
2DAEMON=/usr/sbin/udhcpd
3NAME=udhcpd
4DESC="Busybox UDHCP Server"
5ARGS="/etc/udhcpd.conf"
6
7test -f $DAEMON || exit 1
8
9set -e
10
11case "$1" in
12 start)
13 echo -n "starting $DESC: $NAME... "
14 if [ ! -f /etc/udhcpd.conf ]; then
15 echo "error: /etc/udhcpd.conf is missing."
16 exit 1
17 fi
18 /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
19 echo "done."
20 ;;
21 stop)
22 echo -n "stopping $DESC: $NAME... "
23 /sbin/start-stop-daemon -K -n $NAME
24 echo "done."
25 ;;
26 restart)
27 echo "restarting $DESC: $NAME... "
28 $0 stop
29 $0 start
30 echo "done."
31 ;;
32 reload)
33 echo -n "reloading $DESC: $NAME... "
34 killall -HUP $(basename ${DAEMON})
35 echo "done."
36 ;;
37 *)
38 echo "Usage: $0 {start|stop|restart|reload}"
39 exit 1
40 ;;
41esac
42
43exit 0
diff --git a/meta/recipes-core/busybox/files/default.script b/meta/recipes-core/busybox/files/default.script
new file mode 100644
index 0000000000..f2ac987a27
--- /dev/null
+++ b/meta/recipes-core/busybox/files/default.script
@@ -0,0 +1,4 @@
1#!/bin/sh
2
3exec run-parts -a "$1" /etc/udhcpc.d
4
diff --git a/meta/recipes-core/busybox/files/find-touchscreen.sh b/meta/recipes-core/busybox/files/find-touchscreen.sh
new file mode 100644
index 0000000000..1582ea891c
--- /dev/null
+++ b/meta/recipes-core/busybox/files/find-touchscreen.sh
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3if [ `egrep "input:.*-e0.*,3,.*a0,1,.*18,.*" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
4 ln -sf /dev/input/$MDEV /dev/input/touchscreen0
5fi
6
7if [ `egrep "ads7846" /sys/class/input/$MDEV/device/modalias|wc -l` -gt 0 ]; then
8 ln -sf /dev/input/$MDEV /dev/input/touchscreen0
9fi
diff --git a/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh
new file mode 100644
index 0000000000..be5f94d86c
--- /dev/null
+++ b/meta/recipes-core/busybox/files/hwclock.sh
@@ -0,0 +1,83 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: hwclock
4# Required-Start:
5# Required-Stop: $local_fs
6# Default-Start: S
7# Default-Stop: 0 6
8# Short-Description: Set system clock
9# Description: Set system clock to hardware clock, according to the UTC
10# setting in /etc/default/rcS (see also rcS(5)).
11### END INIT INFO
12#
13# WARNING: If your hardware clock is not in UTC/GMT, this script
14# must know the local time zone. This information is
15# stored in /etc/localtime. This might be a problem if
16# your /etc/localtime is a symlink to something in
17# /usr/share/zoneinfo AND /usr isn't in the root
18# partition! The workaround is to define TZ either
19# in /etc/default/rcS, or in the proper place below.
20
21[ ! -x /sbin/hwclock ] && exit 0
22
23[ -f /etc/default/rcS ] && . /etc/default/rcS
24
25[ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime"
26case "$1" in
27 start)
28 if [ "$VERBOSE" != no ]
29 then
30 echo "System time was `date`."
31 echo "Setting the System Clock using the Hardware Clock as reference..."
32 fi
33
34 if [ "$HWCLOCKACCESS" != no ]
35 then
36 if [ -z "$TZ" ]
37 then
38 hwclock $tz --hctosys
39 else
40 TZ="$TZ" hwclock $tz --hctosys
41 fi
42 fi
43
44 if [ "$VERBOSE" != no ]
45 then
46 echo "System Clock set. System local time is now `date`."
47 fi
48 ;;
49 stop|restart|reload|force-reload)
50 #
51 # Updates the Hardware Clock with the System Clock time.
52 # This will *override* any changes made to the Hardware Clock.
53 #
54 # WARNING: If you disable this, any changes to the system
55 # clock will not be carried across reboots.
56 #
57 if [ "$VERBOSE" != no ]
58 then
59 echo "Saving the System Clock time to the Hardware Clock..."
60 fi
61 if [ "$HWCLOCKACCESS" != no ]
62 then
63 hwclock $tz --systohc
64 fi
65 if [ "$VERBOSE" != no ]
66 then
67 echo "Hardware Clock updated to `date`."
68 fi
69 exit 0
70 ;;
71 show)
72 if [ "$HWCLOCKACCESS" != no ]
73 then
74 hwclock $tz --show
75 fi
76 ;;
77 *)
78 echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2
79 echo " start sets kernel (system) clock from hardware (RTC) clock" >&2
80 echo " stop and reload set hardware (RTC) clock from kernel (system) clock" >&2
81 exit 1
82 ;;
83esac
diff --git a/meta/recipes-core/busybox/files/inetd b/meta/recipes-core/busybox/files/inetd
new file mode 100644
index 0000000000..cf50bcd546
--- /dev/null
+++ b/meta/recipes-core/busybox/files/inetd
@@ -0,0 +1,33 @@
1#!/bin/sh
2#
3# start/stop inetd super server.
4
5if ! [ -x /usr/sbin/inetd ]; then
6 exit 0
7fi
8
9case "$1" in
10 start)
11 echo -n "Starting internet superserver:"
12 echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null
13 echo "."
14 ;;
15 stop)
16 echo -n "Stopping internet superserver:"
17 echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null
18 echo "."
19 ;;
20 restart)
21 echo -n "Restarting internet superserver:"
22 echo -n " inetd "
23 killall -HUP inetd
24 echo "."
25 ;;
26 *)
27 echo "Usage: /etc/init.d/inetd {start|stop|restart}"
28 exit 1
29 ;;
30esac
31
32exit 0
33
diff --git a/meta/recipes-core/busybox/files/inetd.conf b/meta/recipes-core/busybox/files/inetd.conf
new file mode 100644
index 0000000000..b02fe850c9
--- /dev/null
+++ b/meta/recipes-core/busybox/files/inetd.conf
@@ -0,0 +1,20 @@
1# /etc/inetd.conf: see inetd(8) for further informations.
2#
3# Internet server configuration database
4#
5# If you want to disable an entry so it isn't touched during
6# package updates just comment it out with a single '#' character.
7#
8# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
9#
10#:INTERNAL: Internal services
11#echo stream tcp nowait root internal
12#echo dgram udp wait root internal
13#chargen stream tcp nowait root internal
14#chargen dgram udp wait root internal
15#discard stream tcp nowait root internal
16#discard dgram udp wait root internal
17#daytime stream tcp nowait root internal
18#daytime dgram udp wait root internal
19#time stream tcp nowait root internal
20#time dgram udp wait root internal
diff --git a/meta/recipes-core/busybox/files/mdev b/meta/recipes-core/busybox/files/mdev
new file mode 100755
index 0000000000..4eba6190c7
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mdev
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3mount -t tmpfs tmpfs /dev -o size=64k,mode=0755
4mkdir /dev/pts /dev/shm
5mount -t devpts devpts /dev/pts
6echo "/sbin/mdev" > /proc/sys/kernel/hotplug
7mdev -s
diff --git a/meta/recipes-core/busybox/files/mdev.conf b/meta/recipes-core/busybox/files/mdev.conf
new file mode 100644
index 0000000000..e688911ff1
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mdev.conf
@@ -0,0 +1,37 @@
1console 0:0 0600
2cpu_dma_latency 0:0 0660
3fb0:0 44 0660
4full 0:0 0666
5initctl 0:0 0600
6ircomm[0-9].* 0:20 0660
7kmem 0:15 0640
8kmsg 0:0 0660
9log 0:0 0666
10loop[0-9].* 0:6 0640
11mem 0:15 0640
12network_latency 0:0 0660
13network_throughput 0:0 0660
14null 0:0 0666
15port 0:15 0640
16ptmx 0:5 0666
17ram[0-9].* 0:6 0640
18random 0:0 0666
19sda 0:6 0640
20tty 0:5 0666
21tty.* 0:0 0620
22urandom 0:0 0666
23usbdev.* 0:0 0660 */etc/mdev/usb.sh
24vcs.* 0:5 0660
25zero 0:0 0666
26
27snd/pcm.* 0:0 0660
28snd/control.* 0:0 0660
29snd/timer 0:0 0660
30snd/seq 0:0 0660
31snd/mini.* 0:00 0660
32
33input/event.* 0:0 0660 @/etc/mdev/find-touchscreen.sh
34input/mice 0:0 0660
35input/mouse.* 0:0 0660
36
37tun[0-9]* 0:0 0660 =net/
diff --git a/meta/recipes-core/busybox/files/mount.busybox b/meta/recipes-core/busybox/files/mount.busybox
new file mode 100755
index 0000000000..fef945b7b2
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mount.busybox
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3exec /bin/busybox mount $@
diff --git a/meta/recipes-core/busybox/files/run-ptest b/meta/recipes-core/busybox/files/run-ptest
new file mode 100644
index 0000000000..3608a8eb65
--- /dev/null
+++ b/meta/recipes-core/busybox/files/run-ptest
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3current_dir=$(readlink -f $0)
4export bindir=$(dirname $current_dir)
5
6cd testsuite || exit 1
7./runtest -v | sed -r 's/^(SKIPPED|UNTESTED):/SKIP:/'
diff --git a/meta/recipes-core/busybox/files/simple.script b/meta/recipes-core/busybox/files/simple.script
new file mode 100644
index 0000000000..78ac4242a8
--- /dev/null
+++ b/meta/recipes-core/busybox/files/simple.script
@@ -0,0 +1,86 @@
1#!/bin/sh
2
3# udhcpc script edited by Tim Riker <Tim@Rikers.org>
4
5[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
6
7RESOLV_CONF="/etc/resolv.conf"
8[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
9[ -n "$subnet" ] && NETMASK="netmask $subnet"
10
11# return 0 if root is mounted on a network filesystem
12root_is_nfs() {
13 sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
14 grep -q "^/ \(nfs\|smbfs\|ncp\|coda\)$"
15}
16
17have_bin_ip=0
18if [ -x /sbin/ip ]; then
19 have_bin_ip=1
20fi
21
22case "$1" in
23 deconfig)
24 if [ -x /sbin/resolvconf ]; then
25 /sbin/resolvconf -d "${interface}.udhcpc"
26 fi
27 if ! root_is_nfs ; then
28 if [ $have_bin_ip -eq 1 ]; then
29 ip addr flush dev $interface
30 ip link set dev $interface up
31 else
32 /sbin/ifconfig $interface 0.0.0.0
33 fi
34 fi
35 ;;
36
37 renew|bound)
38 if [ $have_bin_ip -eq 1 ]; then
39 ip addr add dev $interface local $ip/$mask $BROADCAST
40 else
41 /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
42 fi
43
44 if [ -n "$router" ] ; then
45 if ! root_is_nfs ; then
46 if [ $have_bin_ip -eq 1 ]; then
47 while ip route del default 2>/dev/null ; do
48 :
49 done
50 else
51 while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
52 :
53 done
54 fi
55 fi
56
57 metric=0
58 for i in $router ; do
59 if [ $have_bin_ip -eq 1 ]; then
60 ip route add default via $i metric $metric
61 else
62 route add default gw $i dev $interface metric $metric 2>/dev/null
63 fi
64 metric=$(($metric + 1))
65 done
66 fi
67
68 # Update resolver configuration file
69 R=""
70 [ -n "$domain" ] && R="domain $domain
71"
72 for i in $dns; do
73 echo "$0: Adding DNS $i"
74 R="${R}nameserver $i
75"
76 done
77
78 if [ -x /sbin/resolvconf ]; then
79 echo -n "$R" | /sbin/resolvconf -a "${interface}.udhcpc"
80 else
81 echo -n "$R" > "$RESOLV_CONF"
82 fi
83 ;;
84esac
85
86exit 0
diff --git a/meta/recipes-core/busybox/files/syslog b/meta/recipes-core/busybox/files/syslog
new file mode 100644
index 0000000000..2944d3d06c
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog
@@ -0,0 +1,77 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: sysklogd
4# Required-Start: $remote_fs $time
5# Required-Stop: $remote_fs $time
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: System logger
9### END INIT INFO
10
11set -e
12
13if [ -f /etc/syslog-startup.conf ]; then
14 . /etc/syslog-startup.conf
15 LOG_LOCAL=0
16 LOG_REMOTE=0
17 for D in $DESTINATION; do
18 if [ "$D" = "buffer" ]; then
19 SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
20 LOG_LOCAL=1
21 elif [ "$D" = "file" ]; then
22 if [ -n "$LOGFILE" ]; then
23 SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
24 fi
25 if [ -n "$ROTATESIZE" ]; then
26 SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
27 fi
28 if [ -n "$ROTATEGENS" ]; then
29 SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
30 fi
31 LOCAL=0
32 elif [ "$D" = "remote" ]; then
33 SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
34 LOG_REMOTE=1
35 fi
36 done
37 if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
38 SYSLOG_ARGS="$SYSLOG_ARGS -L"
39 fi
40 if [ "$REDUCE" = "yes" ]; then
41 SYSLOG_ARGS="$SYSLOG_ARGS -S"
42 fi
43 if [ "$DROPDUPLICATES" = "yes" ]; then
44 SYSLOG_ARGS="$SYSLOG_ARGS -D"
45 fi
46 if [ -n "$LOGLEVEL" ]; then
47 SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
48 fi
49else
50 # default: log to 16K shm circular buffer
51 SYSLOG_ARGS="-C"
52fi
53
54case "$1" in
55 start)
56 echo -n "Starting syslogd/klogd: "
57 start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
58 start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
59 echo "done"
60 ;;
61 stop)
62 echo -n "Stopping syslogd/klogd: "
63 start-stop-daemon -K -n syslogd
64 start-stop-daemon -K -n klogd
65 echo "done"
66 ;;
67 restart)
68 $0 stop
69 $0 start
70 ;;
71 *)
72 echo "Usage: syslog { start | stop | restart }" >&2
73 exit 1
74 ;;
75esac
76
77exit 0
diff --git a/meta/recipes-core/busybox/files/syslog-startup.conf b/meta/recipes-core/busybox/files/syslog-startup.conf
new file mode 100644
index 0000000000..fda450aa0d
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog-startup.conf
@@ -0,0 +1,13 @@
1# This configuration file is used by the busybox syslog init script,
2# /etc/init.d/syslog[.busybox] to set syslog configuration at start time.
3
4DESTINATION=file # log destinations (buffer file remote)
5LOGFILE=/var/log/messages # where to log (file)
6REMOTE=loghost:514 # where to log (syslog remote)
7REDUCE=no # reduce-size logging
8DROPDUPLICATES=no # whether to drop duplicate log entries
9#ROTATESIZE=0 # rotate log if grown beyond X [kByte]
10#ROTATEGENS=3 # keep X generations of rotated logs
11BUFFERSIZE=64 # size of circular buffer [kByte]
12FOREGROUND=no # run in foreground (don't use!)
13#LOGLEVEL=5 # local log level (between 1 and 8)
diff --git a/meta/recipes-core/busybox/files/syslog.conf b/meta/recipes-core/busybox/files/syslog.conf
new file mode 100644
index 0000000000..75bb6309ab
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog.conf
@@ -0,0 +1 @@
# /etc/syslog.conf Configuration file for busybox's syslogd utility
diff --git a/meta/recipes-core/busybox/files/umount.busybox b/meta/recipes-core/busybox/files/umount.busybox
new file mode 100755
index 0000000000..f3731626e6
--- /dev/null
+++ b/meta/recipes-core/busybox/files/umount.busybox
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3exec /bin/busybox umount $@
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars b/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars
new file mode 100644
index 0000000000..32692ab4b9
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars
@@ -0,0 +1,41 @@
1# Makefile variables for PO directory in any package using GNU gettext.
2
3# Usually the message domain is the same as the package name.
4DOMAIN = $(PACKAGE)
5
6# These two variables depend on the location of this directory.
7subdir = po
8top_builddir = ..
9
10# These options get passed to xgettext.
11XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
12
13# This is the copyright holder that gets inserted into the header of the
14# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
15# package. (Note that the msgstr strings, extracted from the package's
16# sources, belong to the copyright holder of the package.) Translators are
17# expected to transfer the copyright for their translations to this person
18# or entity, or to disclaim their copyright. The empty string stands for
19# the public domain; in this case the translators are expected to disclaim
20# their copyright.
21COPYRIGHT_HOLDER = Free Software Foundation, Inc.
22
23# This is the email address or URL to which the translators shall report
24# bugs in the untranslated strings:
25# - Strings which are not entire sentences, see the maintainer guidelines
26# in the GNU gettext documentation, section 'Preparing Strings'.
27# - Strings which use unclear terms or require additional context to be
28# understood.
29# - Strings which make invalid assumptions about notation of date, time or
30# money.
31# - Pluralisation problems.
32# - Incorrect English spelling.
33# - Incorrect formatting.
34# It can be your email address, or a mailing list address where translators
35# can write to without being subscribed, or the URL of a web page through
36# which the translators can contact you.
37MSGID_BUGS_ADDRESS =
38
39# This is the list of locale categories, beyond LC_MESSAGES, for which the
40# message catalogs shall be used. It is usually empty.
41EXTRA_LOCALE_CATEGORIES =
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch
new file mode 100644
index 0000000000..c287014767
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch
@@ -0,0 +1,17 @@
1Upstream-Status: Pending
2
3#
4# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
5#
6
7--- console-tools-0.3.2/contrib/codepage.c~codepage
8+++ console-tools-0.3.2/contrib/codepage.c
9@@ -229,7 +229,7 @@
10 return 0;
11
12 fprintf(stderr, "\
13-Warning: CP format is a hack!\n
14+Warning: CP format is a hack!\n\
15 The files produced may or may not be usable!\n");
16
17 sprintf(outfile, "%d.cp", CPEntryHeader.codepage);
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch
new file mode 100644
index 0000000000..c93f511950
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch
@@ -0,0 +1,12 @@
1Upstream-Status: Pending
2
3--- console-tools-0.3.2/kbdtools/showkey.c~compile 1999-08-25 17:20:08.000000000 -0400
4+++ console-tools-0.3.2/kbdtools/showkey.c 2004-05-09 03:03:23.000000000 -0400
5@@ -264,7 +264,6 @@
6 break;
7 case cmd_keymap:
8 printf(")\n");
9- default:
10 }
11 }
12
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch
new file mode 100644
index 0000000000..15c100c908
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch
@@ -0,0 +1,29 @@
1Upstream-Status: Pending
2
3--- console-tools-0.3.2/configure.in~configure
4+++ console-tools-0.3.2/configure.in
5@@ -2,13 +2,14 @@
6 dnl Process this file with autoconf to produce a configure script.
7
8 # Initialize
9-AC_INIT(kbdtools/loadkeys.y)
10+AC_INIT
11+AC_CONFIG_SRCDIR([kbdtools/loadkeys.y])
12
13 define(ct_unicodedata_default,/usr/share/unidata/UnicodeData-2.txt)
14 ct_localdatadir_default=/usr/local/share # iff --enable-localdatadir without specific dir
15
16 #AC_CONFIG_AUX_DIR(autoconf)
17-AC_CANONICAL_SYSTEM
18+AC_CANONICAL_TARGET([])
19 AM_INIT_AUTOMAKE(console-tools, 0.3.2)
20
21 # Defaults
22@@ -25,7 +26,6 @@
23 # i18n stuff
24 ALL_LINGUAS="cs de ru ga fr"
25 AM_GNU_GETTEXT
26-AC_OUTPUT_COMMANDS([sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
27
28 AC_DEFINE_UNQUOTED(LOCALEDIR, "/usr/share/locale")
29
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch
new file mode 100644
index 0000000000..be61eb846b
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch
@@ -0,0 +1,56 @@
1Fix the following error detected with i586-pokymllib32-linux-gcc (the
2multilib x86-64 lib32 compiler):
3 ../lib/ctutils/.libs/libctutils.so: undefined reference to `get_kernel_sfm'
4 collect2: error: ld returned 1 exit status
5
6It seems that libctutils.so (the library that uses get_kernel_sfm) must
7be stated before libconsole.so (the library that exports the function) when
8using multilib gcc
9
10Upstream-Status: Pending
11Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
12
13Index: console-tools-0.3.2/fontfiletools/Makefile.am
14===================================================================
15--- console-tools-0.3.2.orig/fontfiletools/Makefile.am
16+++ console-tools-0.3.2/fontfiletools/Makefile.am
17@@ -10,5 +10,5 @@ EXTRA_DIST = fonts2virfont.c virfont.h
18
19 # libconsole is needed by ctutils
20 LDADD = ../lib/ctlocal/libctlocal.a ../lib/cfont/libcfont.la \
21- ../lib/console/libconsole.la \
22- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
23+ ../lib/ctutils/libctutils.la \
24+ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
25Index: console-tools-0.3.2/vttools/Makefile.am
26===================================================================
27--- console-tools-0.3.2.orig/vttools/Makefile.am
28+++ console-tools-0.3.2/vttools/Makefile.am
29@@ -7,9 +7,9 @@ bin_PROGRAMS = chvt deallocvt writevt fg
30 vcstime vt-is-UTF8 openvt @RESIZECONS@
31 EXTRA_PROGRAMS = resizecons
32
33-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \
34+LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \
35 ../lib/cfont/libcfont.la \
36- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
37+ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
38
39 vcstime_LDADD = ../lib/ctlocal/libctlocal.a
40 screendump_LDADD = ../lib/ctlocal/libctlocal.a
41Index: console-tools-0.3.2/kbdtools/Makefile.am
42===================================================================
43--- console-tools-0.3.2.orig/kbdtools/Makefile.am
44+++ console-tools-0.3.2/kbdtools/Makefile.am
45@@ -15,9 +15,9 @@ EXTRA_PROGRAMS = getkeycodes setkeycodes
46 loadkeys_SOURCES = loadkeys.y analyze.l
47
48 YFLAGS = -d
49-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \
50+LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \
51 ../lib/cfont/libcfont.la \
52- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
53+ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
54
55 loadkeys_LDADD = $(LDADD) @LEXLIB@
56
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch
new file mode 100644
index 0000000000..f370be8592
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch
@@ -0,0 +1,75 @@
1Patch from Matthias Goebl <oe@m.goebl.net>
2Added via OE bugtracker: bug #478
3
4Upstream-Status: Pending
5
6--- console-tools-0.3.2/kbdtools/kbd_mode.c.orig
7+++ console-tools-0.3.2/kbdtools/kbd_mode.c
8@@ -29,11 +29,16 @@
9 OPT("-u --unicode ", _("UTF-8 mode (UNICODE)"));
10 OPT("-s --scancode ", _("scancode mode (RAW)"));
11 OPT(" --mode={8bit,keycode,unicode,scancode} ", _("set mode"));
12+ OPT("-r --rate=RATE ", _("set repeat rate (default: 33)"));
13+ OPT("-d --delay=DELAY ", _("set repeat delay (default: 250)"));
14
15 OPT("-h --help ", HELPDESC);
16 OPT("-V --version ", VERSIONDESC);
17 }
18
19+int rate=-1;
20+int delay=-1;
21+
22 static int parse_cmdline (int argc, char *argv[])
23 {
24 int mode = -1;
25@@ -46,11 +51,13 @@
26 { "mode" , required_argument, NULL, 'm' },
27 { "scancode" , no_argument, NULL, 's' },
28 { "unicode" , no_argument, NULL, 'u' },
29+ { "rate" , required_argument, NULL, 'r' },
30+ { "delay" , required_argument, NULL, 'd' },
31 { NULL, 0, NULL, 0 }
32 };
33 int c;
34
35- while ( (c = getopt_long (argc, argv, "Vhaksu", long_opts, NULL)) != EOF)
36+ while ( (c = getopt_long (argc, argv, "Vhaksur:d:", long_opts, NULL)) != EOF)
37 switch (c) {
38 case 'h':
39 usage ();
40@@ -58,6 +65,14 @@
41 case 'V':
42 version ();
43 exit(0);
44+ case 'r':
45+ rate = atoi(optarg);
46+ mode = -2;
47+ break;
48+ case 'd':
49+ delay = atoi(optarg);
50+ mode = -2;
51+ break;
52 case 'a':
53 mode = K_XLATE;
54 break;
55@@ -129,6 +144,20 @@
56 exit(0);
57 }
58
59+ if ( rate != -1 || delay != -1 )
60+ {
61+ struct kbd_repeat kbd_rep;
62+ kbd_rep.delay = delay;
63+ kbd_rep.period = rate;
64+ if (ioctl(fd, KDKBDREP, &kbd_rep))
65+ {
66+ fprintf(stderr, progname);
67+ perror(_(": error setting keyboard repeat mode\n"));
68+ exit(1);
69+ }
70+ if(mode==-2) exit(0);
71+ }
72+
73 if (ioctl(fd, KDSKBMODE, mode))
74 {
75 fprintf(stderr, progname);
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4 b/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4
new file mode 100644
index 0000000000..18d47a94f7
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4
@@ -0,0 +1,24 @@
1# Check whether LC_MESSAGES is available in <locale.h>.
2# Ulrich Drepper <drepper@cygnus.com>, 1995.
3#
4# This file can be copied and used freely without restrictions. It can
5# be used in projects which are not available under the GNU General Public
6# License or the GNU Library General Public License but which still want
7# to provide support for the GNU gettext functionality.
8# Please note that the actual code of the GNU gettext library is covered
9# by the GNU Library General Public License, and the rest of the GNU
10# gettext package package is covered by the GNU General Public License.
11# They are *not* in the public domain.
12
13# serial 2
14
15AC_DEFUN([AM_LC_MESSAGES],
16 [if test $ac_cv_header_locale_h = yes; then
17 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
18 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
19 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
20 if test $am_cv_val_LC_MESSAGES = yes; then
21 AC_DEFINE(HAVE_LC_MESSAGES, 1,
22 [Define if your <locale.h> file defines LC_MESSAGES.])
23 fi
24 fi])
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch
new file mode 100644
index 0000000000..2ed609219c
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch
@@ -0,0 +1,22 @@
1The docs need tools we don't have to build so disable them.
2
3Also remove intl since the Makefile doesn't work with 3.82 and we
4don't want to build libintl anyway.
5
6Upstream-Status: Inappropriate [configuration]
7RP 2012/10/17
8
9Index: console-tools-0.3.2/Makefile.am
10===================================================================
11--- console-tools-0.3.2.orig/Makefile.am 1999-04-15 01:33:24.000000000 +0000
12+++ console-tools-0.3.2/Makefile.am 2012-10-17 11:48:14.107069145 +0000
13@@ -1,7 +1,7 @@
14 # -*- makefile -*-
15 AUTOMAKE_OPTIONS = foreign
16
17-SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib doc \
18- compat include examples po intl
19+SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib \
20+ compat include examples po
21
22 EXTRA_DIST = BUGS RELEASE CREDITS COPYING.kbd local-scripts/* debian/* *.lsm
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch
new file mode 100644
index 0000000000..0c95068a36
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch
@@ -0,0 +1,49 @@
1Fixing the locale issues isn't enough, console-tools also does a couple of
2other pretty stupid things (like FILE *f; f->_fileno instead of fileno(f)),
3
4Upstream-Status: Pending
5
6--- console-tools-0.3.2/lib/cfont/fontstruct.c.ark 2005-05-22 19:12:38.000000000 +0000
7+++ console-tools-0.3.2/lib/cfont/fontstruct.c 2005-05-22 19:13:23.000000000 +0000
8@@ -50,8 +50,7 @@
9 * get filesize
10 */
11
12- /* FIXME: should not use _fileno ! */
13- if (fstat(fontfile->_fileno, &stbuf) == -1)
14+ if (fstat(fileno(fontfile), &stbuf) == -1)
15 goto rsf_return_error;
16
17 if (S_ISREG(stbuf.st_mode))
18@@ -211,8 +210,7 @@
19 * get filesize
20 */
21
22- /* FIXME: should not use _fileno ! */
23- if (fstat(fontfile->_fileno, &stbuf) == -1)
24+ if (fstat(fileno(fontfile), &stbuf) == -1)
25 goto rfg_return_error;
26
27 if (S_ISREG(stbuf.st_mode))
28--- console-tools-0.3.2/lib/console/acm.c.ark 2005-05-22 19:17:15.000000000 +0000
29+++ console-tools-0.3.2/lib/console/acm.c 2005-05-22 19:17:23.000000000 +0000
30@@ -30,7 +30,7 @@
31 lct_boolean parse_failed = False;
32 lct_boolean is_unicode;
33
34- if (fstat(fp->_fileno, &stbuf))
35+ if (fstat(fileno(fp), &stbuf))
36 perror(_("Cannot stat ACM file")), exit(1);
37
38 /* first try a wg15-charmap (glibc) file format */
39--- console-tools-0.3.2/include/lct/local.h.ark 2005-05-22 19:08:54.000000000 +0000
40+++ console-tools-0.3.2/include/lct/local.h 2005-05-22 19:09:12.000000000 +0000
41@@ -8,7 +8,7 @@
42 #include <locale.h>
43
44
45-#ifdef HAVE_LOCALE_H
46+#if defined(HAVE_LOCALE_H) && defined(HAVE_LIBINTL_H)
47 # include <libintl.h>
48 # define _(String) gettext (String)
49 # ifdef gettext_noop
diff --git a/meta/recipes-core/console-tools/console-tools_0.3.2.bb b/meta/recipes-core/console-tools/console-tools_0.3.2.bb
new file mode 100644
index 0000000000..80fab55214
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools_0.3.2.bb
@@ -0,0 +1,36 @@
1SECTION = "base"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING.kbd;md5=9b2d91511d3d80d4d20ac6e6b0137fe9"
4SUMMARY = "Allows you to set-up and manipulate the Linux console"
5DESCRIPTION = "Provides tools that enable the set-up and manipulation of the linux console and console-font files."
6PR = "r8"
7
8SRC_URI = "${SOURCEFORGE_MIRROR}/lct/console-tools-${PV}.tar.gz \
9 file://codepage.patch \
10 file://configure.patch \
11 file://compile.patch \
12 file://kbdrate.patch \
13 file://uclibc-fileno.patch \
14 file://nodocs.patch \
15 file://fix-libconsole-linking.patch \
16 file://lcmessage.m4 \
17 file://Makevars"
18
19SRC_URI[md5sum] = "bf21564fc38b3af853ef724babddbacd"
20SRC_URI[sha256sum] = "eea6b441672dacd251079fc85ed322e196282e0e66c16303ec64c3a2b1c126c2"
21
22do_configure_prepend () {
23 mkdir -p ${S}/m4
24 cp ${WORKDIR}/lcmessage.m4 ${S}/m4/
25 rm -f ${S}/acinclude.m4
26 cp ${WORKDIR}/Makevars ${S}/po/
27}
28
29inherit autotools gettext update-alternatives
30
31ALTERNATIVE_PRIORITY = "100"
32
33bindir_progs = "chvt deallocvt fgconsole openvt"
34ALTERNATIVE_${PN} = "${bindir_progs}"
35
36RDEPENDS_${PN} = "bash"
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
new file mode 100644
index 0000000000..5452b46bbc
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
@@ -0,0 +1,120 @@
1Upstream-Status: Inappropriate [legacy version]
2
3This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
4
5The package is stated as being Licensed as GPLv2+.
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9----
10
11When "cp -i --update old new" would do nothing because "new" is
12newer than "old", cp would nonetheless prompt for whether it is
13ok to overwrite "new". Then, regardless of the response (because
14of the --update option), cp would do nothing.
15
16The following patch eliminates the unnecessary prompt in that case.
17
18diff --git a/src/copy.c b/src/copy.c
19index b7bf73b..0e549d2 100644
20--- a/src/copy.c
21+++ b/src/copy.c
22@@ -1210,6 +1210,30 @@ copy_internal (char const *src_name, char const *dst_name,
23 return false;
24 }
25
26+ if (!S_ISDIR (src_mode) && x->update)
27+ {
28+ /* When preserving time stamps (but not moving within a file
29+ system), don't worry if the destination time stamp is
30+ less than the source merely because of time stamp
31+ truncation. */
32+ int options = ((x->preserve_timestamps
33+ && ! (x->move_mode
34+ && dst_sb.st_dev == src_sb.st_dev))
35+ ? UTIMECMP_TRUNCATE_SOURCE
36+ : 0);
37+
38+ if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
39+ {
40+ /* We're using --update and the destination is not older
41+ than the source, so do not copy or move. Pretend the
42+ rename succeeded, so the caller (if it's mv) doesn't
43+ end up removing the source file. */
44+ if (rename_succeeded)
45+ *rename_succeeded = true;
46+ return true;
47+ }
48+ }
49+
50 /* When there is an existing destination file, we may end up
51 returning early, and hence not copying/moving the file.
52 This may be due to an interactive `negative' reply to the
53@@ -1302,30 +1326,6 @@ copy_internal (char const *src_name, char const *dst_name,
54 return false;
55 }
56 }
57-
58- if (x->update)
59- {
60- /* When preserving time stamps (but not moving within a file
61- system), don't worry if the destination time stamp is
62- less than the source merely because of time stamp
63- truncation. */
64- int options = ((x->preserve_timestamps
65- && ! (x->move_mode
66- && dst_sb.st_dev == src_sb.st_dev))
67- ? UTIMECMP_TRUNCATE_SOURCE
68- : 0);
69-
70- if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
71- {
72- /* We're using --update and the destination is not older
73- than the source, so do not copy or move. Pretend the
74- rename succeeded, so the caller (if it's mv) doesn't
75- end up removing the source file. */
76- if (rename_succeeded)
77- *rename_succeeded = true;
78- return true;
79- }
80- }
81 }
82
83 if (x->move_mode)
84diff --git a/tests/mv/update b/tests/mv/update
85index 0c06024..6c3d149 100755
86--- a/tests/mv/update
87+++ b/tests/mv/update
88@@ -1,7 +1,7 @@
89 #!/bin/sh
90 # make sure --update works as advertised
91
92-# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
93+# Copyright (C) 2001, 2004, 2006-2007 Free Software Foundation, Inc.
94
95 # This program is free software; you can redistribute it and/or modify
96 # it under the terms of the GNU General Public License as published by
97@@ -46,11 +46,16 @@ fi
98
99 fail=0
100
101-for cp_or_mv in cp mv; do
102- # This is a no-op.
103- $cp_or_mv --update old new || fail=1
104- case "`cat new`" in new) ;; *) fail=1 ;; esac
105- case "`cat old`" in old) ;; *) fail=1 ;; esac
106+for interactive in '' -i; do
107+ for cp_or_mv in cp mv; do
108+ # This is a no-op, with no prompt.
109+ # With coreutils-6.9 and earlier, using --update with -i would
110+ # mistakenly elicit a prompt.
111+ $cp_or_mv $interactive --update old new < /dev/null > out 2>&1 || fail=1
112+ test -s out && fail=1
113+ case "`cat new`" in new) ;; *) fail=1 ;; esac
114+ case "`cat old`" in old) ;; *) fail=1 ;; esac
115+ done
116 done
117
118 # This will actually perform the rename.
119--
1201.5.3.rc1.16.g9d6f
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch
new file mode 100644
index 0000000000..8273d78eb3
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch
@@ -0,0 +1,28 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Fix the following issue so that coreutils can build with ACL:
4
5configure: WARNING: libacl development library was not found or not usable.
6configure: WARNING: GNU coreutils will be built without ACL support.
7
8Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9---
10 m4/acl.m4 | 2 +-
11 1 files changed, 1 insertions(+), 1 deletions(-)
12
13diff --git a/m4/acl.m4 b/m4/acl.m4
14index d6a448a..a9d4836 100644
15--- a/m4/acl.m4
16+++ b/m4/acl.m4
17@@ -159,7 +159,7 @@ AC_DEFUN([gl_ACL_GET_FILE],
18 ]])],
19 [gl_cv_func_working_acl_get_file=yes],
20 [gl_cv_func_working_acl_get_file=no],
21- [gl_cv_func_working_acl_get_file=cross-compiling])])
22+ [gl_cv_func_working_acl_get_file=yes])])
23
24 AS_IF([test $gl_cv_func_working_acl_get_file = yes], [$1], [$2])
25 ])
26--
271.7.7
28
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
new file mode 100644
index 0000000000..88f61fa108
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
@@ -0,0 +1,101 @@
1Upstream-Status: Inappropriate [legacy version]
2
3The install command doesn't over write the dangling symlink, for
4example:
5
6$ install fileA /tmp/fileA
7
8If /tmp/fileA is a dangling symlink, there would be an error:
9
10install: cannot create regular file '/tmp/fileA': File exists
11
12This is because of the following code in copy.c:
13
14 if (!new_dst)
15 {
16 if (XSTAT (x, dst_name, &dst_sb) != 0)
17 {
18 if (errno != ENOENT)
19 {
20 error (0, errno, _("cannot stat %s"), quote (dst_name));
21 return false;
22 }
23 else
24 {
25 new_dst = true;
26 }
27 }
28
29XSTAT() use stat() for dst_name(the dangling symlink /tmp/fileA) when
30install.c invokes it, and stat will set errno to ENOENT, and then
31new_dst will be set to true which means that /tmp/fileA doesn't exist,
32then we will create /tmp/fileA without remove it first, so the error
33comes.
34
35This is fixed in a way which adds the member cmd_install in
36struct cp_options to make sure my change only affected to the install
37command and use lstat to fix the problem.
38
39Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
40Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
41
42---
43 src/copy.c | 10 +++++++++-
44 src/copy.h | 3 +++
45 src/install.c | 1 +
46 3 files changed, 13 insertions(+), 1 deletions(-)
47
48diff --git a/src/copy.c b/src/copy.c
49--- a/src/copy.c
50+++ b/src/copy.c
51@@ -1029,6 +1029,7 @@ copy_internal (char const *src_name, char const *dst_name,
52 bool delayed_ok;
53 bool copied_as_regular = false;
54 bool preserve_metadata;
55+ int dst_stat_result;
56
57 if (x->move_mode && rename_succeeded)
58 *rename_succeeded = false;
59@@ -1069,7 +1070,14 @@ copy_internal (char const *src_name, char const *dst_name,
60
61 if (!new_dst)
62 {
63- if (XSTAT (x, dst_name, &dst_sb) != 0)
64+ if ( x->cmd_install && ( x->backup_type == no_backups))
65+ dst_stat_result = lstat (dst_name, &dst_sb);
66+ else
67+ {
68+ dst_stat_result = XSTAT (x, dst_name, &dst_sb);
69+ }
70+
71+ if (dst_stat_result != 0)
72 {
73 if (errno != ENOENT)
74 {
75diff --git a/src/copy.h b/src/copy.h
76--- a/src/copy.h
77+++ b/src/copy.h
78@@ -114,6 +114,9 @@ struct cp_options
79 If that fails, then resort to copying. */
80 bool move_mode;
81
82+ /* For the install command */
83+ bool cmd_install;
84+
85 /* Whether this process has appropriate privileges to chown a file
86 whose owner is not the effective user ID. */
87 bool chown_privileges;
88diff --git a/src/install.c b/src/install.c
89--- a/src/install.c
90+++ b/src/install.c
91@@ -149,6 +149,7 @@ cp_option_init (struct cp_options *x)
92 x->hard_link = false;
93 x->interactive = I_UNSPECIFIED;
94 x->move_mode = false;
95+ x->cmd_install = true;
96 x->chown_privileges = chown_privileges ();
97 x->one_file_system = false;
98 x->preserve_ownership = false;
99--
1001.7.0.1
101
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
new file mode 100644
index 0000000000..3ae5a2faeb
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
@@ -0,0 +1,375 @@
1From 170be4023bbf9e9698a709e03265945588ac8e01 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 26 Nov 2013 00:21:50 +0800
4Subject: [PATCH] doc/coreutils.texi: Use '@item' instead of '@itemx'
5
6Use '@item' instead of '@itemx' in several places, as Texinfo 5 refuses
7to process an '@itemx' that is not preceded by an '@item'. Ensure that
8node extended names in menus and sectioning are consistent, and that
9ordering and presence of nodes in menus and in the actual text are
10consistent as well.
11
12Upstream-Status: Backport [From: coreutils.7620.n7.nabble.com, bug#11828]
13
14Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
15---
16 doc/coreutils.texi | 82 +++++++++++++++++++++++++++---------------------------
17 1 file changed, 41 insertions(+), 41 deletions(-)
18
19diff --git a/doc/coreutils.texi b/doc/coreutils.texi
20index 588147f..2dae3fe 100644
21--- a/doc/coreutils.texi
22+++ b/doc/coreutils.texi
23@@ -555,7 +555,7 @@ symbolic link to a directory. @xref{Target directory}.
24 @end macro
25
26 @macro optSi
27-@itemx --si
28+@item --si
29 @opindex --si
30 @cindex SI output
31 Append an SI-style abbreviation to each size, such as @samp{M} for
32@@ -578,7 +578,7 @@ Use the @option{--si} option if you prefer powers of 1000.
33 @end macro
34
35 @macro optStripTrailingSlashes
36-@itemx @w{@kbd{--strip-trailing-slashes}}
37+@item @w{@kbd{--strip-trailing-slashes}}
38 @opindex --strip-trailing-slashes
39 @cindex stripping trailing slashes
40 Remove any trailing slashes from each @var{source} argument.
41@@ -2496,7 +2496,7 @@ by 1048576.
42 However, if @var{n} starts with a @samp{-},
43 print all but the last @var{n} bytes of each file.
44
45-@itemx -n @var{n}
46+@item -n @var{n}
47 @itemx --lines=@var{n}
48 @opindex -n
49 @opindex --lines
50@@ -2633,7 +2633,7 @@ This option is the same as @option{--follow=name --retry}. That is, tail
51 will attempt to reopen a file when it is removed. Should this fail, tail
52 will keep trying until it becomes accessible again.
53
54-@itemx --retry
55+@item --retry
56 @opindex --retry
57 This option is useful mainly when following by name (i.e., with
58 @option{--follow=name}).
59@@ -2641,7 +2641,7 @@ Without this option, when tail encounters a file that doesn't
60 exist or is otherwise inaccessible, it reports that fact and
61 never checks it again.
62
63-@itemx --sleep-interval=@var{number}
64+@item --sleep-interval=@var{number}
65 @opindex --sleep-interval
66 Change the number of seconds to wait between iterations (the default is 1.0).
67 During one iteration, every specified file is checked to see if it has
68@@ -2651,7 +2651,7 @@ Historical implementations of @command{tail} have required that
69 an arbitrary floating point number (using a period before any
70 fractional digits).
71
72-@itemx --pid=@var{pid}
73+@item --pid=@var{pid}
74 @opindex --pid
75 When following by name or by descriptor, you may specify the process ID,
76 @var{pid}, of the sole writer of all @var{file} arguments. Then, shortly
77@@ -2674,7 +2674,7 @@ terminate until long after the real writer has terminated.
78 Note that @option{--pid} cannot be supported on some systems; @command{tail}
79 will print a warning if this is the case.
80
81-@itemx --max-unchanged-stats=@var{n}
82+@item --max-unchanged-stats=@var{n}
83 @opindex --max-unchanged-stats
84 When tailing a file by name, if there have been @var{n} (default
85 n=@value{DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS}) consecutive
86@@ -2686,7 +2686,7 @@ number of seconds between when tail prints the last pre-rotation lines
87 and when it prints the lines that have accumulated in the new log file.
88 This option is meaningful only when following by name.
89
90-@itemx -n @var{n}
91+@item -n @var{n}
92 @itemx --lines=@var{n}
93 @opindex -n
94 @opindex --lines
95@@ -2817,7 +2817,7 @@ option.
96 @opindex --numeric-suffixes
97 Use digits in suffixes rather than lower-case letters.
98
99-@itemx --verbose
100+@item --verbose
101 @opindex --verbose
102 Write a diagnostic to standard error just before each output file is opened.
103
104@@ -3055,7 +3055,7 @@ Print only the newline counts.
105 @opindex --max-line-length
106 Print only the maximum line lengths.
107
108-@itemx --files0-from=@var{FILE}
109+@item --files0-from=@var{FILE}
110 @opindex --files0-from=@var{FILE}
111 @cindex including files from @command{du}
112 Rather than processing files named on the command line, process those
113@@ -3250,7 +3250,7 @@ an MD5 checksum inconsistent with the associated file, or if no valid
114 line is found, @command{md5sum} exits with nonzero status. Otherwise,
115 it exits successfully.
116
117-@itemx --status
118+@item --status
119 @opindex --status
120 @cindex verifying MD5 checksums
121 This option is useful only when verifying checksums.
122@@ -5837,7 +5837,7 @@ command line unless the @option{--dereference-command-line} (@option{-H}),
123 If a command line argument specifies a symbolic link, show information
124 for the file the link references rather than for the link itself.
125
126-@itemx --dereference-command-line-symlink-to-dir
127+@item --dereference-command-line-symlink-to-dir
128 @opindex --dereference-command-line-symlink-to-dir
129 @cindex symbolic links, dereferencing
130 Do not dereference symbolic links, with one exception:
131@@ -7015,15 +7015,15 @@ If specified, the @var{attribute_list} must be a comma-separated list
132 of one or more of the following strings:
133
134 @table @samp
135-@itemx mode
136+@item mode
137 Preserve the file mode bits and access control lists.
138-@itemx ownership
139+@item ownership
140 Preserve the owner and group. On most modern systems,
141 only users with appropriate privileges may change the owner of a file,
142 and ordinary users
143 may preserve the group ownership of a file only if they happen to be
144 a member of the desired group.
145-@itemx timestamps
146+@item timestamps
147 Preserve the times of last access and last modification, when possible.
148 In general, it is not possible to preserve these attributes
149 when the affected file is a symbolic link.
150@@ -7031,12 +7031,12 @@ However, FreeBSD now provides the @code{lutimes} function, which makes
151 it possibile even for symbolic links. However, this implementation does
152 not yet take advantage of that.
153 @c FIXME: once we provide lutimes support, update the above.
154-@itemx links
155+@item links
156 Preserve in the destination files
157 any links between corresponding source files.
158 @c Give examples illustrating how hard links are preserved.
159 @c Also, show how soft links map to hard links with -L and -H.
160-@itemx all
161+@item all
162 Preserve all file attributes.
163 Equivalent to specifying all of the above.
164 @end table
165@@ -7049,12 +7049,12 @@ mode bits of the corresponding source file, minus the bits set in the
166 umask and minus the set-user-ID and set-group-ID bits.
167 @xref{File permissions}.
168
169-@itemx @w{@kbd{--no-preserve}=@var{attribute_list}}
170+@item @w{@kbd{--no-preserve}=@var{attribute_list}}
171 @cindex file information, preserving
172 Do not preserve the specified attributes. The @var{attribute_list}
173 has the same form as for @option{--preserve}.
174
175-@itemx --parents
176+@item --parents
177 @opindex --parents
178 @cindex parent directories and @command{cp}
179 Form the name of each destination file by appending to the target
180@@ -7070,7 +7070,7 @@ cp --parents a/b/c existing_dir
181 copies the file @file{a/b/c} to @file{existing_dir/a/b/c}, creating
182 any missing intermediate directories.
183
184-@itemx @w{@kbd{--reply}=@var{how}}
185+@item @w{@kbd{--reply}=@var{how}}
186 @opindex --reply
187 @cindex interactivity
188 @c FIXME: remove in 2008
189@@ -7742,7 +7742,7 @@ Prompt whether to overwrite each existing destination file, regardless
190 of its permissions.
191 If the response is not affirmative, the file is skipped.
192
193-@itemx @w{@kbd{--reply}=@var{how}}
194+@item @w{@kbd{--reply}=@var{how}}
195 @opindex --reply
196 @cindex interactivity
197 @c FIXME: remove in 2008
198@@ -7847,7 +7847,7 @@ files are named or if a recursive removal is requested. Ignore any
199 previous @option{--force} (@option{-f}) option. Equivalent to
200 @option{--interactive=once}.
201
202-@itemx --interactive [=@var{when}]
203+@item --interactive [=@var{when}]
204 @opindex --interactive
205 Specify when to issue an interactive prompt. @var{when} may be
206 omitted, or one of:
207@@ -7866,7 +7866,7 @@ removal is requested. Equivalent to @option{-I}.
208 Specifying @option{--interactive} and no @var{when} is equivalent to
209 @option{--interactive=always}.
210
211-@itemx --one-file-system
212+@item --one-file-system
213 @opindex --one-file-system
214 @cindex one file system, restricting @command{rm} to
215 When removing a hierarchy recursively, skip any directory that is on a
216@@ -7884,7 +7884,7 @@ warn about and skip directories on other file systems.
217 Of course, this will not save your @file{/home} if it and your
218 chroot happen to be on the same file system.
219
220-@itemx --preserve-root
221+@item --preserve-root
222 @opindex --preserve-root
223 @cindex root directory, disallow recursive destruction
224 Fail upon any attempt to remove the root directory, @file{/},
225@@ -7892,7 +7892,7 @@ when used with the @option{--recursive} option.
226 This is the default behavior.
227 @xref{Treating / specially}.
228
229-@itemx --no-preserve-root
230+@item --no-preserve-root
231 @opindex --no-preserve-root
232 @cindex root directory, allow recursive destruction
233 Do not treat @file{/} specially when removing recursively.
234@@ -8874,7 +8874,7 @@ actually changes.
235 Do not print error messages about files whose ownership cannot be
236 changed.
237
238-@itemx @w{@kbd{--from}=@var{old-owner}}
239+@item @w{@kbd{--from}=@var{old-owner}}
240 @opindex --from
241 @cindex symbolic links, changing owner
242 Change a @var{file}'s ownership only if it has current attributes specified
243@@ -8928,14 +8928,14 @@ is a symbolic link.
244 By default, no diagnostic is issued for symbolic links encountered
245 during a recursive traversal, but see @option{--verbose}.
246
247-@itemx --preserve-root
248+@item --preserve-root
249 @opindex --preserve-root
250 @cindex root directory, disallow recursive modification
251 Fail upon any attempt to recursively change the root directory, @file{/}.
252 Without @option{--recursive}, this option has no effect.
253 @xref{Treating / specially}.
254
255-@itemx --no-preserve-root
256+@item --no-preserve-root
257 @opindex --no-preserve-root
258 @cindex root directory, allow recursive modification
259 Cancel the effect of any preceding @option{--preserve-root} option.
260@@ -9054,14 +9054,14 @@ is a symbolic link.
261 By default, no diagnostic is issued for symbolic links encountered
262 during a recursive traversal, but see @option{--verbose}.
263
264-@itemx --preserve-root
265+@item --preserve-root
266 @opindex --preserve-root
267 @cindex root directory, disallow recursive modification
268 Fail upon any attempt to recursively change the root directory, @file{/}.
269 Without @option{--recursive}, this option has no effect.
270 @xref{Treating / specially}.
271
272-@itemx --no-preserve-root
273+@item --no-preserve-root
274 @opindex --no-preserve-root
275 @cindex root directory, allow recursive modification
276 Cancel the effect of any preceding @option{--preserve-root} option.
277@@ -9175,14 +9175,14 @@ actually changes.
278 Do not print error messages about files whose permissions cannot be
279 changed.
280
281-@itemx --preserve-root
282+@item --preserve-root
283 @opindex --preserve-root
284 @cindex root directory, disallow recursive modification
285 Fail upon any attempt to recursively change the root directory, @file{/}.
286 Without @option{--recursive}, this option has no effect.
287 @xref{Treating / specially}.
288
289-@itemx --no-preserve-root
290+@item --no-preserve-root
291 @opindex --no-preserve-root
292 @cindex root directory, allow recursive modification
293 Cancel the effect of any preceding @option{--preserve-root} option.
294@@ -9603,7 +9603,7 @@ The program accepts the following options. Also see @ref{Common options}.
295 @opindex --all
296 Show counts for all files, not just directories.
297
298-@itemx --apparent-size
299+@item --apparent-size
300 @opindex --apparent-size
301 Print apparent sizes, rather than disk usage. The apparent size of a
302 file is the number of bytes reported by @code{wc -c} on regular files,
303@@ -9654,7 +9654,7 @@ Does not affect other symbolic links. This is helpful for finding
304 out the disk usage of directories, such as @file{/usr/tmp}, which
305 are often symbolic links.
306
307-@itemx --files0-from=@var{FILE}
308+@item --files0-from=@var{FILE}
309 @opindex --files0-from=@var{FILE}
310 @cindex including files from @command{du}
311 Rather than processing files named on the command line, process those
312@@ -9733,7 +9733,7 @@ Output a null byte at the end of each line, rather than a newline.
313 This option enables other programs to parse the output of @command{du}
314 even when that output would contain file names with embedded newlines.
315
316-@itemx --si
317+@item --si
318 @opindex --si
319 @cindex SI output
320 Append an SI-style abbreviation to each size, such as @samp{MB} for
321@@ -9754,13 +9754,13 @@ Display only a total for each argument.
322 Report the size of each directory separately, not including the sizes
323 of subdirectories.
324
325-@itemx --time
326+@item --time
327 @opindex --time
328 @cindex last modified dates, displaying in @command{du}
329 Show time of the most recent modification of any file in the directory,
330 or any of its subdirectories.
331
332-@itemx --time=ctime
333+@item --time=ctime
334 @itemx --time=status
335 @itemx --time=use
336 @opindex --time
337@@ -9770,7 +9770,7 @@ or any of its subdirectories.
338 Show the most recent status change time (the @samp{ctime} in the inode) of
339 any file in the directory, instead of the modification time.
340
341-@itemx --time=atime
342+@item --time=atime
343 @itemx --time=access
344 @opindex --time
345 @opindex atime@r{, show the most recent}
346@@ -9911,7 +9911,7 @@ $ stat --format=%d:%i / /usr
347 2057:2
348 @end example
349
350-@itemx --printf=@var{format}
351+@item --printf=@var{format}
352 @opindex --printf=@var{format}
353 @cindex output format
354 Use @var{format} rather than the default format.
355@@ -12240,7 +12240,7 @@ Overrides all other options.
356 @opindex -s
357 Ignored; for compatibility with other versions of @command{who}.
358
359-@itemx -u
360+@item -u
361 @opindex -u
362 @cindex idle time
363 After the login time, print the number of hours and minutes that the
364@@ -12254,7 +12254,7 @@ user has been idle. @samp{.} means the user was active in the last minute.
365 List only the entries that correspond to processes via which the
366 system is waiting for a user to login. The user name is always @samp{LOGIN}.
367
368-@itemx --lookup
369+@item --lookup
370 @opindex --lookup
371 Attempt to canonicalize hostnames found in utmp through a DNS lookup. This
372 is not the default because it can cause significant delays on systems with
373--
3741.8.3.1
375
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
new file mode 100644
index 0000000000..653722348a
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
@@ -0,0 +1,4051 @@
1Upstream-Status: Inappropriate [legacy version]
2
3This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
4
5The package is stated as being Licensed as GPLv2+.
6
7The comment indicates that the purpose is lin18nux/lsb compliance.
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11--- /dev/null 2007-03-01 09:16:39.219409909 +0000
12+++ coreutils-6.8+/tests/sort/sort-mb-tests 2007-03-01 15:08:24.000000000 +0000
13@@ -0,0 +1,58 @@
14+#! /bin/sh
15+case $# in
16+ 0) xx='../../src/sort';;
17+ *) xx="$1";;
18+esac
19+test "$VERBOSE" && echo=echo || echo=:
20+$echo testing program: $xx
21+errors=0
22+test "$srcdir" || srcdir=.
23+test "$VERBOSE" && $xx --version 2> /dev/null
24+
25+export LC_ALL=en_US.UTF-8
26+locale -k LC_CTYPE 2>&1 | grep -q charmap.*UTF-8 || exit 77
27+errors=0
28+
29+$xx -t ï¼  -k2 -n mb1.I > mb1.O
30+code=$?
31+if test $code != 0; then
32+ $echo "Test mb1 failed: $xx return code $code differs from expected value 0" 1>&2
33+ errors=`expr $errors + 1`
34+else
35+ cmp mb1.O $srcdir/mb1.X > /dev/null 2>&1
36+ case $? in
37+ 0) if test "$VERBOSE"; then $echo "passed mb1"; fi;;
38+ 1) $echo "Test mb1 failed: files mb1.O and $srcdir/mb1.X differ" 1>&2
39+ (diff -c mb1.O $srcdir/mb1.X) 2> /dev/null
40+ errors=`expr $errors + 1`;;
41+ 2) $echo "Test mb1 may have failed." 1>&2
42+ $echo The command "cmp mb1.O $srcdir/mb1.X" failed. 1>&2
43+ errors=`expr $errors + 1`;;
44+ esac
45+fi
46+
47+$xx -t ï¼  -k4 -n mb2.I > mb2.O
48+code=$?
49+if test $code != 0; then
50+ $echo "Test mb2 failed: $xx return code $code differs from expected value 0" 1>&2
51+ errors=`expr $errors + 1`
52+else
53+ cmp mb2.O $srcdir/mb2.X > /dev/null 2>&1
54+ case $? in
55+ 0) if test "$VERBOSE"; then $echo "passed mb2"; fi;;
56+ 1) $echo "Test mb2 failed: files mb2.O and $srcdir/mb2.X differ" 1>&2
57+ (diff -c mb2.O $srcdir/mb2.X) 2> /dev/null
58+ errors=`expr $errors + 1`;;
59+ 2) $echo "Test mb2 may have failed." 1>&2
60+ $echo The command "cmp mb2.O $srcdir/mb2.X" failed. 1>&2
61+ errors=`expr $errors + 1`;;
62+ esac
63+fi
64+
65+if test $errors = 0; then
66+ $echo Passed all 113 tests. 1>&2
67+else
68+ $echo Failed $errors tests. 1>&2
69+fi
70+test $errors = 0 || errors=1
71+exit $errors
72--- /dev/null 2007-03-01 09:16:39.219409909 +0000
73+++ coreutils-6.8+/tests/sort/mb2.I 2007-03-01 15:08:24.000000000 +0000
74@@ -0,0 +1,4 @@
75+Apple@AA10@@20
76+Banana@AA5@@30
77+Citrus@AA20@@5
78+Cherry@AA30@@10
79--- /dev/null 2007-03-01 09:16:39.219409909 +0000
80+++ coreutils-6.8+/tests/sort/mb2.X 2007-03-01 15:08:24.000000000 +0000
81@@ -0,0 +1,4 @@
82+Citrus@AA20@@5
83+Cherry@AA30@@10
84+Apple@AA10@@20
85+Banana@AA5@@30
86--- /dev/null 2007-03-01 09:16:39.219409909 +0000
87+++ coreutils-6.8+/tests/sort/mb1.I 2007-03-01 15:08:24.000000000 +0000
88@@ -0,0 +1,4 @@
89+Appleï¼ 10
90+Bananaï¼ 5
91+Citrusï¼ 20
92+Cherryï¼ 30
93--- /dev/null 2007-03-01 09:16:39.219409909 +0000
94+++ coreutils-6.8+/tests/sort/mb1.X 2007-03-01 15:08:24.000000000 +0000
95@@ -0,0 +1,4 @@
96+Bananaï¼ 5
97+Appleï¼ 10
98+Citrusï¼ 20
99+Cherryï¼ 30
100--- coreutils-6.8+/tests/sort/Makefile.am.i18n 2007-01-24 07:47:37.000000000 +0000
101+++ coreutils-6.8+/tests/sort/Makefile.am 2007-03-01 15:09:59.000000000 +0000
102@@ -66,15 +66,17 @@
103 bigfield.O bigfield.E
104 ##test-files-end
105
106-EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
107-noinst_SCRIPTS = $x-tests
108+run_gen += mb1.0 mb2.0
109+
110+EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X
111+noinst_SCRIPTS = $x-tests # $x-mb-tests
112 TESTS_ENVIRONMENT = \
113 CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
114 PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
115
116 editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
117
118-TESTS = $x-tests
119+TESTS = $x-tests $x-mb-tests
120
121 mk_script = $(srcdir)/../mk-script
122 $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
123--- coreutils-6.8+/lib/linebuffer.h.i18n 2005-05-14 07:44:24.000000000 +0100
124+++ coreutils-6.8+/lib/linebuffer.h 2007-03-01 15:08:24.000000000 +0000
125@@ -22,6 +22,11 @@
126
127 # include <stdio.h>
128
129+/* Get mbstate_t. */
130+# if HAVE_WCHAR_H
131+# include <wchar.h>
132+# endif
133+
134 /* A `struct linebuffer' holds a line of text. */
135
136 struct linebuffer
137@@ -29,6 +34,9 @@
138 size_t size; /* Allocated. */
139 size_t length; /* Used. */
140 char *buffer;
141+# if HAVE_WCHAR_H
142+ mbstate_t state;
143+# endif
144 };
145
146 /* Initialize linebuffer LINEBUFFER for use. */
147--- coreutils-6.8+/src/expand.c.i18n 2007-01-14 15:41:28.000000000 +0000
148+++ coreutils-6.8+/src/expand.c 2007-03-01 15:08:24.000000000 +0000
149@@ -38,11 +38,28 @@
150 #include <stdio.h>
151 #include <getopt.h>
152 #include <sys/types.h>
153+
154+/* Get mbstate_t, mbrtowc(), wcwidth(). */
155+#if HAVE_WCHAR_H
156+# include <wchar.h>
157+#endif
158+
159 #include "system.h"
160 #include "error.h"
161 #include "quote.h"
162 #include "xstrndup.h"
163
164+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
165+ installation; work around this configuration error. */
166+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
167+# define MB_LEN_MAX 16
168+#endif
169+
170+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
171+#if HAVE_MBRTOWC && defined mbstate_t
172+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
173+#endif
174+
175 /* The official name of this program (e.g., no `g' prefix). */
176 #define PROGRAM_NAME "expand"
177
178@@ -183,6 +200,7 @@
179 stops = num_start + len - 1;
180 }
181 }
182+
183 else
184 {
185 error (0, 0, _("tab size contains invalid character(s): %s"),
186@@ -365,6 +383,142 @@
187 }
188 }
189
190+#if HAVE_MBRTOWC
191+static void
192+expand_multibyte (void)
193+{
194+ FILE *fp; /* Input strem. */
195+ mbstate_t i_state; /* Current shift state of the input stream. */
196+ mbstate_t i_state_bak; /* Back up the I_STATE. */
197+ mbstate_t o_state; /* Current shift state of the output stream. */
198+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
199+ char *bufpos; /* Next read position of BUF. */
200+ size_t buflen = 0; /* The length of the byte sequence in buf. */
201+ wchar_t wc; /* A gotten wide character. */
202+ size_t mblength; /* The byte size of a multibyte character
203+ which shows as same character as WC. */
204+ int tab_index = 0; /* Index in `tab_list' of next tabstop. */
205+ int column = 0; /* Column on screen of the next char. */
206+ int next_tab_column; /* Column the next tab stop is on. */
207+ int convert = 1; /* If nonzero, perform translations. */
208+
209+ fp = next_file ((FILE *) NULL);
210+ if (fp == NULL)
211+ return;
212+
213+ memset (&o_state, '\0', sizeof(mbstate_t));
214+ memset (&i_state, '\0', sizeof(mbstate_t));
215+
216+ for (;;)
217+ {
218+ /* Refill the buffer BUF. */
219+ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
220+ {
221+ memmove (buf, bufpos, buflen);
222+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
223+ bufpos = buf;
224+ }
225+
226+ /* No character is left in BUF. */
227+ if (buflen < 1)
228+ {
229+ fp = next_file (fp);
230+
231+ if (fp == NULL)
232+ break; /* No more files. */
233+ else
234+ {
235+ memset (&i_state, '\0', sizeof(mbstate_t));
236+ continue;
237+ }
238+ }
239+
240+ /* Get a wide character. */
241+ i_state_bak = i_state;
242+ mblength = mbrtowc (&wc, bufpos, buflen, &i_state);
243+
244+ switch (mblength)
245+ {
246+ case (size_t)-1: /* illegal byte sequence. */
247+ case (size_t)-2:
248+ mblength = 1;
249+ i_state = i_state_bak;
250+ if (convert)
251+ {
252+ ++column;
253+ if (convert_entire_line == 0)
254+ convert = 0;
255+ }
256+ putchar (*bufpos);
257+ break;
258+
259+ case 0: /* null. */
260+ mblength = 1;
261+ if (convert && convert_entire_line == 0)
262+ convert = 0;
263+ putchar ('\0');
264+ break;
265+
266+ default:
267+ if (wc == L'\n') /* LF. */
268+ {
269+ tab_index = 0;
270+ column = 0;
271+ convert = 1;
272+ putchar ('\n');
273+ }
274+ else if (wc == L'\t' && convert) /* Tab. */
275+ {
276+ if (tab_size == 0)
277+ {
278+ /* Do not let tab_index == first_free_tab;
279+ stop when it is 1 less. */
280+ while (tab_index < first_free_tab - 1
281+ && column >= tab_list[tab_index])
282+ tab_index++;
283+ next_tab_column = tab_list[tab_index];
284+ if (tab_index < first_free_tab - 1)
285+ tab_index++;
286+ if (column >= next_tab_column)
287+ next_tab_column = column + 1;
288+ }
289+ else
290+ next_tab_column = column + tab_size - column % tab_size;
291+
292+ while (column < next_tab_column)
293+ {
294+ putchar (' ');
295+ ++column;
296+ }
297+ }
298+ else /* Others. */
299+ {
300+ if (convert)
301+ {
302+ if (wc == L'\b')
303+ {
304+ if (column > 0)
305+ --column;
306+ }
307+ else
308+ {
309+ int width; /* The width of WC. */
310+
311+ width = wcwidth (wc);
312+ column += (width > 0) ? width : 0;
313+ if (convert_entire_line == 0)
314+ convert = 0;
315+ }
316+ }
317+ fwrite (bufpos, sizeof(char), mblength, stdout);
318+ }
319+ }
320+ buflen -= mblength;
321+ bufpos += mblength;
322+ }
323+}
324+#endif
325+
326 int
327 main (int argc, char **argv)
328 {
329@@ -429,7 +583,12 @@
330
331 file_list = (optind < argc ? &argv[optind] : stdin_argv);
332
333- expand ();
334+#if HAVE_MBRTOWC
335+ if (MB_CUR_MAX > 1)
336+ expand_multibyte ();
337+ else
338+#endif
339+ expand ();
340
341 if (have_read_stdin && fclose (stdin) != 0)
342 error (EXIT_FAILURE, errno, "-");
343--- coreutils-6.8+/src/join.c.i18n 2007-01-14 15:41:28.000000000 +0000
344+++ coreutils-6.8+/src/join.c 2007-03-01 15:08:24.000000000 +0000
345@@ -23,16 +23,30 @@
346 #include <sys/types.h>
347 #include <getopt.h>
348
349+/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth(). */
350+#if HAVE_WCHAR_H
351+# include <wchar.h>
352+#endif
353+
354+/* Get iswblank(), towupper. */
355+#if HAVE_WCTYPE_H
356+# include <wctype.h>
357+#endif
358+
359 #include "system.h"
360 #include "error.h"
361 #include "hard-locale.h"
362 #include "linebuffer.h"
363-#include "memcasecmp.h"
364 #include "quote.h"
365 #include "stdio--.h"
366 #include "xmemcoll.h"
367 #include "xstrtol.h"
368
369+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
370+#if HAVE_MBRTOWC && defined mbstate_t
371+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
372+#endif
373+
374 /* The official name of this program (e.g., no `g' prefix). */
375 #define PROGRAM_NAME "join"
376
377@@ -104,10 +118,12 @@
378 /* Last element in `outlist', where a new element can be added. */
379 static struct outlist *outlist_end = &outlist_head;
380
381-/* Tab character separating fields. If negative, fields are separated
382- by any nonempty string of blanks, otherwise by exactly one
383- tab character whose value (when cast to unsigned char) equals TAB. */
384-static int tab = -1;
385+/* Tab character separating fields. If NULL, fields are separated
386+ by any nonempty string of blanks. */
387+static char *tab = NULL;
388+
389+/* The number of bytes used for tab. */
390+static size_t tablen = 0;
391
392 static struct option const longopts[] =
393 {
394@@ -190,6 +206,8 @@
395
396 /* Fill in the `fields' structure in LINE. */
397
398+/* Fill in the `fields' structure in LINE. */
399+
400 static void
401 xfields (struct line *line)
402 {
403@@ -199,10 +217,11 @@
404 if (ptr == lim)
405 return;
406
407- if (0 <= tab)
408+ if (tab != NULL)
409 {
410+ unsigned char t = tab[0];
411 char *sep;
412- for (; (sep = memchr (ptr, tab, lim - ptr)) != NULL; ptr = sep + 1)
413+ for (; (sep = memchr (ptr, t, lim - ptr)) != NULL; ptr = sep + 1)
414 extract_field (line, ptr, sep - ptr);
415 }
416 else
417@@ -229,6 +248,148 @@
418 extract_field (line, ptr, lim - ptr);
419 }
420
421+#if HAVE_MBRTOWC
422+static void
423+xfields_multibyte (struct line *line)
424+{
425+ char *ptr = line->buf.buffer;
426+ char const *lim = ptr + line->buf.length - 1;
427+ wchar_t wc = 0;
428+ size_t mblength = 1;
429+ mbstate_t state, state_bak;
430+
431+ memset (&state, 0, sizeof (mbstate_t));
432+
433+ if (ptr == lim)
434+ return;
435+
436+ if (tab != NULL)
437+ {
438+ unsigned char t = tab[0];
439+ char *sep = ptr;
440+ for (; ptr < lim; ptr = sep + mblength)
441+ {
442+ sep = ptr;
443+ while (sep < lim)
444+ {
445+ state_bak = state;
446+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
447+
448+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
449+ {
450+ mblength = 1;
451+ state = state_bak;
452+ }
453+ mblength = (mblength < 1) ? 1 : mblength;
454+
455+ if (mblength == tablen && !memcmp (sep, tab, mblength))
456+ break;
457+ else
458+ {
459+ sep += mblength;
460+ continue;
461+ }
462+ }
463+
464+ if (sep == lim)
465+ break;
466+
467+ extract_field (line, ptr, sep - ptr);
468+ }
469+ }
470+ else
471+ {
472+ /* Skip leading blanks before the first field. */
473+ while(ptr < lim)
474+ {
475+ state_bak = state;
476+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
477+
478+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
479+ {
480+ mblength = 1;
481+ state = state_bak;
482+ break;
483+ }
484+ mblength = (mblength < 1) ? 1 : mblength;
485+
486+ if (!iswblank(wc))
487+ break;
488+ ptr += mblength;
489+ }
490+
491+ do
492+ {
493+ char *sep;
494+ state_bak = state;
495+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
496+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
497+ {
498+ mblength = 1;
499+ state = state_bak;
500+ break;
501+ }
502+ mblength = (mblength < 1) ? 1 : mblength;
503+
504+ sep = ptr + mblength;
505+ while (sep != lim)
506+ {
507+ state_bak = state;
508+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
509+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
510+ {
511+ mblength = 1;
512+ state = state_bak;
513+ break;
514+ }
515+ mblength = (mblength < 1) ? 1 : mblength;
516+
517+ if (iswblank (wc))
518+ break;
519+
520+ sep += mblength;
521+ }
522+
523+ extract_field (line, ptr, sep - ptr);
524+ if (sep == lim)
525+ return;
526+
527+ state_bak = state;
528+ mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
529+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
530+ {
531+ mblength = 1;
532+ state = state_bak;
533+ break;
534+ }
535+ mblength = (mblength < 1) ? 1 : mblength;
536+
537+ ptr = sep + mblength;
538+ while (ptr != lim)
539+ {
540+ state_bak = state;
541+ mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
542+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
543+ {
544+ mblength = 1;
545+ state = state_bak;
546+ break;
547+ }
548+ mblength = (mblength < 1) ? 1 : mblength;
549+
550+ if (!iswblank (wc))
551+ break;
552+
553+ ptr += mblength;
554+ }
555+ }
556+ while (ptr != lim);
557+ }
558+
559+ extract_field (line, ptr, lim - ptr);
560+}
561+#endif
562+
563 /* Read a line from FP into LINE and split it into fields.
564 Return true if successful. */
565
566@@ -249,6 +410,11 @@
567 line->nfields_allocated = 0;
568 line->nfields = 0;
569 line->fields = NULL;
570+#if HAVE_MBRTOWC
571+ if (MB_CUR_MAX > 1)
572+ xfields_multibyte (line);
573+ else
574+#endif
575 xfields (line);
576 return true;
577 }
578@@ -303,56 +469,114 @@
579 keycmp (struct line const *line1, struct line const *line2)
580 {
581 /* Start of field to compare in each file. */
582- char *beg1;
583- char *beg2;
584-
585- size_t len1;
586- size_t len2; /* Length of fields to compare. */
587+ char *beg[2];
588+ char *copy[2];
589+ size_t len[2]; /* Length of fields to compare. */
590 int diff;
591+ int i, j;
592
593 if (join_field_1 < line1->nfields)
594 {
595- beg1 = line1->fields[join_field_1].beg;
596- len1 = line1->fields[join_field_1].len;
597+ beg[0] = line1->fields[join_field_1].beg;
598+ len[0] = line1->fields[join_field_1].len;
599 }
600 else
601 {
602- beg1 = NULL;
603- len1 = 0;
604+ beg[0] = NULL;
605+ len[0] = 0;
606 }
607
608 if (join_field_2 < line2->nfields)
609 {
610- beg2 = line2->fields[join_field_2].beg;
611- len2 = line2->fields[join_field_2].len;
612+ beg[1] = line2->fields[join_field_2].beg;
613+ len[1] = line2->fields[join_field_2].len;
614 }
615 else
616 {
617- beg2 = NULL;
618- len2 = 0;
619+ beg[1] = NULL;
620+ len[1] = 0;
621 }
622
623- if (len1 == 0)
624- return len2 == 0 ? 0 : -1;
625- if (len2 == 0)
626+ if (len[0] == 0)
627+ return len[1] == 0 ? 0 : -1;
628+ if (len[1] == 0)
629 return 1;
630
631 if (ignore_case)
632 {
633- /* FIXME: ignore_case does not work with NLS (in particular,
634- with multibyte chars). */
635- diff = memcasecmp (beg1, beg2, MIN (len1, len2));
636+#ifdef HAVE_MBRTOWC
637+ if (MB_CUR_MAX > 1)
638+ {
639+ size_t mblength;
640+ wchar_t wc, uwc;
641+ mbstate_t state, state_bak;
642+
643+ memset (&state, '\0', sizeof (mbstate_t));
644+
645+ for (i = 0; i < 2; i++)
646+ {
647+ copy[i] = alloca (len[i] + 1);
648+
649+ for (j = 0; j < MIN (len[0], len[1]);)
650+ {
651+ state_bak = state;
652+ mblength = mbrtowc (&wc, beg[i] + j, len[i] - j, &state);
653+
654+ switch (mblength)
655+ {
656+ case (size_t) -1:
657+ case (size_t) -2:
658+ state = state_bak;
659+ /* Fall through */
660+ case 0:
661+ mblength = 1;
662+ break;
663+
664+ default:
665+ uwc = towupper (wc);
666+
667+ if (uwc != wc)
668+ {
669+ mbstate_t state_wc;
670+
671+ memset (&state_wc, '\0', sizeof (mbstate_t));
672+ wcrtomb (copy[i] + j, uwc, &state_wc);
673+ }
674+ else
675+ memcpy (copy[i] + j, beg[i] + j, mblength);
676+ }
677+ j += mblength;
678+ }
679+ copy[i][j] = '\0';
680+ }
681+ }
682+ else
683+#endif
684+ {
685+ for (i = 0; i < 2; i++)
686+ {
687+ copy[i] = alloca (len[i] + 1);
688+
689+ for (j = 0; j < MIN (len[0], len[1]); j++)
690+ copy[i][j] = toupper (beg[i][j]);
691+
692+ copy[i][j] = '\0';
693+ }
694+ }
695 }
696 else
697 {
698- if (hard_LC_COLLATE)
699- return xmemcoll (beg1, len1, beg2, len2);
700- diff = memcmp (beg1, beg2, MIN (len1, len2));
701+ copy[0] = (unsigned char *) beg[0];
702+ copy[1] = (unsigned char *) beg[1];
703 }
704
705+ if (hard_LC_COLLATE)
706+ return xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]);
707+ diff = memcmp (copy[0], copy[1], MIN (len[0], len[1]));
708+
709 if (diff)
710 return diff;
711- return len1 < len2 ? -1 : len1 != len2;
712+ return len[0] - len[1];
713 }
714
715 /* Print field N of LINE if it exists and is nonempty, otherwise
716@@ -377,11 +601,18 @@
717
718 /* Print the join of LINE1 and LINE2. */
719
720+#define PUT_TAB_CHAR \
721+ do \
722+ { \
723+ (tab != NULL) ? \
724+ fwrite(tab, sizeof(char), tablen, stdout) : putchar (' '); \
725+ } \
726+ while (0)
727+
728 static void
729 prjoin (struct line const *line1, struct line const *line2)
730 {
731 const struct outlist *outlist;
732- char output_separator = tab < 0 ? ' ' : tab;
733
734 outlist = outlist_head.next;
735 if (outlist)
736@@ -397,12 +628,12 @@
737 if (o->file == 0)
738 {
739 if (line1 == &uni_blank)
740- {
741+ {
742 line = line2;
743 field = join_field_2;
744 }
745 else
746- {
747+ {
748 line = line1;
749 field = join_field_1;
750 }
751@@ -416,7 +647,7 @@
752 o = o->next;
753 if (o == NULL)
754 break;
755- putchar (output_separator);
756+ PUT_TAB_CHAR;
757 }
758 putchar ('\n');
759 }
760@@ -434,23 +665,23 @@
761 prfield (join_field_1, line1);
762 for (i = 0; i < join_field_1 && i < line1->nfields; ++i)
763 {
764- putchar (output_separator);
765+ PUT_TAB_CHAR;
766 prfield (i, line1);
767 }
768 for (i = join_field_1 + 1; i < line1->nfields; ++i)
769 {
770- putchar (output_separator);
771+ PUT_TAB_CHAR;
772 prfield (i, line1);
773 }
774
775 for (i = 0; i < join_field_2 && i < line2->nfields; ++i)
776 {
777- putchar (output_separator);
778+ PUT_TAB_CHAR;
779 prfield (i, line2);
780 }
781 for (i = join_field_2 + 1; i < line2->nfields; ++i)
782 {
783- putchar (output_separator);
784+ PUT_TAB_CHAR;
785 prfield (i, line2);
786 }
787 putchar ('\n');
788@@ -859,20 +1090,41 @@
789
790 case 't':
791 {
792- unsigned char newtab = optarg[0];
793- if (! newtab)
794+ char *newtab;
795+ size_t newtablen;
796+ if (! optarg[0])
797 error (EXIT_FAILURE, 0, _("empty tab"));
798- if (optarg[1])
799+ newtab = xstrdup (optarg);
800+#if HAVE_MBRTOWC
801+ if (MB_CUR_MAX > 1)
802+ {
803+ mbstate_t state;
804+
805+ memset (&state, 0, sizeof (mbstate_t));
806+ newtablen = mbrtowc (NULL, newtab,
807+ strnlen (newtab, MB_LEN_MAX),
808+ &state);
809+ if (newtablen == (size_t) 0
810+ || newtablen == (size_t) -1
811+ || newtablen == (size_t) -2)
812+ newtablen = 1;
813+ }
814+ else
815+#endif
816+ newtablen = 1;
817+
818+ if (newtablen == 1 && newtab[1])
819+ {
820+ if (STREQ (newtab, "\\0"))
821+ newtab[0] = '\0';
822+ }
823+ if (tab != NULL && strcmp (tab, newtab))
824 {
825- if (STREQ (optarg, "\\0"))
826- newtab = '\0';
827- else
828- error (EXIT_FAILURE, 0, _("multi-character tab %s"),
829- quote (optarg));
830+ free (newtab);
831+ error (EXIT_FAILURE, 0, _("incompatible tabs"));
832 }
833- if (0 <= tab && tab != newtab)
834- error (EXIT_FAILURE, 0, _("incompatible tabs"));
835 tab = newtab;
836+ tablen = newtablen;
837 }
838 break;
839
840--- coreutils-6.8+/src/uniq.c.i18n 2007-01-14 15:41:28.000000000 +0000
841+++ coreutils-6.8+/src/uniq.c 2007-03-01 15:08:24.000000000 +0000
842@@ -23,6 +23,16 @@
843 #include <getopt.h>
844 #include <sys/types.h>
845
846+/* Get mbstate_t, mbrtowc(). */
847+#if HAVE_WCHAR_H
848+# include <wchar.h>
849+#endif
850+
851+/* Get isw* functions. */
852+#if HAVE_WCTYPE_H
853+# include <wctype.h>
854+#endif
855+
856 #include "system.h"
857 #include "argmatch.h"
858 #include "linebuffer.h"
859@@ -32,7 +42,19 @@
860 #include "quote.h"
861 #include "xmemcoll.h"
862 #include "xstrtol.h"
863-#include "memcasecmp.h"
864+#include "xmemcoll.h"
865+
866+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
867+ installation; work around this configuration error. */
868+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
869+# define MB_LEN_MAX 16
870+#endif
871+
872+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
873+#if HAVE_MBRTOWC && defined mbstate_t
874+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
875+#endif
876+
877
878 /* The official name of this program (e.g., no `g' prefix). */
879 #define PROGRAM_NAME "uniq"
880@@ -109,6 +131,10 @@
881 /* Select whether/how to delimit groups of duplicate lines. */
882 static enum delimit_method delimit_groups;
883
884+/* Function pointers. */
885+static char *
886+(*find_field) (struct linebuffer *line);
887+
888 static struct option const longopts[] =
889 {
890 {"count", no_argument, NULL, 'c'},
891@@ -198,7 +224,7 @@
892 return a pointer to the beginning of the line's field to be compared. */
893
894 static char *
895-find_field (const struct linebuffer *line)
896+find_field_uni (struct linebuffer *line)
897 {
898 size_t count;
899 char *lp = line->buffer;
900@@ -219,6 +245,83 @@
901 return lp + i;
902 }
903
904+#if HAVE_MBRTOWC
905+
906+# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL) \
907+ do \
908+ { \
909+ mbstate_t state_bak; \
910+ \
911+ CONVFAIL = 0; \
912+ state_bak = *STATEP; \
913+ \
914+ MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP); \
915+ \
916+ switch (MBLENGTH) \
917+ { \
918+ case (size_t)-2: \
919+ case (size_t)-1: \
920+ *STATEP = state_bak; \
921+ CONVFAIL++; \
922+ /* Fall through */ \
923+ case 0: \
924+ MBLENGTH = 1; \
925+ } \
926+ } \
927+ while (0)
928+
929+static char *
930+find_field_multi (struct linebuffer *line)
931+{
932+ size_t count;
933+ char *lp = line->buffer;
934+ size_t size = line->length - 1;
935+ size_t pos;
936+ size_t mblength;
937+ wchar_t wc;
938+ mbstate_t *statep;
939+ int convfail;
940+
941+ pos = 0;
942+ statep = &(line->state);
943+
944+ /* skip fields. */
945+ for (count = 0; count < skip_fields && pos < size; count++)
946+ {
947+ while (pos < size)
948+ {
949+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
950+
951+ if (convfail || !iswblank (wc))
952+ {
953+ pos += mblength;
954+ break;
955+ }
956+ pos += mblength;
957+ }
958+
959+ while (pos < size)
960+ {
961+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
962+
963+ if (!convfail && iswblank (wc))
964+ break;
965+
966+ pos += mblength;
967+ }
968+ }
969+
970+ /* skip fields. */
971+ for (count = 0; count < skip_chars && pos < size; count++)
972+ {
973+ MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
974+ pos += mblength;
975+ }
976+
977+ return lp + pos;
978+}
979+#endif
980+
981 /* Return false if two strings OLD and NEW match, true if not.
982 OLD and NEW point not to the beginnings of the lines
983 but rather to the beginnings of the fields to compare.
984@@ -227,6 +330,8 @@
985 static bool
986 different (char *old, char *new, size_t oldlen, size_t newlen)
987 {
988+ char *copy_old, *copy_new;
989+
990 if (check_chars < oldlen)
991 oldlen = check_chars;
992 if (check_chars < newlen)
993@@ -234,14 +339,92 @@
994
995 if (ignore_case)
996 {
997- /* FIXME: This should invoke strcoll somehow. */
998- return oldlen != newlen || memcasecmp (old, new, oldlen);
999+ size_t i;
1000+
1001+ copy_old = alloca (oldlen + 1);
1002+ copy_new = alloca (oldlen + 1);
1003+
1004+ for (i = 0; i < oldlen; i++)
1005+ {
1006+ copy_old[i] = toupper (old[i]);
1007+ copy_new[i] = toupper (new[i]);
1008+ }
1009 }
1010- else if (hard_LC_COLLATE)
1011- return xmemcoll (old, oldlen, new, newlen) != 0;
1012 else
1013- return oldlen != newlen || memcmp (old, new, oldlen);
1014+ {
1015+ copy_old = (char *)old;
1016+ copy_new = (char *)new;
1017+ }
1018+
1019+ return xmemcoll (copy_old, oldlen, copy_new, newlen);
1020+}
1021+
1022+#if HAVE_MBRTOWC
1023+static int
1024+different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate)
1025+{
1026+ size_t i, j, chars;
1027+ const char *str[2];
1028+ char *copy[2];
1029+ size_t len[2];
1030+ mbstate_t state[2];
1031+ size_t mblength;
1032+ wchar_t wc, uwc;
1033+ mbstate_t state_bak;
1034+
1035+ str[0] = old;
1036+ str[1] = new;
1037+ len[0] = oldlen;
1038+ len[1] = newlen;
1039+ state[0] = oldstate;
1040+ state[1] = newstate;
1041+
1042+ for (i = 0; i < 2; i++)
1043+ {
1044+ copy[i] = alloca (len[i] + 1);
1045+
1046+ for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++)
1047+ {
1048+ state_bak = state[i];
1049+ mblength = mbrtowc (&wc, str[i] + j, len[i] - j, &(state[i]));
1050+
1051+ switch (mblength)
1052+ {
1053+ case (size_t)-1:
1054+ case (size_t)-2:
1055+ state[i] = state_bak;
1056+ /* Fall through */
1057+ case 0:
1058+ mblength = 1;
1059+ break;
1060+
1061+ default:
1062+ if (ignore_case)
1063+ {
1064+ uwc = towupper (wc);
1065+
1066+ if (uwc != wc)
1067+ {
1068+ mbstate_t state_wc;
1069+
1070+ memset (&state_wc, '\0', sizeof(mbstate_t));
1071+ wcrtomb (copy[i] + j, uwc, &state_wc);
1072+ }
1073+ else
1074+ memcpy (copy[i] + j, str[i] + j, mblength);
1075+ }
1076+ else
1077+ memcpy (copy[i] + j, str[i] + j, mblength);
1078+ }
1079+ j += mblength;
1080+ }
1081+ copy[i][j] = '\0';
1082+ len[i] = j;
1083+ }
1084+
1085+ return xmemcoll (copy[0], len[0], copy[1], len[1]);
1086 }
1087+#endif
1088
1089 /* Output the line in linebuffer LINE to standard output
1090 provided that the switches say it should be output.
1091@@ -295,15 +478,43 @@
1092 {
1093 char *prevfield IF_LINT (= NULL);
1094 size_t prevlen IF_LINT (= 0);
1095+#if HAVE_MBRTOWC
1096+ mbstate_t prevstate;
1097+
1098+ memset (&prevstate, '\0', sizeof (mbstate_t));
1099+#endif
1100
1101 while (!feof (stdin))
1102 {
1103 char *thisfield;
1104 size_t thislen;
1105+#if HAVE_MBRTOWC
1106+ mbstate_t thisstate;
1107+#endif
1108+
1109 if (readlinebuffer (thisline, stdin) == 0)
1110 break;
1111 thisfield = find_field (thisline);
1112 thislen = thisline->length - 1 - (thisfield - thisline->buffer);
1113+#if HAVE_MBRTOWC
1114+ if (MB_CUR_MAX > 1)
1115+ {
1116+ thisstate = thisline->state;
1117+
1118+ if (prevline->length == 0 || different_multi
1119+ (thisfield, prevfield, thislen, prevlen, thisstate, prevstate))
1120+ {
1121+ fwrite (thisline->buffer, sizeof (char),
1122+ thisline->length, stdout);
1123+
1124+ SWAP_LINES (prevline, thisline);
1125+ prevfield = thisfield;
1126+ prevlen = thislen;
1127+ prevstate = thisstate;
1128+ }
1129+ }
1130+ else
1131+#endif
1132 if (prevline->length == 0
1133 || different (thisfield, prevfield, thislen, prevlen))
1134 {
1135@@ -322,17 +533,26 @@
1136 size_t prevlen;
1137 uintmax_t match_count = 0;
1138 bool first_delimiter = true;
1139+#if HAVE_MBRTOWC
1140+ mbstate_t prevstate;
1141+#endif
1142
1143 if (readlinebuffer (prevline, stdin) == 0)
1144 goto closefiles;
1145 prevfield = find_field (prevline);
1146 prevlen = prevline->length - 1 - (prevfield - prevline->buffer);
1147+#if HAVE_MBRTOWC
1148+ prevstate = prevline->state;
1149+#endif
1150
1151 while (!feof (stdin))
1152 {
1153 bool match;
1154 char *thisfield;
1155 size_t thislen;
1156+#if HAVE_MBRTOWC
1157+ mbstate_t thisstate;
1158+#endif
1159 if (readlinebuffer (thisline, stdin) == 0)
1160 {
1161 if (ferror (stdin))
1162@@ -341,6 +561,15 @@
1163 }
1164 thisfield = find_field (thisline);
1165 thislen = thisline->length - 1 - (thisfield - thisline->buffer);
1166+#if HAVE_MBRTOWC
1167+ if (MB_CUR_MAX > 1)
1168+ {
1169+ thisstate = thisline->state;
1170+ match = !different_multi (thisfield, prevfield,
1171+ thislen, prevlen, thisstate, prevstate);
1172+ }
1173+ else
1174+#endif
1175 match = !different (thisfield, prevfield, thislen, prevlen);
1176 match_count += match;
1177
1178@@ -373,6 +602,9 @@
1179 SWAP_LINES (prevline, thisline);
1180 prevfield = thisfield;
1181 prevlen = thislen;
1182+#if HAVE_MBRTOWC
1183+ prevstate = thisstate;
1184+#endif
1185 if (!match)
1186 match_count = 0;
1187 }
1188@@ -417,6 +649,19 @@
1189
1190 atexit (close_stdout);
1191
1192+#if HAVE_MBRTOWC
1193+ if (MB_CUR_MAX > 1)
1194+ {
1195+ find_field = find_field_multi;
1196+ }
1197+ else
1198+#endif
1199+ {
1200+ find_field = find_field_uni;
1201+ }
1202+
1203+
1204+
1205 skip_chars = 0;
1206 skip_fields = 0;
1207 check_chars = SIZE_MAX;
1208--- coreutils-6.8+/src/fold.c.i18n 2007-02-23 12:01:47.000000000 +0000
1209+++ coreutils-6.8+/src/fold.c 2007-03-01 15:08:24.000000000 +0000
1210@@ -23,11 +23,33 @@
1211 #include <getopt.h>
1212 #include <sys/types.h>
1213
1214+/* Get mbstate_t, mbrtowc(), wcwidth(). */
1215+#if HAVE_WCHAR_H
1216+# include <wchar.h>
1217+#endif
1218+
1219+/* Get iswprint(), iswblank(), wcwidth(). */
1220+#if HAVE_WCTYPE_H
1221+# include <wctype.h>
1222+#endif
1223+
1224 #include "system.h"
1225 #include "error.h"
1226 #include "quote.h"
1227 #include "xstrtol.h"
1228
1229+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
1230+ installation; work around this configuration error. */
1231+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
1232+# undef MB_LEN_MAX
1233+# define MB_LEN_MAX 16
1234+#endif
1235+
1236+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
1237+#if HAVE_MBRTOWC && defined mbstate_t
1238+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
1239+#endif
1240+
1241 #define TAB_WIDTH 8
1242
1243 /* The official name of this program (e.g., no `g' prefix). */
1244@@ -35,23 +57,44 @@
1245
1246 #define AUTHORS "David MacKenzie"
1247
1248+#define FATAL_ERROR(Message) \
1249+ do \
1250+ { \
1251+ error (0, 0, (Message)); \
1252+ usage (2); \
1253+ } \
1254+ while (0)
1255+
1256+enum operating_mode
1257+{
1258+ /* Fold texts by columns that are at the given positions. */
1259+ column_mode,
1260+
1261+ /* Fold texts by bytes that are at the given positions. */
1262+ byte_mode,
1263+
1264+ /* Fold texts by characters that are at the given positions. */
1265+ character_mode,
1266+};
1267+
1268 /* The name this program was run with. */
1269 char *program_name;
1270
1271+/* The argument shows current mode. (Default: column_mode) */
1272+static enum operating_mode operating_mode;
1273+
1274 /* If nonzero, try to break on whitespace. */
1275 static bool break_spaces;
1276
1277-/* If nonzero, count bytes, not column positions. */
1278-static bool count_bytes;
1279-
1280 /* If nonzero, at least one of the files we read was standard input. */
1281 static bool have_read_stdin;
1282
1283-static char const shortopts[] = "bsw:0::1::2::3::4::5::6::7::8::9::";
1284+static char const shortopts[] = "bcsw:0::1::2::3::4::5::6::7::8::9::";
1285
1286 static struct option const longopts[] =
1287 {
1288 {"bytes", no_argument, NULL, 'b'},
1289+ {"characters", no_argument, NULL, 'c'},
1290 {"spaces", no_argument, NULL, 's'},
1291 {"width", required_argument, NULL, 'w'},
1292 {GETOPT_HELP_OPTION_DECL},
1293@@ -81,6 +124,7 @@
1294 "), stdout);
1295 fputs (_("\
1296 -b, --bytes count bytes rather than columns\n\
1297+ -c, --characters count characters rather than columns\n\
1298 -s, --spaces break at spaces\n\
1299 -w, --width=WIDTH use WIDTH columns instead of 80\n\
1300 "), stdout);
1301@@ -98,7 +142,7 @@
1302 static size_t
1303 adjust_column (size_t column, char c)
1304 {
1305- if (!count_bytes)
1306+ if (operating_mode != byte_mode)
1307 {
1308 if (c == '\b')
1309 {
1310@@ -121,30 +165,14 @@
1311 to stdout, with maximum line length WIDTH.
1312 Return true if successful. */
1313
1314-static bool
1315-fold_file (char const *filename, size_t width)
1316+static void
1317+fold_text (FILE *istream, size_t width, int *saved_errno)
1318 {
1319- FILE *istream;
1320 int c;
1321 size_t column = 0; /* Screen column where next char will go. */
1322 size_t offset_out = 0; /* Index in `line_out' for next char. */
1323 static char *line_out = NULL;
1324 static size_t allocated_out = 0;
1325- int saved_errno;
1326-
1327- if (STREQ (filename, "-"))
1328- {
1329- istream = stdin;
1330- have_read_stdin = true;
1331- }
1332- else
1333- istream = fopen (filename, "r");
1334-
1335- if (istream == NULL)
1336- {
1337- error (0, errno, "%s", filename);
1338- return false;
1339- }
1340
1341 while ((c = getc (istream)) != EOF)
1342 {
1343@@ -172,6 +200,15 @@
1344 bool found_blank = false;
1345 size_t logical_end = offset_out;
1346
1347+ /* If LINE_OUT has no wide character,
1348+ put a new wide character in LINE_OUT
1349+ if column is bigger than width. */
1350+ if (offset_out == 0)
1351+ {
1352+ line_out[offset_out++] = c;
1353+ continue;
1354+ }
1355+
1356 /* Look for the last blank. */
1357 while (logical_end)
1358 {
1359@@ -218,11 +255,225 @@
1360 line_out[offset_out++] = c;
1361 }
1362
1363- saved_errno = errno;
1364+ *saved_errno = errno;
1365+
1366+ if (offset_out)
1367+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
1368+
1369+ free(line_out);
1370+}
1371+
1372+#if HAVE_MBRTOWC
1373+static void
1374+fold_multibyte_text (FILE *istream, size_t width, int *saved_errno)
1375+{
1376+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
1377+ size_t buflen = 0; /* The length of the byte sequence in buf. */
1378+ char *bufpos; /* Next read position of BUF. */
1379+ wint_t wc; /* A gotten wide character. */
1380+ size_t mblength; /* The byte size of a multibyte character which shows
1381+ as same character as WC. */
1382+ mbstate_t state, state_bak; /* State of the stream. */
1383+ int convfail; /* 1, when conversion is failed. Otherwise 0. */
1384+
1385+ char *line_out = NULL;
1386+ size_t offset_out = 0; /* Index in `line_out' for next char. */
1387+ size_t allocated_out = 0;
1388+
1389+ int increment;
1390+ size_t column = 0;
1391+
1392+ size_t last_blank_pos;
1393+ size_t last_blank_column;
1394+ int is_blank_seen;
1395+ int last_blank_increment;
1396+ int is_bs_following_last_blank;
1397+ size_t bs_following_last_blank_num;
1398+ int is_cr_after_last_blank;
1399+
1400+#define CLEAR_FLAGS \
1401+ do \
1402+ { \
1403+ last_blank_pos = 0; \
1404+ last_blank_column = 0; \
1405+ is_blank_seen = 0; \
1406+ is_bs_following_last_blank = 0; \
1407+ bs_following_last_blank_num = 0; \
1408+ is_cr_after_last_blank = 0; \
1409+ } \
1410+ while (0)
1411+
1412+#define START_NEW_LINE \
1413+ do \
1414+ { \
1415+ putchar ('\n'); \
1416+ column = 0; \
1417+ offset_out = 0; \
1418+ CLEAR_FLAGS; \
1419+ } \
1420+ while (0)
1421+
1422+ CLEAR_FLAGS;
1423+ memset (&state, '\0', sizeof(mbstate_t));
1424+
1425+ for (;; bufpos += mblength, buflen -= mblength)
1426+ {
1427+ if (buflen < MB_LEN_MAX && !feof (istream) && !ferror (istream))
1428+ {
1429+ memmove (buf, bufpos, buflen);
1430+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, istream);
1431+ bufpos = buf;
1432+ }
1433+
1434+ if (buflen < 1)
1435+ break;
1436+
1437+ /* Get a wide character. */
1438+ convfail = 0;
1439+ state_bak = state;
1440+ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &state);
1441+
1442+ switch (mblength)
1443+ {
1444+ case (size_t)-1:
1445+ case (size_t)-2:
1446+ convfail++;
1447+ state = state_bak;
1448+ /* Fall through. */
1449+
1450+ case 0:
1451+ mblength = 1;
1452+ break;
1453+ }
1454+
1455+rescan:
1456+ if (operating_mode == byte_mode) /* byte mode */
1457+ increment = mblength;
1458+ else if (operating_mode == character_mode) /* character mode */
1459+ increment = 1;
1460+ else /* column mode */
1461+ {
1462+ if (convfail)
1463+ increment = 1;
1464+ else
1465+ {
1466+ switch (wc)
1467+ {
1468+ case L'\n':
1469+ fwrite (line_out, sizeof(char), offset_out, stdout);
1470+ START_NEW_LINE;
1471+ continue;
1472+
1473+ case L'\b':
1474+ increment = (column > 0) ? -1 : 0;
1475+ break;
1476+
1477+ case L'\r':
1478+ increment = -1 * column;
1479+ break;
1480+
1481+ case L'\t':
1482+ increment = 8 - column % 8;
1483+ break;
1484+
1485+ default:
1486+ increment = wcwidth (wc);
1487+ increment = (increment < 0) ? 0 : increment;
1488+ }
1489+ }
1490+ }
1491+
1492+ if (column + increment > width && break_spaces && last_blank_pos)
1493+ {
1494+ fwrite (line_out, sizeof(char), last_blank_pos, stdout);
1495+ putchar ('\n');
1496+
1497+ offset_out = offset_out - last_blank_pos;
1498+ column = column - last_blank_column + ((is_cr_after_last_blank)
1499+ ? last_blank_increment : bs_following_last_blank_num);
1500+ memmove (line_out, line_out + last_blank_pos, offset_out);
1501+ CLEAR_FLAGS;
1502+ goto rescan;
1503+ }
1504+
1505+ if (column + increment > width && column != 0)
1506+ {
1507+ fwrite (line_out, sizeof(char), offset_out, stdout);
1508+ START_NEW_LINE;
1509+ goto rescan;
1510+ }
1511+
1512+ if (allocated_out < offset_out + mblength)
1513+ {
1514+ allocated_out += 1024;
1515+ line_out = xrealloc (line_out, allocated_out);
1516+ }
1517+
1518+ memcpy (line_out + offset_out, bufpos, mblength);
1519+ offset_out += mblength;
1520+ column += increment;
1521+
1522+ if (is_blank_seen && !convfail && wc == L'\r')
1523+ is_cr_after_last_blank = 1;
1524+
1525+ if (is_bs_following_last_blank && !convfail && wc == L'\b')
1526+ ++bs_following_last_blank_num;
1527+ else
1528+ is_bs_following_last_blank = 0;
1529+
1530+ if (break_spaces && !convfail && iswblank (wc))
1531+ {
1532+ last_blank_pos = offset_out;
1533+ last_blank_column = column;
1534+ is_blank_seen = 1;
1535+ last_blank_increment = increment;
1536+ is_bs_following_last_blank = 1;
1537+ bs_following_last_blank_num = 0;
1538+ is_cr_after_last_blank = 0;
1539+ }
1540+ }
1541+
1542+ *saved_errno = errno;
1543
1544 if (offset_out)
1545 fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
1546
1547+ free(line_out);
1548+}
1549+#endif
1550+
1551+/* Fold file FILENAME, or standard input if FILENAME is "-",
1552+ to stdout, with maximum line length WIDTH.
1553+ Return 0 if successful, 1 if an error occurs. */
1554+
1555+static bool
1556+fold_file (char *filename, size_t width)
1557+{
1558+ FILE *istream;
1559+ int saved_errno;
1560+
1561+ if (STREQ (filename, "-"))
1562+ {
1563+ istream = stdin;
1564+ have_read_stdin = 1;
1565+ }
1566+ else
1567+ istream = fopen (filename, "r");
1568+
1569+ if (istream == NULL)
1570+ {
1571+ error (0, errno, "%s", filename);
1572+ return 1;
1573+ }
1574+
1575+ /* Define how ISTREAM is being folded. */
1576+#if HAVE_MBRTOWC
1577+ if (MB_CUR_MAX > 1)
1578+ fold_multibyte_text (istream, width, &saved_errno);
1579+ else
1580+#endif
1581+ fold_text (istream, width, &saved_errno);
1582+
1583 if (ferror (istream))
1584 {
1585 error (0, saved_errno, "%s", filename);
1586@@ -255,7 +506,8 @@
1587
1588 atexit (close_stdout);
1589
1590- break_spaces = count_bytes = have_read_stdin = false;
1591+ operating_mode = column_mode;
1592+ break_spaces = have_read_stdin = false;
1593
1594 while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
1595 {
1596@@ -264,7 +516,15 @@
1597 switch (optc)
1598 {
1599 case 'b': /* Count bytes rather than columns. */
1600- count_bytes = true;
1601+ if (operating_mode != column_mode)
1602+ FATAL_ERROR (_("only one way of folding may be specified"));
1603+ operating_mode = byte_mode;
1604+ break;
1605+
1606+ case 'c':
1607+ if (operating_mode != column_mode)
1608+ FATAL_ERROR (_("only one way of folding may be specified"));
1609+ operating_mode = character_mode;
1610 break;
1611
1612 case 's': /* Break at word boundaries. */
1613--- coreutils-6.8+/src/sort.c.i18n 2007-02-24 11:23:23.000000000 +0000
1614+++ coreutils-6.8+/src/sort.c 2007-03-01 15:10:57.000000000 +0000
1615@@ -23,10 +23,19 @@
1616
1617 #include <config.h>
1618
1619+#include <assert.h>
1620 #include <getopt.h>
1621 #include <sys/types.h>
1622 #include <sys/wait.h>
1623 #include <signal.h>
1624+#if HAVE_WCHAR_H
1625+# include <wchar.h>
1626+#endif
1627+/* Get isw* functions. */
1628+#if HAVE_WCTYPE_H
1629+# include <wctype.h>
1630+#endif
1631+
1632 #include "system.h"
1633 #include "argmatch.h"
1634 #include "error.h"
1635@@ -116,14 +125,38 @@
1636 /* Thousands separator; if -1, then there isn't one. */
1637 static int thousands_sep;
1638
1639+static int force_general_numcompare = 0;
1640+
1641 /* Nonzero if the corresponding locales are hard. */
1642 static bool hard_LC_COLLATE;
1643-#if HAVE_NL_LANGINFO
1644+#if HAVE_LANGINFO_CODESET
1645 static bool hard_LC_TIME;
1646 #endif
1647
1648 #define NONZERO(x) ((x) != 0)
1649
1650+/* get a multibyte character's byte length. */
1651+#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE) \
1652+ do \
1653+ { \
1654+ wchar_t wc; \
1655+ mbstate_t state_bak; \
1656+ \
1657+ state_bak = STATE; \
1658+ mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE); \
1659+ \
1660+ switch (MBLENGTH) \
1661+ { \
1662+ case (size_t)-1: \
1663+ case (size_t)-2: \
1664+ STATE = state_bak; \
1665+ /* Fall through. */ \
1666+ case 0: \
1667+ MBLENGTH = 1; \
1668+ } \
1669+ } \
1670+ while (0)
1671+
1672 /* The kind of blanks for '-b' to skip in various options. */
1673 enum blanktype { bl_start, bl_end, bl_both };
1674
1675@@ -261,13 +294,11 @@
1676 they were read if all keys compare equal. */
1677 static bool stable;
1678
1679-/* If TAB has this value, blanks separate fields. */
1680-enum { TAB_DEFAULT = CHAR_MAX + 1 };
1681-
1682-/* Tab character separating fields. If TAB_DEFAULT, then fields are
1683+/* Tab character separating fields. If tab_length is 0, then fields are
1684 separated by the empty string between a non-blank character and a blank
1685 character. */
1686-static int tab = TAB_DEFAULT;
1687+static char tab[MB_LEN_MAX + 1];
1688+static size_t tab_length = 0;
1689
1690 /* Flag to remove consecutive duplicate lines from the output.
1691 Only the last of a sequence of equal lines will be output. */
1692@@ -639,6 +670,44 @@
1693 update_proc (pid);
1694 }
1695
1696+/* Function pointers. */
1697+static void
1698+(*inittables) (void);
1699+static char *
1700+(*begfield) (const struct line*, const struct keyfield *);
1701+static char *
1702+(*limfield) (const struct line*, const struct keyfield *);
1703+static int
1704+(*getmonth) (char const *, size_t);
1705+static int
1706+(*keycompare) (const struct line *, const struct line *);
1707+static int
1708+(*numcompare) (const char *, const char *);
1709+
1710+/* Test for white space multibyte character.
1711+ Set LENGTH the byte length of investigated multibyte character. */
1712+#if HAVE_MBRTOWC
1713+static int
1714+ismbblank (const char *str, size_t len, size_t *length)
1715+{
1716+ size_t mblength;
1717+ wchar_t wc;
1718+ mbstate_t state;
1719+
1720+ memset (&state, '\0', sizeof(mbstate_t));
1721+ mblength = mbrtowc (&wc, str, len, &state);
1722+
1723+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
1724+ {
1725+ *length = 1;
1726+ return 0;
1727+ }
1728+
1729+ *length = (mblength < 1) ? 1 : mblength;
1730+ return iswblank (wc);
1731+}
1732+#endif
1733+
1734 /* Clean up any remaining temporary files. */
1735
1736 static void
1737@@ -978,7 +1047,7 @@
1738 free (node);
1739 }
1740
1741-#if HAVE_NL_LANGINFO
1742+#if HAVE_LANGINFO_CODESET
1743
1744 static int
1745 struct_month_cmp (const void *m1, const void *m2)
1746@@ -993,7 +1062,7 @@
1747 /* Initialize the character class tables. */
1748
1749 static void
1750-inittables (void)
1751+inittables_uni (void)
1752 {
1753 size_t i;
1754
1755@@ -1005,7 +1074,7 @@
1756 fold_toupper[i] = toupper (i);
1757 }
1758
1759-#if HAVE_NL_LANGINFO
1760+#if HAVE_LANGINFO_CODESET
1761 /* If we're not in the "C" locale, read different names for months. */
1762 if (hard_LC_TIME)
1763 {
1764@@ -1031,6 +1100,64 @@
1765 #endif
1766 }
1767
1768+#if HAVE_MBRTOWC
1769+static void
1770+inittables_mb (void)
1771+{
1772+ int i, j, k, l;
1773+ char *name, *s;
1774+ size_t s_len, mblength;
1775+ char mbc[MB_LEN_MAX];
1776+ wchar_t wc, pwc;
1777+ mbstate_t state_mb, state_wc;
1778+
1779+ for (i = 0; i < MONTHS_PER_YEAR; i++)
1780+ {
1781+ s = (char *) nl_langinfo (ABMON_1 + i);
1782+ s_len = strlen (s);
1783+ monthtab[i].name = name = (char *) xmalloc (s_len + 1);
1784+ monthtab[i].val = i + 1;
1785+
1786+ memset (&state_mb, '\0', sizeof (mbstate_t));
1787+ memset (&state_wc, '\0', sizeof (mbstate_t));
1788+
1789+ for (j = 0; j < s_len;)
1790+ {
1791+ if (!ismbblank (s + j, s_len - j, &mblength))
1792+ break;
1793+ j += mblength;
1794+ }
1795+
1796+ for (k = 0; j < s_len;)
1797+ {
1798+ mblength = mbrtowc (&wc, (s + j), (s_len - j), &state_mb);
1799+ assert (mblength != (size_t)-1 && mblength != (size_t)-2);
1800+ if (mblength == 0)
1801+ break;
1802+
1803+ pwc = towupper (wc);
1804+ if (pwc == wc)
1805+ {
1806+ memcpy (mbc, s + j, mblength);
1807+ j += mblength;
1808+ }
1809+ else
1810+ {
1811+ j += mblength;
1812+ mblength = wcrtomb (mbc, pwc, &state_wc);
1813+ assert (mblength != (size_t)0 && mblength != (size_t)-1);
1814+ }
1815+
1816+ for (l = 0; l < mblength; l++)
1817+ name[k++] = mbc[l];
1818+ }
1819+ name[k] = '\0';
1820+ }
1821+ qsort ((void *) monthtab, MONTHS_PER_YEAR,
1822+ sizeof (struct month), struct_month_cmp);
1823+}
1824+#endif
1825+
1826 /* Specify the amount of main memory to use when sorting. */
1827 static void
1828 specify_sort_size (char const *s)
1829@@ -1241,7 +1368,7 @@
1830 by KEY in LINE. */
1831
1832 static char *
1833-begfield (const struct line *line, const struct keyfield *key)
1834+begfield_uni (const struct line *line, const struct keyfield *key)
1835 {
1836 char *ptr = line->text, *lim = ptr + line->length - 1;
1837 size_t sword = key->sword;
1838@@ -1251,10 +1378,10 @@
1839 /* The leading field separator itself is included in a field when -t
1840 is absent. */
1841
1842- if (tab != TAB_DEFAULT)
1843+ if (tab_length)
1844 while (ptr < lim && sword--)
1845 {
1846- while (ptr < lim && *ptr != tab)
1847+ while (ptr < lim && *ptr != tab[0])
1848 ++ptr;
1849 if (ptr < lim)
1850 ++ptr;
1851@@ -1282,11 +1409,70 @@
1852 return ptr;
1853 }
1854
1855+#if HAVE_MBRTOWC
1856+static char *
1857+begfield_mb (const struct line *line, const struct keyfield *key)
1858+{
1859+ int i;
1860+ char *ptr = line->text, *lim = ptr + line->length - 1;
1861+ size_t sword = key->sword;
1862+ size_t schar = key->schar;
1863+ size_t mblength;
1864+ mbstate_t state;
1865+
1866+ memset (&state, '\0', sizeof(mbstate_t));
1867+
1868+ if (tab_length)
1869+ while (ptr < lim && sword--)
1870+ {
1871+ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
1872+ {
1873+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1874+ ptr += mblength;
1875+ }
1876+ if (ptr < lim)
1877+ {
1878+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1879+ ptr += mblength;
1880+ }
1881+ }
1882+ else
1883+ while (ptr < lim && sword--)
1884+ {
1885+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
1886+ ptr += mblength;
1887+ if (ptr < lim)
1888+ {
1889+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1890+ ptr += mblength;
1891+ }
1892+ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
1893+ ptr += mblength;
1894+ }
1895+
1896+ if (key->skipsblanks)
1897+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
1898+ ptr += mblength;
1899+
1900+ for (i = 0; i < schar; i++)
1901+ {
1902+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1903+
1904+ if (ptr + mblength > lim)
1905+ break;
1906+ else
1907+ ptr += mblength;
1908+ }
1909+
1910+ return ptr;
1911+}
1912+#endif
1913+
1914 /* Return the limit of (a pointer to the first character after) the field
1915 in LINE specified by KEY. */
1916
1917 static char *
1918-limfield (const struct line *line, const struct keyfield *key)
1919+limfield_uni (const struct line *line, const struct keyfield *key)
1920 {
1921 char *ptr = line->text, *lim = ptr + line->length - 1;
1922 size_t eword = key->eword, echar = key->echar;
1923@@ -1299,10 +1485,10 @@
1924 `beginning' is the first character following the delimiting TAB.
1925 Otherwise, leave PTR pointing at the first `blank' character after
1926 the preceding field. */
1927- if (tab != TAB_DEFAULT)
1928+ if (tab_length)
1929 while (ptr < lim && eword--)
1930 {
1931- while (ptr < lim && *ptr != tab)
1932+ while (ptr < lim && *ptr != tab[0])
1933 ++ptr;
1934 if (ptr < lim && (eword | echar))
1935 ++ptr;
1936@@ -1348,10 +1534,10 @@
1937 */
1938
1939 /* Make LIM point to the end of (one byte past) the current field. */
1940- if (tab != TAB_DEFAULT)
1941+ if (tab_length)
1942 {
1943 char *newlim;
1944- newlim = memchr (ptr, tab, lim - ptr);
1945+ newlim = memchr (ptr, tab[0], lim - ptr);
1946 if (newlim)
1947 lim = newlim;
1948 }
1949@@ -1384,6 +1570,107 @@
1950 return ptr;
1951 }
1952
1953+#if HAVE_MBRTOWC
1954+static char *
1955+limfield_mb (const struct line *line, const struct keyfield *key)
1956+{
1957+ char *ptr = line->text, *lim = ptr + line->length - 1;
1958+ size_t eword = key->eword, echar = key->echar;
1959+ int i;
1960+ size_t mblength;
1961+ mbstate_t state;
1962+
1963+ memset (&state, '\0', sizeof(mbstate_t));
1964+
1965+ if (tab_length)
1966+ while (ptr < lim && eword--)
1967+ {
1968+ while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
1969+ {
1970+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1971+ ptr += mblength;
1972+ }
1973+ if (ptr < lim && (eword | echar))
1974+ {
1975+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1976+ ptr += mblength;
1977+ }
1978+ }
1979+ else
1980+ while (ptr < lim && eword--)
1981+ {
1982+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
1983+ ptr += mblength;
1984+ if (ptr < lim)
1985+ {
1986+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
1987+ ptr += mblength;
1988+ }
1989+ while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
1990+ ptr += mblength;
1991+ }
1992+
1993+
1994+# ifdef POSIX_UNSPECIFIED
1995+ /* Make LIM point to the end of (one byte past) the current field. */
1996+ if (tab_length)
1997+ {
1998+ char *newlim, *p;
1999+
2000+ newlim = NULL;
2001+ for (p = ptr; p < lim;)
2002+ {
2003+ if (memcmp (p, tab, tab_length) == 0)
2004+ {
2005+ newlim = p;
2006+ break;
2007+ }
2008+
2009+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
2010+ p += mblength;
2011+ }
2012+ }
2013+ else
2014+ {
2015+ char *newlim;
2016+ newlim = ptr;
2017+
2018+ while (newlim < lim && ismbblank (newlim, lim - newlim, &mblength))
2019+ newlim += mblength;
2020+ if (ptr < lim)
2021+ {
2022+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
2023+ ptr += mblength;
2024+ }
2025+ while (newlim < lim && !ismbblank (newlim, lim - newlim, &mblength))
2026+ newlim += mblength;
2027+ lim = newlim;
2028+ }
2029+# endif
2030+
2031+ /* If we're skipping leading blanks, don't start counting characters
2032+ * until after skipping past any leading blanks. */
2033+ if (key->skipsblanks)
2034+ while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
2035+ ptr += mblength;
2036+
2037+ memset (&state, '\0', sizeof(mbstate_t));
2038+
2039+ /* Advance PTR by ECHAR (if possible), but no further than LIM. */
2040+ for (i = 0; i < echar; i++)
2041+ {
2042+ GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
2043+
2044+ if (ptr + mblength > lim)
2045+ break;
2046+ else
2047+ ptr += mblength;
2048+ }
2049+
2050+ return ptr;
2051+}
2052+#endif
2053+
2054 /* Fill BUF reading from FP, moving buf->left bytes from the end
2055 of buf->buf to the beginning first. If EOF is reached and the
2056 file wasn't terminated by a newline, supply one. Set up BUF's line
2057@@ -1466,8 +1753,24 @@
2058 else
2059 {
2060 if (key->skipsblanks)
2061- while (blanks[to_uchar (*line_start)])
2062- line_start++;
2063+ {
2064+#if HAVE_MBRTOWC
2065+ if (MB_CUR_MAX > 1)
2066+ {
2067+ size_t mblength;
2068+ mbstate_t state;
2069+ memset (&state, '\0', sizeof(mbstate_t));
2070+ while (line_start < line->keylim &&
2071+ ismbblank (line_start,
2072+ line->keylim - line_start,
2073+ &mblength))
2074+ line_start += mblength;
2075+ }
2076+ else
2077+#endif
2078+ while (blanks[to_uchar (*line_start)])
2079+ line_start++;
2080+ }
2081 line->keybeg = line_start;
2082 }
2083 }
2084@@ -1500,7 +1803,7 @@
2085 hideously fast. */
2086
2087 static int
2088-numcompare (const char *a, const char *b)
2089+numcompare_uni (const char *a, const char *b)
2090 {
2091 while (blanks[to_uchar (*a)])
2092 a++;
2093@@ -1510,6 +1813,25 @@
2094 return strnumcmp (a, b, decimal_point, thousands_sep);
2095 }
2096
2097+#if HAVE_MBRTOWC
2098+static int
2099+numcompare_mb (const char *a, const char *b)
2100+{
2101+ size_t mblength, len;
2102+ len = strlen (a); /* okay for UTF-8 */
2103+ while (*a && ismbblank (a, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
2104+ {
2105+ a += mblength;
2106+ len -= mblength;
2107+ }
2108+ len = strlen (b); /* okay for UTF-8 */
2109+ while (*b && ismbblank (b, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
2110+ b += mblength;
2111+
2112+ return strnumcmp (a, b, decimal_point, thousands_sep);
2113+}
2114+#endif /* HAV_EMBRTOWC */
2115+
2116 static int
2117 general_numcompare (const char *sa, const char *sb)
2118 {
2119@@ -1543,7 +1865,7 @@
2120 Return 0 if the name in S is not recognized. */
2121
2122 static int
2123-getmonth (char const *month, size_t len)
2124+getmonth_uni (char const *month, size_t len)
2125 {
2126 size_t lo = 0;
2127 size_t hi = MONTHS_PER_YEAR;
2128@@ -1698,11 +2020,79 @@
2129 return diff;
2130 }
2131
2132+#if HAVE_MBRTOWC
2133+static int
2134+getmonth_mb (const char *s, size_t len)
2135+{
2136+ char *month;
2137+ register size_t i;
2138+ register int lo = 0, hi = MONTHS_PER_YEAR, result;
2139+ char *tmp;
2140+ size_t wclength, mblength;
2141+ const char **pp;
2142+ const wchar_t **wpp;
2143+ wchar_t *month_wcs;
2144+ mbstate_t state;
2145+
2146+ while (len > 0 && ismbblank (s, len, &mblength))
2147+ {
2148+ s += mblength;
2149+ len -= mblength;
2150+ }
2151+
2152+ if (len == 0)
2153+ return 0;
2154+
2155+ month = (char *) alloca (len + 1);
2156+
2157+ tmp = (char *) alloca (len + 1);
2158+ memcpy (tmp, s, len);
2159+ tmp[len] = '\0';
2160+ pp = (const char **)&tmp;
2161+ month_wcs = (wchar_t *) alloca ((len + 1) * sizeof (wchar_t));
2162+ memset (&state, '\0', sizeof(mbstate_t));
2163+
2164+ wclength = mbsrtowcs (month_wcs, pp, len + 1, &state);
2165+ assert (wclength != (size_t)-1 && *pp == NULL);
2166+
2167+ for (i = 0; i < wclength; i++)
2168+ {
2169+ month_wcs[i] = towupper(month_wcs[i]);
2170+ if (iswblank (month_wcs[i]))
2171+ {
2172+ month_wcs[i] = L'\0';
2173+ break;
2174+ }
2175+ }
2176+
2177+ wpp = (const wchar_t **)&month_wcs;
2178+
2179+ mblength = wcsrtombs (month, wpp, len + 1, &state);
2180+ assert (mblength != (-1) && *wpp == NULL);
2181+
2182+ do
2183+ {
2184+ int ix = (lo + hi) / 2;
2185+
2186+ if (strncmp (month, monthtab[ix].name, strlen (monthtab[ix].name)) < 0)
2187+ hi = ix;
2188+ else
2189+ lo = ix;
2190+ }
2191+ while (hi - lo > 1);
2192+
2193+ result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name))
2194+ ? monthtab[lo].val : 0);
2195+
2196+ return result;
2197+}
2198+#endif
2199+
2200 /* Compare two lines A and B trying every key in sequence until there
2201 are no more keys or a difference is found. */
2202
2203 static int
2204-keycompare (const struct line *a, const struct line *b)
2205+keycompare_uni (const struct line *a, const struct line *b)
2206 {
2207 struct keyfield const *key = keylist;
2208
2209@@ -1875,6 +2265,179 @@
2210 return key->reverse ? -diff : diff;
2211 }
2212
2213+#if HAVE_MBRTOWC
2214+static int
2215+keycompare_mb (const struct line *a, const struct line *b)
2216+{
2217+ struct keyfield *key = keylist;
2218+
2219+ /* For the first iteration only, the key positions have been
2220+ precomputed for us. */
2221+ char *texta = a->keybeg;
2222+ char *textb = b->keybeg;
2223+ char *lima = a->keylim;
2224+ char *limb = b->keylim;
2225+
2226+ size_t mblength_a, mblength_b;
2227+ wchar_t wc_a, wc_b;
2228+ mbstate_t state_a, state_b;
2229+
2230+ int diff;
2231+
2232+ memset (&state_a, '\0', sizeof(mbstate_t));
2233+ memset (&state_b, '\0', sizeof(mbstate_t));
2234+
2235+ for (;;)
2236+ {
2237+ unsigned char *translate = (unsigned char *) key->translate;
2238+ bool const *ignore = key->ignore;
2239+
2240+ /* Find the lengths. */
2241+ size_t lena = lima <= texta ? 0 : lima - texta;
2242+ size_t lenb = limb <= textb ? 0 : limb - textb;
2243+
2244+ /* Actually compare the fields. */
2245+ if (key->random)
2246+ diff = compare_random (texta, lena, textb, lenb);
2247+ else if (key->numeric | key->general_numeric)
2248+ {
2249+ char savea = *lima, saveb = *limb;
2250+
2251+ *lima = *limb = '\0';
2252+ if (force_general_numcompare)
2253+ diff = general_numcompare (texta, textb);
2254+ else
2255+ diff = ((key->numeric ? numcompare : general_numcompare)
2256+ (texta, textb));
2257+ *lima = savea, *limb = saveb;
2258+ }
2259+ else if (key->month)
2260+ diff = getmonth (texta, lena) - getmonth (textb, lenb);
2261+ else
2262+ {
2263+ if (ignore || translate)
2264+ {
2265+ char *copy_a = (char *) alloca (lena + 1 + lenb + 1);
2266+ char *copy_b = copy_a + lena + 1;
2267+ size_t new_len_a, new_len_b;
2268+ size_t i, j;
2269+
2270+ /* Ignore and/or translate chars before comparing. */
2271+# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE) \
2272+ do \
2273+ { \
2274+ wchar_t uwc; \
2275+ char mbc[MB_LEN_MAX]; \
2276+ mbstate_t state_wc; \
2277+ \
2278+ for (NEW_LEN = i = 0; i < LEN;) \
2279+ { \
2280+ mbstate_t state_bak; \
2281+ \
2282+ state_bak = STATE; \
2283+ MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE); \
2284+ \
2285+ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1 \
2286+ || MBLENGTH == 0) \
2287+ { \
2288+ if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1) \
2289+ STATE = state_bak; \
2290+ if (!ignore) \
2291+ COPY[NEW_LEN++] = TEXT[i++]; \
2292+ continue; \
2293+ } \
2294+ \
2295+ if (ignore) \
2296+ { \
2297+ if ((ignore == nonprinting && !iswprint (WC)) \
2298+ || (ignore == nondictionary \
2299+ && !iswalnum (WC) && !iswblank (WC))) \
2300+ { \
2301+ i += MBLENGTH; \
2302+ continue; \
2303+ } \
2304+ } \
2305+ \
2306+ if (translate) \
2307+ { \
2308+ \
2309+ uwc = towupper(WC); \
2310+ if (WC == uwc) \
2311+ { \
2312+ memcpy (mbc, TEXT + i, MBLENGTH); \
2313+ i += MBLENGTH; \
2314+ } \
2315+ else \
2316+ { \
2317+ i += MBLENGTH; \
2318+ WC = uwc; \
2319+ memset (&state_wc, '\0', sizeof (mbstate_t)); \
2320+ \
2321+ MBLENGTH = wcrtomb (mbc, WC, &state_wc); \
2322+ assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0); \
2323+ } \
2324+ \
2325+ for (j = 0; j < MBLENGTH; j++) \
2326+ COPY[NEW_LEN++] = mbc[j]; \
2327+ } \
2328+ else \
2329+ for (j = 0; j < MBLENGTH; j++) \
2330+ COPY[NEW_LEN++] = TEXT[i++]; \
2331+ } \
2332+ COPY[NEW_LEN] = '\0'; \
2333+ } \
2334+ while (0)
2335+ IGNORE_CHARS (new_len_a, lena, texta, copy_a,
2336+ wc_a, mblength_a, state_a);
2337+ IGNORE_CHARS (new_len_b, lenb, textb, copy_b,
2338+ wc_b, mblength_b, state_b);
2339+ diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b);
2340+ }
2341+ else if (lena == 0)
2342+ diff = - NONZERO (lenb);
2343+ else if (lenb == 0)
2344+ goto greater;
2345+ else
2346+ diff = xmemcoll (texta, lena, textb, lenb);
2347+ }
2348+
2349+ if (diff)
2350+ goto not_equal;
2351+
2352+ key = key->next;
2353+ if (! key)
2354+ break;
2355+
2356+ /* Find the beginning and limit of the next field. */
2357+ if (key->eword != -1)
2358+ lima = limfield (a, key), limb = limfield (b, key);
2359+ else
2360+ lima = a->text + a->length - 1, limb = b->text + b->length - 1;
2361+
2362+ if (key->sword != -1)
2363+ texta = begfield (a, key), textb = begfield (b, key);
2364+ else
2365+ {
2366+ texta = a->text, textb = b->text;
2367+ if (key->skipsblanks)
2368+ {
2369+ while (texta < lima && ismbblank (texta, lima - texta, &mblength_a))
2370+ texta += mblength_a;
2371+ while (textb < limb && ismbblank (textb, limb - textb, &mblength_b))
2372+ textb += mblength_b;
2373+ }
2374+ }
2375+ }
2376+
2377+ return 0;
2378+
2379+greater:
2380+ diff = 1;
2381+not_equal:
2382+ return key->reverse ? -diff : diff;
2383+}
2384+#endif
2385+
2386 /* Compare two lines A and B, returning negative, zero, or positive
2387 depending on whether A compares less than, equal to, or greater than B. */
2388
2389@@ -2744,7 +3305,7 @@
2390 initialize_exit_failure (SORT_FAILURE);
2391
2392 hard_LC_COLLATE = hard_locale (LC_COLLATE);
2393-#if HAVE_NL_LANGINFO
2394+#if HAVE_LANGINFO_CODESET
2395 hard_LC_TIME = hard_locale (LC_TIME);
2396 #endif
2397
2398@@ -2765,6 +3326,27 @@
2399 thousands_sep = -1;
2400 }
2401
2402+#if HAVE_MBRTOWC
2403+ if (MB_CUR_MAX > 1)
2404+ {
2405+ inittables = inittables_mb;
2406+ begfield = begfield_mb;
2407+ limfield = limfield_mb;
2408+ getmonth = getmonth_mb;
2409+ keycompare = keycompare_mb;
2410+ numcompare = numcompare_mb;
2411+ }
2412+ else
2413+#endif
2414+ {
2415+ inittables = inittables_uni;
2416+ begfield = begfield_uni;
2417+ limfield = limfield_uni;
2418+ getmonth = getmonth_uni;
2419+ keycompare = keycompare_uni;
2420+ numcompare = numcompare_uni;
2421+ }
2422+
2423 have_read_stdin = false;
2424 inittables ();
2425
2426@@ -3015,13 +3597,35 @@
2427
2428 case 't':
2429 {
2430- char newtab = optarg[0];
2431- if (! newtab)
2432+ char newtab[MB_LEN_MAX + 1];
2433+ size_t newtab_length = 1;
2434+ strncpy (newtab, optarg, MB_LEN_MAX);
2435+ if (! newtab[0])
2436 error (SORT_FAILURE, 0, _("empty tab"));
2437- if (optarg[1])
2438+#if HAVE_MBRTOWC
2439+ if (MB_CUR_MAX > 1)
2440+ {
2441+ wchar_t wc;
2442+ mbstate_t state;
2443+ size_t i;
2444+
2445+ memset (&state, '\0', sizeof (mbstate_t));
2446+ newtab_length = mbrtowc (&wc, newtab, strnlen (newtab,
2447+ MB_LEN_MAX),
2448+ &state);
2449+ switch (newtab_length)
2450+ {
2451+ case (size_t) -1:
2452+ case (size_t) -2:
2453+ case 0:
2454+ newtab_length = 1;
2455+ }
2456+ }
2457+#endif
2458+ if (newtab_length == 1 && optarg[1])
2459 {
2460 if (STREQ (optarg, "\\0"))
2461- newtab = '\0';
2462+ newtab[0] = '\0';
2463 else
2464 {
2465 /* Provoke with `sort -txx'. Complain about
2466@@ -3032,9 +3636,12 @@
2467 quote (optarg));
2468 }
2469 }
2470- if (tab != TAB_DEFAULT && tab != newtab)
2471+ if (tab_length
2472+ && (tab_length != newtab_length
2473+ || memcmp (tab, newtab, tab_length) != 0))
2474 error (SORT_FAILURE, 0, _("incompatible tabs"));
2475- tab = newtab;
2476+ memcpy (tab, newtab, newtab_length);
2477+ tab_length = newtab_length;
2478 }
2479 break;
2480
2481--- coreutils-6.8+/src/unexpand.c.i18n 2007-01-14 15:41:28.000000000 +0000
2482+++ coreutils-6.8+/src/unexpand.c 2007-03-01 15:08:24.000000000 +0000
2483@@ -39,11 +39,28 @@
2484 #include <stdio.h>
2485 #include <getopt.h>
2486 #include <sys/types.h>
2487+
2488+/* Get mbstate_t, mbrtowc(), wcwidth(). */
2489+#if HAVE_WCHAR_H
2490+# include <wchar.h>
2491+#endif
2492+
2493 #include "system.h"
2494 #include "error.h"
2495 #include "quote.h"
2496 #include "xstrndup.h"
2497
2498+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
2499+ installation; work around this configuration error. */
2500+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
2501+# define MB_LEN_MAX 16
2502+#endif
2503+
2504+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
2505+#if HAVE_MBRTOWC && defined mbstate_t
2506+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
2507+#endif
2508+
2509 /* The official name of this program (e.g., no `g' prefix). */
2510 #define PROGRAM_NAME "unexpand"
2511
2512@@ -110,6 +127,208 @@
2513 {NULL, 0, NULL, 0}
2514 };
2515
2516+static FILE *next_file (FILE *fp);
2517+
2518+#if HAVE_MBRTOWC
2519+static void
2520+unexpand_multibyte (void)
2521+{
2522+ FILE *fp; /* Input stream. */
2523+ mbstate_t i_state; /* Current shift state of the input stream. */
2524+ mbstate_t i_state_bak; /* Back up the I_STATE. */
2525+ mbstate_t o_state; /* Current shift state of the output stream. */
2526+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
2527+ char *bufpos; /* Next read position of BUF. */
2528+ size_t buflen = 0; /* The length of the byte sequence in buf. */
2529+ wint_t wc; /* A gotten wide character. */
2530+ size_t mblength; /* The byte size of a multibyte character
2531+ which shows as same character as WC. */
2532+
2533+ /* Index in `tab_list' of next tabstop: */
2534+ int tab_index = 0; /* For calculating width of pending tabs. */
2535+ int print_tab_index = 0; /* For printing as many tabs as possible. */
2536+ unsigned int column = 0; /* Column on screen of next char. */
2537+ int next_tab_column; /* Column the next tab stop is on. */
2538+ int convert = 1; /* If nonzero, perform translations. */
2539+ unsigned int pending = 0; /* Pending columns of blanks. */
2540+
2541+ fp = next_file ((FILE *) NULL);
2542+ if (fp == NULL)
2543+ return;
2544+
2545+ memset (&o_state, '\0', sizeof(mbstate_t));
2546+ memset (&i_state, '\0', sizeof(mbstate_t));
2547+
2548+ for (;;)
2549+ {
2550+ if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
2551+ {
2552+ memmove (buf, bufpos, buflen);
2553+ buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
2554+ bufpos = buf;
2555+ }
2556+
2557+ /* Get a wide character. */
2558+ if (buflen < 1)
2559+ {
2560+ mblength = 1;
2561+ wc = WEOF;
2562+ }
2563+ else
2564+ {
2565+ i_state_bak = i_state;
2566+ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &i_state);
2567+ }
2568+
2569+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
2570+ {
2571+ i_state = i_state_bak;
2572+ wc = L'\0';
2573+ }
2574+
2575+ if (wc == L' ' && convert && column < INT_MAX)
2576+ {
2577+ ++pending;
2578+ ++column;
2579+ }
2580+ else if (wc == L'\t' && convert)
2581+ {
2582+ if (tab_size == 0)
2583+ {
2584+ /* Do not let tab_index == first_free_tab;
2585+ stop when it is 1 less. */
2586+ while (tab_index < first_free_tab - 1
2587+ && column >= tab_list[tab_index])
2588+ tab_index++;
2589+ next_tab_column = tab_list[tab_index];
2590+ if (tab_index < first_free_tab - 1)
2591+ tab_index++;
2592+ if (column >= next_tab_column)
2593+ {
2594+ convert = 0; /* Ran out of tab stops. */
2595+ goto flush_pend_mb;
2596+ }
2597+ }
2598+ else
2599+ {
2600+ next_tab_column = column + tab_size - column % tab_size;
2601+ }
2602+ pending += next_tab_column - column;
2603+ column = next_tab_column;
2604+ }
2605+ else
2606+ {
2607+flush_pend_mb:
2608+ /* Flush pending spaces. Print as many tabs as possible,
2609+ then print the rest as spaces. */
2610+ if (pending == 1)
2611+ {
2612+ putchar (' ');
2613+ pending = 0;
2614+ }
2615+ column -= pending;
2616+ while (pending > 0)
2617+ {
2618+ if (tab_size == 0)
2619+ {
2620+ /* Do not let print_tab_index == first_free_tab;
2621+ stop when it is 1 less. */
2622+ while (print_tab_index < first_free_tab - 1
2623+ && column >= tab_list[print_tab_index])
2624+ print_tab_index++;
2625+ next_tab_column = tab_list[print_tab_index];
2626+ if (print_tab_index < first_free_tab - 1)
2627+ print_tab_index++;
2628+ }
2629+ else
2630+ {
2631+ next_tab_column =
2632+ column + tab_size - column % tab_size;
2633+ }
2634+ if (next_tab_column - column <= pending)
2635+ {
2636+ putchar ('\t');
2637+ pending -= next_tab_column - column;
2638+ column = next_tab_column;
2639+ }
2640+ else
2641+ {
2642+ --print_tab_index;
2643+ column += pending;
2644+ while (pending != 0)
2645+ {
2646+ putchar (' ');
2647+ pending--;
2648+ }
2649+ }
2650+ }
2651+
2652+ if (wc == WEOF)
2653+ {
2654+ fp = next_file (fp);
2655+ if (fp == NULL)
2656+ break; /* No more files. */
2657+ else
2658+ {
2659+ memset (&i_state, '\0', sizeof(mbstate_t));
2660+ continue;
2661+ }
2662+ }
2663+
2664+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
2665+ {
2666+ if (convert)
2667+ {
2668+ ++column;
2669+ if (convert_entire_line == 0)
2670+ convert = 0;
2671+ }
2672+ mblength = 1;
2673+ putchar (buf[0]);
2674+ }
2675+ else if (mblength == 0)
2676+ {
2677+ if (convert && convert_entire_line == 0)
2678+ convert = 0;
2679+ mblength = 1;
2680+ putchar ('\0');
2681+ }
2682+ else
2683+ {
2684+ if (convert)
2685+ {
2686+ if (wc == L'\b')
2687+ {
2688+ if (column > 0)
2689+ --column;
2690+ }
2691+ else
2692+ {
2693+ int width; /* The width of WC. */
2694+
2695+ width = wcwidth (wc);
2696+ column += (width > 0) ? width : 0;
2697+ if (convert_entire_line == 0)
2698+ convert = 0;
2699+ }
2700+ }
2701+
2702+ if (wc == L'\n')
2703+ {
2704+ tab_index = print_tab_index = 0;
2705+ column = pending = 0;
2706+ convert = 1;
2707+ }
2708+ fwrite (bufpos, sizeof(char), mblength, stdout);
2709+ }
2710+ }
2711+ buflen -= mblength;
2712+ bufpos += mblength;
2713+ }
2714+}
2715+#endif
2716+
2717+
2718 void
2719 usage (int status)
2720 {
2721@@ -531,7 +750,12 @@
2722
2723 file_list = (optind < argc ? &argv[optind] : stdin_argv);
2724
2725- unexpand ();
2726+#if HAVE_MBRTOWC
2727+ if (MB_CUR_MAX > 1)
2728+ unexpand_multibyte ();
2729+ else
2730+#endif
2731+ unexpand ();
2732
2733 if (have_read_stdin && fclose (stdin) != 0)
2734 error (EXIT_FAILURE, errno, "-");
2735--- coreutils-6.8+/src/pr.c.i18n 2007-01-14 15:41:28.000000000 +0000
2736+++ coreutils-6.8+/src/pr.c 2007-03-01 15:08:24.000000000 +0000
2737@@ -313,6 +313,32 @@
2738
2739 #include <getopt.h>
2740 #include <sys/types.h>
2741+
2742+/* Get MB_LEN_MAX. */
2743+#include <limits.h>
2744+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
2745+ installation; work around this configuration error. */
2746+#if !defined MB_LEN_MAX || MB_LEN_MAX == 1
2747+# define MB_LEN_MAX 16
2748+#endif
2749+
2750+/* Get MB_CUR_MAX. */
2751+#include <stdlib.h>
2752+
2753+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
2754+/* Get mbstate_t, mbrtowc(), wcwidth(). */
2755+#if HAVE_WCHAR_H
2756+# include <wchar.h>
2757+#endif
2758+
2759+/* Get iswprint(). -- for wcwidth(). */
2760+#if HAVE_WCTYPE_H
2761+# include <wctype.h>
2762+#endif
2763+#if !defined iswprint && !HAVE_ISWPRINT
2764+# define iswprint(wc) 1
2765+#endif
2766+
2767 #include "system.h"
2768 #include "error.h"
2769 #include "hard-locale.h"
2770@@ -324,6 +350,18 @@
2771 #include "strftime.h"
2772 #include "xstrtol.h"
2773
2774+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
2775+#if HAVE_MBRTOWC && defined mbstate_t
2776+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
2777+#endif
2778+
2779+#ifndef HAVE_DECL_WCWIDTH
2780+"this configure-time declaration test was not run"
2781+#endif
2782+#if !HAVE_DECL_WCWIDTH
2783+extern int wcwidth ();
2784+#endif
2785+
2786 /* The official name of this program (e.g., no `g' prefix). */
2787 #define PROGRAM_NAME "pr"
2788
2789@@ -416,7 +454,20 @@
2790
2791 #define NULLCOL (COLUMN *)0
2792
2793-static int char_to_clump (char c);
2794+/* Funtion pointers to switch functions for single byte locale or for
2795+ multibyte locale. If multibyte functions do not exist in your sysytem,
2796+ these pointers always point the function for single byte locale. */
2797+static void (*print_char) (char c);
2798+static int (*char_to_clump) (char c);
2799+
2800+/* Functions for single byte locale. */
2801+static void print_char_single (char c);
2802+static int char_to_clump_single (char c);
2803+
2804+/* Functions for multibyte locale. */
2805+static void print_char_multi (char c);
2806+static int char_to_clump_multi (char c);
2807+
2808 static bool read_line (COLUMN *p);
2809 static bool print_page (void);
2810 static bool print_stored (COLUMN *p);
2811@@ -426,6 +477,7 @@
2812 static void pad_across_to (int position);
2813 static void add_line_number (COLUMN *p);
2814 static void getoptarg (char *arg, char switch_char, char *character,
2815+ int *character_length, int *character_width,
2816 int *number);
2817 void usage (int status);
2818 static void print_files (int number_of_files, char **av);
2819@@ -440,7 +492,6 @@
2820 static void pad_down (int lines);
2821 static void read_rest_of_line (COLUMN *p);
2822 static void skip_read (COLUMN *p, int column_number);
2823-static void print_char (char c);
2824 static void cleanup (void);
2825 static void print_sep_string (void);
2826 static void separator_string (const char *optarg_S);
2827@@ -455,7 +506,7 @@
2828 we store the leftmost columns contiguously in buff.
2829 To print a line from buff, get the index of the first character
2830 from line_vector[i], and print up to line_vector[i + 1]. */
2831-static char *buff;
2832+static unsigned char *buff;
2833
2834 /* Index of the position in buff where the next character
2835 will be stored. */
2836@@ -559,7 +610,7 @@
2837 static bool untabify_input = false;
2838
2839 /* (-e) The input tab character. */
2840-static char input_tab_char = '\t';
2841+static char input_tab_char[MB_LEN_MAX] = "\t";
2842
2843 /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
2844 where the leftmost column is 1. */
2845@@ -569,7 +620,10 @@
2846 static bool tabify_output = false;
2847
2848 /* (-i) The output tab character. */
2849-static char output_tab_char = '\t';
2850+static char output_tab_char[MB_LEN_MAX] = "\t";
2851+
2852+/* (-i) The byte length of output tab character. */
2853+static int output_tab_char_length = 1;
2854
2855 /* (-i) The width of the output tab. */
2856 static int chars_per_output_tab = 8;
2857@@ -643,7 +697,13 @@
2858 static bool numbered_lines = false;
2859
2860 /* (-n) Character which follows each line number. */
2861-static char number_separator = '\t';
2862+static char number_separator[MB_LEN_MAX] = "\t";
2863+
2864+/* (-n) The byte length of the character which follows each line number. */
2865+static int number_separator_length = 1;
2866+
2867+/* (-n) The character width of the character which follows each line number. */
2868+static int number_separator_width = 0;
2869
2870 /* (-n) line counting starts with 1st line of input file (not with 1st
2871 line of 1st page printed). */
2872@@ -696,6 +756,7 @@
2873 -a|COLUMN|-m is a `space' and with the -J option a `tab'. */
2874 static char *col_sep_string = "";
2875 static int col_sep_length = 0;
2876+static int col_sep_width = 0;
2877 static char *column_separator = " ";
2878 static char *line_separator = "\t";
2879
2880@@ -852,6 +913,13 @@
2881 col_sep_length = (int) strlen (optarg_S);
2882 col_sep_string = xmalloc (col_sep_length + 1);
2883 strcpy (col_sep_string, optarg_S);
2884+
2885+#if HAVE_MBRTOWC
2886+ if (MB_CUR_MAX > 1)
2887+ col_sep_width = mbswidth (col_sep_string, 0);
2888+ else
2889+#endif
2890+ col_sep_width = col_sep_length;
2891 }
2892
2893 int
2894@@ -877,6 +945,21 @@
2895
2896 atexit (close_stdout);
2897
2898+/* Define which functions are used, the ones for single byte locale or the ones
2899+ for multibyte locale. */
2900+#if HAVE_MBRTOWC
2901+ if (MB_CUR_MAX > 1)
2902+ {
2903+ print_char = print_char_multi;
2904+ char_to_clump = char_to_clump_multi;
2905+ }
2906+ else
2907+#endif
2908+ {
2909+ print_char = print_char_single;
2910+ char_to_clump = char_to_clump_single;
2911+ }
2912+
2913 n_files = 0;
2914 file_names = (argc > 1
2915 ? xmalloc ((argc - 1) * sizeof (char *))
2916@@ -949,8 +1032,12 @@
2917 break;
2918 case 'e':
2919 if (optarg)
2920- getoptarg (optarg, 'e', &input_tab_char,
2921- &chars_per_input_tab);
2922+ {
2923+ int dummy_length, dummy_width;
2924+
2925+ getoptarg (optarg, 'e', input_tab_char, &dummy_length,
2926+ &dummy_width, &chars_per_input_tab);
2927+ }
2928 /* Could check tab width > 0. */
2929 untabify_input = true;
2930 break;
2931@@ -963,8 +1050,12 @@
2932 break;
2933 case 'i':
2934 if (optarg)
2935- getoptarg (optarg, 'i', &output_tab_char,
2936- &chars_per_output_tab);
2937+ {
2938+ int dummy_width;
2939+
2940+ getoptarg (optarg, 'i', output_tab_char, &output_tab_char_length,
2941+ &dummy_width, &chars_per_output_tab);
2942+ }
2943 /* Could check tab width > 0. */
2944 tabify_output = true;
2945 break;
2946@@ -991,8 +1082,8 @@
2947 case 'n':
2948 numbered_lines = true;
2949 if (optarg)
2950- getoptarg (optarg, 'n', &number_separator,
2951- &chars_per_number);
2952+ getoptarg (optarg, 'n', number_separator, &number_separator_length,
2953+ &number_separator_width, &chars_per_number);
2954 break;
2955 case 'N':
2956 skip_count = false;
2957@@ -1031,7 +1122,7 @@
2958 old_s = false;
2959 /* Reset an additional input of -s, -S dominates -s */
2960 col_sep_string = "";
2961- col_sep_length = 0;
2962+ col_sep_length = col_sep_width = 0;
2963 use_col_separator = true;
2964 if (optarg)
2965 separator_string (optarg);
2966@@ -1188,10 +1279,45 @@
2967 a number. */
2968
2969 static void
2970-getoptarg (char *arg, char switch_char, char *character, int *number)
2971+getoptarg (char *arg, char switch_char, char *character, int *character_length,
2972+ int *character_width, int *number)
2973 {
2974 if (!ISDIGIT (*arg))
2975- *character = *arg++;
2976+ {
2977+#ifdef HAVE_MBRTOWC
2978+ if (MB_CUR_MAX > 1) /* for multibyte locale. */
2979+ {
2980+ wchar_t wc;
2981+ size_t mblength;
2982+ int width;
2983+ mbstate_t state = {'\0'};
2984+
2985+ mblength = mbrtowc (&wc, arg, strnlen(arg, MB_LEN_MAX), &state);
2986+
2987+ if (mblength == (size_t)-1 || mblength == (size_t)-2)
2988+ {
2989+ *character_length = 1;
2990+ *character_width = 1;
2991+ }
2992+ else
2993+ {
2994+ *character_length = (mblength < 1) ? 1 : mblength;
2995+ width = wcwidth (wc);
2996+ *character_width = (width < 0) ? 0 : width;
2997+ }
2998+
2999+ strncpy (character, arg, *character_length);
3000+ arg += *character_length;
3001+ }
3002+ else /* for single byte locale. */
3003+#endif
3004+ {
3005+ *character = *arg++;
3006+ *character_length = 1;
3007+ *character_width = 1;
3008+ }
3009+ }
3010+
3011 if (*arg)
3012 {
3013 long int tmp_long;
3014@@ -1256,7 +1382,7 @@
3015 else
3016 col_sep_string = column_separator;
3017
3018- col_sep_length = 1;
3019+ col_sep_length = col_sep_width = 1;
3020 use_col_separator = true;
3021 }
3022 /* It's rather pointless to define a TAB separator with column
3023@@ -1288,11 +1414,11 @@
3024 TAB_WIDTH (chars_per_input_tab, chars_per_number); */
3025
3026 /* Estimate chars_per_text without any margin and keep it constant. */
3027- if (number_separator == '\t')
3028+ if (number_separator[0] == '\t')
3029 number_width = chars_per_number +
3030 TAB_WIDTH (chars_per_default_tab, chars_per_number);
3031 else
3032- number_width = chars_per_number + 1;
3033+ number_width = chars_per_number + number_separator_width;
3034
3035 /* The number is part of the column width unless we are
3036 printing files in parallel. */
3037@@ -1307,7 +1433,7 @@
3038 }
3039
3040 chars_per_column = (chars_per_line - chars_used_by_number -
3041- (columns - 1) * col_sep_length) / columns;
3042+ (columns - 1) * col_sep_width) / columns;
3043
3044 if (chars_per_column < 1)
3045 error (EXIT_FAILURE, 0, _("page width too narrow"));
3046@@ -1432,7 +1558,7 @@
3047
3048 /* Enlarge p->start_position of first column to use the same form of
3049 padding_not_printed with all columns. */
3050- h = h + col_sep_length;
3051+ h = h + col_sep_width;
3052
3053 /* This loop takes care of all but the rightmost column. */
3054
3055@@ -1466,7 +1592,7 @@
3056 }
3057 else
3058 {
3059- h = h_next + col_sep_length;
3060+ h = h_next + col_sep_width;
3061 h_next = h + chars_per_column;
3062 }
3063 }
3064@@ -1756,9 +1882,9 @@
3065 align_column (COLUMN *p)
3066 {
3067 padding_not_printed = p->start_position;
3068- if (padding_not_printed - col_sep_length > 0)
3069+ if (padding_not_printed - col_sep_width > 0)
3070 {
3071- pad_across_to (padding_not_printed - col_sep_length);
3072+ pad_across_to (padding_not_printed - col_sep_width);
3073 padding_not_printed = ANYWHERE;
3074 }
3075
3076@@ -2029,13 +2155,13 @@
3077 /* May be too generous. */
3078 buff = X2REALLOC (buff, &buff_allocated);
3079 }
3080- buff[buff_current++] = c;
3081+ buff[buff_current++] = (unsigned char) c;
3082 }
3083
3084 static void
3085 add_line_number (COLUMN *p)
3086 {
3087- int i;
3088+ int i, j;
3089 char *s;
3090 int left_cut;
3091
3092@@ -2058,22 +2184,24 @@
3093 /* Tabification is assumed for multiple columns, also for n-separators,
3094 but `default n-separator = TAB' hasn't been given priority over
3095 equal column_width also specified by POSIX. */
3096- if (number_separator == '\t')
3097+ if (number_separator[0] == '\t')
3098 {
3099 i = number_width - chars_per_number;
3100 while (i-- > 0)
3101 (p->char_func) (' ');
3102 }
3103 else
3104- (p->char_func) (number_separator);
3105+ for (j = 0; j < number_separator_length; j++)
3106+ (p->char_func) (number_separator[j]);
3107 }
3108 else
3109 /* To comply with POSIX, we avoid any expansion of default TAB
3110 separator with a single column output. No column_width requirement
3111 has to be considered. */
3112 {
3113- (p->char_func) (number_separator);
3114- if (number_separator == '\t')
3115+ for (j = 0; j < number_separator_length; j++)
3116+ (p->char_func) (number_separator[j]);
3117+ if (number_separator[0] == '\t')
3118 output_position = POS_AFTER_TAB (chars_per_output_tab,
3119 output_position);
3120 }
3121@@ -2234,7 +2362,7 @@
3122 while (goal - h_old > 1
3123 && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
3124 {
3125- putchar (output_tab_char);
3126+ fwrite (output_tab_char, sizeof(char), output_tab_char_length, stdout);
3127 h_old = h_new;
3128 }
3129 while (++h_old <= goal)
3130@@ -2254,6 +2382,7 @@
3131 {
3132 char *s;
3133 int l = col_sep_length;
3134+ int not_space_flag;
3135
3136 s = col_sep_string;
3137
3138@@ -2267,6 +2396,7 @@
3139 {
3140 for (; separators_not_printed > 0; --separators_not_printed)
3141 {
3142+ not_space_flag = 0;
3143 while (l-- > 0)
3144 {
3145 /* 3 types of sep_strings: spaces only, spaces and chars,
3146@@ -2280,12 +2410,15 @@
3147 }
3148 else
3149 {
3150+ not_space_flag = 1;
3151 if (spaces_not_printed > 0)
3152 print_white_space ();
3153 putchar (*s++);
3154- ++output_position;
3155 }
3156 }
3157+ if (not_space_flag)
3158+ output_position += col_sep_width;
3159+
3160 /* sep_string ends with some spaces */
3161 if (spaces_not_printed > 0)
3162 print_white_space ();
3163@@ -2313,7 +2446,7 @@
3164 required number of tabs and spaces. */
3165
3166 static void
3167-print_char (char c)
3168+print_char_single (char c)
3169 {
3170 if (tabify_output)
3171 {
3172@@ -2337,6 +2470,74 @@
3173 putchar (c);
3174 }
3175
3176+#ifdef HAVE_MBRTOWC
3177+static void
3178+print_char_multi (char c)
3179+{
3180+ static size_t mbc_pos = 0;
3181+ static char mbc[MB_LEN_MAX] = {'\0'};
3182+ static mbstate_t state = {'\0'};
3183+ mbstate_t state_bak;
3184+ wchar_t wc;
3185+ size_t mblength;
3186+ int width;
3187+
3188+ if (tabify_output)
3189+ {
3190+ state_bak = state;
3191+ mbc[mbc_pos++] = c;
3192+ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
3193+
3194+ while (mbc_pos > 0)
3195+ {
3196+ switch (mblength)
3197+ {
3198+ case (size_t)-2:
3199+ state = state_bak;
3200+ return;
3201+
3202+ case (size_t)-1:
3203+ state = state_bak;
3204+ ++output_position;
3205+ putchar (mbc[0]);
3206+ memmove (mbc, mbc + 1, MB_CUR_MAX - 1);
3207+ --mbc_pos;
3208+ break;
3209+
3210+ case 0:
3211+ mblength = 1;
3212+
3213+ default:
3214+ if (wc == L' ')
3215+ {
3216+ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
3217+ --mbc_pos;
3218+ ++spaces_not_printed;
3219+ return;
3220+ }
3221+ else if (spaces_not_printed > 0)
3222+ print_white_space ();
3223+
3224+ /* Nonprintables are assumed to have width 0, except L'\b'. */
3225+ if ((width = wcwidth (wc)) < 1)
3226+ {
3227+ if (wc == L'\b')
3228+ --output_position;
3229+ }
3230+ else
3231+ output_position += width;
3232+
3233+ fwrite (mbc, sizeof(char), mblength, stdout);
3234+ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
3235+ mbc_pos -= mblength;
3236+ }
3237+ }
3238+ return;
3239+ }
3240+ putchar (c);
3241+}
3242+#endif
3243+
3244 /* Skip to page PAGE before printing.
3245 PAGE may be larger than total number of pages. */
3246
3247@@ -2517,9 +2718,9 @@
3248 align_empty_cols = false;
3249 }
3250
3251- if (padding_not_printed - col_sep_length > 0)
3252+ if (padding_not_printed - col_sep_width > 0)
3253 {
3254- pad_across_to (padding_not_printed - col_sep_length);
3255+ pad_across_to (padding_not_printed - col_sep_width);
3256 padding_not_printed = ANYWHERE;
3257 }
3258
3259@@ -2620,9 +2821,9 @@
3260 }
3261 }
3262
3263- if (padding_not_printed - col_sep_length > 0)
3264+ if (padding_not_printed - col_sep_width > 0)
3265 {
3266- pad_across_to (padding_not_printed - col_sep_length);
3267+ pad_across_to (padding_not_printed - col_sep_width);
3268 padding_not_printed = ANYWHERE;
3269 }
3270
3271@@ -2635,8 +2836,8 @@
3272 if (spaces_not_printed == 0)
3273 {
3274 output_position = p->start_position + end_vector[line];
3275- if (p->start_position - col_sep_length == chars_per_margin)
3276- output_position -= col_sep_length;
3277+ if (p->start_position - col_sep_width == chars_per_margin)
3278+ output_position -= col_sep_width;
3279 }
3280
3281 return true;
3282@@ -2655,7 +2856,7 @@
3283 number of characters is 1.) */
3284
3285 static int
3286-char_to_clump (char c)
3287+char_to_clump_single (char c)
3288 {
3289 unsigned char uc = c;
3290 char *s = clump_buff;
3291@@ -2665,10 +2866,10 @@
3292 int chars;
3293 int chars_per_c = 8;
3294
3295- if (c == input_tab_char)
3296+ if (c == input_tab_char[0])
3297 chars_per_c = chars_per_input_tab;
3298
3299- if (c == input_tab_char || c == '\t')
3300+ if (c == input_tab_char[0] || c == '\t')
3301 {
3302 width = TAB_WIDTH (chars_per_c, input_position);
3303
3304@@ -2739,6 +2940,154 @@
3305 return chars;
3306 }
3307
3308+#ifdef HAVE_MBRTOWC
3309+static int
3310+char_to_clump_multi (char c)
3311+{
3312+ static size_t mbc_pos = 0;
3313+ static char mbc[MB_LEN_MAX] = {'\0'};
3314+ static mbstate_t state = {'\0'};
3315+ mbstate_t state_bak;
3316+ wchar_t wc;
3317+ size_t mblength;
3318+ int wc_width;
3319+ register char *s = clump_buff;
3320+ register int i, j;
3321+ char esc_buff[4];
3322+ int width;
3323+ int chars;
3324+ int chars_per_c = 8;
3325+
3326+ state_bak = state;
3327+ mbc[mbc_pos++] = c;
3328+ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
3329+
3330+ width = 0;
3331+ chars = 0;
3332+ while (mbc_pos > 0)
3333+ {
3334+ switch (mblength)
3335+ {
3336+ case (size_t)-2:
3337+ state = state_bak;
3338+ return 0;
3339+
3340+ case (size_t)-1:
3341+ state = state_bak;
3342+ mblength = 1;
3343+
3344+ if (use_esc_sequence || use_cntrl_prefix)
3345+ {
3346+ width = +4;
3347+ chars = +4;
3348+ *s++ = '\\';
3349+ sprintf (esc_buff, "%03o", mbc[0]);
3350+ for (i = 0; i <= 2; ++i)
3351+ *s++ = (int) esc_buff[i];
3352+ }
3353+ else
3354+ {
3355+ width += 1;
3356+ chars += 1;
3357+ *s++ = mbc[0];
3358+ }
3359+ break;
3360+
3361+ case 0:
3362+ mblength = 1;
3363+ /* Fall through */
3364+
3365+ default:
3366+ if (memcmp (mbc, input_tab_char, mblength) == 0)
3367+ chars_per_c = chars_per_input_tab;
3368+
3369+ if (memcmp (mbc, input_tab_char, mblength) == 0 || c == '\t')
3370+ {
3371+ int width_inc;
3372+
3373+ width_inc = TAB_WIDTH (chars_per_c, input_position);
3374+ width += width_inc;
3375+
3376+ if (untabify_input)
3377+ {
3378+ for (i = width_inc; i; --i)
3379+ *s++ = ' ';
3380+ chars += width_inc;
3381+ }
3382+ else
3383+ {
3384+ for (i = 0; i < mblength; i++)
3385+ *s++ = mbc[i];
3386+ chars += mblength;
3387+ }
3388+ }
3389+ else if ((wc_width = wcwidth (wc)) < 1)
3390+ {
3391+ if (use_esc_sequence)
3392+ {
3393+ for (i = 0; i < mblength; i++)
3394+ {
3395+ width += 4;
3396+ chars += 4;
3397+ *s++ = '\\';
3398+ sprintf (esc_buff, "%03o", c);
3399+ for (j = 0; j <= 2; ++j)
3400+ *s++ = (int) esc_buff[j];
3401+ }
3402+ }
3403+ else if (use_cntrl_prefix)
3404+ {
3405+ if (wc < 0200)
3406+ {
3407+ width += 2;
3408+ chars += 2;
3409+ *s++ = '^';
3410+ *s++ = wc ^ 0100;
3411+ }
3412+ else
3413+ {
3414+ for (i = 0; i < mblength; i++)
3415+ {
3416+ width += 4;
3417+ chars += 4;
3418+ *s++ = '\\';
3419+ sprintf (esc_buff, "%03o", c);
3420+ for (j = 0; j <= 2; ++j)
3421+ *s++ = (int) esc_buff[j];
3422+ }
3423+ }
3424+ }
3425+ else if (wc == L'\b')
3426+ {
3427+ width += -1;
3428+ chars += 1;
3429+ *s++ = c;
3430+ }
3431+ else
3432+ {
3433+ width += 0;
3434+ chars += mblength;
3435+ for (i = 0; i < mblength; i++)
3436+ *s++ = mbc[i];
3437+ }
3438+ }
3439+ else
3440+ {
3441+ width += wc_width;
3442+ chars += mblength;
3443+ for (i = 0; i < mblength; i++)
3444+ *s++ = mbc[i];
3445+ }
3446+ }
3447+ memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
3448+ mbc_pos -= mblength;
3449+ }
3450+
3451+ input_position += width;
3452+ return chars;
3453+}
3454+#endif
3455+
3456 /* We've just printed some files and need to clean up things before
3457 looking for more options and printing the next batch of files.
3458
3459--- coreutils-6.8+/src/cut.c.i18n 2007-01-14 15:41:28.000000000 +0000
3460+++ coreutils-6.8+/src/cut.c 2007-03-01 15:08:24.000000000 +0000
3461@@ -29,6 +29,11 @@
3462 #include <assert.h>
3463 #include <getopt.h>
3464 #include <sys/types.h>
3465+
3466+/* Get mbstate_t, mbrtowc(). */
3467+#if HAVE_WCHAR_H
3468+# include <wchar.h>
3469+#endif
3470 #include "system.h"
3471
3472 #include "error.h"
3473@@ -37,6 +42,18 @@
3474 #include "quote.h"
3475 #include "xstrndup.h"
3476
3477+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
3478+ installation; work around this configuration error. */
3479+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
3480+# undef MB_LEN_MAX
3481+# define MB_LEN_MAX 16
3482+#endif
3483+
3484+/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
3485+#if HAVE_MBRTOWC && defined mbstate_t
3486+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
3487+#endif
3488+
3489 /* The official name of this program (e.g., no `g' prefix). */
3490 #define PROGRAM_NAME "cut"
3491
3492@@ -67,6 +84,52 @@
3493 } \
3494 while (0)
3495
3496+/* Refill the buffer BUF to get a multibyte character. */
3497+#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM) \
3498+ do \
3499+ { \
3500+ if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM)) \
3501+ { \
3502+ memmove (BUF, BUFPOS, BUFLEN); \
3503+ BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \
3504+ BUFPOS = BUF; \
3505+ } \
3506+ } \
3507+ while (0)
3508+
3509+/* Get wide character on BUFPOS. BUFPOS is not included after that.
3510+ If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */
3511+#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \
3512+ do \
3513+ { \
3514+ mbstate_t state_bak; \
3515+ \
3516+ if (BUFLEN < 1) \
3517+ { \
3518+ WC = WEOF; \
3519+ break; \
3520+ } \
3521+ \
3522+ /* Get a wide character. */ \
3523+ CONVFAIL = 0; \
3524+ state_bak = STATE; \
3525+ MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE); \
3526+ \
3527+ switch (MBLENGTH) \
3528+ { \
3529+ case (size_t)-1: \
3530+ case (size_t)-2: \
3531+ CONVFAIL++; \
3532+ STATE = state_bak; \
3533+ /* Fall througn. */ \
3534+ \
3535+ case 0: \
3536+ MBLENGTH = 1; \
3537+ break; \
3538+ } \
3539+ } \
3540+ while (0)
3541+
3542 struct range_pair
3543 {
3544 size_t lo;
3545@@ -85,7 +148,7 @@
3546 /* The number of bytes allocated for FIELD_1_BUFFER. */
3547 static size_t field_1_bufsize;
3548
3549-/* The largest field or byte index used as an endpoint of a closed
3550+/* The largest byte, character or field index used as an endpoint of a closed
3551 or degenerate range specification; this doesn't include the starting
3552 index of right-open-ended ranges. For example, with either range spec
3553 `2-5,9-', `2-3,5,9-' this variable would be set to 5. */
3554@@ -97,10 +160,11 @@
3555
3556 /* This is a bit vector.
3557 In byte mode, which bytes to output.
3558+ In character mode, which characters to output.
3559 In field mode, which DELIM-separated fields to output.
3560- Both bytes and fields are numbered starting with 1,
3561+ Bytes, characters and fields are numbered starting with 1,
3562 so the zeroth bit of this array is unused.
3563- A field or byte K has been selected if
3564+ A byte, character or field K has been selected if
3565 (K <= MAX_RANGE_ENDPOINT and is_printable_field(K))
3566 || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */
3567 static unsigned char *printable_field;
3568@@ -109,9 +173,12 @@
3569 {
3570 undefined_mode,
3571
3572- /* Output characters that are in the given bytes. */
3573+ /* Output bytes that are at the given positions. */
3574 byte_mode,
3575
3576+ /* Output characters that are at the given positions. */
3577+ character_mode,
3578+
3579 /* Output the given delimeter-separated fields. */
3580 field_mode
3581 };
3582@@ -121,6 +188,13 @@
3583
3584 static enum operating_mode operating_mode;
3585
3586+/* If nonzero, when in byte mode, don't split multibyte characters. */
3587+static int byte_mode_character_aware;
3588+
3589+/* If nonzero, the function for single byte locale is work
3590+ if this program runs on multibyte locale. */
3591+static int force_singlebyte_mode;
3592+
3593 /* If true do not output lines containing no delimeter characters.
3594 Otherwise, all such lines are printed. This option is valid only
3595 with field mode. */
3596@@ -132,6 +206,9 @@
3597
3598 /* The delimeter character for field mode. */
3599 static unsigned char delim;
3600+#if HAVE_WCHAR_H
3601+static wchar_t wcdelim;
3602+#endif
3603
3604 /* True if the --output-delimiter=STRING option was specified. */
3605 static bool output_delimiter_specified;
3606@@ -205,7 +282,7 @@
3607 -f, --fields=LIST select only these fields; also print any line\n\
3608 that contains no delimiter character, unless\n\
3609 the -s option is specified\n\
3610- -n (ignored)\n\
3611+ -n with -b: don't split multibyte characters\n\
3612 "), stdout);
3613 fputs (_("\
3614 --complement complement the set of selected bytes, characters\n\
3615@@ -362,7 +439,7 @@
3616 in_digits = false;
3617 /* Starting a range. */
3618 if (dash_found)
3619- FATAL_ERROR (_("invalid byte or field list"));
3620+ FATAL_ERROR (_("invalid byte, character or field list"));
3621 dash_found = true;
3622 fieldstr++;
3623
3624@@ -387,14 +464,16 @@
3625 if (value == 0)
3626 {
3627 /* `n-'. From `initial' to end of line. */
3628- eol_range_start = initial;
3629+ if (eol_range_start == 0 ||
3630+ (eol_range_start != 0 && eol_range_start > initial))
3631+ eol_range_start = initial;
3632 field_found = true;
3633 }
3634 else
3635 {
3636 /* `m-n' or `-n' (1-n). */
3637 if (value < initial)
3638- FATAL_ERROR (_("invalid byte or field list"));
3639+ FATAL_ERROR (_("invalid byte, character or field list"));
3640
3641 /* Is there already a range going to end of line? */
3642 if (eol_range_start != 0)
3643@@ -467,6 +546,9 @@
3644 if (operating_mode == byte_mode)
3645 error (0, 0,
3646 _("byte offset %s is too large"), quote (bad_num));
3647+ else if (operating_mode == character_mode)
3648+ error (0, 0,
3649+ _("character offset %s is too large"), quote (bad_num));
3650 else
3651 error (0, 0,
3652 _("field number %s is too large"), quote (bad_num));
3653@@ -477,7 +559,7 @@
3654 fieldstr++;
3655 }
3656 else
3657- FATAL_ERROR (_("invalid byte or field list"));
3658+ FATAL_ERROR (_("invalid byte, character or field list"));
3659 }
3660
3661 max_range_endpoint = 0;
3662@@ -570,6 +652,63 @@
3663 }
3664 }
3665
3666+#if HAVE_MBRTOWC
3667+/* This function is in use for the following case.
3668+
3669+ 1. Read from the stream STREAM, printing to standard output any selected
3670+ characters.
3671+
3672+ 2. Read from stream STREAM, printing to standard output any selected bytes,
3673+ without splitting multibyte characters. */
3674+
3675+static void
3676+cut_characters_or_cut_bytes_no_split (FILE *stream)
3677+{
3678+ int idx; /* number of bytes or characters in the line so far. */
3679+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
3680+ char *bufpos; /* Next read position of BUF. */
3681+ size_t buflen; /* The length of the byte sequence in buf. */
3682+ wint_t wc; /* A gotten wide character. */
3683+ size_t mblength; /* The byte size of a multibyte character which shows
3684+ as same character as WC. */
3685+ mbstate_t state; /* State of the stream. */
3686+ int convfail; /* 1, when conversion is failed. Otherwise 0. */
3687+
3688+ idx = 0;
3689+ buflen = 0;
3690+ bufpos = buf;
3691+ memset (&state, '\0', sizeof(mbstate_t));
3692+
3693+ while (1)
3694+ {
3695+ REFILL_BUFFER (buf, bufpos, buflen, stream);
3696+
3697+ GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail);
3698+
3699+ if (wc == WEOF)
3700+ {
3701+ if (idx > 0)
3702+ putchar ('\n');
3703+ break;
3704+ }
3705+ else if (wc == L'\n')
3706+ {
3707+ putchar ('\n');
3708+ idx = 0;
3709+ }
3710+ else
3711+ {
3712+ idx += (operating_mode == byte_mode) ? mblength : 1;
3713+ if (print_kth (idx, NULL))
3714+ fwrite (bufpos, mblength, sizeof(char), stdout);
3715+ }
3716+
3717+ buflen -= mblength;
3718+ bufpos += mblength;
3719+ }
3720+}
3721+#endif
3722+
3723 /* Read from stream STREAM, printing to standard output any selected fields. */
3724
3725 static void
3726@@ -692,13 +831,192 @@
3727 }
3728 }
3729
3730+#if HAVE_MBRTOWC
3731+static void
3732+cut_fields_mb (FILE *stream)
3733+{
3734+ int c;
3735+ unsigned int field_idx;
3736+ int found_any_selected_field;
3737+ int buffer_first_field;
3738+ int empty_input;
3739+ char buf[MB_LEN_MAX + BUFSIZ]; /* For spooling a read byte sequence. */
3740+ char *bufpos; /* Next read position of BUF. */
3741+ size_t buflen; /* The length of the byte sequence in buf. */
3742+ wint_t wc = 0; /* A gotten wide character. */
3743+ size_t mblength; /* The byte size of a multibyte character which shows
3744+ as same character as WC. */
3745+ mbstate_t state; /* State of the stream. */
3746+ int convfail; /* 1, when conversion is failed. Otherwise 0. */
3747+
3748+ found_any_selected_field = 0;
3749+ field_idx = 1;
3750+ bufpos = buf;
3751+ buflen = 0;
3752+ memset (&state, '\0', sizeof(mbstate_t));
3753+
3754+ c = getc (stream);
3755+ empty_input = (c == EOF);
3756+ if (c != EOF)
3757+ ungetc (c, stream);
3758+ else
3759+ wc = WEOF;
3760+
3761+ /* To support the semantics of the -s flag, we may have to buffer
3762+ all of the first field to determine whether it is `delimited.'
3763+ But that is unnecessary if all non-delimited lines must be printed
3764+ and the first field has been selected, or if non-delimited lines
3765+ must be suppressed and the first field has *not* been selected.
3766+ That is because a non-delimited line has exactly one field. */
3767+ buffer_first_field = (suppress_non_delimited ^ !print_kth (1, NULL));
3768+
3769+ while (1)
3770+ {
3771+ if (field_idx == 1 && buffer_first_field)
3772+ {
3773+ int len = 0;
3774+
3775+ while (1)
3776+ {
3777+ REFILL_BUFFER (buf, bufpos, buflen, stream);
3778+
3779+ GET_NEXT_WC_FROM_BUFFER
3780+ (wc, bufpos, buflen, mblength, state, convfail);
3781+
3782+ if (wc == WEOF)
3783+ break;
3784+
3785+ field_1_buffer = xrealloc (field_1_buffer, len + mblength);
3786+ memcpy (field_1_buffer + len, bufpos, mblength);
3787+ len += mblength;
3788+ buflen -= mblength;
3789+ bufpos += mblength;
3790+
3791+ if (!convfail && (wc == L'\n' || wc == wcdelim))
3792+ break;
3793+ }
3794+
3795+ if (wc == WEOF)
3796+ break;
3797+
3798+ /* If the first field extends to the end of line (it is not
3799+ delimited) and we are printing all non-delimited lines,
3800+ print this one. */
3801+ if (convfail || (!convfail && wc != wcdelim))
3802+ {
3803+ if (suppress_non_delimited)
3804+ {
3805+ /* Empty. */
3806+ }
3807+ else
3808+ {
3809+ fwrite (field_1_buffer, sizeof (char), len, stdout);
3810+ /* Make sure the output line is newline terminated. */
3811+ if (convfail || (!convfail && wc != L'\n'))
3812+ putchar ('\n');
3813+ }
3814+ continue;
3815+ }
3816+
3817+ if (print_kth (1, NULL))
3818+ {
3819+ /* Print the field, but not the trailing delimiter. */
3820+ fwrite (field_1_buffer, sizeof (char), len - 1, stdout);
3821+ found_any_selected_field = 1;
3822+ }
3823+ ++field_idx;
3824+ }
3825+
3826+ if (wc != WEOF)
3827+ {
3828+ if (print_kth (field_idx, NULL))
3829+ {
3830+ if (found_any_selected_field)
3831+ {
3832+ fwrite (output_delimiter_string, sizeof (char),
3833+ output_delimiter_length, stdout);
3834+ }
3835+ found_any_selected_field = 1;
3836+ }
3837+
3838+ while (1)
3839+ {
3840+ REFILL_BUFFER (buf, bufpos, buflen, stream);
3841+
3842+ GET_NEXT_WC_FROM_BUFFER
3843+ (wc, bufpos, buflen, mblength, state, convfail);
3844+
3845+ if (wc == WEOF)
3846+ break;
3847+ else if (!convfail && (wc == wcdelim || wc == L'\n'))
3848+ {
3849+ buflen -= mblength;
3850+ bufpos += mblength;
3851+ break;
3852+ }
3853+
3854+ if (print_kth (field_idx, NULL))
3855+ fwrite (bufpos, mblength, sizeof(char), stdout);
3856+
3857+ buflen -= mblength;
3858+ bufpos += mblength;
3859+ }
3860+ }
3861+
3862+ if ((!convfail || wc == L'\n') && buflen < 1)
3863+ wc = WEOF;
3864+
3865+ if (!convfail && wc == wcdelim)
3866+ ++field_idx;
3867+ else if (wc == WEOF || (!convfail && wc == L'\n'))
3868+ {
3869+ if (found_any_selected_field
3870+ || (!empty_input && !(suppress_non_delimited && field_idx == 1)))
3871+ putchar ('\n');
3872+ if (wc == WEOF)
3873+ break;
3874+ field_idx = 1;
3875+ found_any_selected_field = 0;
3876+ }
3877+ }
3878+}
3879+#endif
3880+
3881 static void
3882 cut_stream (FILE *stream)
3883 {
3884- if (operating_mode == byte_mode)
3885- cut_bytes (stream);
3886+#if HAVE_MBRTOWC
3887+ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
3888+ {
3889+ switch (operating_mode)
3890+ {
3891+ case byte_mode:
3892+ if (byte_mode_character_aware)
3893+ cut_characters_or_cut_bytes_no_split (stream);
3894+ else
3895+ cut_bytes (stream);
3896+ break;
3897+
3898+ case character_mode:
3899+ cut_characters_or_cut_bytes_no_split (stream);
3900+ break;
3901+
3902+ case field_mode:
3903+ cut_fields_mb (stream);
3904+ break;
3905+
3906+ default:
3907+ abort ();
3908+ }
3909+ }
3910 else
3911- cut_fields (stream);
3912+#endif
3913+ {
3914+ if (operating_mode == field_mode)
3915+ cut_fields (stream);
3916+ else
3917+ cut_bytes (stream);
3918+ }
3919 }
3920
3921 /* Process file FILE to standard output.
3922@@ -748,6 +1066,8 @@
3923 bool ok;
3924 bool delim_specified = false;
3925 char *spec_list_string IF_LINT(= NULL);
3926+ char mbdelim[MB_LEN_MAX + 1];
3927+ size_t delimlen = 0;
3928
3929 initialize_main (&argc, &argv);
3930 program_name = argv[0];
3931@@ -770,7 +1090,6 @@
3932 switch (optc)
3933 {
3934 case 'b':
3935- case 'c':
3936 /* Build the byte list. */
3937 if (operating_mode != undefined_mode)
3938 FATAL_ERROR (_("only one type of list may be specified"));
3939@@ -778,6 +1097,14 @@
3940 spec_list_string = optarg;
3941 break;
3942
3943+ case 'c':
3944+ /* Build the character list. */
3945+ if (operating_mode != undefined_mode)
3946+ FATAL_ERROR (_("only one type of list may be specified"));
3947+ operating_mode = character_mode;
3948+ spec_list_string = optarg;
3949+ break;
3950+
3951 case 'f':
3952 /* Build the field list. */
3953 if (operating_mode != undefined_mode)
3954@@ -789,10 +1116,35 @@
3955 case 'd':
3956 /* New delimiter. */
3957 /* Interpret -d '' to mean `use the NUL byte as the delimiter.' */
3958- if (optarg[0] != '\0' && optarg[1] != '\0')
3959- FATAL_ERROR (_("the delimiter must be a single character"));
3960- delim = optarg[0];
3961- delim_specified = true;
3962+#if HAVE_MBRTOWC
3963+ {
3964+ if(MB_CUR_MAX > 1)
3965+ {
3966+ mbstate_t state;
3967+
3968+ memset (&state, '\0', sizeof(mbstate_t));
3969+ delimlen = mbrtowc (&wcdelim, optarg, strnlen(optarg, MB_LEN_MAX), &state);
3970+
3971+ if (delimlen == (size_t)-1 || delimlen == (size_t)-2)
3972+ ++force_singlebyte_mode;
3973+ else
3974+ {
3975+ delimlen = (delimlen < 1) ? 1 : delimlen;
3976+ if (wcdelim != L'\0' && *(optarg + delimlen) != '\0')
3977+ FATAL_ERROR (_("the delimiter must be a single character"));
3978+ memcpy (mbdelim, optarg, delimlen);
3979+ }
3980+ }
3981+
3982+ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
3983+#endif
3984+ {
3985+ if (optarg[0] != '\0' && optarg[1] != '\0')
3986+ FATAL_ERROR (_("the delimiter must be a single character"));
3987+ delim = (unsigned char) optarg[0];
3988+ }
3989+ delim_specified = true;
3990+ }
3991 break;
3992
3993 case OUTPUT_DELIMITER_OPTION:
3994@@ -805,6 +1157,7 @@
3995 break;
3996
3997 case 'n':
3998+ byte_mode_character_aware = 1;
3999 break;
4000
4001 case 's':
4002@@ -827,7 +1180,7 @@
4003 if (operating_mode == undefined_mode)
4004 FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
4005
4006- if (delim != '\0' && operating_mode != field_mode)
4007+ if (delim_specified && operating_mode != field_mode)
4008 FATAL_ERROR (_("an input delimiter may be specified only\
4009 when operating on fields"));
4010
4011@@ -854,15 +1207,34 @@
4012 }
4013
4014 if (!delim_specified)
4015- delim = '\t';
4016+ {
4017+ delim = '\t';
4018+#ifdef HAVE_MBRTOWC
4019+ wcdelim = L'\t';
4020+ mbdelim[0] = '\t';
4021+ mbdelim[1] = '\0';
4022+ delimlen = 1;
4023+#endif
4024+ }
4025
4026 if (output_delimiter_string == NULL)
4027 {
4028- static char dummy[2];
4029- dummy[0] = delim;
4030- dummy[1] = '\0';
4031- output_delimiter_string = dummy;
4032- output_delimiter_length = 1;
4033+#ifdef HAVE_MBRTOWC
4034+ if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
4035+ {
4036+ output_delimiter_string = xstrdup(mbdelim);
4037+ output_delimiter_length = delimlen;
4038+ }
4039+
4040+ if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
4041+#endif
4042+ {
4043+ static char dummy[2];
4044+ dummy[0] = delim;
4045+ dummy[1] = '\0';
4046+ output_delimiter_string = dummy;
4047+ output_delimiter_length = 1;
4048+ }
4049 }
4050
4051 if (optind == argc)
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
new file mode 100644
index 0000000000..aba8742f6a
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
@@ -0,0 +1,117 @@
1Upstream-Status: Inappropriate [legacy version]
2
3This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
4
5The package is stated as being Licensed as GPLv2+.
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9--- coreutils-6.9/src/ls.c.ls-x 2007-06-13 14:27:36.000000000 +0100
10+++ coreutils-6.9/src/ls.c 2007-06-13 14:28:42.000000000 +0100
11@@ -4151,16 +4151,16 @@
12 size_t pos = 0;
13 size_t cols = calculate_columns (false);
14 struct column_info const *line_fmt = &column_info[cols - 1];
15- size_t name_length = length_of_file_name_and_frills (cwd_file);
16+ struct fileinfo const *f = sorted_file[0];
17+ size_t name_length = length_of_file_name_and_frills (f);
18 size_t max_name_length = line_fmt->col_arr[0];
19
20 /* Print first entry. */
21- print_file_name_and_frills (cwd_file);
22+ print_file_name_and_frills (f);
23
24 /* Now the rest. */
25 for (filesno = 1; filesno < cwd_n_used; ++filesno)
26 {
27- struct fileinfo const *f;
28 size_t col = filesno % cols;
29
30 if (col == 0)
31--- coreutils-6.9/tests/ls/Makefile.am.ls-x 2007-03-18 21:36:43.000000000 +0000
32+++ coreutils-6.9/tests/ls/Makefile.am 2007-06-13 14:28:42.000000000 +0100
33@@ -24,7 +24,7 @@
34 stat-dtype \
35 inode dangle file-type recursive dired infloop \
36 rt-1 time-1 symlink-slash follow-slink no-arg m-option \
37- stat-vs-dirent
38+ stat-vs-dirent x-option
39
40 EXTRA_DIST = $(TESTS)
41 TESTS_ENVIRONMENT = \
42--- /dev/null 2007-06-13 08:43:51.993263382 +0100
43+++ coreutils-6.9/tests/ls/x-option 2007-06-13 14:28:42.000000000 +0100
44@@ -0,0 +1,59 @@
45+#!/bin/sh
46+# Exercise the -x option.
47+
48+# Copyright (C) 2007 Free Software Foundation, Inc.
49+
50+# This program is free software; you can redistribute it and/or modify
51+# it under the terms of the GNU General Public License as published by
52+# the Free Software Foundation; either version 2 of the License, or
53+# (at your option) any later version.
54+
55+# This program is distributed in the hope that it will be useful,
56+# but WITHOUT ANY WARRANTY; without even the implied warranty of
57+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58+# GNU General Public License for more details.
59+
60+# You should have received a copy of the GNU General Public License
61+# along with this program; if not, write to the Free Software
62+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
63+# 02110-1301, USA.
64+
65+if test "$VERBOSE" = yes; then
66+ set -x
67+ ls --version
68+fi
69+
70+. $srcdir/../envvar-check
71+. $srcdir/../lang-default
72+
73+pwd=`pwd`
74+t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
75+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
76+trap '(exit $?); exit $?' 1 2 13 15
77+
78+framework_failure=0
79+mkdir -p $tmp || framework_failure=1
80+cd $tmp || framework_failure=1
81+mkdir subdir || framework_failure=1
82+touch subdir/b || framework_failure=1
83+touch subdir/a || framework_failure=1
84+
85+if test $framework_failure = 1; then
86+ echo "$0: failure in testing framework" 1>&2
87+ (exit 1); exit 1
88+fi
89+
90+fail=0
91+
92+# Coreutils 6.8 and 6.9 would output this in the wrong order.
93+ls -x subdir > out || fail=1
94+ls -rx subdir >> out || fail=1
95+cat <<\EOF > exp || fail=1
96+a b
97+b a
98+EOF
99+
100+cmp out exp || fail=1
101+test $fail = 1 && diff out exp 2> /dev/null
102+
103+(exit $fail); exit $fail
104--- coreutils-6.9/NEWS.ls-x 2007-03-22 21:19:45.000000000 +0000
105+++ coreutils-6.9/NEWS 2007-06-13 14:28:42.000000000 +0100
106@@ -13,6 +13,11 @@
107 Using pr -m -s (i.e. merging files, with TAB as the output separator)
108 no longer inserts extraneous spaces between output columns.
109
110+** Bug fixes
111+
112+ ls -x DIR would sometimes output the wrong string in place of the
113+ first entry. [introduced in coreutils-6.8]
114+
115
116 * Noteworthy changes in release 6.8 (2007-02-24) [not-unstable]
117
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
new file mode 100644
index 0000000000..58074c09a5
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
@@ -0,0 +1,19 @@
1Upstream-Status: Inappropriate [legacy version]
2
3This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
4
5The package is stated as being Licensed as GPLv2+.
6
7Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
8
9--- coreutils-5.2.1/src/who.c.overflow 2005-05-25 09:59:06.000000000 +0100
10+++ coreutils-5.2.1/src/who.c 2005-05-25 10:00:31.000000000 +0100
11@@ -75,7 +75,7 @@
12 # define NEW_TIME 0
13 #endif
14
15-#define IDLESTR_LEN 6
16+#define IDLESTR_LEN 10
17
18 #if HAVE_STRUCT_XTMP_UT_PID
19 # define PIDSTR_DECL_AND_INIT(Var, Utmp_ent) \
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
new file mode 100644
index 0000000000..02730dbbb4
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
@@ -0,0 +1,32 @@
1Upstream-Status: Pending
2
3automake 1.12 has depricated automatic de-ANSI-fication support
4
5this patch avoids these kinds of errors:
6
7| configure.ac:40: error: automatic de-ANSI-fication support has been removed
8| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
9| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:138: gl_CHECK_ALL_TYPES is expanded from...
10| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:24: coreutils_MACROS is expanded from...
11| configure.ac:40: the top level
12| autom4te: m4 failed with exit status: 1
13
14Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
152012/05/04
16
17Index: coreutils-6.9/m4/jm-macros.m4
18===================================================================
19--- coreutils-6.9.orig/m4/jm-macros.m4
20+++ coreutils-6.9/m4/jm-macros.m4
21@@ -142,11 +142,6 @@ AC_DEFUN([gl_CHECK_ALL_TYPES],
22 dnl whether functions and headers are available, whether they work, etc.
23 AC_REQUIRE([AC_SYS_LARGEFILE])
24
25- dnl This test must precede tests of compiler characteristics like
26- dnl that for the inline keyword, since it may change the degree to
27- dnl which the compiler supports such features.
28- AC_REQUIRE([AM_C_PROTOTYPES])
29-
30 dnl Checks for typedefs, structures, and compiler characteristics.
31 AC_REQUIRE([AC_C_BIGENDIAN])
32 AC_REQUIRE([AC_C_VOLATILE])
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch b/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
new file mode 100644
index 0000000000..e0d600a390
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
@@ -0,0 +1,85 @@
1Upstream-Status: Inappropriate [legacy version]
2
3Use native coreutils binaries to build manpages in cross environment.
4This avoids man page build issues like this:
5
6| Making all in man
7| make[1]: Entering directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
8| Updating man page cut.1
9| Updating man page dir.1
10| Updating man page expand.1
11| Updating man page fold.1
12| Updating man page install.1
13| Updating man page join.1
14| Updating man page pr.1
15| Updating man page ls.1
16| Updating man page sort.1
17| Updating man page unexpand.1
18| Updating man page uniq.1
19| Updating man page who.1
20| Updating man page vdir.1
21| help2man: can't get `--help' info from dir.td/dir
22| help2man: can't get `--help' info from cut.td/cut
23| make[1]: *** [dir.1] Error 126
24| make[1]: *** Waiting for unfinished jobs....
25| help2man: can't get `--help' info from fold.td/fold
26| help2man: can't get `--help' info from install.td/install
27| help2man: can't get `--help' info from expand.td/expand
28| help2man: can't get `--help' info from join.td/join
29| make[1]: *** [cut.1] Error 126
30| make[1]: *** [fold.1] Error 126
31| make[1]: *** [install.1] Error 126
32| help2man: can't get `--help' info from sort.td/sort
33| make[1]: *** [expand.1] Error 126
34| help2man: can't get `--help' info from pr.td/pr
35| make[1]: *** [join.1] Error 126
36| help2man: can't get `--help' info from ls.td/ls
37| help2man: can't get `--help' info from unexpand.td/unexpand
38| help2man: can't get `--help' info from uniq.td/uniq
39| help2man: can't get `--help' info from who.td/who
40| make[1]: *** [sort.1] Error 126
41| make[1]: *** [pr.1] Error 126
42| help2man: can't get `--help' info from vdir.td/vdir
43| make[1]: *** [ls.1] Error 126
44| make[1]: *** [uniq.1] Error 126
45| make[1]: *** [unexpand.1] Error 126
46| make[1]: *** [who.1] Error 126
47| make[1]: *** [vdir.1] Error 126
48| make[1]: Leaving directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
49| make: *** [all-recursive] Error 1
50| FATAL: oe_runmake failed
51| ERROR: Function 'do_compile' failed (see /build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/temp/log.do_compile.12780 for further information)
52NOTE: package coreutils-6.9-r0: task do_compile: Failed
53ERROR: Task 8 (/home/nitin/prj/poky.git/meta/recipes-core/coreutils/coreutils_6.9.bb, do_compile) failed with exit code '1'
54
55
56This patch is made for gplv2 coreutils the recipe
57Nitin A Kamble <nitin.a.kamble@intel.com>
582011/03/17
59
60Index: man/Makefile.am
61===================================================================
62--- a/man.orig/Makefile.am
63+++ b/man/Makefile.am
64@@ -167,7 +167,7 @@ mapped_name = `echo $*|sed 's/install/gi
65 $(PERL) -- $(srcdir)/help2man \
66 --source='$(PACKAGE_STRING)' \
67 --include=$(srcdir)/$*.x \
68- --output=$t/$@ $t/$*; \
69+ --output=$t/$@ $*; \
70 } \
71 && sed 's|$*\.td/||g' $t/$@ > $@ \
72 && chmod a-w $@ \
73Index: man/Makefile.in
74===================================================================
75--- a/man.orig/Makefile.in
76+++ b/man/Makefile.in
77@@ -865,7 +865,7 @@ yes.1: $(common_dep) $(srcdir)/yes.x .
78 $(PERL) -- $(srcdir)/help2man \
79 --source='$(PACKAGE_STRING)' \
80 --include=$(srcdir)/$*.x \
81- --output=$t/$@ $t/$*; \
82+ --output=$t/$@ $*; \
83 } \
84 && sed 's|$*\.td/||g' $t/$@ > $@ \
85 && chmod a-w $@ \
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
new file mode 100644
index 0000000000..5ca590bcc6
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
@@ -0,0 +1,63 @@
1Upstream-Status: Inappropriate [legacy version]
2
3# coreutils uses gnulib which conflicts with newer libc header on futimens
4# this patch simply renames coreutils futimes to avoid confliction
5#
6# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
7# (this patch is licensed under GPLv2)
8
9diff --git a/lib/utimens.c b/lib/utimens.c
10index 71bc510..ae870b8 100644
11--- a/lib/utimens.c
12+++ b/lib/utimens.c
13@@ -75,7 +75,7 @@ struct utimbuf
14 Return 0 on success, -1 (setting errno) on failure. */
15
16 int
17-futimens (int fd ATTRIBUTE_UNUSED,
18+futimens_coreutils (int fd ATTRIBUTE_UNUSED,
19 char const *file, struct timespec const timespec[2])
20 {
21 /* Some Linux-based NFS clients are buggy, and mishandle time stamps
22@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED,
23 int
24 utimens (char const *file, struct timespec const timespec[2])
25 {
26- return futimens (-1, file, timespec);
27+ return futimens_coreutils (-1, file, timespec);
28 }
29diff --git a/lib/utimens.h b/lib/utimens.h
30index 0097aaa..13fc45a 100644
31--- a/lib/utimens.h
32+++ b/lib/utimens.h
33@@ -1,3 +1,3 @@
34 #include <time.h>
35-int futimens (int, char const *, struct timespec const [2]);
36+int futimens_coreutils (int, char const *, struct timespec const [2]);
37 int utimens (char const *, struct timespec const [2]);
38diff --git a/src/copy.c b/src/copy.c
39index 4bdb75c..04634f1 100644
40--- a/src/copy.c
41+++ b/src/copy.c
42@@ -518,7 +518,7 @@ copy_reg (char const *src_name, char const *dst_name,
43 timespec[0] = get_stat_atime (src_sb);
44 timespec[1] = get_stat_mtime (src_sb);
45
46- if (futimens (dest_desc, dst_name, timespec) != 0)
47+ if (futimens_coreutils (dest_desc, dst_name, timespec) != 0)
48 {
49 error (0, errno, _("preserving times for %s"), quote (dst_name));
50 if (x->require_preserve)
51diff --git a/src/touch.c b/src/touch.c
52index a79c26d..6ef317d 100644
53--- a/src/touch.c
54+++ b/src/touch.c
55@@ -182,7 +182,7 @@ touch (const char *file)
56 t = timespec;
57 }
58
59- ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
60+ ok = (futimens_coreutils (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
61
62 if (fd == STDIN_FILENO)
63 {
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
new file mode 100644
index 0000000000..8f355520bd
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
@@ -0,0 +1,21 @@
1Upstream-Status: Inappropriate [legacy version]
2
3# remove the line to cause recursive inclusion error from autoreconf, sicne
4# newer autoconf has included this definition. Simply rename it here.
5#
6# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
7# (this patch is licensed under GPLv2)
8
9diff --git a/extensions.m4 b/extensions.m4
10index 143a9e5..f6558f1 100644
11--- a/m4/extensions.m4
12+++ b/m4/extensions.m4
13@@ -16,7 +16,7 @@
14 # ------------------------
15 # Enable extensions on systems that normally disable them,
16 # typically due to standards-conformance issues.
17-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
18+AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS_DUMMY],
19 [
20 AC_BEFORE([$0], [AC_COMPILE_IFELSE])
21 AC_BEFORE([$0], [AC_RUN_IFELSE])
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
new file mode 100644
index 0000000000..c42cb9c059
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
@@ -0,0 +1,24 @@
1Upstream-Status: Inappropriate [legacy version]
2
3# man page for 'touch' is generated differently from others. All other utilities
4# are provided static man source files, while for 'touch' it requires help2man
5# to invoke "touch --help" and then convert the output into the manual. Since touch
6# is with target format which can't be invoked on build system, disable building
7# 'touch' man page here.
8#
9# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
10# (this patch is licensed under GPLv2)
11
12diff --git a/man/Makefile.am b/man/Makefile.am
13index 32df9d1..37b09e3 100644
14--- a/man/Makefile.am
15+++ b/man/Makefile.am
16@@ -27,7 +27,7 @@ dist_man_MANS = \
17 paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
18 rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \
19 shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
20- su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
21+ su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 tr.1 true.1 tsort.1 \
22 tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
23 whoami.1 yes.1 $(MAN)
24 optional_mans = \
diff --git a/meta/recipes-core/coreutils/coreutils-8.22/dummy_help2man.patch b/meta/recipes-core/coreutils/coreutils-8.22/dummy_help2man.patch
new file mode 100644
index 0000000000..4757f52aa0
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-8.22/dummy_help2man.patch
@@ -0,0 +1,22 @@
1Upstream-Status: Inappropriate [disable feature]
2
3Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
4diff -Nurd coreutils-8.21/man/local.mk coreutils-8.21/man/local.mk
5--- coreutils-8.21/man/local.mk 2013-02-05 16:01:21.000000000 +0200
6+++ coreutils-8.21/man/local.mk 2013-03-23 09:12:53.360470192 +0200
7@@ -19,11 +19,11 @@
8 EXTRA_DIST += man/help2man man/dummy-man
9
10 ## Graceful degradation for systems lacking perl.
11-if HAVE_PERL
12-run_help2man = $(PERL) -- $(srcdir)/man/help2man
13-else
14+#if HAVE_PERL
15+#run_help2man = $(PERL) -- $(srcdir)/man/help2man
16+#else
17 run_help2man = $(SHELL) $(srcdir)/man/dummy-man
18-endif
19+#endif
20
21 man1_MANS = @man1_MANS@
22 EXTRA_DIST += $(man1_MANS:.1=.x)
diff --git a/meta/recipes-core/coreutils/coreutils-8.22/fix-for-dummy-man-usage.patch b/meta/recipes-core/coreutils/coreutils-8.22/fix-for-dummy-man-usage.patch
new file mode 100644
index 0000000000..b7e82609bd
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-8.22/fix-for-dummy-man-usage.patch
@@ -0,0 +1,31 @@
1Upstream-Status: Pending
2
3coreutils: fix for dummy-man usage
4
5The options should be before the final argument, otherwise, the following error
6would appear when compiling.
7
8"dummy-man: too many non-option arguments"
9
10Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
11---
12 man/local.mk | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/man/local.mk b/man/local.mk
16index 7cef5e3..dc0865f 100644
17--- a/man/local.mk
18+++ b/man/local.mk
19@@ -189,8 +189,8 @@ man/yes.1: src/yes
20 && $(run_help2man) \
21 --source='$(PACKAGE_STRING)' \
22 --include=$(srcdir)/man/$$name.x \
23- --output=$$t/$$name.1 $$t/$$name \
24 --info-page='coreutils \(aq'$$name' invocation\(aq' \
25+ --output=$$t/$$name.1 $$t/$$name \
26 && sed \
27 -e 's|$*\.td/||g' \
28 -e '/For complete documentation/d' \
29--
301.7.9.5
31
diff --git a/meta/recipes-core/coreutils/coreutils-8.22/remove-usr-local-lib-from-m4.patch b/meta/recipes-core/coreutils/coreutils-8.22/remove-usr-local-lib-from-m4.patch
new file mode 100644
index 0000000000..2ef8a548ac
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-8.22/remove-usr-local-lib-from-m4.patch
@@ -0,0 +1,31 @@
1We have problem using hardcoded directories like /usr/local here
2which will be checked for cross builds. This is a special case which
3is valid for AIX only. We do not have AIX as one of our supported
4build host or target. Therefore we get rid of the hardcoded paths
5and make life easier for cross compilation process.
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8
9Upstream-Status: Inappropriate [Upstream does care for AIX while we may not]
10
11Index: coreutils-8.14/m4/getloadavg.m4
12===================================================================
13--- coreutils-8.14.orig/m4/getloadavg.m4 2011-09-19 08:09:24.000000000 -0700
14+++ coreutils-8.14/m4/getloadavg.m4 2011-10-19 21:42:00.385533357 -0700
15@@ -41,16 +41,6 @@
16 [LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
17 fi
18
19- if test $gl_func_getloadavg_done = no; then
20- # There is a commonly available library for RS/6000 AIX.
21- # Since it is not a standard part of AIX, it might be installed locally.
22- gl_getloadavg_LIBS=$LIBS
23- LIBS="-L/usr/local/lib $LIBS"
24- AC_CHECK_LIB([getloadavg], [getloadavg],
25- [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
26- [LIBS=$gl_getloadavg_LIBS])
27- fi
28-
29 # Set up the replacement function if necessary.
30 if test $gl_func_getloadavg_done = no; then
31 HAVE_GETLOADAVG=0
diff --git a/meta/recipes-core/coreutils/coreutils_6.9.bb b/meta/recipes-core/coreutils/coreutils_6.9.bb
new file mode 100644
index 0000000000..338aae3d52
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils_6.9.bb
@@ -0,0 +1,106 @@
1SUMMARY = "The basic file, shell and text manipulation utilities"
2DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
3manipulation utilities. These are the core utilities which are expected to exist on \
4every system."
5
6HOMEPAGE = "http://www.gnu.org/software/coreutils/"
7BUGTRACKER = "http://debbugs.gnu.org/coreutils"
8LICENSE = "GPLv2+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
10 file://src/ls.c;beginline=4;endline=16;md5=15ed60f67b1db5fedd5dbc37cf8a9543"
11PR = "r5"
12DEPENDS_class-native = "gettext-native"
13
14inherit autotools gettext
15
16SRC_URI_BASE = "${GNU_MIRROR}/coreutils/${BP}.tar.bz2 \
17 file://gnulib_m4.patch \
18 file://futimens.patch \
19 file://coreutils-ls-x.patch \
20 file://coreutils-6.9-cp-i-u.patch \
21 file://coreutils-i18n.patch \
22 file://coreutils-overflow.patch \
23 file://coreutils-fix-install.patch \
24 file://man-touch.patch \
25 file://coreutils_fix_for_automake-1.12.patch \
26 file://coreutils-build-with-acl.patch \
27 file://coreutils-fix-texinfo.patch \
28 "
29
30SRC_URI = "${SRC_URI_BASE} file://fix_for_manpage_building.patch"
31SRC_URI_class-native = "${SRC_URI_BASE}"
32
33SRC_URI[md5sum] = "c9607d8495f16e98906e7ed2d9751a06"
34SRC_URI[sha256sum] = "89c2895ad157de50e53298b22d91db116ee4e1dd3fdf4019260254e2e31497b0"
35
36
37# acl is not a default feature
38#
39PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
40PACKAGECONFIG_class-native ??= ""
41
42# with, without, depends, rdepends
43#
44PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
45
46
47# [ gets a special treatment and is not included in this
48bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \
49 env expand expr factor fmt fold groups head hostid id install \
50 join link logname md5sum mkfifo nice nl nohup od paste pathchk \
51 pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \
52 sha384sum sha512sum shred shuf sort split sum tac tail tee test \
53 tr tsort tty unexpand uniq unlink users vdir wc who whoami yes uptime"
54
55# hostname gets a special treatment and is not included in this
56base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
57 mknod mv pwd rm rmdir sleep stty sync touch true uname hostname stat"
58
59sbindir_progs= "chroot"
60
61# Let aclocal use the relative path for the m4 file rather than the
62# absolute since coreutils has a lot of m4 files, otherwise there might
63# be an "Argument list too long" error when it is built in a long/deep
64# directory.
65acpaths = "-I ./m4"
66
67do_install() {
68 autotools_do_install
69
70 install -d ${D}${base_bindir}
71 [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
72
73 install -d ${D}${sbindir}
74 [ "${bindir}" != "${sbindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i; done
75
76 # [ requires special handling because [.coreutils will cause the sed stuff
77 # in update-alternatives to fail, therefore use lbracket - the name used
78 # for the actual source file.
79 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
80
81 # Newer versions of coreutils do not include su, to mimic this behavior
82 # we simply remove it.
83 rm -f ${D}${bindir}/su
84}
85
86inherit update-alternatives
87
88ALTERNATIVE_PRIORITY = "100"
89
90ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs}"
91
92ALTERNATIVE_PRIORITY[uptime] = "10"
93ALTERNATIVE_PRIORITY[hostname] = "10"
94
95ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
96ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
97
98python __anonymous() {
99 for prog in d.getVar('base_bindir_progs', True).split():
100 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
101
102 for prog in d.getVar('sbindir_progs', True).split():
103 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog))
104}
105
106BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/coreutils/coreutils_8.22.bb b/meta/recipes-core/coreutils/coreutils_8.22.bb
new file mode 100644
index 0000000000..ba3a0a0228
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils_8.22.bb
@@ -0,0 +1,101 @@
1SUMMARY = "The basic file, shell and text manipulation utilities"
2DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
3manipulation utilities. These are the core utilities which are expected to exist on \
4every system."
5HOMEPAGE = "http://www.gnu.org/software/coreutils/"
6BUGTRACKER = "http://debbugs.gnu.org/coreutils"
7LICENSE = "GPLv3+"
8LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
9 file://src/ls.c;beginline=5;endline=16;md5=38b79785ca88537b75871782a2a3c6b8"
10DEPENDS = "gmp libcap"
11DEPENDS_class-native = ""
12
13inherit autotools gettext
14
15SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
16 file://remove-usr-local-lib-from-m4.patch \
17 file://dummy_help2man.patch \
18 file://fix-for-dummy-man-usage.patch \
19 "
20
21SRC_URI[md5sum] = "8fb0ae2267aa6e728958adc38f8163a2"
22SRC_URI[sha256sum] = "5b3e94998152c017e6c75d56b9b994188eb71bf46d4038a642cb9141f6ff1212"
23
24EXTRA_OECONF_class-native = "--without-gmp"
25EXTRA_OECONF_class-target = "--enable-install-program=arch --libexecdir=${libdir}"
26
27# acl is not a default feature
28#
29PACKAGECONFIG_class-target ??= "${@base_contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
30PACKAGECONFIG_class-native ??= ""
31
32# with, without, depends, rdepends
33#
34PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
35
36# [ df mktemp base64 gets a special treatment and is not included in this
37bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
38 env expand expr factor fmt fold groups head hostid id install \
39 join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \
40 pinky pr printenv printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
41 sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout\
42 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
43
44# hostname gets a special treatment and is not included in this
45base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
46 mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
47
48sbindir_progs= "chroot"
49
50# Let aclocal use the relative path for the m4 file rather than the
51# absolute since coreutils has a lot of m4 files, otherwise there might
52# be an "Argument list too long" error when it is built in a long/deep
53# directory.
54acpaths = "-I ./m4"
55
56# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
57do_compile_prepend () {
58 mkdir -p ${B}/src
59}
60
61do_install_append() {
62 for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
63
64 install -d ${D}${base_bindir}
65 [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
66
67 install -d ${D}${sbindir}
68 [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
69
70 # [ requires special handling because [.coreutils will cause the sed stuff
71 # in update-alternatives to fail, therefore use lbracket - the name used
72 # for the actual source file.
73 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
74}
75
76inherit update-alternatives
77
78ALTERNATIVE_PRIORITY = "100"
79ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df"
80
81ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
82ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
83
84ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
85ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
86
87ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
88ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
89
90ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
91ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
92
93python __anonymous() {
94 for prog in d.getVar('base_bindir_progs', True).split():
95 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
96
97 for prog in d.getVar('sbindir_progs', True).split():
98 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog))
99}
100
101BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/dbus-wait/dbus-wait_git.bb b/meta/recipes-core/dbus-wait/dbus-wait_git.bb
new file mode 100644
index 0000000000..fdb19ba503
--- /dev/null
+++ b/meta/recipes-core/dbus-wait/dbus-wait_git.bb
@@ -0,0 +1,17 @@
1SUMMARY = "A simple tool to wait for a specific signal over DBus"
2HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait"
3SECTION = "base"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
6
7DEPENDS = "dbus"
8
9SRCREV = "6cc6077a36fe2648a5f993fe7c16c9632f946517"
10PV = "0.1+git${SRCPV}"
11PR = "r2"
12
13SRC_URI = "git://git.yoctoproject.org/${BPN}"
14
15S = "${WORKDIR}/git"
16
17inherit autotools
diff --git a/meta/recipes-core/dbus/dbus-glib-0.100.2/no-examples.patch b/meta/recipes-core/dbus/dbus-glib-0.100.2/no-examples.patch
new file mode 100644
index 0000000000..fbb4967828
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib-0.100.2/no-examples.patch
@@ -0,0 +1,15 @@
1Disable compiling examples
2
3Upstream-Status: Inappropriate [disable feature]
4
5Signed-off-by: Kevin Tian <kevin.tian@intel.com>
6Signed-off-by: Scott Garman <scott.a.garman@intel.com>
7
8--- dbus-glib-0.70/dbus/Makefile.am.orig 2006-07-23 16:04:43.000000000 +0200
9+++ dbus-glib-0.70/dbus/Makefile.am 2006-07-23 16:04:52.000000000 +0200
10@@ -1,4 +1,4 @@
11-SUBDIRS = . examples
12+SUBDIRS = .
13
14 INCLUDES=-I$(top_srcdir) $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_GLIB_TOOL_CFLAGS) -DDBUS_COMPILATION=1 -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\"
15
diff --git a/meta/recipes-core/dbus/dbus-glib-0.100.2/obsolete_automake_macros.patch b/meta/recipes-core/dbus/dbus-glib-0.100.2/obsolete_automake_macros.patch
new file mode 100644
index 0000000000..40e3b12b5d
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib-0.100.2/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
1Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=59003]
2
3Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
4diff -Nurd dbus-glib-0.100/configure.ac dbus-glib-0.100/configure.ac
5--- dbus-glib-0.100/configure.ac 2012-06-25 19:26:39.000000000 +0300
6+++ dbus-glib-0.100/configure.ac 2013-01-03 04:53:22.314976758 +0200
7@@ -8,7 +8,7 @@
8
9 AM_INIT_AUTOMAKE([1.9])
10
11-AM_CONFIG_HEADER(config.h)
12+AC_CONFIG_HEADERS(config.h)
13
14 # Honor aclocal flags
15 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
diff --git a/meta/recipes-core/dbus/dbus-glib-0.100.2/test-install-makefile.patch b/meta/recipes-core/dbus/dbus-glib-0.100.2/test-install-makefile.patch
new file mode 100644
index 0000000000..2e8e178bb7
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib-0.100.2/test-install-makefile.patch
@@ -0,0 +1,48 @@
1Change Makefile.am to install regression tests for test package purpose.
2
3Upstream-Status: Inappropriate [test not install is for purpose from upstream]
4
5Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
6
7diff --git a/test/Makefile.am b/test/Makefile.am
8index 7ba11a8..249f0e7 100644
9--- a/test/Makefile.am
10+++ b/test/Makefile.am
11@@ -13,7 +13,8 @@ else
12 TEST_BINARIES=
13 endif
14
15-noinst_PROGRAMS= $(TEST_BINARIES)
16+testdir = $(datadir)/@PACKAGE@/tests
17+test_PROGRAMS= $(TEST_BINARIES)
18
19 test_service_SOURCES= \
20 test-service.c
21diff --git a/test/interfaces/Makefile.am b/test/interfaces/Makefile.am
22index 3cb2c39..e6de67d 100644
23--- a/test/interfaces/Makefile.am
24+++ b/test/interfaces/Makefile.am
25@@ -39,7 +39,8 @@ if DBUS_BUILD_TESTS
26
27 ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
28 ## build even when not doing "make check"
29-noinst_PROGRAMS = test-service test-client
30+testdir = $(datadir)/@PACKAGE@/tests/interfaces
31+test_PROGRAMS = test-service test-client
32
33 test_service_SOURCES = \
34 test-interfaces.c \
35diff --git a/test/core/Makefile.am b/test/core/Makefile.am
36index ef6cb26..9786c3a 100644
37--- a/test/core/Makefile.am
38+++ b/test/core/Makefile.am
39@@ -46,7 +46,8 @@ endif
40
41 ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
42 ## build even when not doing "make check"
43-noinst_PROGRAMS = \
44+testdir = $(datadir)/@PACKAGE@/tests/core
45+test_PROGRAMS = \
46 test-dbus-glib \
47 test-service-glib \
48 $(THREAD_APPS) \
diff --git a/meta/recipes-core/dbus/dbus-glib.inc b/meta/recipes-core/dbus/dbus-glib.inc
new file mode 100644
index 0000000000..6c60d9e408
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib.inc
@@ -0,0 +1,44 @@
1SUMMARY = "High level language (GLib) binding for D-Bus"
2DESCRIPTION = "GLib bindings for the D-Bus message bus that integrate \
3the D-Bus library with the GLib thread abstraction and main loop."
4HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
5LICENSE = "AFL-2 | GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=cf5b3a2f7083750d504333114e738656 \
7 file://dbus/dbus-glib.h;beginline=7;endline=21;md5=7755c9d7abccd5dbd25a6a974538bb3c"
8SECTION = "base"
9
10DEPENDS = "expat glib-2.0 virtual/libintl dbus-glib-native dbus"
11DEPENDS_class-native = "glib-2.0-native dbus-native"
12
13SRC_URI = "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-${PV}.tar.gz \
14 file://no-examples.patch \
15 file://test-install-makefile.patch \
16 file://obsolete_automake_macros.patch \
17"
18
19inherit autotools pkgconfig gettext
20
21#default disable regression tests, some unit test code in non testing code
22#PACKAGECONFIG_pn-${PN} = "tests" enable regression tests local.conf
23PACKAGECONFIG ??= ""
24PACKAGECONFIG[tests] = "--enable-tests,,,"
25
26EXTRA_OECONF = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml \
27 --with-dbus-binding-tool=${STAGING_BINDIR_NATIVE}/dbus-binding-tool"
28EXTRA_OECONF_class-native = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml"
29
30PACKAGES += "${PN}-bash-completion ${PN}-tests-dbg ${PN}-tests"
31
32FILES_${PN} = "${libdir}/lib*${SOLIBS}"
33FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d/dbus-bash-completion.sh \
34 ${libexecdir}/dbus-bash-completion-helper"
35FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
36FILES_${PN}-dev += "${bindir}/dbus-binding-tool"
37
38RDEPENDS_${PN}-tests += "dbus-x11"
39FILES_${PN}-tests = "${datadir}/${BPN}/tests"
40FILES_${PN}-tests-dbg = "${datadir}/${BPN}/tests/.debug/* \
41 ${datadir}/${BPN}/tests/core/.debug/* \
42 ${datadir}/${BPN}/tests/interfaces/.debug/*"
43
44BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/dbus/dbus-glib_0.100.2.bb b/meta/recipes-core/dbus/dbus-glib_0.100.2.bb
new file mode 100644
index 0000000000..c1bb06a1b4
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib_0.100.2.bb
@@ -0,0 +1,5 @@
1require dbus-glib.inc
2
3
4SRC_URI[md5sum] = "ad0920c7e3aad669163bb59171cf138e"
5SRC_URI[sha256sum] = "a5bb42da921f51c28161e0e54a5a8241d94a1c0499a14007150e9ce743da6ac5"
diff --git a/meta/recipes-core/dbus/dbus-test_1.6.18.bb b/meta/recipes-core/dbus/dbus-test_1.6.18.bb
new file mode 100644
index 0000000000..9a7cdc5eee
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-test_1.6.18.bb
@@ -0,0 +1,54 @@
1SUMMARY = "D-Bus test package (for D-bus functionality testing only)"
2HOMEPAGE = "http://dbus.freedesktop.org"
3SECTION = "base"
4LICENSE = "AFL-2 | GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
6 file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
7
8DEPENDS = "python-pygobject dbus dbus-glib"
9
10RDEPENDS_${PN} += "make"
11RDEPENDS_${PN}-dev = ""
12
13SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
14 file://tmpdir.patch \
15 file://ptest.patch \
16 file://dbus-1.init \
17 file://run-ptest \
18 file://python-config.patch \
19 file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
20 file://avoid_parallel_tests.patch \
21 "
22
23SRC_URI[md5sum] = "b02e9c95027a416987b81f9893831061"
24SRC_URI[sha256sum] = "7085a0895a9eb11a952394cdbea6d8b4358e17cb991fed0e8fb85e2b9e686dcd"
25
26S="${WORKDIR}/dbus-${PV}"
27FILESPATH = "${FILE_DIRNAME}/dbus"
28
29inherit autotools pkgconfig gettext ptest
30
31EXTRA_OECONF_X = "${@base_contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
32EXTRA_OECONF_X_class-native = "--without-x"
33
34EXTRA_OECONF = "--enable-tests \
35 --enable-modular-tests \
36 --enable-installed-tests \
37 --enable-checks \
38 --enable-asserts \
39 --enable-verbose-mode \
40 --disable-xml-docs \
41 --disable-doxygen-docs \
42 --disable-libaudit \
43 --with-xml=expat \
44 --disable-systemd \
45 --without-systemdsystemunitdir \
46 --with-dbus-test-dir=${PTEST_PATH} \
47 ${EXTRA_OECONF_X}"
48
49do_install() {
50}
51
52do_install_ptest() {
53 find ${D}${PTEST_PATH} -name Makefile | xargs sed -i 's/^Makefile:/_Makefile:/'
54}
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
new file mode 100644
index 0000000000..035221f61b
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -0,0 +1,157 @@
1SUMMARY = "D-Bus message bus"
2DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a \"single instance\" application or daemon, and to launch applications and daemons on demand when their services are needed."
3HOMEPAGE = "http://dbus.freedesktop.org"
4SECTION = "base"
5LICENSE = "AFL-2 | GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
7 file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
8DEPENDS = "expat virtual/libintl"
9RDEPENDS_dbus_class-native = ""
10RDEPENDS_dbus_class-nativesdk = ""
11PACKAGES += "${@bb.utils.contains('PTEST_ENABLED', '1', 'dbus-ptest', '', d)}"
12ALLOW_EMPTY_dbus-ptest = "1"
13RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest"
14
15SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
16 file://tmpdir.patch \
17 file://dbus-1.init \
18 file://os-test.patch \
19 file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
20 file://Set-correct-address-when-using-address-systemd.patch \
21 file://fixed-memory-freeing-if-error-during-listing-service.patch \
22"
23
24inherit useradd autotools pkgconfig gettext update-rc.d
25
26INITSCRIPT_NAME = "dbus-1"
27INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
28
29python __anonymous() {
30 if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
31 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
32}
33
34USERADD_PACKAGES = "${PN}"
35GROUPADD_PARAM_${PN} = "-r netdev"
36USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
37 --no-create-home --shell /bin/false \
38 --user-group messagebus"
39
40CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
41
42DEBIANNAME_${PN} = "dbus-1"
43
44PACKAGES =+ "${PN}-lib"
45
46OLDPKGNAME = "dbus-x11"
47OLDPKGNAME_class-nativesdk = ""
48
49# for compatibility
50RPROVIDES_${PN} = "${OLDPKGNAME}"
51RREPLACES_${PN} += "${OLDPKGNAME}"
52
53FILES_${PN} = "${bindir}/dbus-daemon* \
54 ${bindir}/dbus-uuidgen \
55 ${bindir}/dbus-cleanup-sockets \
56 ${bindir}/dbus-send \
57 ${bindir}/dbus-monitor \
58 ${bindir}/dbus-launch \
59 ${libexecdir}/dbus* \
60 ${sysconfdir} \
61 ${localstatedir} \
62 ${datadir}/dbus-1/services \
63 ${datadir}/dbus-1/system-services \
64 ${systemd_unitdir}/system/"
65FILES_${PN}-lib = "${libdir}/lib*.so.*"
66RRECOMMENDS_${PN}-lib = "${PN}"
67FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
68
69pkg_postinst_dbus() {
70 # If both systemd and sysvinit are enabled, mask the dbus-1 init script
71 if ${@base_contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
72 if [ -n "$D" ]; then
73 OPTS="--root=$D"
74 fi
75 systemctl $OPTS mask dbus-1.service
76 fi
77
78 if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
79 /etc/init.d/populate-volatile.sh update
80 fi
81}
82
83EXTRA_OECONF = "--disable-tests \
84 --disable-xml-docs \
85 --disable-doxygen-docs \
86 --disable-libaudit \
87 --with-xml=expat \
88 --disable-systemd"
89
90PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
91 ${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
92PACKAGECONFIG_class-native = ""
93PACKAGECONFIG_class-nativesdk = ""
94
95# Would like to --enable-systemd but that's a circular build-dependency between
96# systemd<->dbus
97PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir"
98PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
99
100do_install() {
101 autotools_do_install
102
103 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
104 install -d ${D}${sysconfdir}/init.d
105 sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
106 install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
107 fi
108
109 install -d ${D}${sysconfdir}/default/volatiles
110 echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
111 > ${D}${sysconfdir}/default/volatiles/99_dbus
112
113
114 mkdir -p ${D}${localstatedir}/lib/dbus
115
116 chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
117
118 chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
119 chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
120
121 # Remove Red Hat initscript
122 rm -rf ${D}${sysconfdir}/rc.d
123
124 # Remove empty testexec directory as we don't build tests
125 rm -rf ${D}${libdir}/dbus-1.0/test
126
127 # Remove /var/run as it is created on startup
128 rm -rf ${D}${localstatedir}/run
129}
130
131do_install_class-native() {
132 autotools_do_install
133
134 # for dbus-glib-native introspection generation
135 install -d ${STAGING_DATADIR_NATIVE}/dbus/
136 # N.B. is below install actually required?
137 install -m 0644 bus/session.conf ${STAGING_DATADIR_NATIVE}/dbus/session.conf
138
139 # dbus-glib-native and dbus-glib need this xml file
140 ./bus/dbus-daemon --introspect > ${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
141
142 # dbus-launch has no X support so lets not install it in case the host
143 # has a more featured and useful version
144 rm -f ${D}${bindir}/dbus-launch
145}
146
147do_install_class-nativesdk() {
148 autotools_do_install
149
150 # dbus-launch has no X support so lets not install it in case the host
151 # has a more featured and useful version
152 rm -f ${D}${bindir}/dbus-launch
153
154 # Remove /var/run to avoid QA error
155 rm -rf ${D}${localstatedir}/run
156}
157BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/dbus/dbus/Set-correct-address-when-using-address-systemd.patch b/meta/recipes-core/dbus/dbus/Set-correct-address-when-using-address-systemd.patch
new file mode 100644
index 0000000000..1fca9bb254
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/Set-correct-address-when-using-address-systemd.patch
@@ -0,0 +1,193 @@
1From d728fdc655f17031da3bb129ab2fd17dadf0fe3a Mon Sep 17 00:00:00 2001
2From: Simon Peeters <peeters.simon@gmail.com>
3Date: Sun, 7 Oct 2012 16:59:30 +0200
4Subject: [PATCH] Set correct address when using --address=systemd:
5
6When dbus gets launched through systemd, we need to create an address
7string based on the sockets passed.
8
9The _dbus_append_addres_from_socket() function is responsible for
10extracting the address information from the file-descriptor and
11formatting it in a dbus friendly way.
12
13This fixes bus activation when running dbus under a systemd session.
14
15https://bugs.freedesktop.org/show_bug.cgi?id=50962
16
17Upstream-Status: Backport
18
19Signed-off-by: Simon Peeters <peeters.simon@gmail.com>
20Signed-off-by: Jonathan Liu <net147@gmail.com>
21---
22 dbus/dbus-server-unix.c | 38 ++++++++++++++++++---------
23 dbus/dbus-sysdeps-unix.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++
24 dbus/dbus-sysdeps-unix.h | 4 +++
25 3 files changed, 97 insertions(+), 13 deletions(-)
26
27diff --git a/dbus/dbus-server-unix.c b/dbus/dbus-server-unix.c
28index 130f66e..d995240 100644
29--- a/dbus/dbus-server-unix.c
30+++ b/dbus/dbus-server-unix.c
31@@ -149,7 +149,7 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
32 }
33 else if (strcmp (method, "systemd") == 0)
34 {
35- int n, *fds;
36+ int i, n, *fds;
37 DBusString address;
38
39 n = _dbus_listen_systemd_sockets (&fds, error);
40@@ -159,27 +159,39 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
41 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
42 }
43
44- _dbus_string_init_const (&address, "systemd:");
45+ if (!_dbus_string_init (&address))
46+ goto systemd_oom;
47
48- *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL);
49- if (*server_p == NULL)
50+ for (i = 0; i < n; i++)
51 {
52- int i;
53-
54- for (i = 0; i < n; i++)
55+ if (i > 0)
56 {
57- _dbus_close_socket (fds[i], NULL);
58+ if (!_dbus_string_append (&address, ";"))
59+ goto systemd_oom;
60 }
61- dbus_free (fds);
62-
63- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
64- return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
65+ if (!_dbus_append_address_from_socket (fds[i], &address, error))
66+ goto systemd_err;
67 }
68
69+ *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL);
70+ if (*server_p == NULL)
71+ goto systemd_oom;
72+
73 dbus_free (fds);
74
75 return DBUS_SERVER_LISTEN_OK;
76- }
77+ systemd_oom:
78+ _DBUS_SET_OOM (error);
79+ systemd_err:
80+ for (i = 0; i < n; i++)
81+ {
82+ _dbus_close_socket (fds[i], NULL);
83+ }
84+ dbus_free (fds);
85+ _dbus_string_free (&address);
86+
87+ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
88+ }
89 #ifdef DBUS_ENABLE_LAUNCHD
90 else if (strcmp (method, "launchd") == 0)
91 {
92diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
93index b4ecc96..55743b1 100644
94--- a/dbus/dbus-sysdeps-unix.c
95+++ b/dbus/dbus-sysdeps-unix.c
96@@ -55,6 +55,7 @@
97 #include <netinet/in.h>
98 #include <netdb.h>
99 #include <grp.h>
100+#include <arpa/inet.h>
101
102 #ifdef HAVE_ERRNO_H
103 #include <errno.h>
104@@ -4160,4 +4161,71 @@ _dbus_check_setuid (void)
105 #endif
106 }
107
108+/**
109+ * Read the address from the socket and append it to the string
110+ *
111+ * @param fd the socket
112+ * @param address
113+ * @param error return location for error code
114+ */
115+dbus_bool_t
116+_dbus_append_address_from_socket (int fd,
117+ DBusString *address,
118+ DBusError *error)
119+{
120+ union {
121+ struct sockaddr sa;
122+ struct sockaddr_storage storage;
123+ struct sockaddr_un un;
124+ struct sockaddr_in ipv4;
125+ struct sockaddr_in6 ipv6;
126+ } socket;
127+ char hostip[INET6_ADDRSTRLEN];
128+ int size = sizeof (socket);
129+
130+ if (getsockname (fd, &socket.sa, &size))
131+ goto err;
132+
133+ switch (socket.sa.sa_family)
134+ {
135+ case AF_UNIX:
136+ if (socket.un.sun_path[0]=='\0')
137+ {
138+ if (_dbus_string_append_printf (address, "unix:abstract=%s", &(socket.un.sun_path[1])))
139+ return TRUE;
140+ }
141+ else
142+ {
143+ if (_dbus_string_append_printf (address, "unix:path=%s", socket.un.sun_path))
144+ return TRUE;
145+ }
146+ break;
147+ case AF_INET:
148+ if (inet_ntop (AF_INET, &socket.ipv4.sin_addr, hostip, sizeof (hostip)))
149+ if (_dbus_string_append_printf (address, "tcp:family=ipv4,host=%s,port=%u",
150+ hostip, ntohs (socket.ipv4.sin_port)))
151+ return TRUE;
152+ break;
153+#ifdef AF_INET6
154+ case AF_INET6:
155+ if (inet_ntop (AF_INET6, &socket.ipv6.sin6_addr, hostip, sizeof (hostip)))
156+ if (_dbus_string_append_printf (address, "tcp:family=ipv6,host=%s,port=%u",
157+ hostip, ntohs (socket.ipv6.sin6_port)))
158+ return TRUE;
159+ break;
160+#endif
161+ default:
162+ dbus_set_error (error,
163+ _dbus_error_from_errno (EINVAL),
164+ "Failed to read address from socket: Unknown socket type.");
165+ return FALSE;
166+ }
167+ err:
168+ dbus_set_error (error,
169+ _dbus_error_from_errno (errno),
170+ "Failed to open socket: %s",
171+ _dbus_strerror (errno));
172+ return FALSE;
173+}
174+
175 /* tests in dbus-sysdeps-util.c */
176diff --git a/dbus/dbus-sysdeps-unix.h b/dbus/dbus-sysdeps-unix.h
177index 9b70896..a265b33 100644
178--- a/dbus/dbus-sysdeps-unix.h
179+++ b/dbus/dbus-sysdeps-unix.h
180@@ -138,6 +138,10 @@ dbus_bool_t _dbus_parse_uid (const DBusString *uid_str,
181
182 void _dbus_close_all (void);
183
184+dbus_bool_t _dbus_append_address_from_socket (int fd,
185+ DBusString *address,
186+ DBusError *error);
187+
188 /** @} */
189
190 DBUS_END_DECLS
191--
1921.9.0
193
diff --git a/meta/recipes-core/dbus/dbus/avoid_parallel_tests.patch b/meta/recipes-core/dbus/dbus/avoid_parallel_tests.patch
new file mode 100644
index 0000000000..763b242ed4
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/avoid_parallel_tests.patch
@@ -0,0 +1,19 @@
1ptest needs buildtest-TESTS and runtest-TESTS targets.
2serial-tests is required to generate those targets.
3
4Signed-off-by: Alexandra Safta <alexandra.safta@enea.com>
5Upstream-Status: Pending
6
7diff -ruN a/configure.ac b/configure.ac
8
9--- a/configure.ac 2014-05-27 10:45:55.224225040 +0200
10+++ b/configure.ac 2014-05-27 10:46:28.810814636 +0200
11@@ -13,7 +13,7 @@
12 AC_CONFIG_HEADERS([config.h])
13 AC_CONFIG_MACRO_DIR([m4])
14
15-AM_INIT_AUTOMAKE([1.10 tar-ustar -Wno-portability])
16+AM_INIT_AUTOMAKE([1.10 tar-ustar -Wno-portability serial-tests])
17
18 GETTEXT_PACKAGE=dbus-1
19 AC_SUBST(GETTEXT_PACKAGE)
diff --git a/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch b/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
new file mode 100644
index 0000000000..6bb6d9c82e
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
@@ -0,0 +1,104 @@
1From b8f84bd39485d3977625c9a8b8e8cff5d23be56f Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Thu, 27 Feb 2014 09:05:02 +0800
4Subject: [PATCH] dbus: clear guid_from_server if send_negotiate_unix_fd
5 failed
6
7Upstream-Status: Submitted
8
9bus-test dispatch test failed with below information:
10 ./bus/bus-test: Running message dispatch test
11 Activating service name='org.freedesktop.DBus.TestSuiteEchoService'
12 Successfully activated service 'org.freedesktop.DBus.TestSuiteEchoService'
13 6363: assertion failed "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0" file "dbus-auth.c" line 1545 function process_ok
14 ./bus/bus-test(_dbus_print_backtrace+0x29) [0x80cb969]
15 ./bus/bus-test(_dbus_abort+0x14) [0x80cfb44]
16 ./bus/bus-test(_dbus_real_assert+0x53) [0x80b52c3]
17 ./bus/bus-test() [0x80e24da]
18 ./bus/bus-test(_dbus_auth_do_work+0x388) [0x80e3848]
19 ./bus/bus-test() [0x80aea49]
20 ./bus/bus-test() [0x80affde]
21 ./bus/bus-test(_dbus_transport_handle_watch+0xb1) [0x80ad841]
22 ./bus/bus-test(_dbus_connection_handle_watch+0x104) [0x8089174]
23 ./bus/bus-test(dbus_watch_handle+0xd8) [0x80b15e8]
24 ./bus/bus-test(_dbus_loop_iterate+0x4a9) [0x80d1509]
25 ./bus/bus-test(bus_test_run_clients_loop+0x5d) [0x808129d]
26 ./bus/bus-test() [0x806cab0]
27 ./bus/bus-test() [0x806e0ca]
28 ./bus/bus-test() [0x806da6f]
29 ./bus/bus-test(_dbus_test_oom_handling+0x18c) [0x80b5c8c]
30 ./bus/bus-test() [0x806f723]
31 ./bus/bus-test(bus_dispatch_test+0x3c) [0x8071aac]
32 ./bus/bus-test(main+0x1b7) [0x805acc7]
33 /lib/libc.so.6(__libc_start_main+0xf3) [0x45f919b3]
34 ./bus/bus-test() [0x805ae39]
35
36The stack is below:
37 #0 0xffffe425 in __kernel_vsyscall ()
38 #1 0x45fa62d6 in raise () from /lib/libc.so.6
39 #2 0x45fa9653 in abort () from /lib/libc.so.6
40 #3 0x080cfb65 in _dbus_abort () at dbus-sysdeps.c:94
41 #4 0x080b52c3 in _dbus_real_assert (condition=0,
42 condition_text=condition_text@entry=0x8117a38 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
43 file=file@entry=0x8117273 "dbus-auth.c", line=line@entry=1545,
44 func=func@entry=0x8117f8e <__FUNCTION__.3492> "process_ok")
45 data=0x8157290) at dbus-connection.c:1515
46 #0 0x00000033fee353e9 in raise () from /lib64/libc.so.6
47 #1 0x00000033fee38508 in abort () from /lib64/libc.so.6
48 #2 0x000000000047d585 in _dbus_abort () at dbus-sysdeps.c:94
49 #3 0x0000000000466486 in _dbus_real_assert (condition=<optimized out>,
50 condition_text=condition_text@entry=0x4c2988 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
51 file=file@entry=0x4c21a5 "dbus-auth.c", line=line@entry=1546,
52 func=func@entry=0x4c2fce <__FUNCTION__.3845> "process_ok")
53 at dbus-internals.c:931
54 #4 0x000000000048d424 in process_ok (args_from_ok=0x7fffffffe480,
55 auth=0x6ff340) at dbus-auth.c:1546
56 #5 handle_client_state_waiting_for_data (auth=0x6ff340,
57 command=<optimized out>, args=0x7fffffffe480) at dbus-auth.c:1996
58 #6 0x000000000048e789 in process_command (auth=0x6ff340) at dbus-auth.c:2208
59 #7 _dbus_auth_do_work (auth=0x6ff340) at dbus-auth.c:2458
60 #8 0x000000000046091d in do_authentication (
61 transport=transport@entry=0x6ffaa0, do_reading=do_reading@entry=1,
62 do_writing=do_writing@entry=0,
63 auth_completed=auth_completed@entry=0x7fffffffe55c)
64 at dbus-transport-socket.c:442
65 #9 0x0000000000461d08 in socket_handle_watch (transport=0x6ffaa0,
66 watch=0x6f4190, flags=1) at dbus-transport-socket.c:921
67 #10 0x000000000045fa3a in _dbus_transport_handle_watch (transport=0x6ffaa0,
68
69Once send_negotiate_unix_fd failed, this failure will happen, since
70auth->guid_from_server has been set to some value before
71send_negotiate_unix_fd. send_negotiate_unix_fd failure will lead to
72this auth be handled by process_ok again, but this auth->guid_from_server
73is not zero.
74
75So we should clear auth->guid_from_server if send_negotiate_unix_fd failed
76
77Signed-off-by: Roy Li <rongqing.li@windriver.com>
78---
79 dbus/dbus-auth.c | 9 +++++++--
80 1 file changed, 7 insertions(+), 2 deletions(-)
81
82diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
83index d2c37a7..37b45c6 100644
84--- a/dbus/dbus-auth.c
85+++ b/dbus/dbus-auth.c
86@@ -1571,8 +1571,13 @@ process_ok(DBusAuth *auth,
87 _dbus_verbose ("Got GUID '%s' from the server\n",
88 _dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server));
89
90- if (auth->unix_fd_possible)
91- return send_negotiate_unix_fd(auth);
92+ if (auth->unix_fd_possible) {
93+ if (!send_negotiate_unix_fd(auth)) {
94+ _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
95+ return FALSE;
96+ }
97+ return TRUE;
98+ }
99
100 _dbus_verbose("Not negotiating unix fd passing, since not possible\n");
101 return send_begin (auth);
102--
1031.7.10.4
104
diff --git a/meta/recipes-core/dbus/dbus/dbus-1.init b/meta/recipes-core/dbus/dbus/dbus-1.init
new file mode 100644
index 0000000000..42c86297c3
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/dbus-1.init
@@ -0,0 +1,123 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: dbus
4# Required-Start: $remote_fs $syslog
5# Required-Stop: $remote_fs $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 1
8# Short-Description: D-Bus systemwide message bus
9# Description: D-Bus is a simple interprocess messaging system, used
10# for sending messages between applications.
11### END INIT INFO
12#
13# -*- coding: utf-8 -*-
14# Debian init.d script for D-BUS
15# Copyright © 2003 Colin Walters <walters@debian.org>
16
17# set -e
18
19# Source function library.
20. /etc/init.d/functions
21
22DAEMON=@bindir@/dbus-daemon
23NAME=dbus
24DAEMONUSER=messagebus # must match /etc/dbus-1/system.conf
25PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
26UUIDDIR=/var/lib/dbus
27DESC="system message bus"
28EVENTDIR=/etc/dbus-1/event.d
29
30test -x $DAEMON || exit 0
31
32# Source defaults file; edit that file to configure this script.
33ENABLED=1
34PARAMS=""
35if [ -e /etc/default/dbus ]; then
36 . /etc/default/dbus
37fi
38
39test "$ENABLED" != "0" || exit 0
40
41start_it_up()
42{
43 mkdir -p "`dirname $PIDFILE`"
44 if [ -e $PIDFILE ]; then
45 PIDDIR=/proc/$(cat $PIDFILE)
46 if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
47 echo "$DESC already started; not starting."
48 else
49 echo "Removing stale PID file $PIDFILE."
50 rm -f $PIDFILE
51 fi
52 fi
53
54 if [ ! -d $UUIDDIR ]; then
55 mkdir -p $UUIDDIR
56 chown $DAEMONUSER $UUIDDIR
57 chgrp $DAEMONUSER $UUIDDIR
58 fi
59
60 dbus-uuidgen --ensure
61
62 echo -n "Starting $DESC: "
63 start-stop-daemon -o --start --quiet --pidfile $PIDFILE \
64 --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
65 echo "$NAME."
66 if [ -d $EVENTDIR ]; then
67 run-parts --arg=start $EVENTDIR
68 fi
69}
70
71shut_it_down()
72{
73 if [ -d $EVENTDIR ]; then
74 # TODO: --reverse when busybox supports it
75 run-parts --arg=stop $EVENTDIR
76 fi
77 echo -n "Stopping $DESC: "
78 start-stop-daemon -o --stop --quiet --pidfile $PIDFILE \
79 --user $DAEMONUSER
80 # We no longer include these arguments so that start-stop-daemon
81 # can do its job even given that we may have been upgraded.
82 # We rely on the pidfile being sanely managed
83 # --exec $DAEMON -- --system $PARAMS
84 echo "$NAME."
85 rm -f $PIDFILE
86}
87
88reload_it()
89{
90 echo -n "Reloading $DESC config: "
91 dbus-send --print-reply --system --type=method_call \
92 --dest=org.freedesktop.DBus \
93 / org.freedesktop.DBus.ReloadConfig > /dev/null
94 # hopefully this is enough time for dbus to reload it's config file.
95 echo "done."
96}
97
98case "$1" in
99 start)
100 start_it_up
101 ;;
102 stop)
103 shut_it_down
104 ;;
105 status)
106 status $DAEMON
107 exit $?
108 ;;
109 reload|force-reload)
110 reload_it
111 ;;
112 restart)
113 shut_it_down
114 sleep 1
115 start_it_up
116 ;;
117 *)
118 echo "Usage: /etc/init.d/$NAME {start|stop|status|restart|reload|force-reload}" >&2
119 exit 1
120 ;;
121esac
122
123exit 0
diff --git a/meta/recipes-core/dbus/dbus/fixed-memory-freeing-if-error-during-listing-service.patch b/meta/recipes-core/dbus/dbus/fixed-memory-freeing-if-error-during-listing-service.patch
new file mode 100644
index 0000000000..96290f41be
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/fixed-memory-freeing-if-error-during-listing-service.patch
@@ -0,0 +1,45 @@
1From 03aeaccbffa97c9237b57ca067e3da7388862129 Mon Sep 17 00:00:00 2001
2From: Radoslaw Pajak <r.pajak@samsung.com>
3Date: Fri, 8 Nov 2013 13:51:32 +0100
4Subject: [PATCH] fixed memory freeing if error during listing services
5
6Upstream-Status: Backport
7
8Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
9Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
10Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71526
11Signed-off-by: Jonathan Liu <net147@gmail.com>
12---
13 bus/activation.c | 2 +-
14 bus/services.c | 2 +-
15 2 files changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/bus/activation.c b/bus/activation.c
18index fcb7133..ea48a26 100644
19--- a/bus/activation.c
20+++ b/bus/activation.c
21@@ -2179,7 +2179,7 @@ bus_activation_list_services (BusActivation *activation,
22
23 error:
24 for (j = 0; j < i; j++)
25- dbus_free (retval[i]);
26+ dbus_free (retval[j]);
27 dbus_free (retval);
28
29 return FALSE;
30diff --git a/bus/services.c b/bus/services.c
31index 6f380fa..01a720e 100644
32--- a/bus/services.c
33+++ b/bus/services.c
34@@ -368,7 +368,7 @@ bus_registry_list_services (BusRegistry *registry,
35
36 error:
37 for (j = 0; j < i; j++)
38- dbus_free (retval[i]);
39+ dbus_free (retval[j]);
40 dbus_free (retval);
41
42 return FALSE;
43--
441.9.0
45
diff --git a/meta/recipes-core/dbus/dbus/os-test.patch b/meta/recipes-core/dbus/dbus/os-test.patch
new file mode 100644
index 0000000000..79554b1ee1
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/os-test.patch
@@ -0,0 +1,35 @@
1dbus: remove build host test in configure script
2
3The dbus build tests the build host to detect what initscript
4environment it expects. Remove the test and set it to "redhat"
5unconditionally as the oe-core initscript has a redhat-style pid file
6path.
7
8Signed-off-by: Andy Ross <andy.ross@windriver.com>
9Upstream-Status: innappropriate [embedded]
10
11diff -u a/configure.ac b/configure.ac
12--- a/configure.ac 2012-08-28 11:23:43.040609874 -0700
13+++ b/configure.ac 2012-08-28 11:54:25.602913945 -0700
14@@ -1348,19 +1348,8 @@
15 AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
16 AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
17
18-#### Check our operating system
19-operating_system=unknown
20-if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
21- operating_system=redhat
22-fi
23-
24-if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
25- operating_system=slackware
26-fi
27-
28-if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
29- operating_system=cygwin
30-fi
31+#### Build host test removed from upstream code, openembedded initscript is redhat-like:
32+operating_system=redhat
33
34 #### Sort out init scripts
35
diff --git a/meta/recipes-core/dbus/dbus/ptest.patch b/meta/recipes-core/dbus/dbus/ptest.patch
new file mode 100644
index 0000000000..263d17eff7
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/ptest.patch
@@ -0,0 +1,154 @@
1Add install-ptest rules.
2Change TEST_ENVIRONMENT to allow running outside build dir.
3
4 Makefile.am | 7 +++++++
5 bus/Makefile.am | 6 ++++++
6 dbus/Makefile.am | 6 ++++++
7 doc/Makefile.am | 4 ++++
8 test/Makefile.am | 25 ++++++++++++++++++++-----
9 test/name-test/Makefile.am | 9 +++++++++
10 tools/Makefile.am | 12 ++++++++++++
11 7 files changed, 64 insertions(+), 5 deletions(-)
12
13Signed-off-by: Björn Stenberg <bjst@enea.com>
14Upstream-Status: Pending
15
16diff -ur a/Makefile.am b/Makefile.am
17--- a/Makefile.am 2012-12-06 14:34:01.157414449 +0100
18+++ b/Makefile.am 2012-12-06 15:21:14.447113035 +0100
19@@ -30,4 +30,11 @@
20
21 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
22
23+if DBUS_BUILD_TESTS
24+install-ptest:
25+ @for subdir in $(SUBDIRS); do \
26+ $(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \
27+ done
28+endif
29+
30 include tools/lcov.am
31diff -ur a/bus/Makefile.am b/bus/Makefile.am
32--- a/bus/Makefile.am 2012-12-06 14:34:01.169413931 +0100
33+++ b/bus/Makefile.am 2012-12-06 15:21:14.463112346 +0100
34@@ -290,3 +290,9 @@
35 #### Extra dist
36
37 EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES)
38+
39+if DBUS_BUILD_TESTS
40+install-ptest:
41+ @$(MKDIR_P) $(DESTDIR)
42+ @install $(dbus_daemon_exec_PROGRAMS) $(noinst_PROGRAMS) $(DESTDIR)
43+endif
44diff -ur a/dbus/Makefile.am b/dbus/Makefile.am
45--- a/dbus/Makefile.am 2012-12-06 14:34:01.161414276 +0100
46+++ b/dbus/Makefile.am 2012-12-06 15:21:14.451112862 +0100
47@@ -310,3 +310,9 @@
48 update-systemd:
49 curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
50 curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h
51+
52+if DBUS_BUILD_TESTS
53+install-ptest:
54+ @$(MKDIR_P) $(DESTDIR)
55+ @install $(noinst_PROGRAMS) $(DESTDIR)
56+endif
57diff -ur a/test/Makefile.am b/test/Makefile.am
58--- a/test/Makefile.am 2012-12-06 14:34:01.165414103 +0100
59+++ b/test/Makefile.am 2012-12-06 15:21:14.455112690 +0100
60@@ -119,12 +119,13 @@
61 DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
62 DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
63
64+ptest_run_dir = ..
65+
66 TESTS_ENVIRONMENT = \
67- DBUS_BLOCK_ON_ABORT=1 \
68- DBUS_FATAL_WARNINGS=1 \
69- DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
70- DBUS_TEST_DATA=@abs_top_builddir@/test/data \
71- DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
72+ DBUS_FATAL_WARNINGS=0 \
73+ DBUS_TEST_DAEMON=$(ptest_run_dir)/bus/dbus-daemon$(EXEEXT) \
74+ DBUS_TEST_DATA=$(ptest_run_dir)/test/data \
75+ DBUS_TEST_HOMEDIR=$(ptest_run_dir)/dbus \
76 $(NULL)
77
78 test_corrupt_SOURCES = corrupt.c
79@@ -325,3 +325,25 @@
80 data/valid-config-files/system.conf: $(top_builddir)/bus/system.conf
81 $(AM_V_at)$(MKDIR_P) data/valid-config-files
82 $(AM_V_GEN)cp $< $@
83+
84+if DBUS_BUILD_TESTS
85+install-ptest: install-ptest-nonrecursive
86+ @for subdir in $(SUBDIRS); do \
87+ if [ $$subdir != "." ]; then \
88+ $(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \
89+ fi; \
90+ done
91+
92+install-ptest-nonrecursive:
93+ @$(MKDIR_P) $(DESTDIR)/data/valid-config-files/session.d
94+ @for file in Makefile $(installable_tests) $(noinst_PROGRAMS) $(noinst_DATA) ; do \
95+ if [ -f .libs/$$file ]; then \
96+ install .libs/$$file $(DESTDIR); \
97+ else \
98+ install -D $${file%.in} $(DESTDIR)/$${file%.in}; \
99+ fi; \
100+ done;
101+ @for file in $(EXTRA_DIST); do \
102+ install -D ${srcdir}/$${file%.in} $(DESTDIR)/$${file%.in}; \
103+ done;
104+endif
105diff -ur a/test/name-test/Makefile.am b/test/name-test/Makefile.am
106--- a/test/name-test/Makefile.am 2012-12-06 14:34:01.169413931 +0100
107+++ b/test/name-test/Makefile.am 2012-12-06 15:21:14.459112518 +0100
108@@ -36,4 +36,16 @@
109 test_privserver_client_LDADD=../libdbus-testutils.la
110 test_autolaunch_LDADD=../libdbus-testutils.la
111
112+install-ptest:
113+ @$(MKDIR_P) $(DESTDIR)
114+ @for file in Makefile $(noinst_PROGRAMS); do \
115+ if [ -f .libs/$$file ]; then \
116+ install .libs/$$file $(DESTDIR); \
117+ else \
118+ install $$file $(DESTDIR); \
119+ fi \
120+ done;
121+ @for file in $(EXTRA_DIST); do \
122+ cp $(srcdir)/$$file $(DESTDIR); \
123+ done;
124 endif
125diff -ur a/tools/Makefile.am b/tools/Makefile.am
126--- a/tools/Makefile.am 2012-12-06 14:34:01.161414276 +0100
127+++ b/tools/Makefile.am 2012-12-06 15:21:14.455112690 +0100
128@@ -78,3 +78,15 @@
129
130 installcheck-local:
131 test -d $(DESTDIR)$(localstatedir)/lib/dbus
132+
133+if DBUS_BUILD_TESTS
134+install-ptest:
135+ @$(MKDIR_P) $(DESTDIR)
136+ @for file in $(bin_PROGRAMS); do \
137+ if [ -f .libs/$$file ]; then \
138+ install .libs/$$file $(DESTDIR); \
139+ else \
140+ install $$file $(DESTDIR); \
141+ fi; \
142+ done;
143+endif
144diff -ur a/doc/Makefile.am b/doc/Makefile.am
145--- a/doc/Makefile.am 2012-06-06 12:45:55.000000000 +0200
146+++ b/doc/Makefile.am 2012-12-06 16:04:58.990070587 +0100
147@@ -174,3 +174,7 @@
148
149 maintainer-clean-local:
150 rm -f $(XMLTO_OUTPUT)
151+
152+if DBUS_BUILD_TESTS
153+install-ptest:
154+endif
diff --git a/meta/recipes-core/dbus/dbus/python-config.patch b/meta/recipes-core/dbus/dbus/python-config.patch
new file mode 100644
index 0000000000..294400247e
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/python-config.patch
@@ -0,0 +1,25 @@
1When building the dbus-ptest package, we have to enable python. However
2checking if the host-system python has the necessary library isn't useful.
3
4Disable the python module check for cross compiling.
5
6Upstream-Status: Inappropriate [oe specific]
7
8Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
9
10--- dbus-1.6.8/configure.ac.orig 2013-07-11 14:15:58.834554799 -0500
11+++ dbus-1.6.8/configure.ac 2013-07-11 14:14:40.969554848 -0500
12@@ -257,13 +257,6 @@
13 # full test coverage is required, Python is a hard dependency
14 AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject])
15 AM_PATH_PYTHON([2.6])
16- AC_MSG_CHECKING([for Python modules for full test coverage])
17- if "$PYTHON" -c "import dbus, gobject, dbus.mainloop.glib"; then
18- AC_MSG_RESULT([yes])
19- else
20- AC_MSG_RESULT([no])
21- AC_MSG_ERROR([cannot import dbus, gobject, dbus.mainloop.glib Python modules])
22- fi
23 else
24 # --enable-tests not given: do not abort if Python is missing
25 AM_PATH_PYTHON([2.6], [], [:])
diff --git a/meta/recipes-core/dbus/dbus/run-ptest b/meta/recipes-core/dbus/dbus/run-ptest
new file mode 100755
index 0000000000..e08ecb1a63
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2cd test
3make -k runtest-TESTS
diff --git a/meta/recipes-core/dbus/dbus/tmpdir.patch b/meta/recipes-core/dbus/dbus/tmpdir.patch
new file mode 100644
index 0000000000..bf086e1788
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/tmpdir.patch
@@ -0,0 +1,44 @@
1From 5105fedd7fa13dadd2d0d864fb77873b83b79a4b Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Thu, 23 Jun 2011 13:52:09 +0200
4Subject: [PATCH] buildsys: hardcode socketdir to /tmp
5
6the TMPDIR env var isn't always pointing to the right target path
7
8Upstream-Status: Inappropriate [embedded]
9
10Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
11
12Original comment:
13
14 avoid to check tmp dir at build time. instead uses hard coded /tmp here
15 comment added by Kevin Tian <kevin.tian@intel.com>
16---
17 configure.ac | 11 +----------
18 1 files changed, 1 insertions(+), 10 deletions(-)
19
20diff --git a/configure.ac b/configure.ac
21index 408054b..6d26180 100644
22--- a/configure.ac
23+++ b/configure.ac
24@@ -1483,16 +1483,7 @@ AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
25 AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY",
26 [Full path to the launch helper test program in the builddir])
27
28-#### Find socket directories
29-if ! test -z "$TMPDIR" ; then
30- DEFAULT_SOCKET_DIR=$TMPDIR
31-elif ! test -z "$TEMP" ; then
32- DEFAULT_SOCKET_DIR=$TEMP
33-elif ! test -z "$TMP" ; then
34- DEFAULT_SOCKET_DIR=$TMP
35-else
36- DEFAULT_SOCKET_DIR=/tmp
37-fi
38+DEFAULT_SOCKET_DIR=/tmp
39
40 DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
41
42--
431.6.6.1
44
diff --git a/meta/recipes-core/dbus/dbus_1.6.18.bb b/meta/recipes-core/dbus/dbus_1.6.18.bb
new file mode 100644
index 0000000000..7270c36f95
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus_1.6.18.bb
@@ -0,0 +1,4 @@
1include dbus.inc
2
3SRC_URI[md5sum] = "b02e9c95027a416987b81f9893831061"
4SRC_URI[sha256sum] = "7085a0895a9eb11a952394cdbea6d8b4358e17cb991fed0e8fb85e2b9e686dcd"
diff --git a/meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch b/meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch
new file mode 100644
index 0000000000..6f828cfc51
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch
@@ -0,0 +1,229 @@
1Fix various linkage errors for LibTomCrypt library in order to run tests
2using ANSI-C PRNG algorithm. Also check that XCLOCKS_PER_SEC is larger than 1000000
3so that there may be a valid PRNG (Pseudo Random Number Generator).
4Customize the tests output to be ptest-compliant <result: testname>.
5
6Upstream-Status: Pending
7Signed-off-by: Dorin Gheorghe<dorin.gheorghe@enea.com>
8
9diff -Naur dropbear-2012.55/libtomcrypt/Makefile.in dropbear-2012.55.modified/libtomcrypt/Makefile.in
10--- dropbear-2012.55/libtomcrypt/Makefile.in 2013-04-16 14:20:45.270448945 +0200
11+++ dropbear-2012.55.modified/libtomcrypt/Makefile.in 2013-04-16 11:00:06.517614900 +0200
12@@ -19,7 +19,7 @@
13
14 # Compilation flags. Note the += does not write over the user's CFLAGS!
15 # The rest of the flags come from the parent Dropbear makefile
16-CFLAGS += -c -I$(srcdir)/src/headers/ -I$(srcdir)/../
17+CFLAGS += -c -I$(srcdir)/src/headers/ -I$(srcdir)/../ -I./testprof
18
19 # additional warnings (newer GCC 3.4 and higher)
20 ifdef GCC_34
21@@ -175,6 +175,7 @@
22 MULTIS=demos/multi.o
23 TIMINGS=demos/timing.o
24 TESTS=demos/test.o
25+YARROW=src/prngs/yarrow.o src/prngs/rng_make_prng.o src/prngs/rng_get_bytes.o
26
27 #Files left over from making the crypt.pdf.
28 LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out
29@@ -227,8 +228,8 @@
30 timing: library testprof/$(LIBTEST) $(TIMINGS)
31 $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING)
32
33-test: library testprof/$(LIBTEST) $(TESTS)
34- $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST)
35+test: library testprof/$(LIBTEST) $(TESTS) $(YARROW)
36+ $(CC) $(LDFLAGS) $(TESTS) $(YARROW) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST)
37
38 #This rule installs the library and the header files. This must be run
39 #as root in order to have a high enough permission to write to the correct
40diff -Naur dropbear-2012.55/libtomcrypt/demos/test.c dropbear-2012.55.modified/libtomcrypt/demos/test.c
41--- dropbear-2012.55/libtomcrypt/demos/test.c 2012-02-23 14:47:05.000000000 +0100
42+++ dropbear-2012.55.modified/libtomcrypt/demos/test.c 2013-04-18 14:30:44.519839797 +0200
43@@ -12,21 +12,21 @@
44 #elif defined(USE_GMP)
45 ltc_mp = gmp_desc;
46 #else
47- extern ltc_math_descriptor EXT_MATH_LIB;
48+ ltc_math_descriptor EXT_MATH_LIB;
49 ltc_mp = EXT_MATH_LIB;
50 #endif
51
52 printf("build == \n%s\n", crypt_build_settings);
53- printf("\nstore_test...."); fflush(stdout); x = store_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
54- printf("\ncipher_test..."); fflush(stdout); x = cipher_hash_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
55- printf("\nmodes_test...."); fflush(stdout); x = modes_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
56- printf("\nder_test......"); fflush(stdout); x = der_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
57- printf("\nmac_test......"); fflush(stdout); x = mac_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
58- printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
59- printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
60- printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
61- printf("\ndsa_test......"); fflush(stdout); x = dsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
62- printf("\nkatja_test...."); fflush(stdout); x = katja_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
63+ fflush(stdout); x = store_test(); printf(x ? "FAIL: " : "PASS: "); printf("store_test\n"); if (x) exit(EXIT_FAILURE);
64+ fflush(stdout); x = cipher_hash_test(); printf(x ? "FAIL: " : "PASS: "); printf("cipher_test\n"); if (x) exit(EXIT_FAILURE);
65+ fflush(stdout); x = modes_test(); printf(x ? "FAIL: " : "PASS: "); printf("modes_test\n"); if (x) exit(EXIT_FAILURE);
66+ fflush(stdout); x = der_tests(); printf(x ? "FAIL: " : "PASS: "); printf("der_test\n"); if (x) exit(EXIT_FAILURE);
67+ fflush(stdout); x = mac_test(); printf(x ? "FAIL: " : "PASS: "); printf("mac_test\n"); if (x) exit(EXIT_FAILURE);
68+ fflush(stdout); x = pkcs_1_test(); printf(x ? "FAIL: " : "PASS: "); printf("pkcs_1_test\n"); if (x) exit(EXIT_FAILURE);
69+ fflush(stdout); x = rsa_test(); printf(x ? "FAIL: " : "PASS: "); printf("rsa_test\n"); if (x) exit(EXIT_FAILURE);
70+ fflush(stdout); x = ecc_tests(); printf(x ? "FAIL: " : "PASS: "); printf("ecc_test\n"); if (x) exit(EXIT_FAILURE);
71+ fflush(stdout); x = dsa_test(); printf(x ? "FAIL: " : "PASS: "); printf("dsa_test\n"); if (x) exit(EXIT_FAILURE);
72+ fflush(stdout); x = katja_test(); printf(x ? "FAIL: " : "PASS: "); printf("katja_test\n"); if (x) exit(EXIT_FAILURE);
73 printf("\n");
74 return EXIT_SUCCESS;
75 }
76diff -Naur dropbear-2012.55/libtomcrypt/src/ciphers/des.c dropbear-2012.55.modified/libtomcrypt/src/ciphers/des.c
77--- dropbear-2012.55/libtomcrypt/src/ciphers/des.c 2012-02-23 14:47:05.000000000 +0100
78+++ dropbear-2012.55.modified/libtomcrypt/src/ciphers/des.c 2013-04-16 11:05:46.171309548 +0200
79@@ -20,7 +20,7 @@
80 #define EN0 0
81 #define DE1 1
82
83-#if 0
84+#if 1
85 const struct ltc_cipher_descriptor des_desc =
86 {
87 "des",
88@@ -1520,7 +1520,7 @@
89 }
90 #endif
91
92-#if 0
93+#if 1
94 /**
95 Initialize the DES block cipher
96 @param key The symmetric key you wish to pass
97@@ -1581,7 +1581,7 @@
98 return CRYPT_OK;
99 }
100
101-#if 0
102+#if 1
103 /**
104 Encrypts a block of text with DES
105 @param pt The input plaintext (8 bytes)
106@@ -1672,7 +1672,7 @@
107 return CRYPT_OK;
108 }
109
110-#if 0
111+#if 1
112 /**
113 Performs a self-test of the DES block cipher
114 @return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
115@@ -1857,7 +1857,7 @@
116 #endif
117 }
118
119-#if 0
120+#if 1
121 /** Terminate the context
122 @param skey The scheduled key
123 */
124@@ -1874,7 +1874,7 @@
125 }
126
127
128-#if 0
129+#if 1
130 /**
131 Gets suitable key size
132 @param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
133diff -Naur dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_cipher.h dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_cipher.h
134--- dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_cipher.h 2012-02-23 14:47:05.000000000 +0100
135+++ dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_cipher.h 2013-04-16 10:41:21.916943343 +0200
136@@ -187,6 +187,7 @@
137 void *data;
138 } symmetric_key;
139
140+#define LTC_ECB_MODE
141 #ifdef LTC_ECB_MODE
142 /** A block cipher ECB structure */
143 typedef struct {
144diff -Naur dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_custom.h dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_custom.h
145--- dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_custom.h 2012-02-23 14:47:05.000000000 +0100
146+++ dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_custom.h 2013-04-16 14:02:10.794122645 +0200
147@@ -72,13 +72,15 @@
148
149 /* Enable self-test test vector checking */
150 /* Not for dropbear */
151-/*#define LTC_TEST*/
152+#define LTC_TEST
153+
154+#define YARROW
155
156 /* clean the stack of functions which put private information on stack */
157 /* #define LTC_CLEAN_STACK */
158
159 /* disable all file related functions */
160-#define LTC_NO_FILE
161+//#define LTC_NO_FILE
162
163 /* disable all forms of ASM */
164 /* #define LTC_NO_ASM */
165diff -Naur dropbear-2012.55/libtomcrypt/src/misc/crypt/crypt.c dropbear-2012.55.modified/libtomcrypt/src/misc/crypt/crypt.c
166--- dropbear-2012.55/libtomcrypt/src/misc/crypt/crypt.c 2012-02-23 14:47:06.000000000 +0100
167+++ dropbear-2012.55.modified/libtomcrypt/src/misc/crypt/crypt.c 2013-04-16 10:46:33.359842595 +0200
168@@ -15,7 +15,6 @@
169 Build strings, Tom St Denis
170 */
171
172-/*
173 const char *crypt_build_settings =
174 "LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n"
175 "LibTomCrypt is public domain software.\n"
176@@ -358,7 +357,7 @@
177 "\n"
178 "\n\n\n"
179 ;
180- */
181+
182
183
184 /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt.c,v $ */
185diff -Naur dropbear-2012.55/libtomcrypt/src/prngs/rng_get_bytes.c dropbear-2012.55.modified/libtomcrypt/src/prngs/rng_get_bytes.c
186--- dropbear-2012.55/libtomcrypt/src/prngs/rng_get_bytes.c 2012-02-23 14:47:06.000000000 +0100
187+++ dropbear-2012.55.modified/libtomcrypt/src/prngs/rng_get_bytes.c 2013-04-18 14:20:03.974930313 +0200
188@@ -60,7 +60,7 @@
189 clock_t t1;
190 int l, acc, bits, a, b;
191
192- if (XCLOCKS_PER_SEC < 100 || XCLOCKS_PER_SEC > 10000) {
193+ if (XCLOCKS_PER_SEC < 100 || XCLOCKS_PER_SEC > 1000000) {
194 return 0;
195 }
196
197diff -Naur dropbear-2012.55/libtomcrypt/testprof/cipher_hash_test.c dropbear-2012.55.modified/libtomcrypt/testprof/cipher_hash_test.c
198--- dropbear-2012.55/libtomcrypt/testprof/cipher_hash_test.c 2012-02-23 14:47:06.000000000 +0100
199+++ dropbear-2012.55.modified/libtomcrypt/testprof/cipher_hash_test.c 2013-04-16 14:08:22.042234657 +0200
200@@ -11,6 +11,8 @@
201
202 /* test ciphers */
203 for (x = 0; cipher_descriptor[x].name != NULL; x++) {
204+ /* md5 test is failing with segfault */
205+ if (!strcmp(cipher_descriptor[x].name, "md5")) break;
206 DO(cipher_descriptor[x].test());
207 }
208
209diff -Naur dropbear-2012.55/libtomcrypt/testprof/makefile dropbear-2012.55.modified/libtomcrypt/testprof/makefile
210--- dropbear-2012.55/libtomcrypt/testprof/makefile 2012-02-23 14:47:06.000000000 +0100
211+++ dropbear-2012.55.modified/libtomcrypt/testprof/makefile 2013-04-16 10:35:21.200110690 +0200
212@@ -1,4 +1,4 @@
213-CFLAGS += -I../src/headers -I./ -Wall -W
214+CFLAGS += -I../src/headers -I./ -I./../../ -Wall -W
215
216 # ranlib tools
217 ifndef RANLIB
218diff -Naur dropbear-2012.55/libtomcrypt/testprof/modes_test.c dropbear-2012.55.modified/libtomcrypt/testprof/modes_test.c
219--- dropbear-2012.55/libtomcrypt/testprof/modes_test.c 2012-02-23 14:47:06.000000000 +0100
220+++ dropbear-2012.55.modified/libtomcrypt/testprof/modes_test.c 2013-04-16 10:50:53.820882559 +0200
221@@ -1,6 +1,8 @@
222 /* test CFB/OFB/CBC modes */
223 #include <tomcrypt_test.h>
224
225+extern unsigned long yarrow_read(unsigned char *out, unsigned long outlen, prng_state *prng);
226+
227 int modes_test(void)
228 {
229 unsigned char pt[64], ct[64], tmp[64], key[16], iv[16], iv2[16];
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc
new file mode 100644
index 0000000000..40ed9d261d
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear.inc
@@ -0,0 +1,99 @@
1SUMMARY = "A lightweight SSH and SCP implementation"
2HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
3SECTION = "console/network"
4
5# some files are from other projects and have others license terms:
6# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY
7LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=4d290ce0ac102c828dfc9ce836784688"
9
10DEPENDS = "zlib"
11RPROVIDES_${PN} = "ssh sshd"
12
13DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
14
15SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
16 file://0001-urandom-xauth-changes-to-options.h.patch \
17 file://0003-configure.patch \
18 file://0004-fix-2kb-keys.patch \
19 file://0007-dropbear-fix-for-x32-abi.patch \
20 file://init \
21 file://dropbearkey.service \
22 file://dropbear@.service \
23 file://dropbear.socket \
24 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} "
25
26PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
27 file://0006-dropbear-configuration-file.patch \
28 file://dropbear"
29
30inherit autotools update-rc.d systemd
31
32INITSCRIPT_NAME = "dropbear"
33INITSCRIPT_PARAMS = "defaults 10"
34
35SYSTEMD_SERVICE_${PN} = "dropbear.socket"
36
37CFLAGS_prepend = " -I. "
38LD = "${CC}"
39
40SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
41BINCOMMANDS = "dbclient ssh scp"
42EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
43EXTRA_OECONF += "\
44 ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
45CFLAGS += "-DSFTPSERVER_PATH=\\"${libdir}/openssh/sftp-server\\""
46
47do_install() {
48 install -d ${D}${sysconfdir} \
49 ${D}${sysconfdir}/init.d \
50 ${D}${sysconfdir}/default \
51 ${D}${sysconfdir}/dropbear \
52 ${D}${bindir} \
53 ${D}${sbindir} \
54 ${D}${localstatedir}
55
56 install -m 0755 dropbearmulti ${D}${sbindir}/
57 ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient
58
59 for i in ${SBINCOMMANDS}
60 do
61 ln -s ./dropbearmulti ${D}${sbindir}/$i
62 done
63 cat ${WORKDIR}/init | sed -e 's,/etc,${sysconfdir},g' \
64 -e 's,/usr/sbin,${sbindir},g' \
65 -e 's,/var,${localstatedir},g' \
66 -e 's,/usr/bin,${bindir},g' \
67 -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/dropbear
68 chmod 755 ${D}${sysconfdir}/init.d/dropbear
69 if [ "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
70 install -d ${D}${sysconfdir}/pam.d
71 install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
72 fi
73
74 # deal with systemd unit files
75 install -d ${D}${systemd_unitdir}/system
76 install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system
77 install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system
78 install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system
79 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
80 -e 's,@BINDIR@,${bindir},g' \
81 -e 's,@SBINDIR@,${sbindir},g' \
82 ${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service
83}
84
85inherit update-alternatives
86
87ALTERNATIVE_PRIORITY = "20"
88ALTERNATIVE_${PN} = "scp ssh"
89
90ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti"
91
92pkg_postrm_append_${PN} () {
93 if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then
94 rm ${sysconfdir}/dropbear/dropbear_rsa_host_key
95 fi
96 if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then
97 rm ${sysconfdir}/dropbear/dropbear_dss_host_key
98 fi
99}
diff --git a/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
new file mode 100644
index 0000000000..71a4666b5c
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
@@ -0,0 +1,23 @@
1Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h
2
3Upstream-Status: Inappropriate [configuration]
4---
5 options.h | 2 +-
6 1 file changed, 1 insertion(+), 1 deletion(-)
7
8diff --git a/options.h b/options.h
9index 7d06322..71a21c2 100644
10--- a/options.h
11+++ b/options.h
12@@ -247,7 +247,7 @@ much traffic. */
13 /* The command to invoke for xauth when using X11 forwarding.
14 * "-q" for quiet */
15 #ifndef XAUTH_COMMAND
16-#define XAUTH_COMMAND "/usr/bin/X11/xauth -q"
17+#define XAUTH_COMMAND "xauth -q"
18 #endif
19
20 /* if you want to enable running an sftp server (such as the one included with
21--
221.7.11.7
23
diff --git a/meta/recipes-core/dropbear/dropbear/0003-configure.patch b/meta/recipes-core/dropbear/dropbear/0003-configure.patch
new file mode 100644
index 0000000000..2baf665ae4
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0003-configure.patch
@@ -0,0 +1,40 @@
1From c5f5c5054c1b15539dccf866e2c3faba7ed68456 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
3Date: Thu, 25 Apr 2013 00:27:25 +0200
4Subject: [PATCH 3/6] configure
5
6---
7 configure.ac | 11 ++++++++---
8 1 file changed, 8 insertions(+), 3 deletions(-)
9
10diff --git a/configure.ac b/configure.ac
11index 05461f3..9c16d90 100644
12--- a/configure.ac
13+++ b/configure.ac
14@@ -166,15 +166,20 @@ AC_ARG_ENABLE(openpty,
15 AC_MSG_NOTICE(Not using openpty)
16 else
17 AC_MSG_NOTICE(Using openpty if available)
18- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)])
19+ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
20 fi
21 ],
22 [
23 AC_MSG_NOTICE(Using openpty if available)
24- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
25+ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
26 ]
27 )
28-
29+
30+if test "x$dropbear_cv_func_have_openpty" = "xyes"; then
31+ AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)
32+ no_ptc_check=yes
33+ no_ptmx_check=yes
34+fi
35
36 AC_ARG_ENABLE(syslog,
37 [ --disable-syslog Don't include syslog support],
38--
391.7.11.7
40
diff --git a/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch b/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
new file mode 100644
index 0000000000..7539d2034f
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
@@ -0,0 +1,22 @@
1Subject: [PATCH 4/6] fix 2kb keys
2
3Upstream-Status: Inappropriate [configuration]
4---
5 kex.h | 2 +-
6 1 file changed, 1 insertion(+), 1 deletion(-)
7
8diff --git a/kex.h b/kex.h
9index 72430e9..375c677 100644
10--- a/kex.h
11+++ b/kex.h
12@@ -67,6 +67,6 @@ struct KEXState {
13 };
14
15
16-#define MAX_KEXHASHBUF 2000
17+#define MAX_KEXHASHBUF 3000
18
19 #endif /* _KEX_H_ */
20--
211.7.11.7
22
diff --git a/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
new file mode 100644
index 0000000000..c408c571e6
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
@@ -0,0 +1,28 @@
1Subject: [PATCH 5/6] dropbear enable pam
2
3dropbear: We need modify file option.h besides enabling pam in \
4configure if we want dropbear to support pam.
5
6Upstream-Status: Pending
7
8Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
9---
10 options.h | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13Index: dropbear-2013.62/options.h
14===================================================================
15--- dropbear-2013.62.orig/options.h 2014-01-14 21:53:02.803262009 +0000
16+++ dropbear-2013.62/options.h 2014-01-14 21:53:56.119263462 +0000
17@@ -192,9 +192,9 @@
18 * PAM challenge/response.
19 * You can't enable both PASSWORD and PAM. */
20
21-#define ENABLE_SVR_PASSWORD_AUTH
22+/*#define ENABLE_SVR_PASSWORD_AUTH*/
23 /* PAM requires ./configure --enable-pam */
24-/*#define ENABLE_SVR_PAM_AUTH */
25+#define ENABLE_SVR_PAM_AUTH
26 #define ENABLE_SVR_PUBKEY_AUTH
27
28 /* Whether to take public key options in
diff --git a/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
new file mode 100644
index 0000000000..fa4c8d0a67
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
@@ -0,0 +1,22 @@
1Subject: [PATCH 6/6] dropbear configuration file
2
3dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \
4to "/etc/pam.d/dropbear for dropbear when enabling pam supporting"
5
6Upstream-Status: Inappropriate [configuration]
7
8Signed-off-by: Maxin B. John <maxin.john@enea.com>
9Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
10---
11diff -Naur dropbear-2013.60-orig/svr-authpam.c dropbear-2013.60/svr-authpam.c
12--- dropbear-2013.60-orig/svr-authpam.c 2013-10-16 16:34:53.000000000 +0200
13+++ dropbear-2013.60/svr-authpam.c 2013-10-21 17:04:04.969416055 +0200
14@@ -211,7 +211,7 @@
15 userData.passwd = password;
16
17 /* Init pam */
18- if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
19+ if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
20 dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s",
21 rc, pam_strerror(pamHandlep, rc));
22 goto cleanup;
diff --git a/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch b/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch
new file mode 100644
index 0000000000..b4501211c3
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch
@@ -0,0 +1,140 @@
1Upstream-Status: Pending
2
3The dropbearkey utility built in x32 abi format, when generating ssh
4keys, was getting lost in the infinite loop.
5
6This patch fixes the issue by fixing types of variables and
7parameters of functions used in the code, which were getting
8undesired size, when compiled with the x32 abi toolchain.
9
102013/05/23
11Received this fix from H J Lu.
12
13Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
14
15# HG changeset patch
16# User H.J. Lu <hjl.tools@gmail.com>
17# Date 1369344079 25200
18# Node ID a10a1c46b857cc8a3923c3bb6d1504aa25b6052f
19# Parent e76614145aea67f66e4a4257685c771efba21aa1
20Typdef mp_digit to unsigned long long for MP_64BIT
21
22When GCC is used with MP_64BIT, we should typedef mp_digit to unsigned
23long long instead of unsigned long since for x32, unsigned long is
2432-bit and unsigned long long is 64-bit and it is safe to use unsigned
25long long for 64-bit integer with GCC.
26
27diff -r e76614145aea -r a10a1c46b857 libtommath/tommath.h
28--- a/libtommath/tommath.h Thu Apr 18 22:57:47 2013 +0800
29+++ b/libtommath/tommath.h Thu May 23 14:21:19 2013 -0700
30@@ -73,7 +73,7 @@
31 typedef signed long long long64;
32 #endif
33
34- typedef unsigned long mp_digit;
35+ typedef unsigned long long mp_digit;
36 typedef unsigned long mp_word __attribute__ ((mode(TI)));
37
38 #define DIGIT_BIT 60
39# HG changeset patch
40# User H.J. Lu <hjl.tools@gmail.com>
41# Date 1369344241 25200
42# Node ID c7555a4cb7ded3a88409ba85f4027baa7af5f536
43# Parent a10a1c46b857cc8a3923c3bb6d1504aa25b6052f
44Cast to mp_digit when updating *rho
45
46There is
47
48int
49mp_montgomery_setup (mp_int * n, mp_digit * rho)
50
51We should cast to mp_digit instead of unsigned long when updating
52*rho since mp_digit may be unsigned long long and unsigned long long
53may be different from unsigned long, like in x32.
54
55diff -r a10a1c46b857 -r c7555a4cb7de libtommath/bn_mp_montgomery_setup.c
56--- a/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:21:19 2013 -0700
57+++ b/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:24:01 2013 -0700
58@@ -48,7 +48,7 @@
59 #endif
60
61 /* rho = -1/m mod b */
62- *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK;
63+ *rho = (mp_digit)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK;
64
65 return MP_OKAY;
66 }
67# HG changeset patch
68# User H.J. Lu <hjl.tools@gmail.com>
69# Date 1369344541 25200
70# Node ID 7c656e7071a6412688b2f30a529a9afac6c7bf5a
71# Parent c7555a4cb7ded3a88409ba85f4027baa7af5f536
72Define LTC_FAST_TYPE to unsigned long long for __x86_64__
73
74We should define LTC_FAST_TYPE to unsigned long long instead of unsigned
75long if __x86_64__ to support x32 where unsigned long long is 64-bit
76and unsigned long is 32-bit.
77
78diff -r c7555a4cb7de -r 7c656e7071a6 libtomcrypt/src/headers/tomcrypt_cfg.h
79--- a/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:24:01 2013 -0700
80+++ b/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:29:01 2013 -0700
81@@ -74,7 +74,7 @@
82 #define ENDIAN_LITTLE
83 #define ENDIAN_64BITWORD
84 #define LTC_FAST
85- #define LTC_FAST_TYPE unsigned long
86+ #define LTC_FAST_TYPE unsigned long long
87 #endif
88
89 /* detect PPC32 */
90# HG changeset patch
91# User H.J. Lu <hjl.tools@gmail.com>
92# Date 1369344730 25200
93# Node ID a7d4690158fae4ede2c4e5b56233e83730bf38ee
94# Parent 7c656e7071a6412688b2f30a529a9afac6c7bf5a
95Use unsigned long long aas unsigned 64-bit integer for x86-64 GCC
96
97We should use unsigned long long instead of unsigned long as unsigned
9864-bit integer for x86-64 GCC to support x32 where unsigned long is
9932-bit.
100
101diff -r 7c656e7071a6 -r a7d4690158fa libtomcrypt/src/headers/tomcrypt_macros.h
102--- a/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:29:01 2013 -0700
103+++ b/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:32:10 2013 -0700
104@@ -343,7 +343,7 @@
105 /* 64-bit Rotates */
106 #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM)
107
108-static inline unsigned long ROL64(unsigned long word, int i)
109+static inline unsigned long long ROL64(unsigned long long word, int i)
110 {
111 asm("rolq %%cl,%0"
112 :"=r" (word)
113@@ -351,7 +351,7 @@
114 return word;
115 }
116
117-static inline unsigned long ROR64(unsigned long word, int i)
118+static inline unsigned long long ROR64(unsigned long long word, int i)
119 {
120 asm("rorq %%cl,%0"
121 :"=r" (word)
122@@ -361,7 +361,7 @@
123
124 #ifndef LTC_NO_ROLC
125
126-static inline unsigned long ROL64c(unsigned long word, const int i)
127+static inline unsigned long long ROL64c(unsigned long long word, const int i)
128 {
129 asm("rolq %2,%0"
130 :"=r" (word)
131@@ -369,7 +369,7 @@
132 return word;
133 }
134
135-static inline unsigned long ROR64c(unsigned long word, const int i)
136+static inline unsigned long long ROR64c(unsigned long long word, const int i)
137 {
138 asm("rorq %2,%0"
139 :"=r" (word)
140
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear b/meta/recipes-core/dropbear/dropbear/dropbear
new file mode 100644
index 0000000000..47e787fb10
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear
@@ -0,0 +1,4 @@
1#%PAM-1.0
2
3auth include common-auth
4account include common-account
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear.socket b/meta/recipes-core/dropbear/dropbear/dropbear.socket
new file mode 100644
index 0000000000..e5c61b755e
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear.socket
@@ -0,0 +1,10 @@
1[Unit]
2Conflicts=dropbear.service
3
4[Socket]
5ListenStream=22
6Accept=yes
7
8[Install]
9WantedBy=sockets.target
10Also=dropbearkey.service
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear@.service b/meta/recipes-core/dropbear/dropbear/dropbear@.service
new file mode 100644
index 0000000000..6fe9942090
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear@.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=SSH Per-Connection Server
3Wants=dropbearkey.service
4After=syslog.target dropbearkey.service
5
6[Service]
7EnvironmentFile=-/etc/default/dropbear
8ExecStart=-@SBINDIR@/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS
9ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
10StandardInput=socket
11KillMode=process
diff --git a/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/meta/recipes-core/dropbear/dropbear/dropbearkey.service
new file mode 100644
index 0000000000..ccc21d5cca
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbearkey.service
@@ -0,0 +1,8 @@
1[Unit]
2Description=SSH Key Generation
3ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key
4
5[Service]
6Type=oneshot
7ExecStart=@SBINDIR@/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
8RemainAfterExit=yes
diff --git a/meta/recipes-core/dropbear/dropbear/init b/meta/recipes-core/dropbear/dropbear/init
new file mode 100755
index 0000000000..e8fed3f94d
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/init
@@ -0,0 +1,113 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: sshd
4# Required-Start: $remote_fs $syslog $networking
5# Required-Stop: $remote_fs $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 1
8# Short-Description: Dropbear Secure Shell server
9### END INIT INFO
10#
11# Do not configure this file. Edit /etc/default/dropbear instead!
12#
13
14PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15DAEMON=/usr/sbin/dropbear
16NAME=dropbear
17DESC="Dropbear SSH server"
18PIDFILE=/var/run/dropbear.pid
19
20DROPBEAR_PORT=22
21DROPBEAR_EXTRA_ARGS=
22NO_START=0
23
24set -e
25
26test ! -r /etc/default/dropbear || . /etc/default/dropbear
27test "$NO_START" = "0" || exit 0
28test -x "$DAEMON" || exit 0
29test ! -h /var/service/dropbear || exit 0
30
31readonly_rootfs=0
32for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' </proc/mounts`; do
33 case $flag in
34 ro)
35 readonly_rootfs=1
36 ;;
37 esac
38done
39
40if [ $readonly_rootfs = "1" ]; then
41 mkdir -p /var/lib/dropbear
42 DROPBEAR_RSAKEY_DEFAULT="/var/lib/dropbear/dropbear_rsa_host_key"
43 DROPBEAR_DSSKEY_DEFAULT="/var/lib/dropbear/dropbear_dss_host_key"
44else
45 DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
46 DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key"
47fi
48
49test -z "$DROPBEAR_BANNER" || \
50 DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
51test -n "$DROPBEAR_RSAKEY" || \
52 DROPBEAR_RSAKEY=$DROPBEAR_RSAKEY_DEFAULT
53test -n "$DROPBEAR_DSSKEY" || \
54 DROPBEAR_DSSKEY=$DROPBEAR_DSSKEY_DEFAULT
55test -n "$DROPBEAR_KEYTYPES" || \
56 DROPBEAR_KEYTYPES="rsa"
57
58gen_keys() {
59for t in $DROPBEAR_KEYTYPES; do
60 case $t in
61 rsa)
62 if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
63 rm $DROPBEAR_RSAKEY || true
64 fi
65 test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
66 ;;
67 dsa)
68 if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
69 rm $DROPBEAR_DSSKEY || true
70 fi
71 test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
72 ;;
73 esac
74done
75}
76
77case "$1" in
78 start)
79 echo -n "Starting $DESC: "
80 gen_keys
81 KEY_ARGS=""
82 test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
83 test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
84 start-stop-daemon -S -p $PIDFILE \
85 -x "$DAEMON" -- $KEY_ARGS \
86 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
87 echo "$NAME."
88 ;;
89 stop)
90 echo -n "Stopping $DESC: "
91 start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
92 echo "$NAME."
93 ;;
94 restart|force-reload)
95 echo -n "Restarting $DESC: "
96 start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
97 sleep 1
98 KEY_ARGS=""
99 test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
100 test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
101 start-stop-daemon -S -p $PIDFILE \
102 -x "$DAEMON" -- $KEY_ARGS \
103 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
104 echo "$NAME."
105 ;;
106 *)
107 N=/etc/init.d/$NAME
108 echo "Usage: $N {start|stop|restart|force-reload}" >&2
109 exit 1
110 ;;
111esac
112
113exit 0
diff --git a/meta/recipes-core/dropbear/dropbear/run-ptest b/meta/recipes-core/dropbear/dropbear/run-ptest
new file mode 100644
index 0000000000..61f1e0c0dd
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/run-ptest
@@ -0,0 +1,2 @@
1#!/bin/sh
2cd libtomcrypt; ./test 2>&1 | sed 's/NOPPASS/SKIP/'
diff --git a/meta/recipes-core/dropbear/dropbear_2014.63.bb b/meta/recipes-core/dropbear/dropbear_2014.63.bb
new file mode 100644
index 0000000000..bb7e6178bc
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear_2014.63.bb
@@ -0,0 +1,4 @@
1require dropbear.inc
2
3SRC_URI[md5sum] = "7066bb9a2da708f3ed06314fdc9c47fd"
4SRC_URI[sha256sum] = "595992de432ba586a0e7e191bbb1ad587727678bb3e345b018c395b8c55b57ae"
diff --git a/meta/recipes-core/eglibc/cross-localedef-native_2.19.bb b/meta/recipes-core/eglibc/cross-localedef-native_2.19.bb
new file mode 100644
index 0000000000..3ce0e1d394
--- /dev/null
+++ b/meta/recipes-core/eglibc/cross-localedef-native_2.19.bb
@@ -0,0 +1,49 @@
1SUMMARY = "Cross locale generation tool for eglibc"
2HOMEPAGE = "http://www.eglibc.org/home"
3SECTION = "libs"
4LICENSE = "LGPL-2.1"
5
6LIC_DIR = "${WORKDIR}/eglibc-${PV}/libc"
7LIC_FILES_CHKSUM = "file://${LIC_DIR}/LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
8 file://${LIC_DIR}/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
9 file://${LIC_DIR}/posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
10 file://${LIC_DIR}/COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
11
12
13inherit native
14inherit autotools
15
16# pick up an eglibc patch
17FILESPATH = "${FILE_DIRNAME}/eglibc-${PV}"
18
19SRC_URI = "http://downloads.yoctoproject.org/releases/eglibc/eglibc-${PV}-svnr25243.tar.bz2 \
20 file://fix_for_centos_5.8.patch;patchdir=.. \
21 "
22SRC_URI[md5sum] = "197836c2ba42fb146e971222647198dd"
23SRC_URI[sha256sum] = "baaa030531fc308f7820c46acdf8e1b2f8e3c1f40bcd28b6e440d1c95d170d4c"
24
25S = "${WORKDIR}/eglibc-${PV}/localedef"
26
27do_unpack_append() {
28 bb.build.exec_func('do_move_ports', d)
29}
30
31do_move_ports() {
32 if test -d ${WORKDIR}/eglibc-${PV}/ports ; then
33 rm -rf ${WORKDIR}/libc/ports
34 mv ${WORKDIR}/eglibc-${PV}/ports ${WORKDIR}/libc/
35 fi
36}
37
38EXTRA_OECONF = "--with-glibc=${WORKDIR}/eglibc-${PV}/libc"
39CFLAGS += "-DNOT_IN_libc=1"
40
41do_configure () {
42 ${S}/configure ${EXTRA_OECONF}
43}
44
45
46do_install() {
47 install -d ${D}${bindir}
48 install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef
49}
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch b/meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch
new file mode 100644
index 0000000000..b4489e9ae9
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0001-R_ARM_TLS_DTPOFF32.patch
@@ -0,0 +1,56 @@
1
2Quote from bug 1443 which explains what the patch does :
3
4 We build some random program and link it with -lust. When we run it,
5 it dies with a SIGSEGV before reaching main().
6
7 Libust.so depends on liburcu-bp.so from the usermode-rcu package.
8 Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this
9 is critical.
10
11 Libust.so uses a TLS / __thread variable that is defined in liburcu-
12 bp.so. There are special ARM-specific relocation types that allow two
13 shared libraries to share thread-specific data. This is critical too.
14
15 One more critical issue: although liburcu-bp.so is prelinked, we can't
16 load it at its prelinked address, because we also link against
17 librt.so, and librt.so uses that address.
18
19 The dynamic linker is forced to relink liburcu-bp.so at a different
20 address. In the course of relinking, it processes the special ARM
21 relocation record mentioned above. The prelinker has already filled
22 in the information, which is a short offset into a table of thread-
23 specific data that is allocated per-thread for each library that uses
24 TLS. Because the normal behavior of a relocation is to add the symbol
25 value to an addend stored at the address being relocated, we end up
26 adding the short offset to itself, doubling it.
27
28 Now we have an awkward situation. The libust.so library doesn't know
29 about the addend, so its TLS data for this element is correct. The
30 liburcu-bp.so library has a different offset for the element. When we
31 go to initialize the element for the first time in liburcu-bp.so, we
32 write the address of the result at the doubled (broken) offset.
33 Later, when we refer to the address from libust.so, we check the value
34 at the correct offset, but it's NULL, so we eat hot SIGSEGV.
35
36Upstream-Status: Pending
37
38Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
39---
40 .../libc/ports/sysdeps/arm/dl-machine.h | 2 +-
41 1 file changed, 1 insertion(+), 1 deletion(-)
42
43ndex 8d905e8..dcfa71e 100644
44--- libc.orig/ports/sysdeps/arm/dl-machine.h
45+++ libc/ports/sysdeps/arm/dl-machine.h
46@@ -503,7 +503,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
47
48 case R_ARM_TLS_DTPOFF32:
49 if (sym != NULL)
50- *reloc_addr += sym->st_value;
51+ *reloc_addr = sym->st_value;
52 break;
53
54 case R_ARM_TLS_TPOFF32:
55--
56
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch
new file mode 100644
index 0000000000..4559a110fb
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-menuconfig-support.patch
@@ -0,0 +1,912 @@
1Pulled from
2http://www.eglibc.org/archives/patches/msg01042.html
3
4Upstream-Status: Pending
5Signed-off-by: Khem
6
7Hi,
8
9This patch adds 'make menuconfig' support to EGLIBC.
10
11
12EGLIBC can re-use the Linux kernel kconfig host tools ('conf' and 'mconf') unmodified, by passing appropriate environment variables and with some pre- and post-processing on the input/output config files.
13
14There are three new make targets supported, which all are defined in the new libc/options-config/Makefile, which is included by the top-level libc/Makefile:
15
16- 'make defconfig'. This passes 'libc/option-groups.defaults' to 'conf' as a default config, and outputs 'option-groups.config' to the top-level build directory, which will be the same as the default config.
17
18- 'make config'. This is the same line-oriented interface as in the Linux kernel. Input and output is 'option-groups.config' in the top-level build directory.
19
20- 'make menuconfig'. This is the same menu-based interface as in the Linux kernel. Input and output is 'option-groups.config' in the top-level build directory.
21
22
23Pre-Processing:
24
25
26The Linux kernel kconfig tools expect a prefix of "CONFIG_" on all config option names, but EGLIBC expects a prefix of "OPTION_". The pre-processing script, libc/options-config/config-preproc.pl, simply replaces "CONFIG_ with "OPTION_" in the given config file. The libc/options-config/Makefile passes the script output to a temporary config file, which is then passed to 'conf' or 'mconf'.
27
28Post-Processing (libc/options-config/config-postproc.pl):
29
30
31- Disabled options are output as a comment line of the form "# CONFIG_FOO is not set". This needs to be changed to an explicit "CONFIG_FOO=n" in order to be compatible with 'option-groups.awk' which generates the option-groups.h header.
32
33- "CONFIG_" prefix is changed back to "OPTION_".
34
35
36- The kconfig tools will not output anything for options that depend on a parent option, when the parent option is disabled. This implicit disable must be converted to an explicit "CONFIG_FOO=n" in order to be compatible with the way EGLIBC overrides the default option settings in 'libc/option-groups.defaults' with those in 'option-groups.config'.
37
38
39A new configure option, '--with-kconfig=<PATH>', tells EGLIBC where to find the pre-built 'conf' and 'mconf' host tools from Linux kernel builds.
40
41libc/EGLIBC.cross-building is updated to include instructions for using '--with-kconfig' for the final EGLIBC build, and shows how and when to run 'make *config'.
42
43libc/EGLIBC.option-groups is updated to include new information on the menuconfig support.
44
45Thanks,
46
47attached is the updated patch to address above issues.
48
49Steve
50
51--
52Steve Longerbeam | Senior Embedded Engineer, ESD Services
53Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
54P 510.354.5838 | M 408.410.2735
55Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS
56
57
58Index: libc/EGLIBC.cross-building
59===================================================================
60--- libc.orig/EGLIBC.cross-building
61+++ libc/EGLIBC.cross-building
62@@ -243,9 +243,29 @@ full EGLIBC build:
63 > $src/libc/configure \
64 > --prefix=/usr \
65 > --with-headers=$sysroot/usr/include \
66+ > --with-kconfig=$obj/linux/scripts/kconfig \
67 > --build=$build \
68 > --host=$target \
69 > --disable-profile --without-gd --without-cvs --enable-add-ons
70+
71+Note the additional '--with-kconfig' option. This tells EGLIBC where to
72+find the host config tools used by the kernel 'make config' and 'make
73+menuconfig'. These tools can be re-used by EGLIBC for its own 'make
74+*config' support, which will create 'option-groups.config' for you.
75+But first make sure those tools have been built by running some
76+dummy 'make *config' calls in the kernel directory:
77+
78+ $ cd $obj/linux
79+ $ PATH=$tools/bin:$PATH make config \
80+ > ARCH=$linux_arch CROSS_COMPILE=$target- \
81+ $ PATH=$tools/bin:$PATH make menuconfig \
82+ > ARCH=$linux_arch CROSS_COMPILE=$target- \
83+
84+Now we can configure and build the full EGLIBC:
85+
86+ $ cd $obj/eglibc
87+ $ PATH=$tools/bin:$PATH make defconfig
88+ $ PATH=$tools/bin:$PATH make menuconfig
89 $ PATH=$tools/bin:$PATH make
90 $ PATH=$tools/bin:$PATH make install install_root=$sysroot
91
92Index: libc/configure.ac
93===================================================================
94--- libc.orig/configure.ac
95+++ libc/configure.ac
96@@ -127,6 +127,16 @@ AC_ARG_WITH([headers],
97 [sysheaders=''])
98 AC_SUBST(sysheaders)
99
100+AC_ARG_WITH([kconfig],
101+ AC_HELP_STRING([--with-kconfig=PATH],
102+ [location of kconfig tools to use (from Linux
103+ kernel builds) to re-use for configuring EGLIBC
104+ option groups]),
105+ [KCONFIG_TOOLS=$withval],
106+ [KCONFIG_TOOLS=''])
107+AC_SUBST(KCONFIG_TOOLS)
108+
109+
110 AC_SUBST(use_default_link)
111 AC_ARG_WITH([default-link],
112 AC_HELP_STRING([--with-default-link],
113Index: libc/config.make.in
114===================================================================
115--- libc.orig/config.make.in
116+++ libc/config.make.in
117@@ -45,6 +45,8 @@ sysincludes = @SYSINCLUDES@
118 c++-sysincludes = @CXX_SYSINCLUDES@
119 all-warnings = @all_warnings@
120
121+kconfig_tools = @KCONFIG_TOOLS@
122+
123 have-z-combreloc = @libc_cv_z_combreloc@
124 have-z-execstack = @libc_cv_z_execstack@
125 have-Bgroup = @libc_cv_Bgroup@
126Index: libc/options-config/config-postproc.pl
127===================================================================
128--- /dev/null
129+++ libc/options-config/config-postproc.pl
130@@ -0,0 +1,54 @@
131+#!/usr/bin/perl
132+
133+$usage = "usage: $0 <default config file> <config file>\n";
134+
135+die "$usage" unless @ARGV;
136+$defaults = shift @ARGV;
137+die "$usage" unless @ARGV;
138+die "Could not open $ARGV[0]" unless -T $ARGV[0];
139+
140+sub yank {
141+ @option = grep($_ ne $_[0], @option);
142+}
143+
144+open(DEFAULTS, $defaults) || die "Could not open $defaults\n";
145+
146+# get the full list of available options using the default config file
147+$i = 0;
148+while (<DEFAULTS>) {
149+ if (/^\s*OPTION_(\w+)\s*=/) {
150+ $option[$i++] = $1;
151+ }
152+}
153+
154+# now go through the config file, making the necessary changes
155+while (<>) {
156+ if (/Linux Kernel Configuration/) {
157+ # change title
158+ s/Linux Kernel/Option Groups/;
159+ print;
160+ } elsif (/^\s*CONFIG_(\w+)\s*=/) {
161+ # this is an explicit option set line, change CONFIG_ to OPTION_
162+ # before printing and remove this option from option list
163+ $opt = $1;
164+ yank($opt);
165+ s/CONFIG_/OPTION_/g;
166+ print;
167+ } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) {
168+ # this is a comment line, change CONFIG_ to OPTION_, remove this
169+ # option from option list, and convert to explicit OPTION_FOO=n
170+ $opt = $1;
171+ yank($opt);
172+ s/CONFIG_/OPTION_/g;
173+ print "OPTION_$opt=n\n";
174+ } else {
175+ print;
176+ }
177+}
178+
179+# any options left in @options, are options that were not mentioned in
180+# the config file, and implicitly that means the option must be set =n,
181+# so do that here.
182+foreach $opt (@option) {
183+ print "OPTION_$opt=n\n";
184+}
185Index: libc/options-config/config-preproc.pl
186===================================================================
187--- /dev/null
188+++ libc/options-config/config-preproc.pl
189@@ -0,0 +1,8 @@
190+#!/usr/bin/perl
191+
192+if (@ARGV) {
193+ while (<>) {
194+ s/OPTION_/CONFIG_/g;
195+ print;
196+ }
197+}
198Index: libc/options-config/Makefile
199===================================================================
200--- /dev/null
201+++ libc/options-config/Makefile
202@@ -0,0 +1,55 @@
203+# ===========================================================================
204+# EGLIBC option-groups configuration targets
205+# These targets are included from top-level makefile
206+
207+ifneq ($(kconfig_tools),)
208+ifneq (no,$(PERL))
209+
210+ocdir := options-config
211+
212+OconfigDefaults := option-groups.defaults
213+OconfigDefaults_tmp := $(common-objpfx).tmp.defconfig
214+OconfigDef := option-groups.def
215+Oconfig := $(common-objpfx)option-groups.config
216+Oconfig_tmp := $(common-objpfx).tmp.config
217+
218+conf := $(kconfig_tools)/conf
219+mconf := $(kconfig_tools)/mconf
220+
221+preproc := $(PERL) $(ocdir)/config-preproc.pl
222+postproc := $(PERL) $(ocdir)/config-postproc.pl
223+
224+PHONY += defconfig config menuconfig
225+
226+defconfig: $(conf) $(OconfigDefaults) $(OconfigDef)
227+ rm -f $(OconfigDefaults_tmp)
228+ rm -f $(Oconfig_tmp)
229+ $(preproc) $(OconfigDefaults) > $(OconfigDefaults_tmp)
230+ KCONFIG_CONFIG=$(Oconfig_tmp) $< --defconfig=$(OconfigDefaults_tmp) \
231+ $(OconfigDef)
232+ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig)
233+ rm $(Oconfig_tmp)
234+ rm $(OconfigDefaults_tmp)
235+
236+config: $(conf) $(OconfigDefaults) $(OconfigDef)
237+ rm -f $(Oconfig_tmp)
238+ $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp)
239+ KCONFIG_CONFIG=$(Oconfig_tmp) $< --oldaskconfig $(OconfigDef)
240+ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig)
241+ rm $(Oconfig_tmp)
242+
243+menuconfig: $(mconf) $(OconfigDefaults) $(OconfigDef)
244+ rm -f $(Oconfig_tmp)
245+ $(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp)
246+ KCONFIG_CONFIG=$(Oconfig_tmp) $< $(OconfigDef)
247+ $(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig)
248+ rm $(Oconfig_tmp)
249+
250+# Help text used by make help
251+help:
252+ @echo ' defconfig - New config with default from default config'
253+ @echo ' config - Update current config utilising a line-oriented program'
254+ @echo ' menuconfig - Update current config utilising a menu based program'
255+
256+endif
257+endif
258Index: libc/option-groups.def
259===================================================================
260--- libc.orig/option-groups.def
261+++ libc/option-groups.def
262@@ -4,19 +4,19 @@
263 #
264 # An entry of the form:
265 #
266-# config OPTION_GROUP_NAME
267+# config GROUP_NAME
268 # bool "one-line explanation of what this option group controls"
269 # help
270 # Multi-line help explaining the option group's meaning in
271 # some detail, terminated by indentation level.
272 #
273-# defines an option group whose variable is OPTION_GROUP_NAME, with
274+# defines an option group whose variable is GROUP_NAME, with
275 # meaningful values 'y' (enabled) and 'n' (disabled). The
276 # documentation is formatted to be consumed by some sort of
277 # interactive configuration interface, but EGLIBC doesn't have such an
278 # interface yet.
279 #
280-# An option may have a 'depends' line, indicating which other options
281+# An option may have a 'depends on' line, indicating which other options
282 # must also be enabled if this option is. At present, EGLIBC doesn't
283 # check that these dependencies are satisfied.
284 #
285@@ -41,9 +41,9 @@
286 # although this simply reestablishes the value already set by
287 # 'option-groups.defaults'.
288
289-config OPTION_EGLIBC_ADVANCED_INET6
290+config EGLIBC_ADVANCED_INET6
291 bool "IPv6 Advanced Sockets API support (RFC3542)"
292- depends OPTION_EGLIBC_INET
293+ depends on EGLIBC_INET
294 help
295 This option group includes the functions specified by RFC 3542,
296 "Advanced Sockets Application Program Interface (API) for
297@@ -71,7 +71,7 @@ config OPTION_EGLIBC_ADVANCED_INET6
298 inet6_rth_segments
299 inet6_rth_space
300
301-config OPTION_EGLIBC_BACKTRACE
302+config EGLIBC_BACKTRACE
303 bool "Functions for producing backtraces"
304 help
305 This option group includes functions for producing a list of
306@@ -85,7 +85,7 @@ config OPTION_EGLIBC_BACKTRACE
307 backtrace_symbols
308 backtrace_symbols_fd
309
310-config OPTION_EGLIBC_BIG_MACROS
311+config EGLIBC_BIG_MACROS
312 bool "Use extensive inline code"
313 help
314 This option group specifies whether certain pieces of code
315@@ -93,7 +93,7 @@ config OPTION_EGLIBC_BIG_MACROS
316 group is not selected, function calls will be used instead,
317 hence reducing the library footprint.
318
319-config OPTION_EGLIBC_BSD
320+config EGLIBC_BSD
321 bool "BSD-specific functions, and their compatibility stubs"
322 help
323 This option group includes functions specific to BSD kernels.
324@@ -109,10 +109,9 @@ config OPTION_EGLIBC_BSD
325 revoke
326 setlogin
327
328-config OPTION_EGLIBC_CXX_TESTS
329+config EGLIBC_CXX_TESTS
330 bool "Tests that link against the standard C++ library."
331- depends OPTION_POSIX_WIDE_CHAR_DEVICE_IO
332- depends OPTION_EGLIBC_LIBM
333+ depends on POSIX_WIDE_CHAR_DEVICE_IO && EGLIBC_LIBM
334 help
335 This option group does not include any C library functions;
336 instead, it controls which EGLIBC tests an ordinary 'make
337@@ -121,23 +120,22 @@ config OPTION_EGLIBC_CXX_TESTS
338 run.
339
340 The standard C++ library depends on the math library 'libm' and
341- the wide character I/O functions included in EGLIBC. If those
342- option groups are disabled, this test must also be disabled.
343+ the wide character I/O functions included in EGLIBC. So those
344+ option groups must be enabled if this test is enabled.
345
346-config OPTION_EGLIBC_CATGETS
347+config EGLIBC_CATGETS
348 bool "Functions for accessing message catalogs"
349- depends OPTION_EGLIBC_LOCALE_CODE
350+ depends on EGLIBC_LOCALE_CODE
351 help
352 This option group includes functions for accessing message
353 catalogs: catopen, catclose, and catgets.
354
355- This option group depends on the OPTION_EGLIBC_LOCALE_CODE
356- option group; if you disable that, you must also disable this.
357+ This option group depends on the EGLIBC_LOCALE_CODE
358+ option group.
359
360-config OPTION_EGLIBC_CHARSETS
361+config EGLIBC_CHARSETS
362 bool "iconv/gconv character set conversion libraries"
363 help
364-
365 This option group includes support for character sets other
366 than ASCII (ANSI_X3.4-1968) and Unicode and ISO-10646 in their
367 various encodings. This affects both the character sets
368@@ -198,16 +196,16 @@ config OPTION_EGLIBC_CHARSETS
369 WCHAR_T - EGLIBC's internal form (target-endian,
370 32-bit ISO 10646)
371
372-config OPTION_EGLIBC_CRYPT
373+config EGLIBC_CRYPT
374 bool "Encryption library"
375 help
376 This option group includes the `libcrypt' library which
377 provides functions for one-way encryption. Supported
378 encryption algorithms include MD5, SHA-256, SHA-512 and DES.
379
380-config OPTION_EGLIBC_CRYPT_UFC
381+config EGLIBC_CRYPT_UFC
382 bool "Ultra fast `crypt' implementation"
383- depends OPTION_EGLIBC_CRYPT
384+ depends on EGLIBC_CRYPT
385 help
386 This option group provides ultra fast DES-based implementation of
387 the `crypt' function. When this option group is disabled,
388@@ -216,7 +214,7 @@ config OPTION_EGLIBC_CRYPT_UFC
389 errno to ENOSYS if /salt/ passed does not correspond to either MD5,
390 SHA-256 or SHA-512 algorithm.
391
392-config OPTION_EGLIBC_DB_ALIASES
393+config EGLIBC_DB_ALIASES
394 bool "Functions for accessing the mail aliases database"
395 help
396 This option group includues functions for looking up mail
397@@ -233,7 +231,7 @@ config OPTION_EGLIBC_DB_ALIASES
398 When this option group is disabled, the NSS service libraries
399 also lack support for querying their mail alias tables.
400
401-config OPTION_EGLIBC_ENVZ
402+config EGLIBC_ENVZ
403 bool "Functions for handling envz-style environment vectors."
404 help
405 This option group contains functions for creating and operating
406@@ -248,7 +246,7 @@ config OPTION_EGLIBC_ENVZ
407 envz_entry envz_remove
408 envz_get envz_strip
409
410-config OPTION_EGLIBC_FCVT
411+config EGLIBC_FCVT
412 bool "Functions for converting floating-point numbers to strings"
413 help
414 This option group includes functions for converting
415@@ -262,14 +260,14 @@ config OPTION_EGLIBC_FCVT
416 fcvt_r qfcvt_r
417 gcvt qgcvt
418
419-config OPTION_EGLIBC_FMTMSG
420+config EGLIBC_FMTMSG
421 bool "Functions for formatting messages"
422 help
423 This option group includes the following functions:
424
425 addseverity fmtmsg
426
427-config OPTION_EGLIBC_FSTAB
428+config EGLIBC_FSTAB
429 bool "Access functions for 'fstab'"
430 help
431 This option group includes functions for reading the mount
432@@ -283,7 +281,7 @@ config OPTION_EGLIBC_FSTAB
433 getfsent setfsent
434 getfsfile
435
436-config OPTION_EGLIBC_FTRAVERSE
437+config EGLIBC_FTRAVERSE
438 bool "Functions for traversing file hierarchies"
439 help
440 This option group includes functions for traversing file
441@@ -297,9 +295,9 @@ config OPTION_EGLIBC_FTRAVERSE
442 fts_set nftw64
443 fts_close
444
445-config OPTION_EGLIBC_GETLOGIN
446+config EGLIBC_GETLOGIN
447 bool "The getlogin function"
448- depends OPTION_EGLIBC_UTMP
449+ depends on EGLIBC_UTMP
450 help
451 This function group includes the 'getlogin' and 'getlogin_r'
452 functions, which return the user name associated by the login
453@@ -309,17 +307,17 @@ config OPTION_EGLIBC_GETLOGIN
454 fall back on 'getlogin' to find the user's login name for tilde
455 expansion when the 'HOME' environment variable is not set.
456
457-config OPTION_EGLIBC_IDN
458+config EGLIBC_IDN
459 bool "International domain names support"
460 help
461 This option group includes the `libcidn' library which
462 provides support for international domain names.
463
464-config OPTION_EGLIBC_INET
465+config EGLIBC_INET
466 bool "Networking support"
467 help
468 This option group includes networking-specific functions and
469- data. With OPTION_EGLIBC_INET disabled, the EGLIBC
470+ data. With EGLIBC_INET disabled, the EGLIBC
471 installation and API changes as follows:
472
473 - The following libraries are not installed:
474@@ -439,14 +437,14 @@ config OPTION_EGLIBC_INET
475 use Unix-domain sockets to communicate with the syslog daemon;
476 syslog is valuable in non-networked contexts.
477
478-config OPTION_EGLIBC_INET_ANL
479+config EGLIBC_INET_ANL
480 bool "Asynchronous name lookup"
481- depends OPTION_EGLIBC_INET
482+ depends on EGLIBC_INET
483 help
484 This option group includes the `libanl' library which
485 provides support for asynchronous name lookup.
486
487-config OPTION_EGLIBC_LIBM
488+config EGLIBC_LIBM
489 bool "libm (math library)"
490 help
491 This option group includes the 'libm' library, containing
492@@ -464,7 +462,7 @@ config OPTION_EGLIBC_LIBM
493 group, you will not be able to build 'libstdc++' against the
494 resulting EGLIBC installation.
495
496-config OPTION_EGLIBC_LOCALES
497+config EGLIBC_LOCALES
498 bool "Locale definitions"
499 help
500 This option group includes all locale definitions other than
501@@ -472,17 +470,17 @@ config OPTION_EGLIBC_LOCALES
502 only the "C" locale is supported.
503
504
505-config OPTION_EGLIBC_LOCALE_CODE
506+config EGLIBC_LOCALE_CODE
507 bool "Locale functions"
508- depends OPTION_POSIX_C_LANG_WIDE_CHAR
509+ depends on POSIX_C_LANG_WIDE_CHAR
510 help
511 This option group includes locale support functions, programs,
512- and libraries. With OPTION_EGLIBC_LOCALE_FUNCTIONS disabled,
513+ and libraries. With EGLIBC_LOCALE_CODE disabled,
514 EGLIBC supports only the 'C' locale (also known as 'POSIX'),
515 and ignores the settings of the 'LANG' and 'LC_*' environment
516 variables.
517
518- With OPTION_EGLIBC_LOCALE_CODE disabled, the following
519+ With EGLIBC_LOCALE_CODE disabled, the following
520 functions are omitted from libc:
521
522 duplocale localeconv nl_langinfo rpmatch strfmon_l
523@@ -491,46 +489,43 @@ config OPTION_EGLIBC_LOCALE_CODE
524 Furthermore, only the LC_CTYPE and LC_TIME categories of the
525 standard "C" locale are available.
526
527- The OPTION_EGLIBC_CATGETS option group depends on this option
528- group; if you disable OPTION_EGLIBC_LOCALE_CODE, you must also
529- disable OPTION_EGLIBC_CATGETS.
530+ The EGLIBC_CATGETS option group depends on this option group.
531+
532
533-config OPTION_EGLIBC_MEMUSAGE
534+config EGLIBC_MEMUSAGE
535 bool "Memory profiling library"
536 help
537 This option group includes the `libmemusage' library and
538 the `memusage' and `memusagestat' utilities.
539 These components provide memory profiling functions.
540
541- OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
542+ EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
543
544 Libmemusage library buffers the profiling data in memory
545 before writing it out to disk. By default, the library
546 allocates 1.5M buffer, which can be substantial for some
547- systems. OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option
548+ systems. EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option
549 allows to change the default buffer size. It specifies
550 the number of entries the buffer should have.
551 On most architectures one buffer entry amounts to 48 bytes,
552 so setting this option to the value of 512 will reduce the size of
553 the memory buffer to 24K.
554
555-config OPTION_EGLIBC_NIS
556+config EGLIBC_NIS
557 bool "Support for NIS, NIS+, and the special 'compat' services."
558- depends OPTION_EGLIBC_INET
559- depends OPTION_EGLIBC_SUNRPC
560+ depends on EGLIBC_INET && EGLIBC_SUNRPC
561 help
562 This option group includes the NIS, NIS+, and 'compat' Name
563 Service Switch service libraries. When it is disabled, those
564 services libraries are not installed; you should remove any
565 references to them from your 'nsswitch.conf' file.
566
567- This option group depends on the OPTION_EGLIBC_INET option
568+ This option group depends on the EGLIBC_INET option
569 group; you must enable that to enable this option group.
570
571-config OPTION_EGLIBC_NSSWITCH
572+config EGLIBC_NSSWITCH
573 bool "Name service switch (nsswitch) support"
574 help
575-
576 This option group includes support for the 'nsswitch' facility.
577 With this option group enabled, all EGLIBC functions for
578 accessing various system databases (passwords and groups;
579@@ -544,12 +539,12 @@ config OPTION_EGLIBC_NSSWITCH
580 'option-groups.config' file must set the following two
581 variables:
582
583- OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG
584+ EGLIBC_NSSWITCH_FIXED_CONFIG
585
586 Set this to the name of a file whose contents observe the
587 same syntax as an ordinary '/etc/nsswitch.conf' file. The
588 EGLIBC build process parses this file just as EGLIBC would
589- at run time if OPTION_EGLIBC_NSSWITCH were enabled, and
590+ at run time if EGLIBC_NSSWITCH were enabled, and
591 produces a C library that uses the nsswitch service
592 libraries to search for database entries as this file
593 specifies, instead of consulting '/etc/nsswitch.conf' at run
594@@ -567,7 +562,7 @@ config OPTION_EGLIBC_NSSWITCH
595 you will probably want to delete references to databases not
596 needed on your system.
597
598- OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS
599+ EGLIBC_NSSWITCH_FIXED_FUNCTIONS
600
601 The EGLIBC build process uses this file to decide which
602 functions to make available from which service libraries.
603@@ -585,28 +580,28 @@ config OPTION_EGLIBC_NSSWITCH
604 Be sure to mention each function in each service you wish to
605 use. If you do not mention a service's function here, the
606 EGLIBC database access functions will not find it, even if
607- it is listed in the OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG
608+ it is listed in the EGLIBC_NSSWITCH_FIXED_CONFIG
609 file.
610
611- In this arrangement, EGLIBC will not use the 'dlopen' and
612- 'dlsym' functions to find database access functions. Instead,
613- libc hard-codes references to the service libraries' database
614- access functions. You must explicitly link your program
615- against the name service libraries (those whose names start
616- with 'libnss_', in the sysroot's '/lib' directory) whose
617- functions you intend to use. This arrangement helps
618- system-wide static analysis tools decide which functions a
619- system actually uses.
620-
621- Note that some nsswitch service libraries require other option
622- groups to be enabled; for example, the OPTION_EGLIBC_INET
623- option group must be enabled to use the 'libnss_dns.so.2'
624- service library, which uses the Domain Name System network
625- protocol to answer queries.
626+ In this arrangement, EGLIBC will not use the 'dlopen' and
627+ 'dlsym' functions to find database access functions. Instead,
628+ libc hard-codes references to the service libraries' database
629+ access functions. You must explicitly link your program
630+ against the name service libraries (those whose names start
631+ with 'libnss_', in the sysroot's '/lib' directory) whose
632+ functions you intend to use. This arrangement helps
633+ system-wide static analysis tools decide which functions a
634+ system actually uses.
635+
636+ Note that some nsswitch service libraries require other option
637+ groups to be enabled; for example, the EGLIBC_INET
638+ option group must be enabled to use the 'libnss_dns.so.2'
639+ service library, which uses the Domain Name System network
640+ protocol to answer queries.
641
642-config OPTION_EGLIBC_RCMD
643+config EGLIBC_RCMD
644 bool "Support for 'rcmd' and related library functions"
645- depends OPTION_EGLIBC_INET
646+ depends on EGLIBC_INET
647 help
648 This option group includes functions for running commands on
649 remote machines via the 'rsh' protocol, and doing authentication
650@@ -622,7 +617,7 @@ config OPTION_EGLIBC_RCMD
651 rresvport ruserpass
652 rresvport_af
653
654-config OPTION_EGLIBC_RTLD_DEBUG
655+config EGLIBC_RTLD_DEBUG
656 bool "Runtime linker debug print outs"
657 help
658 This option group enables debug output of the runtime linker
659@@ -633,7 +628,7 @@ config OPTION_EGLIBC_RTLD_DEBUG
660 the `ldd' utility which may also be used by the prelinker.
661 In particular, the `--unused' ldd option will not work correctly.
662
663-config OPTION_EGLIBC_SPAWN
664+config EGLIBC_SPAWN
665 bool "Support for POSIX posix_spawn functions"
666 help
667 This option group includes the POSIX functions for executing
668@@ -669,7 +664,7 @@ config OPTION_EGLIBC_SPAWN
669 disabled, those programs will only operate on uncompressed
670 charmap files.
671
672-config OPTION_EGLIBC_STREAMS
673+config EGLIBC_STREAMS
674 bool "Support for accessing STREAMS."
675 help
676 This option group includes functions for reading and writing
677@@ -685,14 +680,14 @@ config OPTION_EGLIBC_STREAMS
678 isastream fdetach
679 putmsg
680
681-config OPTION_EGLIBC_SUNRPC
682+config EGLIBC_SUNRPC
683 bool "Support for the Sun 'RPC' protocol."
684- depends OPTION_EGLIBC_INET
685+ depends on EGLIBC_INET
686 help
687 This option group includes support for the Sun RPC protocols,
688 including the 'rpcgen' and 'rpcinfo' programs.
689
690-config OPTION_EGLIBC_UTMP
691+config EGLIBC_UTMP
692 bool "Older access functions for 'utmp' login records"
693 help
694 This option group includes the older 'utent' family of
695@@ -719,9 +714,9 @@ config OPTION_EGLIBC_UTMP
696
697 libutil.so (and libutil.a)
698
699-config OPTION_EGLIBC_UTMPX
700+config EGLIBC_UTMPX
701 bool "POSIX access functions for 'utmp' login records"
702- depends OPTION_EGLIBC_UTMP
703+ depends on EGLIBC_UTMP
704 help
705 This option group includes the POSIX functions for reading and
706 writing user login records in the 'utmp' file (usually
707@@ -742,21 +737,21 @@ config OPTION_EGLIBC_UTMPX
708 updwtmpx
709 utmpxname
710
711-config OPTION_EGLIBC_WORDEXP
712+config EGLIBC_WORDEXP
713 bool "Shell-style word expansion"
714 help
715 This option group includes the 'wordexp' function for
716 performing word expansion in the manner of the shell, and the
717 accompanying 'wordfree' function.
718
719-config OPTION_POSIX_C_LANG_WIDE_CHAR
720+config POSIX_C_LANG_WIDE_CHAR
721 bool "ISO C library wide character functions, excluding I/O"
722 help
723 This option group includes the functions defined by the ISO C
724 standard for working with wide and multibyte characters in
725 memory. Functions for reading and writing wide and multibyte
726 characters from and to files call in the
727- OPTION_POSIX_WIDE_CHAR_DEVICE_IO option group.
728+ POSIX_WIDE_CHAR_DEVICE_IO option group.
729
730 This option group includes the following functions:
731
732@@ -778,14 +773,14 @@ config OPTION_POSIX_C_LANG_WIDE_CHAR
733 mbrlen wcscoll wcstol
734 mbrtowc wcscpy wcstold
735
736-config OPTION_POSIX_REGEXP
737+config POSIX_REGEXP
738 bool "Regular expressions"
739 help
740 This option group includes the POSIX regular expression
741 functions, and the associated non-POSIX extensions and
742 compatibility functions.
743
744- With OPTION_POSIX_REGEXP disabled, the following functions are
745+ With POSIX_REGEXP disabled, the following functions are
746 omitted from libc:
747
748 re_comp re_max_failures regcomp
749@@ -799,9 +794,9 @@ config OPTION_POSIX_REGEXP
750 <regexp.h> header file, 'compile', 'step', and 'advance', is
751 omitted.
752
753-config OPTION_POSIX_REGEXP_GLIBC
754+config POSIX_REGEXP_GLIBC
755 bool "Regular expressions from GLIBC"
756- depends OPTION_POSIX_REGEXP
757+ depends on POSIX_REGEXP
758 help
759 This option group specifies which regular expression
760 library to use. The choice is between regex
761@@ -810,9 +805,9 @@ config OPTION_POSIX_REGEXP_GLIBC
762 optimized for speed; regex from libiberty is more than twice
763 as small while still is enough for most practical purposes.
764
765-config OPTION_POSIX_WIDE_CHAR_DEVICE_IO
766+config POSIX_WIDE_CHAR_DEVICE_IO
767 bool "Input and output functions for wide characters"
768- depends OPTION_POSIX_C_LANG_WIDE_CHAR
769+ depends on POSIX_C_LANG_WIDE_CHAR
770 help
771 This option group includes functions for reading and writing
772 wide characters to and from <stdio.h> streams.
773Index: libc/Makefile
774===================================================================
775--- libc.orig/Makefile
776+++ libc/Makefile
777@@ -24,6 +24,7 @@ endif
778
779 include Makeconfig
780
781+include options-config/Makefile
782
783 # This is the default target; it makes everything except the tests.
784 .PHONY: all
785Index: libc/configure
786===================================================================
787--- libc.orig/configure
788+++ libc/configure
789@@ -621,6 +621,7 @@ KSH
790 libc_cv_have_bash2
791 BASH_SHELL
792 libc_cv_gcc_static_libgcc
793+KCONFIG_TOOLS
794 CXX_SYSINCLUDES
795 SYSINCLUDES
796 AUTOCONF
797@@ -734,6 +735,7 @@ with_fp
798 with_binutils
799 with_selinux
800 with_headers
801+with_kconfig
802 with_default_link
803 enable_sanity_checks
804 enable_shared
805@@ -1438,6 +1440,9 @@ Optional Packages:
806 --with-selinux if building with SELinux support
807 --with-headers=PATH location of system headers to use (for example
808 /usr/src/linux/include) [default=compiler default]
809+ --with-kconfig=PATH location of kconfig tools to use (from Linux kernel
810+ builds) to re-use for configuring EGLIBC option
811+ groups
812 --with-default-link do not use explicit linker scripts
813 --with-cpu=CPU select code for CPU variant
814
815@@ -3401,6 +3406,14 @@ fi
816
817
818
819+# Check whether --with-kconfig was given.
820+if test "${with_kconfig+set}" = set; then
821+ withval=$with_kconfig; KCONFIG_TOOLS=$withval
822+else
823+ KCONFIG_TOOLS=''
824+fi
825+
826+
827
828 # Check whether --with-default-link was given.
829 if test "${with_default_link+set}" = set; then :
830Index: libc/EGLIBC.option-groups
831===================================================================
832--- libc.orig/EGLIBC.option-groups
833+++ libc/EGLIBC.option-groups
834@@ -56,33 +56,9 @@ disable option groups one by one, until
835
836 The Option Groups
837
838-EGLIBC currently implements the following option groups, also
839-documented in the file 'option-groups.def':
840-
841-OPTION_EGLIBC_CATGETS
842- This option group includes functions for accessing message
843- catalogs: catopen, catclose, and catgets.
844-
845-OPTION_EGLIBC_LOCALES
846- This option group includes all locale definitions other than
847- those for the "C" locale. If this option group is omitted, then
848- only the "C" locale is supported.
849-
850-OPTION_EGLIBC_LIBM
851- This option group includes the 'libm' library, containing
852- mathematical functions. If this option group is omitted, then
853- an EGLIBC installation does not include shared or unshared versions
854- of the math library.
855-
856- Note that this does not remove all floating-point related
857- functionality from EGLIBC; for example, 'printf' and 'scanf'
858- can still print and read floating-point values with this option
859- group disabled.
860-
861- Note that the ISO Standard C++ library 'libstdc++' depends on
862- EGLIBC's math library 'libm'. If you disable this option
863- group, you will not be able to build 'libstdc++' against the
864- resulting EGLIBC installation.
865+To see the current full list of implemented option groups, refer to the
866+file 'option-groups.def' at the top of the source tree, or run
867+'make menuconfig' from the top-level build directory.
868
869 The POSIX.1-2001 specification includes a suggested partition of all
870 the functions in the POSIX C API into option groups: math functions
871@@ -110,6 +86,18 @@ data, but include mathematical functions
872 OPTION_EGLIBC_LOCALES = n
873 OPTION_EGLIBC_LIBM = y
874
875+Like the Linux kernel, EGLIBC supports a similar set of '*config' make
876+targets to make it easier to create 'option-groups.config', with all
877+dependencies between option groups automatically satisfied. Run
878+'make help' to see the list of supported make config targets. For
879+example, 'make menuconfig' will update the current config utilising a
880+menu based program.
881+
882+The option group names and their type (boolean, int, hex, string), help
883+description, and dependencies with other option groups, are described by
884+'option-groups.def' at the top of the source tree, analogous to the
885+'Kconfig' files in the Linux kernel.
886+
887 In general, each option group variable controls whether a given set of
888 object files in EGLIBC is compiled and included in the final
889 libraries, or omitted from the build.
890@@ -132,22 +120,3 @@ under development.
891
892 We have used the system to subset some portions of EGLIBC's
893 functionality. It needs to be extended to cover more of the library.
894-
895-At the moment, EGLIBC performs no sanity checks on the contents of
896-'option-groups.config'; if an option group's name is mistyped, the
897-option group is silently included in the build. EGLIBC should check
898-that all variables set in 'option-groups.config' are proper option
899-group names, and that their values are appropriate.
900-
901-Some portions of EGLIBC depend on others; for example, the Sun Remote
902-Procedure Call functions in 'sunrpc' depend on the networking
903-functions in 'inet'. The sanity checking described above should check
904-that the selection configuration satisfies dependencies within EGLIBC,
905-and produce a legible error message if it does not. At the moment,
906-inconsistent configurations produce link errors late in the build
907-process.
908-
909-The Linux kernel's configuration system provides interactive
910-interfaces for creating and modifying configuration files (which also
911-perform the sanity checking and dependency tracking described above).
912-EGLIBC should provide similar interfaces.
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
new file mode 100644
index 0000000000..a8463ea915
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
@@ -0,0 +1,36 @@
1From 713d822908d1b2ae8403af7f9375c7054ed3dd49 Mon Sep 17 00:00:00 2001
2From: Ting Liu <b28495@freescale.com>
3Date: Wed, 19 Dec 2012 04:39:57 -0600
4Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S}
5
6libm-err-tab.pl will parse all the files named "libm-test-ulps"
7in the given dir recursively. To avoid parsing the one in
8${S}/.pc/ (it does exist after eglibc adds aarch64 support,
9${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/
10aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs
11in ${S}.
12
13Upstream-Status: inappropriate [OE specific]
14
15Signed-off-by: Ting Liu <b28495@freescale.com>
16---
17 manual/Makefile | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20diff --git a/manual/Makefile b/manual/Makefile
21index 6fddff0..7af242e 100644
22--- a/manual/Makefile
23+++ b/manual/Makefile
24@@ -109,7 +109,8 @@ $(objpfx)libm-err.texi: $(objpfx)stamp-libm-err
25 $(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
26 $(dir)/libm-test-ulps))
27 pwd=`pwd`; \
28- $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp
29+ $(PERL) $< $$pwd/../ports > $(objpfx)libm-err-tmp
30+ $(PERL) $< $$pwd/../sysdeps >> $(objpfx)libm-err-tmp
31 $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
32 touch $@
33
34--
351.7.9.7
36
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch b/meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch
new file mode 100644
index 0000000000..7caba48112
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0002-eglibc-menuconfig-hex-string-options.patch
@@ -0,0 +1,169 @@
1pulled from
2
3http://www.eglibc.org/archives/patches/msg01043.html
4
5
6Upstream-Status: Pending
7Signed-off-by: Khem
8
9
10This patch builds on the menuconfig patch for EGLIBC.
11
12
13There are a few options that have non-boolean types, that would benefit from the new 'make *config' support:
14
15EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE (int)
16EGLIBC_NSSWITCH_FIXED_CONFIG (string)
17EGLIBC_NSSWITCH_FIXED_FUNCTIONS (string)
18
19
20The patch converts these to real options in libc/option-groups.def. Also, libc/scripts/option-groups.awk is modified to output a '#define' line for int, hex, or string options encountered in the config file.
21
22In the post-processing script config-postproc.pl, a small change is needed: for any boolean option FOO that is implicitly disabled in the kconfig output, make sure that option is indeed a boolean before printing the explicit OPTION_FOO=n.
23
24Finally, libc/malloc/Makefile passes __OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE as a CPPFLAGS, which is not necessary anymore because this macro will now be present in the generated header.
25
26attached is the updated patch to address above issues.
27
28Steve
29
30--
31Steve Longerbeam | Senior Embedded Engineer, ESD Services
32Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
33P 510.354.5838 | M 408.410.2735
34Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS
35
36
37Index: libc/malloc/Makefile
38===================================================================
39--- libc.orig/malloc/Makefile 2012-01-04 22:06:18.000000000 -0800
40+++ libc/malloc/Makefile 2012-05-09 19:35:28.598682105 -0700
41@@ -48,10 +48,6 @@
42 ifeq ($(OPTION_EGLIBC_MEMUSAGE),y)
43 extra-libs = libmemusage
44 extra-libs-others = $(extra-libs)
45-
46-ifdef OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
47-CPPFLAGS-memusage += -D__OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE=$(OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE)
48-endif
49 endif
50
51 libmemusage-routines = memusage
52Index: libc/option-groups.def
53===================================================================
54--- libc.orig/option-groups.def 2012-05-09 19:33:48.398677256 -0700
55+++ libc/option-groups.def 2012-05-09 19:35:28.610682107 -0700
56@@ -513,8 +513,11 @@
57 the `memusage' and `memusagestat' utilities.
58 These components provide memory profiling functions.
59
60- EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
61-
62+config EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
63+ int "Memory profiling library buffer size"
64+ depends on EGLIBC_MEMUSAGE
65+ default "32768"
66+ help
67 Libmemusage library buffers the profiling data in memory
68 before writing it out to disk. By default, the library
69 allocates 1.5M buffer, which can be substantial for some
70@@ -553,8 +556,11 @@
71 'option-groups.config' file must set the following two
72 variables:
73
74- EGLIBC_NSSWITCH_FIXED_CONFIG
75-
76+config EGLIBC_NSSWITCH_FIXED_CONFIG
77+ string "Nsswitch fixed config filename"
78+ depends on !EGLIBC_NSSWITCH
79+ default ""
80+ help
81 Set this to the name of a file whose contents observe the
82 same syntax as an ordinary '/etc/nsswitch.conf' file. The
83 EGLIBC build process parses this file just as EGLIBC would
84@@ -576,8 +582,11 @@
85 you will probably want to delete references to databases not
86 needed on your system.
87
88- EGLIBC_NSSWITCH_FIXED_FUNCTIONS
89-
90+config EGLIBC_NSSWITCH_FIXED_FUNCTIONS
91+ string "Nsswitch fixed functions filename"
92+ depends on !EGLIBC_NSSWITCH
93+ default ""
94+ help
95 The EGLIBC build process uses this file to decide which
96 functions to make available from which service libraries.
97 The file 'nss/fixed-nsswitch.functions' serves as a sample
98Index: libc/options-config/config-postproc.pl
99===================================================================
100--- libc.orig/options-config/config-postproc.pl 2012-05-09 19:33:36.530676681 -0700
101+++ libc/options-config/config-postproc.pl 2012-05-09 19:35:28.610682107 -0700
102@@ -8,7 +8,7 @@
103 die "Could not open $ARGV[0]" unless -T $ARGV[0];
104
105 sub yank {
106- @option = grep($_ ne $_[0], @option);
107+ @option = grep(!($_ =~ /$_[0]\s*=/), @option);
108 }
109
110 open(DEFAULTS, $defaults) || die "Could not open $defaults\n";
111@@ -16,7 +16,7 @@
112 # get the full list of available options using the default config file
113 $i = 0;
114 while (<DEFAULTS>) {
115- if (/^\s*OPTION_(\w+)\s*=/) {
116+ if (/^\s*OPTION_(\w+\s*=.*$)/) {
117 $option[$i++] = $1;
118 }
119 }
120@@ -35,8 +35,9 @@
121 s/CONFIG_/OPTION_/g;
122 print;
123 } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) {
124- # this is a comment line, change CONFIG_ to OPTION_, remove this
125- # option from option list, and convert to explicit OPTION_FOO=n
126+ # this is a comment line for an unset boolean option, change CONFIG_
127+ # to OPTION_, remove this option from option list, and convert to
128+ # explicit OPTION_FOO=n
129 $opt = $1;
130 yank($opt);
131 s/CONFIG_/OPTION_/g;
132@@ -46,9 +47,12 @@
133 }
134 }
135
136-# any options left in @options, are options that were not mentioned in
137+# any boolean options left in @options, are options that were not mentioned in
138 # the config file, and implicitly that means the option must be set =n,
139 # so do that here.
140 foreach $opt (@option) {
141- print "OPTION_$opt=n\n";
142+ if ($opt =~ /=\s*[yn]/) {
143+ $opt =~ s/=\s*[yn]/=n/;
144+ print "OPTION_$opt\n";
145+ }
146 }
147Index: libc/scripts/option-groups.awk
148===================================================================
149--- libc.orig/scripts/option-groups.awk 2012-01-04 22:06:00.000000000 -0800
150+++ libc/scripts/option-groups.awk 2012-05-09 19:35:28.610682107 -0700
151@@ -46,9 +46,15 @@
152 print "#define __" var " 1"
153 else if (vars[var] == "n")
154 print "/* #undef __" var " */"
155- # Ignore variables that don't have boolean values.
156- # Ideally, this would be driven by the types given in
157- # option-groups.def.
158+ else if (vars[var] ~ /^[0-9]+/ ||
159+ vars[var] ~ /^0x[0-9aAbBcCdDeEfF]+/ ||
160+ vars[var] ~ /^\"/)
161+ print "#define __" var " " vars[var]
162+ else
163+ print "/* #undef __" var " */"
164+ # Ignore variables that don't have boolean, int, hex, or
165+ # string values. Ideally, this would be driven by the types
166+ # given in option-groups.def.
167 }
168 }
169
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch b/meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch
new file mode 100644
index 0000000000..d137f5b318
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/0003-eglibc-menuconfig-build-instructions.patch
@@ -0,0 +1,176 @@
1Pulled from
2
3http://www.eglibc.org/archives/patches/msg01035.html
4
5Upstream-Status: Pending
6Signed-off-by: Khem
7
8As part of the menuconfig development, I encountered some outdated information in the cross-build instructions, libc/EGLIBC.cross-building. This patch updates the file with new (and tested) instructions. It is unrelated to the menuconfig support, but applies after.
9
10My testing was done with an ARM target, and an x86_64 Linux host, so I converted the instructions to use those host/target types from the original i686/powerpc. Hope that's ok.
11
12
13Thanks,
14
15--
16Steve Longerbeam | Senior Embedded Engineer, ESD Services
17Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
18P 510.354.5838 | M 408.410.2735
19Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS
20
21
22 EGLIBC.cross-building | 59 +++++++++++++++++++++++++++++---------------------
23 1 file changed, 35 insertions(+), 24 deletions(-)
24
25Index: libc/EGLIBC.cross-building
26===================================================================
27--- libc.orig/EGLIBC.cross-building 2012-05-09 19:33:36.522676681 -0700
28+++ libc/EGLIBC.cross-building 2012-05-09 19:36:13.918684298 -0700
29@@ -47,31 +47,34 @@
30 EGLIBC requires recent versions of the GNU binutils, GCC, and the
31 Linux kernel. The web page <http://www.eglibc.org/prerequisites>
32 documents the current requirements, and lists patches needed for
33-certain target architectures. As of this writing, EGLIBC required
34-binutils 2.17, GCC 4.1, and Linux 2.6.19.1.
35+certain target architectures. As of this writing, these build
36+instructions have been tested with binutils 2.22.51, GCC 4.6.2,
37+and Linux 3.1.
38
39 First, let's set some variables, to simplify later commands. We'll
40-build EGLIBC and GCC for a PowerPC target, known to the Linux kernel
41-as 'powerpc', and we'll do the build on an Intel Linux box:
42+build EGLIBC and GCC for an ARM target, known to the Linux kernel
43+as 'arm', and we'll do the build on an Intel x86_64 Linux box:
44
45- $ build=i686-pc-linux-gnu
46+ $ build=x86_64-pc-linux-gnu
47 $ host=$build
48- $ target=powerpc-none-linux-gnu
49- $ linux_arch=powerpc
50+ $ target=arm-none-linux-gnueabi
51+ $ linux_arch=arm
52
53 We're using the aforementioned versions of Binutils, GCC, and Linux:
54
55- $ binutilsv=binutils-2.17
56- $ gccv=gcc-4.1.1
57- $ linuxv=linux-2.6.20
58+ $ binutilsv=binutils-2.22.51
59+ $ gccv=gcc-4.6.2
60+ $ linuxv=linux-3.1
61
62 We're carrying out the entire process under '~/cross-build', which
63-contains unpacked source trees:
64+contains unpacked source trees for binutils, gcc, and linux kernel,
65+along with EGLIBC svn trunk (which can be checked-out with
66+'svn co http://www.eglibc.org/svn/trunk eglibc'):
67
68- $ top=$HOME/cross-build/ppc
69+ $ top=$HOME/cross-build/$target
70 $ src=$HOME/cross-build/src
71 $ ls $src
72- binutils-2.17 gcc-4.1.1 libc linux-2.6.20
73+ binutils-2.22.51 eglibc gcc-4.6.2 linux-3.1
74
75 We're going to place our build directories in a subdirectory 'obj',
76 we'll install the cross-development toolchain in 'tools', and we'll
77@@ -99,7 +102,7 @@
78
79 The First GCC
80
81-For our work, we need a cross-compiler targeting a PowerPC Linux
82+For our work, we need a cross-compiler targeting an ARM Linux
83 system. However, that configuration includes the shared library
84 'libgcc_s.so', which is compiled against the EGLIBC headers (which we
85 haven't installed yet) and linked against 'libc.so' (which we haven't
86@@ -125,7 +128,8 @@
87 > --prefix=$tools \
88 > --without-headers --with-newlib \
89 > --disable-shared --disable-threads --disable-libssp \
90- > --disable-libgomp --disable-libmudflap \
91+ > --disable-libgomp --disable-libmudflap --disable-libquadmath \
92+ > --disable-decimal-float --disable-libffi \
93 > --enable-languages=c
94 $ PATH=$tools/bin:$PATH make
95 $ PATH=$tools/bin:$PATH make install
96@@ -162,12 +166,13 @@
97 > CXX=$tools/bin/$target-g++ \
98 > AR=$tools/bin/$target-ar \
99 > RANLIB=$tools/bin/$target-ranlib \
100- > $src/libc/configure \
101+ > $src/eglibc/libc/configure \
102 > --prefix=/usr \
103 > --with-headers=$sysroot/usr/include \
104 > --build=$build \
105 > --host=$target \
106- > --disable-profile --without-gd --without-cvs --enable-add-ons
107+ > --disable-profile --without-gd --without-cvs \
108+ > --enable-add-ons=nptl,libidn,../ports
109
110 The option '--prefix=/usr' may look strange, but you should never
111 configure EGLIBC with a prefix other than '/usr': in various places,
112@@ -181,6 +186,11 @@
113 The '--with-headers' option tells EGLIBC where the Linux headers have
114 been installed.
115
116+The '--enable-add-ons=nptl,libidn,../ports' option tells EGLIBC to look
117+for the listed glibc add-ons. Most notably the ports add-on (located
118+just above the libc sources in the EGLIBC svn tree) is required to
119+support ARM targets.
120+
121 We can now use the 'install-headers' makefile target to install the
122 headers:
123
124@@ -223,6 +233,7 @@
125 > --prefix=$tools \
126 > --with-sysroot=$sysroot \
127 > --disable-libssp --disable-libgomp --disable-libmudflap \
128+ > --disable-libffi --disable-libquadmath \
129 > --enable-languages=c
130 $ PATH=$tools/bin:$PATH make
131 $ PATH=$tools/bin:$PATH make install
132@@ -240,13 +251,14 @@
133 > CXX=$tools/bin/$target-g++ \
134 > AR=$tools/bin/$target-ar \
135 > RANLIB=$tools/bin/$target-ranlib \
136- > $src/libc/configure \
137+ > $src/eglibc/libc/configure \
138 > --prefix=/usr \
139 > --with-headers=$sysroot/usr/include \
140 > --with-kconfig=$obj/linux/scripts/kconfig \
141 > --build=$build \
142 > --host=$target \
143- > --disable-profile --without-gd --without-cvs --enable-add-ons
144+ > --disable-profile --without-gd --without-cvs \
145+ > --enable-add-ons=nptl,libidn,../ports
146
147 Note the additional '--with-kconfig' option. This tells EGLIBC where to
148 find the host config tools used by the kernel 'make config' and 'make
149@@ -337,15 +349,15 @@
150 ELF Header:
151 ...
152 Type: EXEC (Executable file)
153- Machine: PowerPC
154+ Machine: ARM
155
156 ...
157 Program Headers:
158 Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
159 PHDR 0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4
160- INTERP 0x000134 0x10000134 0x10000134 0x0000d 0x0000d R 0x1
161- [Requesting program interpreter: /lib/ld.so.1]
162- LOAD 0x000000 0x10000000 0x10000000 0x008f0 0x008f0 R E 0x10000
163+ INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1
164+ [Requesting program interpreter: /lib/ld-linux.so.3]
165+ LOAD 0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000
166 ...
167
168 Looking at the dynamic section of the installed 'libgcc_s.so', we see
169@@ -357,7 +369,6 @@
170 Dynamic section at offset 0x1083c contains 24 entries:
171 Tag Type Name/Value
172 0x00000001 (NEEDED) Shared library: [libc.so.6]
173- 0x00000001 (NEEDED) Shared library: [ld.so.1]
174 0x0000000e (SONAME) Library soname: [libgcc_s.so.1]
175 ...
176
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch b/meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch
new file mode 100644
index 0000000000..7258c82418
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/GLRO_dl_debug_mask.patch
@@ -0,0 +1,143 @@
1Its controlled by __OPTION_EGLIBC_RTLD_DEBUG
2so we should use GLRO_dl_debug_mask
3
4Singed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Upstream-Status: Pending
7Index: libc/elf/dl-open.c
8===================================================================
9--- libc.orig/elf/dl-open.c 2012-10-25 10:18:12.000000000 -0700
10+++ libc/elf/dl-open.c 2013-01-09 11:49:02.635577870 -0800
11@@ -155,7 +155,7 @@
12 ns->_ns_main_searchlist->r_list[new_nlist++] = map;
13
14 /* We modify the global scope. Report this. */
15- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
16+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0))
17 _dl_debug_printf ("\nadd %s [%lu] to global scope\n",
18 map->l_name, map->l_ns);
19 }
20@@ -298,7 +298,7 @@
21 LIBC_PROBE (map_complete, 3, args->nsid, r, new);
22
23 /* Print scope information. */
24- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
25+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0))
26 _dl_show_scope (new, 0);
27
28 /* Only do lazy relocation if `LD_BIND_NOW' is not set. */
29@@ -515,7 +515,7 @@
30 }
31
32 /* Print scope information. */
33- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
34+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0))
35 _dl_show_scope (imap, from_scope);
36 }
37
38Index: libc/ports/sysdeps/mips/dl-lookup.c
39===================================================================
40--- libc.orig/ports/sysdeps/mips/dl-lookup.c 2012-08-17 12:39:53.000000000 -0700
41+++ libc/ports/sysdeps/mips/dl-lookup.c 2013-01-09 11:49:02.635577870 -0800
42@@ -111,7 +111,7 @@
43 continue;
44
45 /* Print some debugging info if wanted. */
46- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS, 0))
47+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SYMBOLS, 0))
48 _dl_debug_printf ("symbol=%s; lookup in file=%s [%lu]\n",
49 undef_name,
50 map->l_name[0] ? map->l_name : rtld_progname,
51@@ -432,7 +432,7 @@
52 hash table. */
53 if (__builtin_expect (tab->size, 0))
54 {
55- assert (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK);
56+ assert (GLRO_dl_debug_mask & DL_DEBUG_PRELINK);
57 __rtld_lock_unlock_recursive (tab->lock);
58 goto success;
59 }
60@@ -681,7 +681,7 @@
61 }
62
63 /* Display information if we are debugging. */
64- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
65+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0))
66 _dl_debug_printf ("\
67 \nfile=%s [%lu]; needed by %s [%lu] (relocation dependency)\n\n",
68 map->l_name[0] ? map->l_name : rtld_progname,
69@@ -788,7 +788,7 @@
70 {
71 if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK)
72 && skip_map == NULL
73- && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED))
74+ && !(GLRO_dl_debug_mask & DL_DEBUG_UNUSED))
75 {
76 /* We could find no value for a strong reference. */
77 const char *reference_name = undef_map ? undef_map->l_name : "";
78@@ -861,7 +861,7 @@
79 if (__builtin_expect (current_value.m->l_used == 0, 0))
80 current_value.m->l_used = 1;
81
82- if (__builtin_expect (GLRO(dl_debug_mask)
83+ if (__builtin_expect (GLRO_dl_debug_mask
84 & (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
85 _dl_debug_bindings (undef_name, undef_map, ref,
86 &current_value, version, type_class, protected);
87@@ -926,7 +926,7 @@
88 {
89 const char *reference_name = undef_map->l_name;
90
91- if (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS)
92+ if (GLRO_dl_debug_mask & DL_DEBUG_BINDINGS)
93 {
94 _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'",
95 (reference_name[0]
96@@ -942,7 +942,7 @@
97 _dl_debug_printf_c ("\n");
98 }
99 #ifdef SHARED
100- if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
101+ if (GLRO_dl_debug_mask & DL_DEBUG_PRELINK)
102 {
103 int conflict = 0;
104 struct sym_val val = { NULL, NULL };
105Index: libc/elf/rtld.c
106===================================================================
107--- libc.orig/elf/rtld.c 2012-10-10 08:35:46.000000000 -0700
108+++ libc/elf/rtld.c 2013-01-09 11:49:02.635577870 -0800
109@@ -2118,7 +2118,7 @@
110 GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
111
112 /* Print scope information. */
113- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES, 0))
114+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_SCOPES, 0))
115 {
116 _dl_debug_printf ("\nInitial object scopes\n");
117
118Index: libc/elf/dl-lookup.c
119===================================================================
120--- libc.orig/elf/dl-lookup.c 2012-08-17 12:39:53.000000000 -0700
121+++ libc/elf/dl-lookup.c 2013-01-09 11:49:02.635577870 -0800
122@@ -771,7 +771,7 @@
123 {
124 if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK)
125 && skip_map == NULL
126- && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED))
127+ && !(GLRO_dl_debug_mask & DL_DEBUG_UNUSED))
128 {
129 /* We could find no value for a strong reference. */
130 const char *reference_name = undef_map ? undef_map->l_name : "";
131Index: libc/elf/get-dynamic-info.h
132===================================================================
133--- libc.orig/elf/get-dynamic-info.h 2012-12-02 13:11:45.000000000 -0800
134+++ libc/elf/get-dynamic-info.h 2013-01-09 12:53:51.015657653 -0800
135@@ -157,7 +157,7 @@
136 them. Therefore to avoid breaking existing applications the
137 best we can do is add a warning during debugging with the
138 intent of notifying the user of the problem. */
139- if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)
140+ if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0)
141 && l->l_flags_1 & ~DT_1_SUPPORTED_MASK)
142 _dl_debug_printf ("\nWARNING: Unsupported flag value(s) of 0x%x in DT_FLAGS_1.\n",
143 l->l_flags_1 & ~DT_1_SUPPORTED_MASK);
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch b/meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch
new file mode 100644
index 0000000000..cf5803585c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/IO-acquire-lock-fix.patch
@@ -0,0 +1,17 @@
1import http://sourceware.org/ml/libc-ports/2007-12/msg00000.html
2
3Upstream-Status: Pending
4
5Index: libc/bits/stdio-lock.h
6===================================================================
7--- libc.orig/bits/stdio-lock.h 2009-10-28 14:34:19.000000000 -0700
8+++ libc/bits/stdio-lock.h 2009-10-28 14:34:54.000000000 -0700
9@@ -50,6 +50,8 @@ __libc_lock_define_recursive (typedef, _
10 _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp)); \
11 _IO_flockfile (_fp)
12
13+# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
14+
15 # define _IO_release_lock(_fp) \
16 _IO_funlockfile (_fp); \
17 _IO_cleanup_region_end (0)
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch b/meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch
new file mode 100644
index 0000000000..f5023c08d4
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/add_resource_h_to_wait_h.patch
@@ -0,0 +1,20 @@
1The older versions of perf still require sys/resource.h to be
2present in this header, the newer version of perf in 3.2 and
3beyond directly include sys/resource.h
4
5Upstream-Status: Inapproriate [older kernel/perf specific]
6
7Signed-off-by: Saul Wold <sgw@linux.intel.com>
8
9Index: libc/posix/sys/wait.h
10===================================================================
11--- libc.orig/posix/sys/wait.h
12+++ libc/posix/sys/wait.h
13@@ -28,6 +28,7 @@
14 __BEGIN_DECLS
15
16 #include <signal.h>
17+#include <sys/resource.h>
18
19 /* These macros could also be defined in <stdlib.h>. */
20 #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8)
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch b/meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch
new file mode 100644
index 0000000000..4313aa5197
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/eglibc-svn-arm-lowlevellock-include-tls.patch
@@ -0,0 +1,21 @@
1In file included from ../nptl/sysdeps/unix/sysv/linux/libc-lowlevellock.c:21:
2../nptl/sysdeps/unix/sysv/linux/lowlevellock.c: In function '__lll_lock_wait_private':
3../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: warning: implicit declaration of function 'THREAD_GETMEM'
4../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'THREAD_SELF' undeclared (first use in this function)
5../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: (Each undeclared identifier is reported only once
6../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: for each function it appears in.)
7../nptl/sysdeps/unix/sysv/linux/lowlevellock.c:34: error: 'header' undeclared (first use in this function)
8make[4]: *** [/var/tmp/portage/sys-libs/glibc-2.7-r1/work/build-default-armv4l-unknown-linux-gnu-nptl/nptl/rtld-libc-lowlevellock.os] Error 1
9
10Upstream-Status: Pending
11
12--- libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h.orig
13+++ libc/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
14@@ -25,6 +25,7 @@
15 #include <atomic.h>
16 #include <sysdep.h>
17 #include <kernel-features.h>
18+#include <tls.h>
19
20 #define FUTEX_WAIT 0
21 #define FUTEX_WAKE 1
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch b/meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch
new file mode 100644
index 0000000000..bbf4605505
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/eglibc_fix_findidx_parameters.patch
@@ -0,0 +1,38 @@
1Upstream-Status: backport
2
3Imported patch from: http://www.eglibc.org/archives/patches/msg01124.html
4
5Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
62012/05/09
7
8Index: libc/posix/xregex.c
9===================================================================
10--- libc.orig/posix/xregex.c
11+++ libc/posix/xregex.c
12@@ -2943,7 +2943,7 @@ PREFIX(regex_compile) (const char *ARG_P
13 _NL_CURRENT (LC_COLLATE,
14 _NL_COLLATE_INDIRECTWC);
15
16- idx = findidx ((const wint_t**)&cp);
17+ idx = findidx ((const wint_t**)&cp, -1);
18 if (idx == 0 || cp < (wint_t*) str + c1)
19 /* This is no valid character. */
20 FREE_STACK_RETURN (REG_ECOLLATE);
21@@ -3392,7 +3392,7 @@ PREFIX(regex_compile) (const char *ARG_P
22 indirect = (const int32_t *)
23 _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
24
25- idx = findidx (&cp);
26+ idx = findidx (&cp, -1);
27 if (idx == 0 || cp < str + c1)
28 /* This is no valid character. */
29 FREE_STACK_RETURN (REG_ECOLLATE);
30@@ -6363,7 +6363,7 @@ byte_re_match_2_internal (struct re_patt
31 }
32 str_buf[i] = TRANSLATE(*(d+i));
33 str_buf[i+1] = '\0'; /* sentinel */
34- idx2 = findidx ((const wint_t**)&cp);
35+ idx2 = findidx ((const wint_t**)&cp, -1);
36 }
37
38 /* Update d, however d will be incremented at
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf b/meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/etc/ld.so.conf
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch b/meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch
new file mode 100644
index 0000000000..2ca0bca248
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/fileops-without-wchar-io.patch
@@ -0,0 +1,22 @@
1Fix error like
2
3/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/work/mips64-oe-linux/eglibc-2.16-r2+svnr19383/build-mips64-oe-linux/libc_pic.os: In function `_IO_new_file_fopen':
4/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-eglibc/work/mips64-oe-linux/eglibc-2.16-r2+svnr19383/eglibc-2_16/libc/libio/fileops.c:431: undefined reference to `_IO_file_close_it_internal'
5collect2: error: ld returned 1 exit status
6
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Upstream-Status: Pending
10Index: libc/libio/fileops.c
11===================================================================
12--- libc.orig/libio/fileops.c 2012-07-04 18:25:47.000000000 -0700
13+++ libc/libio/fileops.c 2012-07-24 00:21:17.220322557 -0700
14@@ -428,7 +428,7 @@
15 result->_mode = 1;
16 #else
17 /* Treat this as if we couldn't find the given character set. */
18- (void) INTUSE(_IO_file_close_it) (fp);
19+ (void) _IO_file_close_it (fp);
20 __set_errno (EINVAL);
21 return NULL;
22 #endif
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch b/meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch
new file mode 100644
index 0000000000..25c43a9fe6
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/fix-tibetian-locales.patch
@@ -0,0 +1,38 @@
1cross localedef fails to compile these locales because name_fmt field is empty
2It is not acceptable for cross localedef and it errors out
3
4LC_NAME: field `name_fmt' not defined
5
6We therefore give a dummy string to the format, the real fix needs some native
7tibetian person to define proper name_fmt
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13Index: libc/localedata/locales/bo_CN
14===================================================================
15--- libc.orig/localedata/locales/bo_CN 2012-11-17 09:50:14.000000000 -0800
16+++ libc/localedata/locales/bo_CN 2013-01-04 08:55:15.593612288 -0800
17@@ -145,7 +145,7 @@
18 LC_NAME
19 % FIXME
20
21-name_fmt ""
22+name_fmt "FIXME"
23 % name_gen "FIXME"
24 % name_miss "FIXME"
25 % name_mr "FIXME"
26Index: libc/localedata/locales/bo_IN
27===================================================================
28--- libc.orig/localedata/locales/bo_IN 2012-11-17 09:50:14.000000000 -0800
29+++ libc/localedata/locales/bo_IN 2013-01-04 08:54:12.345609028 -0800
30@@ -70,7 +70,7 @@
31
32 LC_NAME
33 % FIXME
34-name_fmt ""
35+name_fmt "FIXME"
36 % name_gen "FIXME"
37 % name_miss "FIXME"
38 % name_mr "FIXME"
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch b/meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch
new file mode 100644
index 0000000000..7618c99534
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/fix_for_centos_5.8.patch
@@ -0,0 +1,18 @@
1Upstream-Status: Inappropriate [other]
2
3This is a hack to fix building the locale bits on an older
4CentOs 5.X machine
5
6Index: eglibc-2_16/libc/locale/programs/config.h
7===================================================================
8--- eglibc-2_16.orig/libc/locale/programs/config.h
9+++ eglibc-2_16/libc/locale/programs/config.h
10@@ -19,6 +19,8 @@
11 #ifndef _LD_CONFIG_H
12 #define _LD_CONFIG_H 1
13
14+#define DUMMY_LOCALE_T
15+
16 /* Use the internal textdomain used for libc messages. */
17 #define PACKAGE _libc_intl_domainname
18 #ifndef VERSION
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch b/meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch
new file mode 100644
index 0000000000..511ee9d19e
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/fsl-ppc-no-fsqrt.patch
@@ -0,0 +1,100 @@
1Create e5500 specific math_private.h and let it include when compiling for e5500/64bit core
2We prefefine __CPU_HAS_FSQRT to 0 and then in general ppc64 math_private.h we check if its
3already defined before redefining it. This way we can ensure that on e5500 builds it wont
4emit fsqrt intructions
5
6-Khem
7
8Upstream-Status: Pending
9
10Index: libc/sysdeps/powerpc/fpu/math_private.h
11===================================================================
12--- libc.orig/sysdeps/powerpc/fpu/math_private.h
13+++ libc/sysdeps/powerpc/fpu/math_private.h
14@@ -25,10 +25,12 @@
15 #include <dl-procinfo.h>
16 #include_next <math_private.h>
17
18-# if __WORDSIZE == 64 || defined _ARCH_PWR4
19-# define __CPU_HAS_FSQRT 1
20-# else
21-# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
22+# ifndef __CPU_HAS_FSQRT
23+# if __WORDSIZE == 64 || defined _ARCH_PWR4
24+# define __CPU_HAS_FSQRT 1
25+# else
26+# define __CPU_HAS_FSQRT ((GLRO(dl_hwcap) & PPC_FEATURE_64) != 0)
27+# endif
28 # endif
29
30 extern double __slow_ieee754_sqrt (double);
31Index: libc/ports/sysdeps/powerpc/powerpc64/e5500/fpu/math_private.h
32===================================================================
33--- /dev/null
34+++ libc/ports/sysdeps/powerpc/powerpc64/e5500/fpu/math_private.h
35@@ -0,0 +1,9 @@
36+#ifndef _E5500_MATH_PRIVATE_H_
37+#define _E5500_MATH_PRIVATE_H_ 1
38+/* E5500 core FPU does not implement
39+ fsqrt */
40+
41+#define __CPU_HAS_FSQRT 0
42+#include_next <math_private.h>
43+
44+#endif /* _E5500_MATH_PRIVATE_H_ */
45Index: libc/ports/sysdeps/powerpc/powerpc64/e6500/fpu/math_private.h
46===================================================================
47--- /dev/null
48+++ libc/ports/sysdeps/powerpc/powerpc64/e6500/fpu/math_private.h
49@@ -0,0 +1,9 @@
50+#ifndef _E6500_MATH_PRIVATE_H_
51+#define _E6500_MATH_PRIVATE_H_ 1
52+/* E6500 core FPU does not implement
53+ fsqrt */
54+
55+#define __CPU_HAS_FSQRT 0
56+#include_next <math_private.h>
57+
58+#endif /* _E6500_MATH_PRIVATE_H_ */
59Index: libc/ports/sysdeps/powerpc/powerpc32/e500mc/fpu/math_private.h
60===================================================================
61--- /dev/null
62+++ libc/ports/sysdeps/powerpc/powerpc32/e500mc/fpu/math_private.h
63@@ -0,0 +1,9 @@
64+#ifndef _E500MC_MATH_PRIVATE_H_
65+#define _E500MC_MATH_PRIVATE_H_ 1
66+/* E500MC core FPU does not implement
67+ fsqrt */
68+
69+#define __CPU_HAS_FSQRT 0
70+#include_next <math_private.h>
71+
72+#endif /* _E500MC_MATH_PRIVATE_H_ */
73Index: libc/ports/sysdeps/powerpc/powerpc32/e5500/fpu/math_private.h
74===================================================================
75--- /dev/null
76+++ libc/ports/sysdeps/powerpc/powerpc32/e5500/fpu/math_private.h
77@@ -0,0 +1,9 @@
78+#ifndef _E5500_MATH_PRIVATE_H_
79+#define _E5500_MATH_PRIVATE_H_ 1
80+/* E5500 core FPU does not implement
81+ fsqrt */
82+
83+#define __CPU_HAS_FSQRT 0
84+#include_next <math_private.h>
85+
86+#endif /* _E5500_MATH_PRIVATE_H_ */
87Index: libc/ports/sysdeps/powerpc/powerpc32/e6500/fpu/math_private.h
88===================================================================
89--- /dev/null
90+++ libc/ports/sysdeps/powerpc/powerpc32/e6500/fpu/math_private.h
91@@ -0,0 +1,9 @@
92+#ifndef _E6500_MATH_PRIVATE_H_
93+#define _E6500_MATH_PRIVATE_H_ 1
94+/* E6500 core FPU does not implement
95+ fsqrt */
96+
97+#define __CPU_HAS_FSQRT 0
98+#include_next <math_private.h>
99+
100+#endif /* _E6500_MATH_PRIVATE_H_ */
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk b/meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk
new file mode 100644
index 0000000000..d2a28c2dc6
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/generate-supported.mk
@@ -0,0 +1,11 @@
1#!/usr/bin/make
2
3include $(IN)
4
5all:
6 rm -f $(OUT)
7 touch $(OUT)
8 for locale in $(SUPPORTED-LOCALES); do \
9 [ $$locale = true ] && continue; \
10 echo $$locale | sed 's,/, ,' >> $(OUT); \
11 done
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch b/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch
new file mode 100644
index 0000000000..689b79c61c
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/glibc.fix_sqrt2.patch
@@ -0,0 +1,1516 @@
1Signed-of-by: Edmar Wienskoski <edmar@freescale.com>
2Upstream-Status: Pending
3
4Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
5===================================================================
6--- /dev/null
7+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
8@@ -0,0 +1,134 @@
9+/* Double-precision floating point square root.
10+ Copyright (C) 2010 Free Software Foundation, Inc.
11+ This file is part of the GNU C Library.
12+
13+ The GNU C Library is free software; you can redistribute it and/or
14+ modify it under the terms of the GNU Lesser General Public
15+ License as published by the Free Software Foundation; either
16+ version 2.1 of the License, or (at your option) any later version.
17+
18+ The GNU C Library is distributed in the hope that it will be useful,
19+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21+ Lesser General Public License for more details.
22+
23+ You should have received a copy of the GNU Lesser General Public
24+ License along with the GNU C Library; if not, write to the Free
25+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26+ 02111-1307 USA. */
27+
28+#include <math.h>
29+#include <math_private.h>
30+#include <fenv_libc.h>
31+#include <inttypes.h>
32+
33+#include <sysdep.h>
34+#include <ldsodefs.h>
35+
36+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
37+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
38+static const float two108 = 3.245185536584267269e+32;
39+static const float twom54 = 5.551115123125782702e-17;
40+static const float half = 0.5;
41+
42+/* The method is based on the descriptions in:
43+
44+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
45+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
46+
47+ We find the actual square root and half of its reciprocal
48+ simultaneously. */
49+
50+#ifdef __STDC__
51+double
52+__ieee754_sqrt (double b)
53+#else
54+double
55+__ieee754_sqrt (b)
56+ double b;
57+#endif
58+{
59+ if (__builtin_expect (b > 0, 1))
60+ {
61+ double y, g, h, d, r;
62+ ieee_double_shape_type u;
63+
64+ if (__builtin_expect (b != a_inf.value, 1))
65+ {
66+ fenv_t fe;
67+
68+ fe = fegetenv_register ();
69+
70+ u.value = b;
71+
72+ relax_fenv_state ();
73+
74+ __asm__ ("frsqrte %[estimate], %[x]\n"
75+ : [estimate] "=f" (y) : [x] "f" (b));
76+
77+ /* Following Muller et al, page 168, equation 5.20.
78+
79+ h goes to 1/(2*sqrt(b))
80+ g goes to sqrt(b).
81+
82+ We need three iterations to get within 1ulp. */
83+
84+ /* Indicate that these can be performed prior to the branch. GCC
85+ insists on sinking them below the branch, however; it seems like
86+ they'd be better before the branch so that we can cover any latency
87+ from storing the argument and loading its high word. Oh well. */
88+
89+ g = b * y;
90+ h = 0.5 * y;
91+
92+ /* Handle small numbers by scaling. */
93+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
94+ return __ieee754_sqrt (b * two108) * twom54;
95+
96+#define FMADD(a_, c_, b_) \
97+ ({ double __r; \
98+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
99+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
100+ __r;})
101+#define FNMSUB(a_, c_, b_) \
102+ ({ double __r; \
103+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
104+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
105+ __r;})
106+
107+ r = FNMSUB (g, h, half);
108+ g = FMADD (g, r, g);
109+ h = FMADD (h, r, h);
110+
111+ r = FNMSUB (g, h, half);
112+ g = FMADD (g, r, g);
113+ h = FMADD (h, r, h);
114+
115+ r = FNMSUB (g, h, half);
116+ g = FMADD (g, r, g);
117+ h = FMADD (h, r, h);
118+
119+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
120+
121+ /* Final refinement. */
122+ d = FNMSUB (g, g, b);
123+
124+ fesetenv_register (fe);
125+ return FMADD (d, h, g);
126+ }
127+ }
128+ else if (b < 0)
129+ {
130+ /* For some reason, some PowerPC32 processors don't implement
131+ FE_INVALID_SQRT. */
132+#ifdef FE_INVALID_SQRT
133+ feraiseexcept (FE_INVALID_SQRT);
134+
135+ fenv_union_t u = { .fenv = fegetenv_register () };
136+ if ((u.l & FE_INVALID) == 0)
137+#endif
138+ feraiseexcept (FE_INVALID);
139+ b = a_nan.value;
140+ }
141+ return f_wash (b);
142+}
143Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
144===================================================================
145--- /dev/null
146+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
147@@ -0,0 +1,101 @@
148+/* Single-precision floating point square root.
149+ Copyright (C) 2010 Free Software Foundation, Inc.
150+ This file is part of the GNU C Library.
151+
152+ The GNU C Library is free software; you can redistribute it and/or
153+ modify it under the terms of the GNU Lesser General Public
154+ License as published by the Free Software Foundation; either
155+ version 2.1 of the License, or (at your option) any later version.
156+
157+ The GNU C Library is distributed in the hope that it will be useful,
158+ but WITHOUT ANY WARRANTY; without even the implied warranty of
159+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
160+ Lesser General Public License for more details.
161+
162+ You should have received a copy of the GNU Lesser General Public
163+ License along with the GNU C Library; if not, write to the Free
164+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
165+ 02111-1307 USA. */
166+
167+#include <math.h>
168+#include <math_private.h>
169+#include <fenv_libc.h>
170+#include <inttypes.h>
171+
172+#include <sysdep.h>
173+#include <ldsodefs.h>
174+
175+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
176+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
177+static const float threehalf = 1.5;
178+
179+/* The method is based on the descriptions in:
180+
181+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
182+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
183+
184+ We find the reciprocal square root and use that to compute the actual
185+ square root. */
186+
187+#ifdef __STDC__
188+float
189+__ieee754_sqrtf (float b)
190+#else
191+float
192+__ieee754_sqrtf (b)
193+ float b;
194+#endif
195+{
196+ if (__builtin_expect (b > 0, 1))
197+ {
198+#define FMSUB(a_, c_, b_) \
199+ ({ double __r; \
200+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
201+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
202+ __r;})
203+#define FNMSUB(a_, c_, b_) \
204+ ({ double __r; \
205+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
206+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
207+ __r;})
208+
209+ if (__builtin_expect (b != a_inf.value, 1))
210+ {
211+ double y, x;
212+ fenv_t fe;
213+
214+ fe = fegetenv_register ();
215+
216+ relax_fenv_state ();
217+
218+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
219+ y = FMSUB (threehalf, b, b);
220+
221+ /* Initial estimate. */
222+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
223+
224+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
225+ x = x * FNMSUB (y, x * x, threehalf);
226+ x = x * FNMSUB (y, x * x, threehalf);
227+ x = x * FNMSUB (y, x * x, threehalf);
228+
229+ /* All done. */
230+ fesetenv_register (fe);
231+ return x * b;
232+ }
233+ }
234+ else if (b < 0)
235+ {
236+ /* For some reason, some PowerPC32 processors don't implement
237+ FE_INVALID_SQRT. */
238+#ifdef FE_INVALID_SQRT
239+ feraiseexcept (FE_INVALID_SQRT);
240+
241+ fenv_union_t u = { .fenv = fegetenv_register () };
242+ if ((u.l & FE_INVALID) == 0)
243+#endif
244+ feraiseexcept (FE_INVALID);
245+ b = a_nan.value;
246+ }
247+ return f_washf (b);
248+}
249Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
250===================================================================
251--- /dev/null
252+++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
253@@ -0,0 +1,134 @@
254+/* Double-precision floating point square root.
255+ Copyright (C) 2010 Free Software Foundation, Inc.
256+ This file is part of the GNU C Library.
257+
258+ The GNU C Library is free software; you can redistribute it and/or
259+ modify it under the terms of the GNU Lesser General Public
260+ License as published by the Free Software Foundation; either
261+ version 2.1 of the License, or (at your option) any later version.
262+
263+ The GNU C Library is distributed in the hope that it will be useful,
264+ but WITHOUT ANY WARRANTY; without even the implied warranty of
265+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
266+ Lesser General Public License for more details.
267+
268+ You should have received a copy of the GNU Lesser General Public
269+ License along with the GNU C Library; if not, write to the Free
270+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
271+ 02111-1307 USA. */
272+
273+#include <math.h>
274+#include <math_private.h>
275+#include <fenv_libc.h>
276+#include <inttypes.h>
277+
278+#include <sysdep.h>
279+#include <ldsodefs.h>
280+
281+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
282+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
283+static const float two108 = 3.245185536584267269e+32;
284+static const float twom54 = 5.551115123125782702e-17;
285+static const float half = 0.5;
286+
287+/* The method is based on the descriptions in:
288+
289+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
290+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
291+
292+ We find the actual square root and half of its reciprocal
293+ simultaneously. */
294+
295+#ifdef __STDC__
296+double
297+__ieee754_sqrt (double b)
298+#else
299+double
300+__ieee754_sqrt (b)
301+ double b;
302+#endif
303+{
304+ if (__builtin_expect (b > 0, 1))
305+ {
306+ double y, g, h, d, r;
307+ ieee_double_shape_type u;
308+
309+ if (__builtin_expect (b != a_inf.value, 1))
310+ {
311+ fenv_t fe;
312+
313+ fe = fegetenv_register ();
314+
315+ u.value = b;
316+
317+ relax_fenv_state ();
318+
319+ __asm__ ("frsqrte %[estimate], %[x]\n"
320+ : [estimate] "=f" (y) : [x] "f" (b));
321+
322+ /* Following Muller et al, page 168, equation 5.20.
323+
324+ h goes to 1/(2*sqrt(b))
325+ g goes to sqrt(b).
326+
327+ We need three iterations to get within 1ulp. */
328+
329+ /* Indicate that these can be performed prior to the branch. GCC
330+ insists on sinking them below the branch, however; it seems like
331+ they'd be better before the branch so that we can cover any latency
332+ from storing the argument and loading its high word. Oh well. */
333+
334+ g = b * y;
335+ h = 0.5 * y;
336+
337+ /* Handle small numbers by scaling. */
338+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
339+ return __ieee754_sqrt (b * two108) * twom54;
340+
341+#define FMADD(a_, c_, b_) \
342+ ({ double __r; \
343+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
344+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
345+ __r;})
346+#define FNMSUB(a_, c_, b_) \
347+ ({ double __r; \
348+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
349+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
350+ __r;})
351+
352+ r = FNMSUB (g, h, half);
353+ g = FMADD (g, r, g);
354+ h = FMADD (h, r, h);
355+
356+ r = FNMSUB (g, h, half);
357+ g = FMADD (g, r, g);
358+ h = FMADD (h, r, h);
359+
360+ r = FNMSUB (g, h, half);
361+ g = FMADD (g, r, g);
362+ h = FMADD (h, r, h);
363+
364+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
365+
366+ /* Final refinement. */
367+ d = FNMSUB (g, g, b);
368+
369+ fesetenv_register (fe);
370+ return FMADD (d, h, g);
371+ }
372+ }
373+ else if (b < 0)
374+ {
375+ /* For some reason, some PowerPC32 processors don't implement
376+ FE_INVALID_SQRT. */
377+#ifdef FE_INVALID_SQRT
378+ feraiseexcept (FE_INVALID_SQRT);
379+
380+ fenv_union_t u = { .fenv = fegetenv_register () };
381+ if ((u.l & FE_INVALID) == 0)
382+#endif
383+ feraiseexcept (FE_INVALID);
384+ b = a_nan.value;
385+ }
386+ return f_wash (b);
387+}
388Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
389===================================================================
390--- /dev/null
391+++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
392@@ -0,0 +1,101 @@
393+/* Single-precision floating point square root.
394+ Copyright (C) 2010 Free Software Foundation, Inc.
395+ This file is part of the GNU C Library.
396+
397+ The GNU C Library is free software; you can redistribute it and/or
398+ modify it under the terms of the GNU Lesser General Public
399+ License as published by the Free Software Foundation; either
400+ version 2.1 of the License, or (at your option) any later version.
401+
402+ The GNU C Library is distributed in the hope that it will be useful,
403+ but WITHOUT ANY WARRANTY; without even the implied warranty of
404+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
405+ Lesser General Public License for more details.
406+
407+ You should have received a copy of the GNU Lesser General Public
408+ License along with the GNU C Library; if not, write to the Free
409+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
410+ 02111-1307 USA. */
411+
412+#include <math.h>
413+#include <math_private.h>
414+#include <fenv_libc.h>
415+#include <inttypes.h>
416+
417+#include <sysdep.h>
418+#include <ldsodefs.h>
419+
420+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
421+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
422+static const float threehalf = 1.5;
423+
424+/* The method is based on the descriptions in:
425+
426+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
427+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
428+
429+ We find the reciprocal square root and use that to compute the actual
430+ square root. */
431+
432+#ifdef __STDC__
433+float
434+__ieee754_sqrtf (float b)
435+#else
436+float
437+__ieee754_sqrtf (b)
438+ float b;
439+#endif
440+{
441+ if (__builtin_expect (b > 0, 1))
442+ {
443+#define FMSUB(a_, c_, b_) \
444+ ({ double __r; \
445+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
446+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
447+ __r;})
448+#define FNMSUB(a_, c_, b_) \
449+ ({ double __r; \
450+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
451+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
452+ __r;})
453+
454+ if (__builtin_expect (b != a_inf.value, 1))
455+ {
456+ double y, x;
457+ fenv_t fe;
458+
459+ fe = fegetenv_register ();
460+
461+ relax_fenv_state ();
462+
463+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
464+ y = FMSUB (threehalf, b, b);
465+
466+ /* Initial estimate. */
467+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
468+
469+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
470+ x = x * FNMSUB (y, x * x, threehalf);
471+ x = x * FNMSUB (y, x * x, threehalf);
472+ x = x * FNMSUB (y, x * x, threehalf);
473+
474+ /* All done. */
475+ fesetenv_register (fe);
476+ return x * b;
477+ }
478+ }
479+ else if (b < 0)
480+ {
481+ /* For some reason, some PowerPC32 processors don't implement
482+ FE_INVALID_SQRT. */
483+#ifdef FE_INVALID_SQRT
484+ feraiseexcept (FE_INVALID_SQRT);
485+
486+ fenv_union_t u = { .fenv = fegetenv_register () };
487+ if ((u.l & FE_INVALID) == 0)
488+#endif
489+ feraiseexcept (FE_INVALID);
490+ b = a_nan.value;
491+ }
492+ return f_washf (b);
493+}
494Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
495===================================================================
496--- /dev/null
497+++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
498@@ -0,0 +1,134 @@
499+/* Double-precision floating point square root.
500+ Copyright (C) 2010 Free Software Foundation, Inc.
501+ This file is part of the GNU C Library.
502+
503+ The GNU C Library is free software; you can redistribute it and/or
504+ modify it under the terms of the GNU Lesser General Public
505+ License as published by the Free Software Foundation; either
506+ version 2.1 of the License, or (at your option) any later version.
507+
508+ The GNU C Library is distributed in the hope that it will be useful,
509+ but WITHOUT ANY WARRANTY; without even the implied warranty of
510+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
511+ Lesser General Public License for more details.
512+
513+ You should have received a copy of the GNU Lesser General Public
514+ License along with the GNU C Library; if not, write to the Free
515+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
516+ 02111-1307 USA. */
517+
518+#include <math.h>
519+#include <math_private.h>
520+#include <fenv_libc.h>
521+#include <inttypes.h>
522+
523+#include <sysdep.h>
524+#include <ldsodefs.h>
525+
526+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
527+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
528+static const float two108 = 3.245185536584267269e+32;
529+static const float twom54 = 5.551115123125782702e-17;
530+static const float half = 0.5;
531+
532+/* The method is based on the descriptions in:
533+
534+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
535+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
536+
537+ We find the actual square root and half of its reciprocal
538+ simultaneously. */
539+
540+#ifdef __STDC__
541+double
542+__ieee754_sqrt (double b)
543+#else
544+double
545+__ieee754_sqrt (b)
546+ double b;
547+#endif
548+{
549+ if (__builtin_expect (b > 0, 1))
550+ {
551+ double y, g, h, d, r;
552+ ieee_double_shape_type u;
553+
554+ if (__builtin_expect (b != a_inf.value, 1))
555+ {
556+ fenv_t fe;
557+
558+ fe = fegetenv_register ();
559+
560+ u.value = b;
561+
562+ relax_fenv_state ();
563+
564+ __asm__ ("frsqrte %[estimate], %[x]\n"
565+ : [estimate] "=f" (y) : [x] "f" (b));
566+
567+ /* Following Muller et al, page 168, equation 5.20.
568+
569+ h goes to 1/(2*sqrt(b))
570+ g goes to sqrt(b).
571+
572+ We need three iterations to get within 1ulp. */
573+
574+ /* Indicate that these can be performed prior to the branch. GCC
575+ insists on sinking them below the branch, however; it seems like
576+ they'd be better before the branch so that we can cover any latency
577+ from storing the argument and loading its high word. Oh well. */
578+
579+ g = b * y;
580+ h = 0.5 * y;
581+
582+ /* Handle small numbers by scaling. */
583+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
584+ return __ieee754_sqrt (b * two108) * twom54;
585+
586+#define FMADD(a_, c_, b_) \
587+ ({ double __r; \
588+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
589+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
590+ __r;})
591+#define FNMSUB(a_, c_, b_) \
592+ ({ double __r; \
593+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
594+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
595+ __r;})
596+
597+ r = FNMSUB (g, h, half);
598+ g = FMADD (g, r, g);
599+ h = FMADD (h, r, h);
600+
601+ r = FNMSUB (g, h, half);
602+ g = FMADD (g, r, g);
603+ h = FMADD (h, r, h);
604+
605+ r = FNMSUB (g, h, half);
606+ g = FMADD (g, r, g);
607+ h = FMADD (h, r, h);
608+
609+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
610+
611+ /* Final refinement. */
612+ d = FNMSUB (g, g, b);
613+
614+ fesetenv_register (fe);
615+ return FMADD (d, h, g);
616+ }
617+ }
618+ else if (b < 0)
619+ {
620+ /* For some reason, some PowerPC32 processors don't implement
621+ FE_INVALID_SQRT. */
622+#ifdef FE_INVALID_SQRT
623+ feraiseexcept (FE_INVALID_SQRT);
624+
625+ fenv_union_t u = { .fenv = fegetenv_register () };
626+ if ((u.l & FE_INVALID) == 0)
627+#endif
628+ feraiseexcept (FE_INVALID);
629+ b = a_nan.value;
630+ }
631+ return f_wash (b);
632+}
633Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
634===================================================================
635--- /dev/null
636+++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
637@@ -0,0 +1,101 @@
638+/* Single-precision floating point square root.
639+ Copyright (C) 2010 Free Software Foundation, Inc.
640+ This file is part of the GNU C Library.
641+
642+ The GNU C Library is free software; you can redistribute it and/or
643+ modify it under the terms of the GNU Lesser General Public
644+ License as published by the Free Software Foundation; either
645+ version 2.1 of the License, or (at your option) any later version.
646+
647+ The GNU C Library is distributed in the hope that it will be useful,
648+ but WITHOUT ANY WARRANTY; without even the implied warranty of
649+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
650+ Lesser General Public License for more details.
651+
652+ You should have received a copy of the GNU Lesser General Public
653+ License along with the GNU C Library; if not, write to the Free
654+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
655+ 02111-1307 USA. */
656+
657+#include <math.h>
658+#include <math_private.h>
659+#include <fenv_libc.h>
660+#include <inttypes.h>
661+
662+#include <sysdep.h>
663+#include <ldsodefs.h>
664+
665+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
666+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
667+static const float threehalf = 1.5;
668+
669+/* The method is based on the descriptions in:
670+
671+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
672+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
673+
674+ We find the reciprocal square root and use that to compute the actual
675+ square root. */
676+
677+#ifdef __STDC__
678+float
679+__ieee754_sqrtf (float b)
680+#else
681+float
682+__ieee754_sqrtf (b)
683+ float b;
684+#endif
685+{
686+ if (__builtin_expect (b > 0, 1))
687+ {
688+#define FMSUB(a_, c_, b_) \
689+ ({ double __r; \
690+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
691+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
692+ __r;})
693+#define FNMSUB(a_, c_, b_) \
694+ ({ double __r; \
695+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
696+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
697+ __r;})
698+
699+ if (__builtin_expect (b != a_inf.value, 1))
700+ {
701+ double y, x;
702+ fenv_t fe;
703+
704+ fe = fegetenv_register ();
705+
706+ relax_fenv_state ();
707+
708+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
709+ y = FMSUB (threehalf, b, b);
710+
711+ /* Initial estimate. */
712+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
713+
714+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
715+ x = x * FNMSUB (y, x * x, threehalf);
716+ x = x * FNMSUB (y, x * x, threehalf);
717+ x = x * FNMSUB (y, x * x, threehalf);
718+
719+ /* All done. */
720+ fesetenv_register (fe);
721+ return x * b;
722+ }
723+ }
724+ else if (b < 0)
725+ {
726+ /* For some reason, some PowerPC32 processors don't implement
727+ FE_INVALID_SQRT. */
728+#ifdef FE_INVALID_SQRT
729+ feraiseexcept (FE_INVALID_SQRT);
730+
731+ fenv_union_t u = { .fenv = fegetenv_register () };
732+ if ((u.l & FE_INVALID) == 0)
733+#endif
734+ feraiseexcept (FE_INVALID);
735+ b = a_nan.value;
736+ }
737+ return f_washf (b);
738+}
739Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
740===================================================================
741--- /dev/null
742+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
743@@ -0,0 +1,134 @@
744+/* Double-precision floating point square root.
745+ Copyright (C) 2010 Free Software Foundation, Inc.
746+ This file is part of the GNU C Library.
747+
748+ The GNU C Library is free software; you can redistribute it and/or
749+ modify it under the terms of the GNU Lesser General Public
750+ License as published by the Free Software Foundation; either
751+ version 2.1 of the License, or (at your option) any later version.
752+
753+ The GNU C Library is distributed in the hope that it will be useful,
754+ but WITHOUT ANY WARRANTY; without even the implied warranty of
755+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
756+ Lesser General Public License for more details.
757+
758+ You should have received a copy of the GNU Lesser General Public
759+ License along with the GNU C Library; if not, write to the Free
760+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
761+ 02111-1307 USA. */
762+
763+#include <math.h>
764+#include <math_private.h>
765+#include <fenv_libc.h>
766+#include <inttypes.h>
767+
768+#include <sysdep.h>
769+#include <ldsodefs.h>
770+
771+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
772+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
773+static const float two108 = 3.245185536584267269e+32;
774+static const float twom54 = 5.551115123125782702e-17;
775+static const float half = 0.5;
776+
777+/* The method is based on the descriptions in:
778+
779+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
780+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
781+
782+ We find the actual square root and half of its reciprocal
783+ simultaneously. */
784+
785+#ifdef __STDC__
786+double
787+__ieee754_sqrt (double b)
788+#else
789+double
790+__ieee754_sqrt (b)
791+ double b;
792+#endif
793+{
794+ if (__builtin_expect (b > 0, 1))
795+ {
796+ double y, g, h, d, r;
797+ ieee_double_shape_type u;
798+
799+ if (__builtin_expect (b != a_inf.value, 1))
800+ {
801+ fenv_t fe;
802+
803+ fe = fegetenv_register ();
804+
805+ u.value = b;
806+
807+ relax_fenv_state ();
808+
809+ __asm__ ("frsqrte %[estimate], %[x]\n"
810+ : [estimate] "=f" (y) : [x] "f" (b));
811+
812+ /* Following Muller et al, page 168, equation 5.20.
813+
814+ h goes to 1/(2*sqrt(b))
815+ g goes to sqrt(b).
816+
817+ We need three iterations to get within 1ulp. */
818+
819+ /* Indicate that these can be performed prior to the branch. GCC
820+ insists on sinking them below the branch, however; it seems like
821+ they'd be better before the branch so that we can cover any latency
822+ from storing the argument and loading its high word. Oh well. */
823+
824+ g = b * y;
825+ h = 0.5 * y;
826+
827+ /* Handle small numbers by scaling. */
828+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
829+ return __ieee754_sqrt (b * two108) * twom54;
830+
831+#define FMADD(a_, c_, b_) \
832+ ({ double __r; \
833+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
834+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
835+ __r;})
836+#define FNMSUB(a_, c_, b_) \
837+ ({ double __r; \
838+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
839+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
840+ __r;})
841+
842+ r = FNMSUB (g, h, half);
843+ g = FMADD (g, r, g);
844+ h = FMADD (h, r, h);
845+
846+ r = FNMSUB (g, h, half);
847+ g = FMADD (g, r, g);
848+ h = FMADD (h, r, h);
849+
850+ r = FNMSUB (g, h, half);
851+ g = FMADD (g, r, g);
852+ h = FMADD (h, r, h);
853+
854+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
855+
856+ /* Final refinement. */
857+ d = FNMSUB (g, g, b);
858+
859+ fesetenv_register (fe);
860+ return FMADD (d, h, g);
861+ }
862+ }
863+ else if (b < 0)
864+ {
865+ /* For some reason, some PowerPC32 processors don't implement
866+ FE_INVALID_SQRT. */
867+#ifdef FE_INVALID_SQRT
868+ feraiseexcept (FE_INVALID_SQRT);
869+
870+ fenv_union_t u = { .fenv = fegetenv_register () };
871+ if ((u.l & FE_INVALID) == 0)
872+#endif
873+ feraiseexcept (FE_INVALID);
874+ b = a_nan.value;
875+ }
876+ return f_wash (b);
877+}
878Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
879===================================================================
880--- /dev/null
881+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
882@@ -0,0 +1,101 @@
883+/* Single-precision floating point square root.
884+ Copyright (C) 2010 Free Software Foundation, Inc.
885+ This file is part of the GNU C Library.
886+
887+ The GNU C Library is free software; you can redistribute it and/or
888+ modify it under the terms of the GNU Lesser General Public
889+ License as published by the Free Software Foundation; either
890+ version 2.1 of the License, or (at your option) any later version.
891+
892+ The GNU C Library is distributed in the hope that it will be useful,
893+ but WITHOUT ANY WARRANTY; without even the implied warranty of
894+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
895+ Lesser General Public License for more details.
896+
897+ You should have received a copy of the GNU Lesser General Public
898+ License along with the GNU C Library; if not, write to the Free
899+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
900+ 02111-1307 USA. */
901+
902+#include <math.h>
903+#include <math_private.h>
904+#include <fenv_libc.h>
905+#include <inttypes.h>
906+
907+#include <sysdep.h>
908+#include <ldsodefs.h>
909+
910+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
911+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
912+static const float threehalf = 1.5;
913+
914+/* The method is based on the descriptions in:
915+
916+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
917+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
918+
919+ We find the reciprocal square root and use that to compute the actual
920+ square root. */
921+
922+#ifdef __STDC__
923+float
924+__ieee754_sqrtf (float b)
925+#else
926+float
927+__ieee754_sqrtf (b)
928+ float b;
929+#endif
930+{
931+ if (__builtin_expect (b > 0, 1))
932+ {
933+#define FMSUB(a_, c_, b_) \
934+ ({ double __r; \
935+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
936+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
937+ __r;})
938+#define FNMSUB(a_, c_, b_) \
939+ ({ double __r; \
940+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
941+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
942+ __r;})
943+
944+ if (__builtin_expect (b != a_inf.value, 1))
945+ {
946+ double y, x;
947+ fenv_t fe;
948+
949+ fe = fegetenv_register ();
950+
951+ relax_fenv_state ();
952+
953+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
954+ y = FMSUB (threehalf, b, b);
955+
956+ /* Initial estimate. */
957+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
958+
959+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
960+ x = x * FNMSUB (y, x * x, threehalf);
961+ x = x * FNMSUB (y, x * x, threehalf);
962+ x = x * FNMSUB (y, x * x, threehalf);
963+
964+ /* All done. */
965+ fesetenv_register (fe);
966+ return x * b;
967+ }
968+ }
969+ else if (b < 0)
970+ {
971+ /* For some reason, some PowerPC32 processors don't implement
972+ FE_INVALID_SQRT. */
973+#ifdef FE_INVALID_SQRT
974+ feraiseexcept (FE_INVALID_SQRT);
975+
976+ fenv_union_t u = { .fenv = fegetenv_register () };
977+ if ((u.l & FE_INVALID) == 0)
978+#endif
979+ feraiseexcept (FE_INVALID);
980+ b = a_nan.value;
981+ }
982+ return f_washf (b);
983+}
984Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
985===================================================================
986--- /dev/null
987+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
988@@ -0,0 +1,134 @@
989+/* Double-precision floating point square root.
990+ Copyright (C) 2010 Free Software Foundation, Inc.
991+ This file is part of the GNU C Library.
992+
993+ The GNU C Library is free software; you can redistribute it and/or
994+ modify it under the terms of the GNU Lesser General Public
995+ License as published by the Free Software Foundation; either
996+ version 2.1 of the License, or (at your option) any later version.
997+
998+ The GNU C Library is distributed in the hope that it will be useful,
999+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1000+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1001+ Lesser General Public License for more details.
1002+
1003+ You should have received a copy of the GNU Lesser General Public
1004+ License along with the GNU C Library; if not, write to the Free
1005+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1006+ 02111-1307 USA. */
1007+
1008+#include <math.h>
1009+#include <math_private.h>
1010+#include <fenv_libc.h>
1011+#include <inttypes.h>
1012+
1013+#include <sysdep.h>
1014+#include <ldsodefs.h>
1015+
1016+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1017+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1018+static const float two108 = 3.245185536584267269e+32;
1019+static const float twom54 = 5.551115123125782702e-17;
1020+static const float half = 0.5;
1021+
1022+/* The method is based on the descriptions in:
1023+
1024+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1025+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1026+
1027+ We find the actual square root and half of its reciprocal
1028+ simultaneously. */
1029+
1030+#ifdef __STDC__
1031+double
1032+__ieee754_sqrt (double b)
1033+#else
1034+double
1035+__ieee754_sqrt (b)
1036+ double b;
1037+#endif
1038+{
1039+ if (__builtin_expect (b > 0, 1))
1040+ {
1041+ double y, g, h, d, r;
1042+ ieee_double_shape_type u;
1043+
1044+ if (__builtin_expect (b != a_inf.value, 1))
1045+ {
1046+ fenv_t fe;
1047+
1048+ fe = fegetenv_register ();
1049+
1050+ u.value = b;
1051+
1052+ relax_fenv_state ();
1053+
1054+ __asm__ ("frsqrte %[estimate], %[x]\n"
1055+ : [estimate] "=f" (y) : [x] "f" (b));
1056+
1057+ /* Following Muller et al, page 168, equation 5.20.
1058+
1059+ h goes to 1/(2*sqrt(b))
1060+ g goes to sqrt(b).
1061+
1062+ We need three iterations to get within 1ulp. */
1063+
1064+ /* Indicate that these can be performed prior to the branch. GCC
1065+ insists on sinking them below the branch, however; it seems like
1066+ they'd be better before the branch so that we can cover any latency
1067+ from storing the argument and loading its high word. Oh well. */
1068+
1069+ g = b * y;
1070+ h = 0.5 * y;
1071+
1072+ /* Handle small numbers by scaling. */
1073+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
1074+ return __ieee754_sqrt (b * two108) * twom54;
1075+
1076+#define FMADD(a_, c_, b_) \
1077+ ({ double __r; \
1078+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
1079+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1080+ __r;})
1081+#define FNMSUB(a_, c_, b_) \
1082+ ({ double __r; \
1083+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1084+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1085+ __r;})
1086+
1087+ r = FNMSUB (g, h, half);
1088+ g = FMADD (g, r, g);
1089+ h = FMADD (h, r, h);
1090+
1091+ r = FNMSUB (g, h, half);
1092+ g = FMADD (g, r, g);
1093+ h = FMADD (h, r, h);
1094+
1095+ r = FNMSUB (g, h, half);
1096+ g = FMADD (g, r, g);
1097+ h = FMADD (h, r, h);
1098+
1099+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
1100+
1101+ /* Final refinement. */
1102+ d = FNMSUB (g, g, b);
1103+
1104+ fesetenv_register (fe);
1105+ return FMADD (d, h, g);
1106+ }
1107+ }
1108+ else if (b < 0)
1109+ {
1110+ /* For some reason, some PowerPC32 processors don't implement
1111+ FE_INVALID_SQRT. */
1112+#ifdef FE_INVALID_SQRT
1113+ feraiseexcept (FE_INVALID_SQRT);
1114+
1115+ fenv_union_t u = { .fenv = fegetenv_register () };
1116+ if ((u.l & FE_INVALID) == 0)
1117+#endif
1118+ feraiseexcept (FE_INVALID);
1119+ b = a_nan.value;
1120+ }
1121+ return f_wash (b);
1122+}
1123Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
1124===================================================================
1125--- /dev/null
1126+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
1127@@ -0,0 +1,101 @@
1128+/* Single-precision floating point square root.
1129+ Copyright (C) 2010 Free Software Foundation, Inc.
1130+ This file is part of the GNU C Library.
1131+
1132+ The GNU C Library is free software; you can redistribute it and/or
1133+ modify it under the terms of the GNU Lesser General Public
1134+ License as published by the Free Software Foundation; either
1135+ version 2.1 of the License, or (at your option) any later version.
1136+
1137+ The GNU C Library is distributed in the hope that it will be useful,
1138+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1139+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1140+ Lesser General Public License for more details.
1141+
1142+ You should have received a copy of the GNU Lesser General Public
1143+ License along with the GNU C Library; if not, write to the Free
1144+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1145+ 02111-1307 USA. */
1146+
1147+#include <math.h>
1148+#include <math_private.h>
1149+#include <fenv_libc.h>
1150+#include <inttypes.h>
1151+
1152+#include <sysdep.h>
1153+#include <ldsodefs.h>
1154+
1155+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1156+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1157+static const float threehalf = 1.5;
1158+
1159+/* The method is based on the descriptions in:
1160+
1161+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1162+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1163+
1164+ We find the reciprocal square root and use that to compute the actual
1165+ square root. */
1166+
1167+#ifdef __STDC__
1168+float
1169+__ieee754_sqrtf (float b)
1170+#else
1171+float
1172+__ieee754_sqrtf (b)
1173+ float b;
1174+#endif
1175+{
1176+ if (__builtin_expect (b > 0, 1))
1177+ {
1178+#define FMSUB(a_, c_, b_) \
1179+ ({ double __r; \
1180+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
1181+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1182+ __r;})
1183+#define FNMSUB(a_, c_, b_) \
1184+ ({ double __r; \
1185+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1186+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1187+ __r;})
1188+
1189+ if (__builtin_expect (b != a_inf.value, 1))
1190+ {
1191+ double y, x;
1192+ fenv_t fe;
1193+
1194+ fe = fegetenv_register ();
1195+
1196+ relax_fenv_state ();
1197+
1198+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1199+ y = FMSUB (threehalf, b, b);
1200+
1201+ /* Initial estimate. */
1202+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1203+
1204+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1205+ x = x * FNMSUB (y, x * x, threehalf);
1206+ x = x * FNMSUB (y, x * x, threehalf);
1207+ x = x * FNMSUB (y, x * x, threehalf);
1208+
1209+ /* All done. */
1210+ fesetenv_register (fe);
1211+ return x * b;
1212+ }
1213+ }
1214+ else if (b < 0)
1215+ {
1216+ /* For some reason, some PowerPC32 processors don't implement
1217+ FE_INVALID_SQRT. */
1218+#ifdef FE_INVALID_SQRT
1219+ feraiseexcept (FE_INVALID_SQRT);
1220+
1221+ fenv_union_t u = { .fenv = fegetenv_register () };
1222+ if ((u.l & FE_INVALID) == 0)
1223+#endif
1224+ feraiseexcept (FE_INVALID);
1225+ b = a_nan.value;
1226+ }
1227+ return f_washf (b);
1228+}
1229Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
1230===================================================================
1231--- /dev/null
1232+++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
1233@@ -0,0 +1,134 @@
1234+/* Double-precision floating point square root.
1235+ Copyright (C) 2010 Free Software Foundation, Inc.
1236+ This file is part of the GNU C Library.
1237+
1238+ The GNU C Library is free software; you can redistribute it and/or
1239+ modify it under the terms of the GNU Lesser General Public
1240+ License as published by the Free Software Foundation; either
1241+ version 2.1 of the License, or (at your option) any later version.
1242+
1243+ The GNU C Library is distributed in the hope that it will be useful,
1244+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1245+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1246+ Lesser General Public License for more details.
1247+
1248+ You should have received a copy of the GNU Lesser General Public
1249+ License along with the GNU C Library; if not, write to the Free
1250+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1251+ 02111-1307 USA. */
1252+
1253+#include <math.h>
1254+#include <math_private.h>
1255+#include <fenv_libc.h>
1256+#include <inttypes.h>
1257+
1258+#include <sysdep.h>
1259+#include <ldsodefs.h>
1260+
1261+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1262+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1263+static const float two108 = 3.245185536584267269e+32;
1264+static const float twom54 = 5.551115123125782702e-17;
1265+static const float half = 0.5;
1266+
1267+/* The method is based on the descriptions in:
1268+
1269+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1270+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1271+
1272+ We find the actual square root and half of its reciprocal
1273+ simultaneously. */
1274+
1275+#ifdef __STDC__
1276+double
1277+__ieee754_sqrt (double b)
1278+#else
1279+double
1280+__ieee754_sqrt (b)
1281+ double b;
1282+#endif
1283+{
1284+ if (__builtin_expect (b > 0, 1))
1285+ {
1286+ double y, g, h, d, r;
1287+ ieee_double_shape_type u;
1288+
1289+ if (__builtin_expect (b != a_inf.value, 1))
1290+ {
1291+ fenv_t fe;
1292+
1293+ fe = fegetenv_register ();
1294+
1295+ u.value = b;
1296+
1297+ relax_fenv_state ();
1298+
1299+ __asm__ ("frsqrte %[estimate], %[x]\n"
1300+ : [estimate] "=f" (y) : [x] "f" (b));
1301+
1302+ /* Following Muller et al, page 168, equation 5.20.
1303+
1304+ h goes to 1/(2*sqrt(b))
1305+ g goes to sqrt(b).
1306+
1307+ We need three iterations to get within 1ulp. */
1308+
1309+ /* Indicate that these can be performed prior to the branch. GCC
1310+ insists on sinking them below the branch, however; it seems like
1311+ they'd be better before the branch so that we can cover any latency
1312+ from storing the argument and loading its high word. Oh well. */
1313+
1314+ g = b * y;
1315+ h = 0.5 * y;
1316+
1317+ /* Handle small numbers by scaling. */
1318+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
1319+ return __ieee754_sqrt (b * two108) * twom54;
1320+
1321+#define FMADD(a_, c_, b_) \
1322+ ({ double __r; \
1323+ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
1324+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1325+ __r;})
1326+#define FNMSUB(a_, c_, b_) \
1327+ ({ double __r; \
1328+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1329+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1330+ __r;})
1331+
1332+ r = FNMSUB (g, h, half);
1333+ g = FMADD (g, r, g);
1334+ h = FMADD (h, r, h);
1335+
1336+ r = FNMSUB (g, h, half);
1337+ g = FMADD (g, r, g);
1338+ h = FMADD (h, r, h);
1339+
1340+ r = FNMSUB (g, h, half);
1341+ g = FMADD (g, r, g);
1342+ h = FMADD (h, r, h);
1343+
1344+ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
1345+
1346+ /* Final refinement. */
1347+ d = FNMSUB (g, g, b);
1348+
1349+ fesetenv_register (fe);
1350+ return FMADD (d, h, g);
1351+ }
1352+ }
1353+ else if (b < 0)
1354+ {
1355+ /* For some reason, some PowerPC32 processors don't implement
1356+ FE_INVALID_SQRT. */
1357+#ifdef FE_INVALID_SQRT
1358+ feraiseexcept (FE_INVALID_SQRT);
1359+
1360+ fenv_union_t u = { .fenv = fegetenv_register () };
1361+ if ((u.l & FE_INVALID) == 0)
1362+#endif
1363+ feraiseexcept (FE_INVALID);
1364+ b = a_nan.value;
1365+ }
1366+ return f_wash (b);
1367+}
1368Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
1369===================================================================
1370--- /dev/null
1371+++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
1372@@ -0,0 +1,101 @@
1373+/* Single-precision floating point square root.
1374+ Copyright (C) 2010 Free Software Foundation, Inc.
1375+ This file is part of the GNU C Library.
1376+
1377+ The GNU C Library is free software; you can redistribute it and/or
1378+ modify it under the terms of the GNU Lesser General Public
1379+ License as published by the Free Software Foundation; either
1380+ version 2.1 of the License, or (at your option) any later version.
1381+
1382+ The GNU C Library is distributed in the hope that it will be useful,
1383+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1384+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1385+ Lesser General Public License for more details.
1386+
1387+ You should have received a copy of the GNU Lesser General Public
1388+ License along with the GNU C Library; if not, write to the Free
1389+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1390+ 02111-1307 USA. */
1391+
1392+#include <math.h>
1393+#include <math_private.h>
1394+#include <fenv_libc.h>
1395+#include <inttypes.h>
1396+
1397+#include <sysdep.h>
1398+#include <ldsodefs.h>
1399+
1400+static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
1401+static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
1402+static const float threehalf = 1.5;
1403+
1404+/* The method is based on the descriptions in:
1405+
1406+ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
1407+ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
1408+
1409+ We find the reciprocal square root and use that to compute the actual
1410+ square root. */
1411+
1412+#ifdef __STDC__
1413+float
1414+__ieee754_sqrtf (float b)
1415+#else
1416+float
1417+__ieee754_sqrtf (b)
1418+ float b;
1419+#endif
1420+{
1421+ if (__builtin_expect (b > 0, 1))
1422+ {
1423+#define FMSUB(a_, c_, b_) \
1424+ ({ double __r; \
1425+ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
1426+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1427+ __r;})
1428+#define FNMSUB(a_, c_, b_) \
1429+ ({ double __r; \
1430+ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
1431+ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
1432+ __r;})
1433+
1434+ if (__builtin_expect (b != a_inf.value, 1))
1435+ {
1436+ double y, x;
1437+ fenv_t fe;
1438+
1439+ fe = fegetenv_register ();
1440+
1441+ relax_fenv_state ();
1442+
1443+ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
1444+ y = FMSUB (threehalf, b, b);
1445+
1446+ /* Initial estimate. */
1447+ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
1448+
1449+ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
1450+ x = x * FNMSUB (y, x * x, threehalf);
1451+ x = x * FNMSUB (y, x * x, threehalf);
1452+ x = x * FNMSUB (y, x * x, threehalf);
1453+
1454+ /* All done. */
1455+ fesetenv_register (fe);
1456+ return x * b;
1457+ }
1458+ }
1459+ else if (b < 0)
1460+ {
1461+ /* For some reason, some PowerPC32 processors don't implement
1462+ FE_INVALID_SQRT. */
1463+#ifdef FE_INVALID_SQRT
1464+ feraiseexcept (FE_INVALID_SQRT);
1465+
1466+ fenv_union_t u = { .fenv = fegetenv_register () };
1467+ if ((u.l & FE_INVALID) == 0)
1468+#endif
1469+ feraiseexcept (FE_INVALID);
1470+ b = a_nan.value;
1471+ }
1472+ return f_washf (b);
1473+}
1474Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
1475===================================================================
1476--- /dev/null
1477+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
1478@@ -0,0 +1 @@
1479+powerpc/powerpc32/603e/fpu
1480Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
1481===================================================================
1482--- /dev/null
1483+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
1484@@ -0,0 +1,2 @@
1485+# e300c3 is a variant of 603e so use the same optimizations for sqrt
1486+powerpc/powerpc32/603e/fpu
1487Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
1488===================================================================
1489--- /dev/null
1490+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
1491@@ -0,0 +1 @@
1492+powerpc/powerpc32/e500mc/fpu
1493Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
1494===================================================================
1495--- /dev/null
1496+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
1497@@ -0,0 +1 @@
1498+powerpc/powerpc32/e5500/fpu
1499Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
1500===================================================================
1501--- /dev/null
1502+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
1503@@ -0,0 +1 @@
1504+powerpc/powerpc32/e6500/fpu
1505Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
1506===================================================================
1507--- /dev/null
1508+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
1509@@ -0,0 +1 @@
1510+powerpc/powerpc64/e5500/fpu
1511Index: libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
1512===================================================================
1513--- /dev/null
1514+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
1515@@ -0,0 +1 @@
1516+powerpc/powerpc64/e6500/fpu
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch b/meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch
new file mode 100644
index 0000000000..be29856b03
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/initgroups_keys.patch
@@ -0,0 +1,20 @@
1This is needed since initgroups belongs to NET group
2so when NET is disabled in eglibc build then it reports
3as undefined symbol
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6Upstream-Status: Pending
7
8Index: libc/nss/getent.c
9===================================================================
10--- libc.orig/nss/getent.c 2012-03-09 09:41:57.099581559 -0800
11+++ libc/nss/getent.c 2012-03-09 09:42:13.095582334 -0800
12@@ -898,7 +898,7 @@
13 D(group)
14 D(gshadow)
15 DN(hosts)
16-D(initgroups)
17+DN(initgroups)
18 DN(netgroup)
19 DN(networks)
20 D(passwd)
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch b/meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch
new file mode 100644
index 0000000000..e83a0ad6d2
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/ld-search-order.patch
@@ -0,0 +1,56 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3The default lib search path order is:
4
5 1) LD_LIBRARY_PATH
6 2) RPATH from the binary
7 3) ld.so.cache
8 4) default search paths embedded in the linker
9
10For nativesdk binaries which are being used alongside binaries on a host system, we
11need the search paths to firstly search the shipped nativesdk libs but then also
12cover the host system. For example we want the host system's libGL and this may be
13in a non-standard location like /usr/lib/mesa. The only place the location is know
14about is in the ld.so.cache of the host system.
15
16Since nativesdk has a simple structure and doesn't need to use a cache itself, we
17repurpose the cache for use as a last resort in finding host system binaries. This
18means we need to switch the order of 3 and 4 above to make this work effectively.
19
20RP 14/10/2010
21
22Index: libc/elf/dl-load.c
23===================================================================
24--- libc.orig/elf/dl-load.c 2012-12-02 13:11:45.000000000 -0800
25+++ libc/elf/dl-load.c 2013-01-09 07:00:59.135223084 -0800
26@@ -2215,7 +2215,14 @@
27 fd = open_path (name, namelen, mode & __RTLD_SECURE,
28 &loader->l_runpath_dirs, &realname, &fb, loader,
29 LA_SER_RUNPATH, &found_other_class);
30-
31+ /* try the default path. */
32+ if (fd == -1
33+ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
34+ || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
35+ && rtld_search_dirs.dirs != (void *) -1)
36+ fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
37+ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
38+ /* Finally try ld.so.cache */
39 #ifdef USE_LDCONFIG
40 if (fd == -1
41 && (__builtin_expect (! (mode & __RTLD_SECURE), 1)
42@@ -2283,14 +2290,6 @@
43 }
44 #endif
45
46- /* Finally, try the default path. */
47- if (fd == -1
48- && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
49- || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
50- && rtld_search_dirs.dirs != (void *) -1)
51- fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
52- &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
53-
54 /* Add another newline when we are tracing the library loading. */
55 if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
56 _dl_debug_printf ("\n");
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch b/meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch
new file mode 100644
index 0000000000..9b646fea95
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/mips-rld-map-check.patch
@@ -0,0 +1,26 @@
1
2On mips target, binutils currently sets DT_MIPS_RLD_MAP to 0 in dynamic
3section if a --version-script sets _RLD_MAP to local. This is apparently
4a binutils bug, but libc shouldn't segfault in this case.
5
6see also: http://sourceware.org/bugilla/show_bug.cgi?id=11615
7
8Upstream-Status: Pending
9
109/19/2010 - added by Qing He <qing.he@intel.com>
11
12
13---
14diff -ru glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h glibc-2.10.1/ports/sysdeps/mips/dl-machine.h
15--- glibc-2.10.1.orig/ports/sysdeps/mips/dl-machine.h 2009-05-16 16:36:20.000000000 +0800
16+++ glibc-2.10.1/ports/sysdeps/mips/dl-machine.h 2010-09-19 09:11:53.000000000 +0800
17@@ -70,7 +70,8 @@
18 /* If there is a DT_MIPS_RLD_MAP entry in the dynamic section, fill it in
19 with the run-time address of the r_debug structure */
20 #define ELF_MACHINE_DEBUG_SETUP(l,r) \
21-do { if ((l)->l_info[DT_MIPS (RLD_MAP)]) \
22+do { if ((l)->l_info[DT_MIPS (RLD_MAP)] && \
23+ (l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) \
24 *(ElfW(Addr) *)((l)->l_info[DT_MIPS (RLD_MAP)]->d_un.d_ptr) = \
25 (ElfW(Addr)) (r); \
26 } while (0)
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch b/meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch
new file mode 100644
index 0000000000..1542b1b519
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/multilib_readlib.patch
@@ -0,0 +1,17 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Replace the OECORE_KNOWN_INTERPRETER_NAMES with the value of
4variable EGLIBC_KNOWN_INTERPRETER_NAMES.
5
6Lianhao Lu, 08/01/2011
7
8--- libc/elf/readlib.c.orig 2011-08-12 17:05:51.864470837 +0800
9+++ libc/elf/readlib.c 2011-08-12 17:06:39.346942074 +0800
10@@ -52,6 +52,7 @@
11 #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
12 SYSDEP_KNOWN_INTERPRETER_NAMES
13 #endif
14+ OECORE_KNOWN_INTERPRETER_NAMES
15 };
16
17 static struct known_names known_libs[] =
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch b/meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch
new file mode 100644
index 0000000000..6ea666b1d6
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/ppc-sqrt_finite.patch
@@ -0,0 +1,184 @@
1on ppc fixes the errors like below
2| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite'
3| collect2: ld returned 1 exit status
4
5Upstream-Status: Pending
6
7ChangeLog
8
92012-01-06 Khem Raj <raj.khem@gmail.com>
10
11 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias.
12 Remove cruft.
13 * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto.
14 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto.
15 * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto.
16
17Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
18===================================================================
19--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
20+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
21@@ -39,14 +39,8 @@ static const float half = 0.5;
22 We find the actual square root and half of its reciprocal
23 simultaneously. */
24
25-#ifdef __STDC__
26 double
27 __ieee754_sqrt (double b)
28-#else
29-double
30-__ieee754_sqrt (b)
31- double b;
32-#endif
33 {
34 if (__builtin_expect (b > 0, 1))
35 {
36@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
37 }
38 return f_wash (b);
39 }
40+strong_alias (__ieee754_sqrt, __sqrt_finite)
41Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
42===================================================================
43--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
44+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
45@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
46 We find the reciprocal square root and use that to compute the actual
47 square root. */
48
49-#ifdef __STDC__
50 float
51 __ieee754_sqrtf (float b)
52-#else
53-float
54-__ieee754_sqrtf (b)
55- float b;
56-#endif
57 {
58 if (__builtin_expect (b > 0, 1))
59 {
60@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
61 }
62 return f_washf (b);
63 }
64+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
65Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
66===================================================================
67--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
68+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
69@@ -39,14 +39,8 @@ static const float half = 0.5;
70 We find the actual square root and half of its reciprocal
71 simultaneously. */
72
73-#ifdef __STDC__
74 double
75 __ieee754_sqrt (double b)
76-#else
77-double
78-__ieee754_sqrt (b)
79- double b;
80-#endif
81 {
82 if (__builtin_expect (b > 0, 1))
83 {
84@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
85 }
86 return f_wash (b);
87 }
88+strong_alias (__ieee754_sqrt, __sqrt_finite)
89Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
90===================================================================
91--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
92+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
93@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
94 We find the reciprocal square root and use that to compute the actual
95 square root. */
96
97-#ifdef __STDC__
98 float
99 __ieee754_sqrtf (float b)
100-#else
101-float
102-__ieee754_sqrtf (b)
103- float b;
104-#endif
105 {
106 if (__builtin_expect (b > 0, 1))
107 {
108@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
109 }
110 return f_washf (b);
111 }
112+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
113Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
114===================================================================
115--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
116+++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
117@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
118 }
119 return f_wash (b);
120 }
121+strong_alias (__ieee754_sqrt, __sqrt_finite)
122Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
123===================================================================
124--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
125+++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
126@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
127 }
128 return f_washf (b);
129 }
130+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
131Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
132===================================================================
133--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
134+++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
135@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
136 }
137 return f_wash (b);
138 }
139+strong_alias (__ieee754_sqrt, __sqrt_finite)
140Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
141===================================================================
142--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
143+++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
144@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
145 }
146 return f_washf (b);
147 }
148+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
149Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
150===================================================================
151--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
152+++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
153@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
154 }
155 return f_wash (b);
156 }
157+strong_alias (__ieee754_sqrt, __sqrt_finite)
158Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
159===================================================================
160--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
161+++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
162@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
163 }
164 return f_washf (b);
165 }
166+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
167Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
168===================================================================
169--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
170+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
171@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
172 }
173 return f_wash (b);
174 }
175+strong_alias (__ieee754_sqrt, __sqrt_finite)
176Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
177===================================================================
178--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
179+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
180@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
181 }
182 return f_washf (b);
183 }
184+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch
new file mode 100644
index 0000000000..60532cbd03
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/ppc_slow_ieee754_sqrt.patch
@@ -0,0 +1,365 @@
1 __ieee754_sqrt{,f} are now inline functions and call out __slow versions
2
3
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5Upstream-Status: Pending
6Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
7===================================================================
8--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
9+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
10@@ -40,7 +40,7 @@ static const float half = 0.5;
11 simultaneously. */
12
13 double
14-__ieee754_sqrt (double b)
15+__slow_ieee754_sqrt (double b)
16 {
17 if (__builtin_expect (b > 0, 1))
18 {
19@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
20
21 /* Handle small numbers by scaling. */
22 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
23- return __ieee754_sqrt (b * two108) * twom54;
24+ return __slow_ieee754_sqrt (b * two108) * twom54;
25
26 #define FMADD(a_, c_, b_) \
27 ({ double __r; \
28@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
29 }
30 return f_wash (b);
31 }
32+
33+#undef __ieee754_sqrt
34+double
35+__ieee754_sqrt (double x)
36+{
37+ return __slow_ieee754_sqrt (x);
38+}
39+
40 strong_alias (__ieee754_sqrt, __sqrt_finite)
41Index: libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
42===================================================================
43--- libc.orig/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
44+++ libc/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
45@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
46 square root. */
47
48 float
49-__ieee754_sqrtf (float b)
50+__slow_ieee754_sqrtf (float b)
51 {
52 if (__builtin_expect (b > 0, 1))
53 {
54@@ -93,4 +93,10 @@ __ieee754_sqrtf (float b)
55 }
56 return f_washf (b);
57 }
58+#undef __ieee754_sqrtf
59+float
60+__ieee754_sqrtf (float x)
61+{
62+ return __slow_ieee754_sqrtf (x);
63+}
64 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
65Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
66===================================================================
67--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
68+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
69@@ -40,7 +40,7 @@ static const float half = 0.5;
70 simultaneously. */
71
72 double
73-__ieee754_sqrt (double b)
74+__slow_ieee754_sqrt (double b)
75 {
76 if (__builtin_expect (b > 0, 1))
77 {
78@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
79
80 /* Handle small numbers by scaling. */
81 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
82- return __ieee754_sqrt (b * two108) * twom54;
83+ return __slow_ieee754_sqrt (b * two108) * twom54;
84
85 #define FMADD(a_, c_, b_) \
86 ({ double __r; \
87@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
88 }
89 return f_wash (b);
90 }
91+
92+#undef __ieee754_sqrt
93+double
94+__ieee754_sqrt (double x)
95+{
96+ return __slow_ieee754_sqrt (x);
97+}
98+
99 strong_alias (__ieee754_sqrt, __sqrt_finite)
100Index: libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
101===================================================================
102--- libc.orig/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
103+++ libc/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
104@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
105 square root. */
106
107 float
108-__ieee754_sqrtf (float b)
109+__slow_ieee754_sqrtf (float b)
110 {
111 if (__builtin_expect (b > 0, 1))
112 {
113@@ -93,4 +93,11 @@ __ieee754_sqrtf (float b)
114 }
115 return f_washf (b);
116 }
117+#undef __ieee754_sqrtf
118+float
119+__ieee754_sqrtf (float x)
120+{
121+ return __slow_ieee754_sqrtf (x);
122+}
123+
124 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
125Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
126===================================================================
127--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
128+++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
129@@ -41,10 +41,10 @@ static const float half = 0.5;
130
131 #ifdef __STDC__
132 double
133-__ieee754_sqrt (double b)
134+__slow_ieee754_sqrt (double b)
135 #else
136 double
137-__ieee754_sqrt (b)
138+__slow_ieee754_sqrt (b)
139 double b;
140 #endif
141 {
142@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
143
144 /* Handle small numbers by scaling. */
145 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
146- return __ieee754_sqrt (b * two108) * twom54;
147+ return __slow_ieee754_sqrt (b * two108) * twom54;
148
149 #define FMADD(a_, c_, b_) \
150 ({ double __r; \
151@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
152 }
153 return f_wash (b);
154 }
155+
156+#undef __ieee754_sqrt
157+double
158+__ieee754_sqrt (double x)
159+{
160+ return __slow_ieee754_sqrt (x);
161+}
162+
163 strong_alias (__ieee754_sqrt, __sqrt_finite)
164Index: libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
165===================================================================
166--- libc.orig/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
167+++ libc/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
168@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
169
170 #ifdef __STDC__
171 float
172-__ieee754_sqrtf (float b)
173+__slow_ieee754_sqrtf (float b)
174 #else
175 float
176-__ieee754_sqrtf (b)
177+__slow_ieee754_sqrtf (b)
178 float b;
179 #endif
180 {
181@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
182 }
183 return f_washf (b);
184 }
185+
186+#undef __ieee754_sqrtf
187+float
188+__ieee754_sqrtf (float x)
189+{
190+ return __slow_ieee754_sqrtf (x);
191+}
192+
193 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
194Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
195===================================================================
196--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
197+++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
198@@ -41,10 +41,10 @@ static const float half = 0.5;
199
200 #ifdef __STDC__
201 double
202-__ieee754_sqrt (double b)
203+__slow_ieee754_sqrt (double b)
204 #else
205 double
206-__ieee754_sqrt (b)
207+__slow_ieee754_sqrt (b)
208 double b;
209 #endif
210 {
211@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
212
213 /* Handle small numbers by scaling. */
214 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
215- return __ieee754_sqrt (b * two108) * twom54;
216+ return __slow_ieee754_sqrt (b * two108) * twom54;
217
218 #define FMADD(a_, c_, b_) \
219 ({ double __r; \
220@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
221 }
222 return f_wash (b);
223 }
224+
225+#undef __ieee754_sqrt
226+double
227+__ieee754_sqrt (double x)
228+{
229+ return __slow_ieee754_sqrt (x);
230+}
231+
232 strong_alias (__ieee754_sqrt, __sqrt_finite)
233Index: libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
234===================================================================
235--- libc.orig/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
236+++ libc/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
237@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
238
239 #ifdef __STDC__
240 float
241-__ieee754_sqrtf (float b)
242+__slow_ieee754_sqrtf (float b)
243 #else
244 float
245-__ieee754_sqrtf (b)
246+__slow_ieee754_sqrtf (b)
247 float b;
248 #endif
249 {
250@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
251 }
252 return f_washf (b);
253 }
254+
255+#undef __ieee754_sqrtf
256+float
257+__ieee754_sqrtf (float x)
258+{
259+ return __slow_ieee754_sqrtf (x);
260+}
261+
262 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
263Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
264===================================================================
265--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
266+++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
267@@ -41,10 +41,10 @@ static const float half = 0.5;
268
269 #ifdef __STDC__
270 double
271-__ieee754_sqrt (double b)
272+__slow_ieee754_sqrt (double b)
273 #else
274 double
275-__ieee754_sqrt (b)
276+__slow_ieee754_sqrt (b)
277 double b;
278 #endif
279 {
280@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
281
282 /* Handle small numbers by scaling. */
283 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
284- return __ieee754_sqrt (b * two108) * twom54;
285+ return __slow_ieee754_sqrt (b * two108) * twom54;
286
287 #define FMADD(a_, c_, b_) \
288 ({ double __r; \
289@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
290 }
291 return f_wash (b);
292 }
293+
294+#undef __ieee754_sqrt
295+double
296+__ieee754_sqrt (double x)
297+{
298+ return __slow_ieee754_sqrt (x);
299+}
300+
301 strong_alias (__ieee754_sqrt, __sqrt_finite)
302Index: libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
303===================================================================
304--- libc.orig/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
305+++ libc/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
306@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
307
308 #ifdef __STDC__
309 float
310-__ieee754_sqrtf (float b)
311+__slow_ieee754_sqrtf (float b)
312 #else
313 float
314-__ieee754_sqrtf (b)
315+__slow_ieee754_sqrtf (b)
316 float b;
317 #endif
318 {
319@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
320 }
321 return f_washf (b);
322 }
323+
324+#undef __ieee754_sqrtf
325+float
326+__ieee754_sqrtf (float x)
327+{
328+ return __slow_ieee754_sqrtf (x);
329+}
330+
331 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
332Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
333===================================================================
334--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
335+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
336@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
337 }
338 return f_wash (b);
339 }
340+
341+#undef __ieee754_sqrt
342+double
343+__ieee754_sqrt (double x)
344+{
345+ return __slow_ieee754_sqrt (x);
346+}
347+
348 strong_alias (__ieee754_sqrt, __sqrt_finite)
349Index: libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
350===================================================================
351--- libc.orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
352+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
353@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
354 }
355 return f_washf (b);
356 }
357+
358+#undef __ieee754_sqrtf
359+float
360+__ieee754_sqrtf (float x)
361+{
362+ return __slow_ieee754_sqrtf (x);
363+}
364+
365 strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch b/meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch
new file mode 100644
index 0000000000..4c6c1070c3
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/ppce6500-32b_slow_ieee754_sqrt.patch
@@ -0,0 +1,47 @@
1 __ieee754_sqrt{,f} are now inline functions and call out __slow versions
2
3
4Signed-off-by: chunrong guo <B40290@freescale.com>
5Upstream-Status: Pending
6
7diff -rNu libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
8--- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-04-08 04:39:58.487229887 -0500
9+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c 2014-04-08 04:40:52.643069198 -0500
10@@ -41,10 +41,10 @@
11
12 #ifdef __STDC__
13 double
14-__ieee754_sqrt (double b)
15+__slow_ieee754_sqrt (double b)
16 #else
17 double
18-__ieee754_sqrt (b)
19+__slow_ieee754_sqrt (b)
20 double b;
21 #endif
22 {
23@@ -83,7 +83,7 @@
24
25 /* Handle small numbers by scaling. */
26 if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
27- return __ieee754_sqrt (b * two108) * twom54;
28+ return __slow_ieee754_sqrt (b * two108) * twom54;
29
30 #define FMADD(a_, c_, b_) \
31 ({ double __r; \
32diff -rNu libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
33--- libc-orig/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-04-08 04:39:58.487229887 -0500
34+++ libc/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c 2014-04-08 04:41:26.017067682 -0500
35@@ -39,10 +39,10 @@
36
37 #ifdef __STDC__
38 float
39-__ieee754_sqrtf (float b)
40+__slow_ieee754_sqrtf (float b)
41 #else
42 float
43-__ieee754_sqrtf (b)
44+__slow_ieee754_sqrtf (b)
45 float b;
46 #endif
47 {
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch
new file mode 100644
index 0000000000..ca5f17ba58
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk.patch
@@ -0,0 +1,108 @@
1Upstream-Status: Inappropriate [SDK specific]
2
3This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings
4and lengths as well as ld.so.cache path in the dynamic loader to specific
5sections in memory. The sections that contain paths have been allocated a 4096
6byte section, which is the maximum path length in linux. This will allow the
7relocating script to parse the ELF binary, detect the section and easily replace
8the strings in a certain path.
9
10Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
11
12Index: libc/elf/interp.c
13===================================================================
14--- libc.orig/elf/interp.c
15+++ libc/elf/interp.c
16@@ -16,5 +16,5 @@
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
19
20-const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
21+const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp")))
22 = RUNTIME_LINKER;
23Index: libc/elf/dl-load.c
24===================================================================
25--- libc.orig/elf/dl-load.c
26+++ libc/elf/dl-load.c
27@@ -144,8 +144,8 @@ static size_t max_capstrlen attribute_re
28 /* Get the generated information about the trusted directories. */
29 #include "trusted-dirs.h"
30
31-static const char system_dirs[] = SYSTEM_DIRS;
32-static const size_t system_dirs_len[] =
33+static const char system_dirs[4096] __attribute__ ((section (".sysdirs"))) = SYSTEM_DIRS;
34+volatile static const size_t system_dirs_len[] __attribute__ ((section (".sysdirslen"))) =
35 {
36 SYSTEM_DIRS_LEN
37 };
38Index: libc/elf/dl-cache.c
39===================================================================
40--- libc.orig/elf/dl-cache.c
41+++ libc/elf/dl-cache.c
42@@ -133,6 +133,10 @@ do \
43 while (0)
44
45
46+const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))) =
47+ SYSCONFDIR "/ld.so.cache";
48+
49+
50 int
51 internal_function
52 _dl_cache_libcmp (const char *p1, const char *p2)
53Index: libc/elf/ldconfig.c
54===================================================================
55--- libc.orig/elf/ldconfig.c
56+++ libc/elf/ldconfig.c
57@@ -166,6 +166,9 @@ static struct argp argp =
58 options, parse_opt, NULL, doc, NULL, more_help, NULL
59 };
60
61+
62+extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
63+
64 /* Check if string corresponds to an important hardware capability or
65 a platform. */
66 static int
67Index: libc/sysdeps/generic/dl-cache.h
68===================================================================
69--- libc.orig/sysdeps/generic/dl-cache.h
70+++ libc/sysdeps/generic/dl-cache.h
71@@ -27,10 +27,6 @@
72 ((flags) == 1 || (flags) == _DL_CACHE_DEFAULT_ID)
73 #endif
74
75-#ifndef LD_SO_CACHE
76-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
77-#endif
78-
79 #ifndef add_system_dir
80 # define add_system_dir(dir) add_dir (dir)
81 #endif
82Index: libc/elf/rtld.c
83===================================================================
84--- libc.orig/elf/rtld.c
85+++ libc/elf/rtld.c
86@@ -99,6 +99,7 @@ uintptr_t __pointer_chk_guard_local
87 strong_alias (__pointer_chk_guard_local, __pointer_chk_guard)
88 #endif
89
90+extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
91
92 /* List of auditing DSOs. */
93 static struct audit_list
94@@ -1031,12 +1032,12 @@ of this helper program; chances are you
95 --list list all dependencies and how they are resolved\n\
96 --verify verify that given object really is a dynamically linked\n\
97 object we can handle\n\
98- --inhibit-cache Do not use " LD_SO_CACHE "\n\
99+ --inhibit-cache Do not use %s\n\
100 --library-path PATH use given PATH instead of content of the environment\n\
101 variable LD_LIBRARY_PATH\n\
102 --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\
103 in LIST\n\
104- --audit LIST use objects named in LIST as auditors\n");
105+ --audit LIST use objects named in LIST as auditors\n", LD_SO_CACHE);
106
107 ++_dl_skip_args;
108 --_dl_argc;
diff --git a/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch
new file mode 100644
index 0000000000..f164f8f9ae
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-2.19/relocatable_sdk_fix_openpath.patch
@@ -0,0 +1,41 @@
1Upstream-Status: Inappropriate [SDK specific]
2
3eglibc-nativesdk: Fix buffer overrun with a relocated SDK
4
5When ld-linux-*.so.2 is relocated to a path that is longer than the
6original fixed location, the dynamic loader will crash in open_path
7because it implicitly assumes that max_dirnamelen is a fixed size that
8never changes.
9
10The allocated buffer will not be large enough to contain the directory
11path string which is larger than the fixed location provided at build
12time.
13
14Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
15
16---
17 elf/dl-load.c | 12 ++++++++++++
18 1 file changed, 12 insertions(+)
19
20--- a/elf/dl-load.c
21+++ b/elf/dl-load.c
22@@ -1919,7 +1919,19 @@ open_path (const char *name, size_t name
23 given on the command line when rtld is run directly. */
24 return -1;
25
26+ do
27+ {
28+ struct r_search_path_elem *this_dir = *dirs;
29+ if (this_dir->dirnamelen > max_dirnamelen)
30+ {
31+ max_dirnamelen = this_dir->dirnamelen;
32+ }
33+ }
34+ while (*++dirs != NULL);
35+
36 buf = alloca (max_dirnamelen + max_capstrlen + namelen);
37+
38+ dirs = sps->dirs;
39 do
40 {
41 struct r_search_path_elem *this_dir = *dirs;
diff --git a/meta/recipes-core/eglibc/eglibc-collateral.inc b/meta/recipes-core/eglibc/eglibc-collateral.inc
new file mode 100644
index 0000000000..8feca09f2e
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-collateral.inc
@@ -0,0 +1,12 @@
1INHIBIT_DEFAULT_DEPS = "1"
2LICENSE = "GPLv2 & LGPLv2.1"
3HOMEPAGE = "http://www.eglibc.org/"
4
5do_fetch[noexec] = "1"
6do_unpack[noexec] = "1"
7do_patch[noexec] = "1"
8do_configure[noexec] = "1"
9do_compile[noexec] = "1"
10
11do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot"
12
diff --git a/meta/recipes-core/eglibc/eglibc-common.inc b/meta/recipes-core/eglibc/eglibc-common.inc
new file mode 100644
index 0000000000..d18786ab93
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-common.inc
@@ -0,0 +1,9 @@
1SUMMARY = "Embedded GLIBC (GNU C Library)"
2DESCRIPTION = "Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC) that is designed to work well on embedded systems. EGLIBC strives to be source and binary compatible with GLIBC. EGLIBC's goals include reduced footprint, configurable components, better support for cross-compilation and cross-testing."
3HOMEPAGE = "http://www.eglibc.org/home"
4SECTION = "libs"
5LICENSE = "GPLv2 & LGPLv2.1"
6LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
7 file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
8 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
9 file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc
new file mode 100644
index 0000000000..0f0e1cd5e1
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-initial.inc
@@ -0,0 +1,78 @@
1DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial"
2PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
3
4PACKAGES = ""
5PACKAGES_DYNAMIC = ""
6
7STAGINGCC = "gcc-cross-initial"
8STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
9TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
10
11do_configure () {
12 sed -ie 's,{ (exit 1); exit 1; }; },{ (exit 0); }; },g' ${S}/configure
13 chmod +x ${S}/configure
14 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
15 find ${S} -name "configure" | xargs touch
16 ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
17 --prefix=/usr \
18 --without-cvs --disable-sanity-checks \
19 --with-headers=${STAGING_DIR_TARGET}${includedir} \
20 --with-kconfig=${STAGING_BINDIR_NATIVE} \
21 --enable-hacker-mode --enable-addons
22}
23
24do_compile () {
25 :
26}
27
28do_install () {
29 oe_runmake cross-compiling=yes install_root=${D} \
30 includedir='${includedir}' prefix='${prefix}' \
31 install-bootstrap-headers=yes install-headers
32
33 oe_runmake csu/subdir_lib
34 mkdir -p ${D}${libdir}/
35 install -m 644 csu/crt[1in].o ${D}${libdir}
36
37 # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
38 # so do them by hand. We can tolerate an empty stubs.h for the moment.
39 # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
40 mkdir -p ${D}${includedir}/gnu/
41 touch ${D}${includedir}/gnu/stubs.h
42 cp ${S}/include/features.h ${D}${includedir}/features.h
43
44 if [ -e ${B}/bits/stdio_lim.h ]; then
45 cp ${B}/bits/stdio_lim.h ${D}${includedir}/bits/
46 fi
47 # add links to linux-libc-headers: final eglibc build need this.
48 for t in linux asm asm-generic; do
49 ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
50 done
51}
52
53do_install_locale() {
54 :
55}
56
57do_siteconfig () {
58 :
59}
60
61SSTATEPOSTINSTFUNCS += "eglibcinitial_sstate_postinst"
62eglibcinitial_sstate_postinst() {
63 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
64 then
65 # Recreate the symlinks to ensure they point to the correct location
66 for t in linux asm asm-generic; do
67 rm -f ${STAGING_DIR_TCBOOTSTRAP}${includedir}/$t
68 ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${STAGING_DIR_TCBOOTSTRAP}${includedir}/
69 done
70 fi
71}
72
73do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
74
75# We don't install any scripts so there is nothing to evacuate
76do_evacuate_scripts () {
77 :
78}
diff --git a/meta/recipes-core/eglibc/eglibc-initial_2.19.bb b/meta/recipes-core/eglibc/eglibc-initial_2.19.bb
new file mode 100644
index 0000000000..de45079603
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-initial_2.19.bb
@@ -0,0 +1,11 @@
1require eglibc_${PV}.bb
2require eglibc-initial.inc
3
4DEPENDS += "kconfig-frontends-native"
5
6# main eglibc recipes muck with TARGET_CPPFLAGS to point into
7# final target sysroot but we
8# are not there when building eglibc-initial
9# so reset it here
10
11TARGET_CPPFLAGS = ""
diff --git a/meta/recipes-core/eglibc/eglibc-ld.inc b/meta/recipes-core/eglibc/eglibc-ld.inc
new file mode 100644
index 0000000000..6261ae3419
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-ld.inc
@@ -0,0 +1,56 @@
1def ld_append_if_tune_exists(d, infos, dict):
2 tune = d.getVar("DEFAULTTUNE", True) or ""
3 libdir = d.getVar("base_libdir", True) or ""
4 if tune in dict:
5 infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }')
6 infos['lddrewrite'].add(libdir+'/'+dict[tune][0])
7
8def eglibc_dl_info(d):
9 ld_info_all = {
10 "mips": ["ld.so.1", "FLAG_ELF_LIBC6"],
11 "mips64-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
12 "mips64": ["ld.so.1", "FLAG_ELF_LIBC6"],
13 "mipsel": ["ld.so.1", "FLAG_ELF_LIBC6"],
14 "mips64el-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
15 "mips64el": ["ld.so.1", "FLAG_ELF_LIBC6"],
16 "mips-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
17 "mips64-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
18 "mips64-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
19 "mips64el-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
20 "mips64el-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
21 "powerpc": ["ld.so.1", "FLAG_ELF_LIBC6"],
22 "powerpc-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
23 "powerpc64": ["ld64.so.1", "FLAG_ELF_LIBC6"],
24 "powerpc64-nf": ["ld64.so.1", "FLAG_ELF_LIBC6"],
25 "core2-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
26 "core2-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
27 "x86": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
28 "x86-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
29 "i586": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
30 "corei7-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
31 "corei7-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
32 }
33
34 infos = {'ldconfig':set(), 'lddrewrite':set()}
35 ld_append_if_tune_exists(d, infos, ld_info_all)
36
37 #DEFAULTTUNE_MULTILIB_ORIGINAL
38 original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL",True)
39 if original_tune:
40 localdata = bb.data.createCopy(d)
41 localdata.setVar("DEFAULTTUNE", original_tune)
42 ld_append_if_tune_exists(localdata, infos, ld_info_all)
43
44 variants = d.getVar("MULTILIB_VARIANTS", True) or ""
45 for item in variants.split():
46 localdata = bb.data.createCopy(d)
47 overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
48 localdata.setVar("OVERRIDES", overrides)
49 bb.data.update_data(localdata)
50 ld_append_if_tune_exists(localdata, infos, ld_info_all)
51 infos['ldconfig'] = ','.join(infos['ldconfig'])
52 infos['lddrewrite'] = ' '.join(infos['lddrewrite'])
53 return infos
54
55EGLIBC_KNOWN_INTERPRETER_NAMES = "${@eglibc_dl_info(d)['ldconfig']}"
56RTLDLIST = "${@eglibc_dl_info(d)['lddrewrite']}"
diff --git a/meta/recipes-core/eglibc/eglibc-locale.inc b/meta/recipes-core/eglibc/eglibc-locale.inc
new file mode 100644
index 0000000000..4da5abd778
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-locale.inc
@@ -0,0 +1,96 @@
1include eglibc-collateral.inc
2
3SUMMARY = "Locale data from eglibc"
4
5BPN = "eglibc"
6LOCALEBASEPN = "${MLPREFIX}eglibc"
7
8# eglibc-collateral.inc inhibits all default deps, but do_package needs objcopy
9# ERROR: objcopy failed with exit code 127 (cmd was 'i586-webos-linux-objcopy' --only-keep-debug 'eglibc-locale/2.17-r0/package/usr/lib/gconv/IBM1166.so' 'eglibc-locale/2.17-r0/package/usr/lib/gconv/.debug/IBM1166.so')
10# ERROR: Function failed: split_and_strip_files
11BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot"
12BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
13do_package[depends] += "${BINUTILSDEP}"
14
15# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
16# is set. The idea is to avoid running localedef on the target (at first boot)
17# to decrease initial boot time and avoid localedef being killed by the OOM
18# killer which used to effectively break i18n on machines with < 128MB RAM.
19
20# default to disabled
21ENABLE_BINARY_LOCALE_GENERATION ?= "0"
22ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-eglibc-locale = "0"
23
24#enable locale generation on these arches
25# BINARY_LOCALE_ARCHES is a space separated list of regular expressions
26BINARY_LOCALE_ARCHES ?= "arm.* i[3-6]86 x86_64 powerpc mips mips64"
27
28# set "1" to use cross-localedef for locale generation
29# set "0" for qemu emulation of native localedef for locale generation
30LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1"
31
32PROVIDES = "virtual/libc-locale"
33
34PACKAGES = "localedef ${PN}-dbg"
35
36PACKAGES_DYNAMIC = "^locale-base-.* \
37 ^eglibc-gconv-.* ^eglibc-charmap-.* ^eglibc-localedata-.* ^eglibc-binary-localedata-.* \
38 ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \
39 ^${MLPREFIX}eglibc-gconv$"
40
41# Create a eglibc-binaries package
42ALLOW_EMPTY_${BPN}-binaries = "1"
43PACKAGES += "${BPN}-binaries"
44RRECOMMENDS_${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-binary") != -1])}"
45
46# Create a eglibc-charmaps package
47ALLOW_EMPTY_${BPN}-charmaps = "1"
48PACKAGES += "${BPN}-charmaps"
49RRECOMMENDS_${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-charmap") != -1])}"
50
51# Create a eglibc-gconvs package
52ALLOW_EMPTY_${BPN}-gconvs = "1"
53PACKAGES += "${BPN}-gconvs"
54RRECOMMENDS_${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-gconv") != -1])}"
55
56# Create a eglibc-localedatas package
57ALLOW_EMPTY_${BPN}-localedatas = "1"
58PACKAGES += "${BPN}-localedatas"
59RRECOMMENDS_${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("eglibc-localedata") != -1])}"
60
61DESCRIPTION_localedef = "eglibc: compile locale definition files"
62
63# eglibc-gconv is dynamically added into PACKAGES, thus
64# FILES_eglibc-gconv will not be automatically extended in multilib.
65# Explicitly add ${MLPREFIX} for FILES_eglibc-gconv.
66FILES_${MLPREFIX}eglibc-gconv = "${libdir}/gconv/*"
67FILES_${PN}-dbg += "${libdir}/gconv/.debug/*"
68FILES_localedef = "${bindir}/localedef"
69
70LOCALETREESRC = "${STAGING_INCDIR}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS}"
71
72do_install () {
73 mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir}
74 if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then
75 cp -fpPR ${LOCALETREESRC}/${bindir}/* ${D}${bindir}
76 fi
77 if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then
78 mkdir -p ${D}${localedir}
79 cp -fpPR ${LOCALETREESRC}/${localedir}/* ${D}${localedir}
80 fi
81 if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then
82 cp -fpPR ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir}
83 fi
84 if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then
85 cp -fpPR ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir}
86 fi
87 if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
88 cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
89 fi
90 chown root.root -R ${D}
91 cp -fpPR ${LOCALETREESRC}/SUPPORTED ${WORKDIR}
92}
93
94inherit libc-package
95
96BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-core/eglibc/eglibc-locale_2.19.bb b/meta/recipes-core/eglibc/eglibc-locale_2.19.bb
new file mode 100644
index 0000000000..ce6c1d2320
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-locale_2.19.bb
@@ -0,0 +1 @@
require eglibc-locale.inc
diff --git a/meta/recipes-core/eglibc/eglibc-mtrace.inc b/meta/recipes-core/eglibc/eglibc-mtrace.inc
new file mode 100644
index 0000000000..d68783e439
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-mtrace.inc
@@ -0,0 +1,13 @@
1include eglibc-collateral.inc
2
3SUMMARY = "mtrace utility provided by eglibc"
4DESCRIPTION = "mtrace utility provided by eglibc"
5RDEPENDS_${PN} = "perl"
6RPROVIDES_${PN} = "libc-mtrace"
7
8SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
9
10do_install() {
11 install -d -m 0755 ${D}${bindir}
12 install -m 0755 ${SRC}/mtrace ${D}${bindir}/
13}
diff --git a/meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb b/meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb
new file mode 100644
index 0000000000..6fa2be9cc9
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-mtrace_2.19.bb
@@ -0,0 +1 @@
require eglibc-mtrace.inc
diff --git a/meta/recipes-core/eglibc/eglibc-options.inc b/meta/recipes-core/eglibc/eglibc-options.inc
new file mode 100644
index 0000000000..0432758417
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-options.inc
@@ -0,0 +1,162 @@
1def eglibc_cfg(feature, tokens, cnf):
2 if type(tokens) == type(""):
3 tokens = [tokens]
4 if feature:
5 cnf.extend([token + '=y' for token in tokens])
6 else:
7 for token in tokens:
8 cnf.extend([token + '=n'])
9 if token == 'OPTION_EGLIBC_NSSWITCH':
10 cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG=\"${S}/nss/nsswitch.conf\""])
11 cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS=\"${S}/nss/fixed-nsswitch.functions\""])
12
13# Map distro features to eglibc options settings
14def features_to_eglibc_settings(d):
15 cnf = ([])
16
17 ipv4 = base_contains('DISTRO_FEATURES', 'ipv4', True, False, d)
18 ipv6 = base_contains('DISTRO_FEATURES', 'ipv6', True, False, d)
19 libc_backtrace = base_contains('DISTRO_FEATURES', 'libc-backtrace', True, False, d)
20 libc_big_macros = base_contains('DISTRO_FEATURES', 'libc-big-macros', True, False, d)
21 libc_bsd = base_contains('DISTRO_FEATURES', 'libc-bsd', True, False, d)
22 libc_cxx_tests = base_contains('DISTRO_FEATURES', 'libc-cxx-tests', True, False, d)
23 libc_catgets = base_contains('DISTRO_FEATURES', 'libc-catgets', True, False, d)
24 libc_charsets = base_contains('DISTRO_FEATURES', 'libc-charsets', True, False, d)
25 libc_crypt = base_contains('DISTRO_FEATURES', 'libc-crypt', True, False, d)
26 libc_crypt_ufc = base_contains('DISTRO_FEATURES', 'libc-crypt-ufc', True, False, d)
27 libc_db_aliases = base_contains('DISTRO_FEATURES', 'libc-db-aliases', True, False, d)
28 libc_envz = base_contains('DISTRO_FEATURES', 'libc-envz', True, False, d)
29 libc_fcvt = base_contains('DISTRO_FEATURES', 'libc-fcvt', True, False, d)
30 libc_fmtmsg = base_contains('DISTRO_FEATURES', 'libc-fmtmsg', True, False, d)
31 libc_fstab = base_contains('DISTRO_FEATURES', 'libc-fstab', True, False, d)
32 libc_ftraverse = base_contains('DISTRO_FEATURES', 'libc-ftraverse', True, False, d)
33 libc_getlogin = base_contains('DISTRO_FEATURES', 'libc-getlogin', True, False, d)
34 libc_idn = base_contains('DISTRO_FEATURES', 'libc-idn', True, False, d)
35 libc_inet_anl = base_contains('DISTRO_FEATURES', 'libc-inet-anl', True, False, d)
36 libc_libm = base_contains('DISTRO_FEATURES', 'libc-libm', True, False, d)
37 libc_locales = base_contains('DISTRO_FEATURES', 'libc-locales', True, False, d)
38 libc_locale_code = base_contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d)
39 libc_memusage = base_contains('DISTRO_FEATURES', 'libc-memusage', True, False, d)
40 libc_nis = base_contains('DISTRO_FEATURES', 'libc-nis', True, False, d)
41 libc_nsswitch = base_contains('DISTRO_FEATURES', 'libc-nsswitch', True, False, d)
42 libc_rcmd = base_contains('DISTRO_FEATURES', 'libc-rcmd', True, False, d)
43 libc_rtld_debug = base_contains('DISTRO_FEATURES', 'libc-rtld-debug', True, False, d)
44 libc_spawn = base_contains('DISTRO_FEATURES', 'libc-spawn', True, False, d)
45 libc_streams = base_contains('DISTRO_FEATURES', 'libc-streams', True, False, d)
46 libc_sunrpc = base_contains('DISTRO_FEATURES', 'libc-sunrpc', True, False, d)
47 libc_utmp = base_contains('DISTRO_FEATURES', 'libc-utmp', True, False, d)
48 libc_utmpx = base_contains('DISTRO_FEATURES', 'libc-utmpx', True, False, d)
49 libc_wordexp = base_contains('DISTRO_FEATURES', 'libc-wordexp', True, False, d)
50 libc_posix_clang_wchar = base_contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', True, False, d)
51 libc_posix_regexp = base_contains('DISTRO_FEATURES', 'libc-posix-regexp', True, False, d)
52 libc_posix_regexp_glibc = base_contains('DISTRO_FEATURES', 'libc-posix-regexp-glibc', True, False, d)
53 libc_posix_wchar_io = base_contains('DISTRO_FEATURES', 'libc-posix-wchar-io', True, False, d)
54
55 # arrange the dependencies among eglibc configuable options according to file option-groups.def from eglibc source code
56 new_dep = True
57 while new_dep:
58 new_dep = False
59
60 if ipv6 and not ipv4:
61 new_dep = True
62 ipv4 = True
63
64 if ipv4 and not libc_nsswitch:
65 new_dep = True
66 libc_nsswitch = True
67
68 if libc_cxx_tests:
69 if not libc_posix_wchar_io:
70 new_dep = True
71 libc_posix_wchar_io = True
72 if not libc_libm:
73 new_dep = True
74 libc_libm = True
75
76 if libc_catgets and not libc_locale_code:
77 new_dep = True
78 libc_locale_code = True
79
80 if libc_crypt_ufc and not libc_crypt:
81 new_dep = True
82 libc_crypt = True
83
84 if libc_getlogin and not libc_utmp:
85 new_dep = True
86 libc_utmp = True
87
88 if libc_inet_anl and not ipv4:
89 new_dep = True
90 ipv4 = True
91
92 if libc_locale_code and not libc_posix_clang_wchar:
93 new_dep = True
94 libc_posix_clang_wchar = True
95
96 if libc_nis:
97 if not ipv4:
98 new_dep = True
99 ipv4 = True
100 if not libc_sunrpc:
101 new_dep = True
102 libc_sunrpc = True
103
104 if libc_rcmd and not ipv4:
105 new_dep = True
106 ipv4 = True
107
108 if libc_sunrpc and not ipv4:
109 new_dep = True
110 ipv4 = True
111
112 if libc_utmpx and not libc_utmp:
113 new_dep = True
114 libc_utmp = True
115
116 if libc_posix_regexp_glibc and not libc_posix_regexp:
117 new_dep = True
118 libc_posix_regexp = True
119
120 if libc_posix_wchar_io and not libc_posix_clang_wchar:
121 new_dep = True
122 libc_posix_clang_wchar = True
123
124 eglibc_cfg(ipv6, 'OPTION_EGLIBC_ADVANCED_INET6', cnf)
125 eglibc_cfg(libc_backtrace, 'OPTION_EGLIBC_BACKTRACE', cnf)
126 eglibc_cfg(libc_big_macros, 'OPTION_EGLIBC_BIG_MACROS', cnf)
127 eglibc_cfg(libc_bsd, 'OPTION_EGLIBC_BSD', cnf)
128 eglibc_cfg(libc_cxx_tests, 'OPTION_EGLIBC_CXX_TESTS', cnf)
129 eglibc_cfg(libc_catgets, 'OPTION_EGLIBC_CATGETS', cnf)
130 eglibc_cfg(libc_charsets, 'OPTION_EGLIBC_CHARSETS', cnf)
131 eglibc_cfg(libc_crypt, 'OPTION_EGLIBC_CRYPT', cnf)
132 eglibc_cfg(libc_crypt_ufc, 'OPTION_EGLIBC_CRYPT_UFC', cnf)
133 eglibc_cfg(libc_db_aliases, 'OPTION_EGLIBC_DB_ALIASES', cnf)
134 eglibc_cfg(libc_envz, 'OPTION_EGLIBC_ENVZ', cnf)
135 eglibc_cfg(libc_fcvt, 'OPTION_EGLIBC_FCVT', cnf)
136 eglibc_cfg(libc_fmtmsg, 'OPTION_EGLIBC_FMTMSG', cnf)
137 eglibc_cfg(libc_fstab, 'OPTION_EGLIBC_FSTAB', cnf)
138 eglibc_cfg(libc_ftraverse, 'OPTION_EGLIBC_FTRAVERSE', cnf)
139 eglibc_cfg(libc_getlogin, 'OPTION_EGLIBC_GETLOGIN', cnf)
140 eglibc_cfg(libc_idn, 'OPTION_EGLIBC_IDN', cnf)
141 eglibc_cfg(ipv4, 'OPTION_EGLIBC_INET', cnf)
142 eglibc_cfg(libc_inet_anl, 'OPTION_EGLIBC_INET_ANL', cnf)
143 eglibc_cfg(libc_libm, 'OPTION_EGLIBC_LIBM', cnf)
144 eglibc_cfg(libc_locales, 'OPTION_EGLIBC_LOCALES', cnf)
145 eglibc_cfg(libc_locale_code, 'OPTION_EGLIBC_LOCALE_CODE', cnf)
146 eglibc_cfg(libc_memusage, 'OPTION_EGLIBC_MEMUSAGE', cnf)
147 eglibc_cfg(libc_nis, 'OPTION_EGLIBC_NIS', cnf)
148 eglibc_cfg(libc_nsswitch, 'OPTION_EGLIBC_NSSWITCH', cnf)
149 eglibc_cfg(libc_rcmd, 'OPTION_EGLIBC_RCMD', cnf)
150 eglibc_cfg(libc_rtld_debug, 'OPTION_EGLIBC_RTLD_DEBUG', cnf)
151 eglibc_cfg(libc_spawn, 'OPTION_EGLIBC_SPAWN', cnf)
152 eglibc_cfg(libc_streams, 'OPTION_EGLIBC_STREAMS', cnf)
153 eglibc_cfg(libc_sunrpc, 'OPTION_EGLIBC_SUNRPC', cnf)
154 eglibc_cfg(libc_utmp, 'OPTION_EGLIBC_UTMP', cnf)
155 eglibc_cfg(libc_utmpx, 'OPTION_EGLIBC_UTMPX', cnf)
156 eglibc_cfg(libc_wordexp, 'OPTION_EGLIBC_WORDEXP', cnf)
157 eglibc_cfg(libc_posix_clang_wchar, 'OPTION_POSIX_C_LANG_WIDE_CHAR', cnf)
158 eglibc_cfg(libc_posix_regexp, 'OPTION_POSIX_REGEXP', cnf)
159 eglibc_cfg(libc_posix_regexp_glibc, 'OPTION_POSIX_REGEXP_GLIBC', cnf)
160 eglibc_cfg(libc_posix_wchar_io, 'OPTION_POSIX_WIDE_CHAR_DEVICE_IO', cnf)
161
162 return "\n".join(cnf)
diff --git a/meta/recipes-core/eglibc/eglibc-package.inc b/meta/recipes-core/eglibc/eglibc-package.inc
new file mode 100644
index 0000000000..6721819d2e
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-package.inc
@@ -0,0 +1,155 @@
1#
2# For now, we will skip building of a gcc package if it is a uclibc one
3# and our build is not a uclibc one, and we skip a eglibc one if our build
4# is a uclibc build.
5#
6# See the note in gcc/gcc_3.4.0.oe
7#
8
9python __anonymous () {
10 import bb, re
11 uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None)
12 if uc_os:
13 raise bb.parse.SkipPackage("incompatible with target %s" %
14 d.getVar('TARGET_OS', True))
15}
16
17# Set this to zero if you don't want ldconfig in the output package
18USE_LDCONFIG ?= "1"
19
20PACKAGES = "${PN}-dbg catchsegv sln nscd ldd ${PN}-utils eglibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} eglibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
21
22# The ld.so in this eglibc supports the GNU_HASH
23RPROVIDES_${PN} = "glibc rtld(GNU_HASH)"
24RPROVIDES_${PN}-utils = "glibc-utils"
25RPROVIDES_${PN}-mtrace = "glibc-mtrace libc-mtrace"
26RPROVIDES_${PN}-pic = "glibc-pic"
27RPROVIDES_${PN}-dev = "glibc-dev libc6-dev virtual-libc-dev"
28RPROVIDES_${PN}-staticdev = "glibc-staticdev"
29RPROVIDES_${PN}-doc = "glibc-doc"
30RPROVIDES_eglibc-extra-nss = "glibc-extra-nss"
31RPROVIDES_eglibc-thread-db = "glibc-thread-db"
32RPROVIDES_${PN}-pcprofile = "glibc-pcprofile"
33RPROVIDES_${PN}-dbg = "glibc-dbg"
34libc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so ${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so"
35
36FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${@base_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf', '', d)}"
37FILES_ldd = "${bindir}/ldd"
38FILES_libsegfault = "${base_libdir}/libSegFault*"
39FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*"
40FILES_libmemusage = "${base_libdir}/libmemusage.so"
41FILES_eglibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*"
42FILES_sln = "/sbin/sln"
43FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o"
44FILES_libsotruss = "${libdir}/audit/sotruss-lib.so"
45FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
46FILES_${PN}-dev += "${bindir}/rpcgen ${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal"
47FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a"
48FILES_nscd = "${sbindir}/nscd*"
49FILES_${PN}-mtrace = "${bindir}/mtrace"
50FILES_${PN}-utils = "${bindir}/* ${sbindir}/*"
51FILES_${PN}-dbg += "${libexecdir}/*/.debug ${libdir}/audit/.debug"
52FILES_catchsegv = "${bindir}/catchsegv"
53RDEPENDS_catchsegv = "libsegfault"
54FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so"
55FILES_eglibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so"
56RPROVIDES_${PN}-dev += "libc-dev"
57RPROVIDES_${PN}-staticdev += "libc-staticdev"
58
59SUMMARY_sln = "The static ln"
60DESCRIPTION_sln = "Similar to the 'ln' utility, but statically linked. sln is useful to make symbolic links to dynamic libraries if the dynamic linking system, for some reason, is not functional."
61SUMMARY_nscd = "Name service cache daemon"
62DESCRIPTION_nscd = "nscd, name service cache daemon, caches name service lookups for the passwd, group and hosts information. It can damatically improvide performance with remote, such as NIS or NIS+, name services."
63SUMMARY_eglibc-extra-nss = "hesiod, NIS and NIS+ nss libraries"
64DESCRIPTION_eglibc-extra-nss = "eglibc: nis, nisplus and hesiod search services."
65SUMMARY_ldd = "print shared library dependencies"
66DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line."
67SUMMARY_${PN}-utils = "Miscellaneous utilities provided by eglibc"
68DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconf, locale, gencat, tzselect, zic, rpcinfo, ..."
69DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs"
70
71inherit libc-common multilib_header
72
73do_install_append () {
74 rm -f ${D}${sysconfdir}/localtime
75 rm -rf ${D}${localstatedir}
76
77 # remove empty eglibc dir
78 if [ -d ${D}${libdir}/eglibc -a ! -e ${D}${libdir}/eglibc/pt_chown ]; then
79 rmdir ${D}${libdir}/eglibc
80 fi
81 oe_multilib_header bits/syscall.h
82
83 if [ -f ${D}${bindir}/mtrace ]; then
84 sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace
85 fi
86 rm -rf ${D}${includedir}/rpcsvc/rquota*
87 # Info dir listing isn't interesting at this point so remove it if it exists.
88 if [ -e "${D}${infodir}/dir" ]; then
89 rm -f ${D}${infodir}/dir
90 fi
91
92 if [ "${USE_LDCONFIG}" != "1" ]; then
93 # We won't ship this file (see FILES above) so let's not install it
94 rm -f ${D}${sysconfdir}/ld.so.conf
95 # This directory will be empty now so remove it too.
96 # But check whether it exists first, since it won't for eglibc-initial.
97 if [ -d ${D}${sysconfdir} ]; then
98 rmdir ${D}${sysconfdir}
99 fi
100 fi
101}
102
103do_install_locale () {
104 dest=${D}/${includedir}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS}
105 install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir}
106 if [ "${base_libdir}" != "${libdir}" ]; then
107 cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir}
108 fi
109 if [ -e ${D}${bindir}/localedef ]; then
110 mv -f ${D}${bindir}/localedef ${dest}${bindir}
111 fi
112 if [ -e ${D}${libdir}/gconv ]; then
113 mv -f ${D}${libdir}/gconv ${dest}${libdir}
114 fi
115 if [ -e ${D}${exec_prefix}/lib ]; then
116 cp -fpPR ${D}${exec_prefix}/lib ${dest}${exec_prefix}
117 fi
118 if [ -e ${D}${datadir}/i18n ]; then
119 mv ${D}${datadir}/i18n ${dest}${datadir}
120 fi
121 cp -fpPR ${D}${datadir}/* ${dest}${datadir}
122 rm -rf ${D}${datadir}/locale/
123 cp -fpPR ${WORKDIR}/SUPPORTED ${dest}
124}
125
126addtask do_install_locale after do_install before do_populate_sysroot do_package
127
128bashscripts = "mtrace sotruss xtrace"
129
130do_evacuate_scripts () {
131 target=${D}${includedir}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}
132 mkdir -p $target
133 for i in ${bashscripts}; do
134 if [ -f ${D}${bindir}/$i ]; then
135 cp ${D}${bindir}/$i $target/
136 fi
137 done
138}
139
140addtask evacuate_scripts after do_install before do_populate_sysroot do_package
141
142PACKAGE_PREPROCESS_FUNCS += "eglibc_package_preprocess"
143
144eglibc_package_preprocess () {
145 rm -rf ${PKGD}/${includedir}/eglibc-locale-internal-${MULTIMACH_TARGET_SYS}
146 rm -rf ${PKGD}/${includedir}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}
147 for i in ${bashscripts}; do
148 rm -f ${PKGD}${bindir}/$i
149 done
150 rm -rf ${PKGD}/${localedir}
151 if [ "${libdir}" != "${exec_prefix}/lib" ]; then
152 # This dir only exists to hold locales
153 rm -rf ${PKGD}${exec_prefix}/lib
154 fi
155}
diff --git a/meta/recipes-core/eglibc/eglibc-scripts.inc b/meta/recipes-core/eglibc/eglibc-scripts.inc
new file mode 100644
index 0000000000..9ca6673404
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-scripts.inc
@@ -0,0 +1,16 @@
1include eglibc-collateral.inc
2
3SUMMARY = "utility scripts provided by eglibc"
4DESCRIPTION = "utility scripts provided by eglibc"
5RDEPENDS_${PN} = "bash eglibc-mtrace"
6
7SRC = "${STAGING_INCDIR}/eglibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
8
9bashscripts = "sotruss xtrace"
10
11do_install() {
12 install -d -m 0755 ${D}${bindir}
13 for i in ${bashscripts}; do
14 install -m 0755 ${SRC}/$i ${D}${bindir}/
15 done
16}
diff --git a/meta/recipes-core/eglibc/eglibc-scripts_2.19.bb b/meta/recipes-core/eglibc/eglibc-scripts_2.19.bb
new file mode 100644
index 0000000000..31133621d1
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-scripts_2.19.bb
@@ -0,0 +1 @@
require eglibc-scripts.inc
diff --git a/meta/recipes-core/eglibc/eglibc-testing.inc b/meta/recipes-core/eglibc/eglibc-testing.inc
new file mode 100644
index 0000000000..ab3ec1555f
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc-testing.inc
@@ -0,0 +1,79 @@
1do_compile_append () {
2 # now generate script to drive testing
3 echo "#!/usr/bin/env sh" >${B}/${HOST_PREFIX}testeglibc
4 set >> ${B}/${HOST_PREFIX}testeglibc
5 # prune out the unneeded vars
6 sed -i -e "/^BASH/d" ${B}/${HOST_PREFIX}testeglibc
7 sed -i -e "/^USER/d" ${B}/${HOST_PREFIX}testeglibc
8 sed -i -e "/^OPT/d" ${B}/${HOST_PREFIX}testeglibc
9 sed -i -e "/^DIRSTACK/d" ${B}/${HOST_PREFIX}testeglibc
10 sed -i -e "/^EUID/d" ${B}/${HOST_PREFIX}testeglibc
11 sed -i -e "/^FUNCNAME/d" ${B}/${HOST_PREFIX}testeglibc
12 sed -i -e "/^GROUPS/d" ${B}/${HOST_PREFIX}testeglibc
13 sed -i -e "/^HOST/d" ${B}/${HOST_PREFIX}testeglibc
14 sed -i -e "/^HOME/d" ${B}/${HOST_PREFIX}testeglibc
15 sed -i -e "/^IFS/d" ${B}/${HOST_PREFIX}testeglibc
16 sed -i -e "/^LC_ALL/d" ${B}/${HOST_PREFIX}testeglibc
17 sed -i -e "/^LOGNAME/d" ${B}/${HOST_PREFIX}testeglibc
18 sed -i -e "/^MACHTYPE/d" ${B}/${HOST_PREFIX}testeglibc
19 sed -i -e "/^OSTYPE/d" ${B}/${HOST_PREFIX}testeglibc
20 sed -i -e "/^PIPE/d" ${B}/${HOST_PREFIX}testeglibc
21 sed -i -e "/^SHELL/d" ${B}/${HOST_PREFIX}testeglibc
22 sed -i -e "/^'/d" ${B}/${HOST_PREFIX}testeglibc
23 sed -i -e "/^UID/d" ${B}/${HOST_PREFIX}testeglibc
24 sed -i -e "/^TERM/d" ${B}/${HOST_PREFIX}testeglibc
25 sed -i -e "/^PATCH_GET/d" ${B}/${HOST_PREFIX}testeglibc
26 sed -i -e "/^PKG_/d" ${B}/${HOST_PREFIX}testeglibc
27 sed -i -e "/^POSIXLY_/d" ${B}/${HOST_PREFIX}testeglibc
28 sed -i -e "/^PPID/d" ${B}/${HOST_PREFIX}testeglibc
29 sed -i -e "/^PS4/d" ${B}/${HOST_PREFIX}testeglibc
30 sed -i -e "/^Q/d" ${B}/${HOST_PREFIX}testeglibc
31 sed -i -e "/^SHLVL/d" ${B}/${HOST_PREFIX}testeglibc
32 sed -i -e "/^STAGING/d" ${B}/${HOST_PREFIX}testeglibc
33 sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${HOST_PREFIX}testeglibc
34 sed -i -e "/^PSEUDO/d" ${B}/${HOST_PREFIX}testeglibc
35
36 # point to real sysroot not the toolchain bootstrap sysroot
37 sed -i -e "s/\-tcbootstrap//g" ${B}/${HOST_PREFIX}testeglibc
38
39 # use the final cross-gcc to test since some tests need libstdc++
40 sed -i -e "s/^PATH=.*\.gcc-cross-initial\:/PATH=/g" ${B}/${HOST_PREFIX}testeglibc
41
42 # append execution part script
43cat >> ${B}/${HOST_PREFIX}testeglibc << STOP
44target="\$1"
45if [ "x\$target" = "x" ]
46then
47 echo "Please specify the target machine and remote user in form of user@target"
48 exit 1;
49fi
50ssh \$target ls \$PWD\ 2>&1 > /dev/null
51if [ "x\$?" != "x0" ]
52then
53 echo "Failed connecting to \$target it could be because of:"
54 echo "1. You dont have passwordless ssh setup to access \$target"
55 echo "2. NFS share on \$target is not mounted or if mounted then not matching the build tree layout."
56 echo " The tree should be accessible at same location on build host and target"
57 echo " You can add nfs-server to IMAGE_FEATURES to get the nfs client on target"
58 echo "3. nfs server on build host is not running."
59 echo " Please make sure that you have 'no_root_squash' added in /etc/exports if you want"
60 echo " to test as root user on target (usually its recommended to create a non"
61 echo " root user."
62 echo " As a sanity check make sure that target can read/write to the eglibc build tree"
63 echo " Please refer to ${S}/EGLIBC.cross-testing for further instructions on setup"
64 exit 1
65fi
66 echo "# we test using cross compiler from real sysroot therefore override the" > ${B}/configparms
67 echo "# definitions that come from ${B}/config.make" >> ${B}/configparms
68
69 fgrep tcbootstrap ${B}/config.make > ${B}/configparms
70 sed -i -e "s/\-tcbootstrap//g" ${B}/configparms
71wrapper="${S}/scripts/cross-test-ssh.sh \$target"
72localedef="${STAGING_BINDIR_NATIVE}/cross-localedef --little-endian --uint32-align=4"
73make tests-clean
74make cross-localedef="\$localedef" cross-test-wrapper="\$wrapper" -k check
75rm -rf ${B}/configparms
76STOP
77
78 chmod +x ${B}/${HOST_PREFIX}testeglibc
79}
diff --git a/meta/recipes-core/eglibc/eglibc.inc b/meta/recipes-core/eglibc/eglibc.inc
new file mode 100644
index 0000000000..375b9bc116
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc.inc
@@ -0,0 +1,84 @@
1require eglibc-common.inc
2require eglibc-ld.inc
3require eglibc-testing.inc
4
5STAGINGCC = "gcc-cross-initial"
6STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
7PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
8
9TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
10
11# eglibc can't be built without optimization, if someone tries to compile an
12# entire image as -O0, we override it with -O2 here and give a note about it.
13def get_optimization(d):
14 selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
15 if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
16 bb.note("eglibc can't be built with -O0, -O2 will be used instead.")
17 return selected_optimization.replace("-O0", "-O2")
18 return selected_optimization
19
20SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
21
22# siteconfig.bbclass runs configure which needs a working compiler
23# For the compiler to work we need a working libc yet libc isn't
24# in the sysroots directory at this point. This means the libc.so
25# linker script won't work as the --sysroot setting isn't correct.
26# Here we create a hacked up libc linker script and pass in the right
27# flags to let configure work. Ugly.
28EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
29siteconfig_do_siteconfig_gencache_prepend = " \
30 mkdir -p ${WORKDIR}/site_config_libc; \
31 cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
32 sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
33"
34
35# nptl needs unwind support in gcc, which can't be built without glibc.
36DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
37# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this
38#RDEPENDS_${PN} += "${@['','libgcc']['nptl' in '${GLIBC_ADDONS}']}"
39PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
40PROVIDES += "virtual/libintl virtual/libiconv"
41inherit autotools
42require eglibc-options.inc
43
44LEAD_SONAME = "libc.so"
45
46CACHED_CONFIGUREVARS += "ac_cv_path_KSH=${base_bindir}/bash \
47 ac_cv_path_BASH_SHELL=${base_bindir}/bash \
48 libc_cv_localedir=${localedir} \
49 libc_cv_ssp=no \
50 "
51
52GLIBC_EXTRA_OECONF ?= ""
53GLIBC_EXTRA_OECONF_class-nativesdk = ""
54INHIBIT_DEFAULT_DEPS = "1"
55
56ARM_INSTRUCTION_SET = "arm"
57
58# eglibc uses PARALLELMFLAGS variable to pass parallel build info so transfer
59# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE
60EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}""
61EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM"
62EXTRA_OEMAKE += "${EGLIBCPARALLELISM}"
63PARALLEL_MAKE = ""
64
65# eglibc make-syscalls.sh has a number of issues with /bin/dash and
66# it's output which make calls via the SHELL also has issues, so
67# ensure make uses /bin/bash
68EXTRA_OEMAKE += "SHELL=/bin/bash"
69
70OE_FEATURES = "${@features_to_eglibc_settings(d)}"
71do_configure_prepend() {
72 sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
73 echo '${OE_FEATURES}' > ${B}/option-groups.config
74}
75
76do_configure_append() {
77 oe_runmake config
78
79 # Remove quotation marks from OPTION_EGLIBC_NSSWITCH_FIXED_*. This will
80 # avoid install error.
81 sed -i 's/^OPTION_EGLIBC_NSSWITCH_FIXED_\(.*\)="\(.*\)"$/OPTION_EGLIBC_NSSWITCH_FIXED_\1=\2/' option-groups.config
82}
83
84GLIBC_ADDONS ?= "ports,nptl,libidn"
diff --git a/meta/recipes-core/eglibc/eglibc_2.19.bb b/meta/recipes-core/eglibc/eglibc_2.19.bb
new file mode 100644
index 0000000000..8f096769ee
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc_2.19.bb
@@ -0,0 +1,146 @@
1require eglibc.inc
2
3DEPENDS += "gperf-native kconfig-frontends-native"
4
5SRC_URI = "http://downloads.yoctoproject.org/releases/eglibc/eglibc-${PV}-svnr25243.tar.bz2 \
6 file://eglibc-svn-arm-lowlevellock-include-tls.patch \
7 file://IO-acquire-lock-fix.patch \
8 file://mips-rld-map-check.patch \
9 file://etc/ld.so.conf \
10 file://generate-supported.mk \
11 file://glibc.fix_sqrt2.patch \
12 file://multilib_readlib.patch \
13 file://ppc-sqrt_finite.patch \
14 file://GLRO_dl_debug_mask.patch \
15 file://initgroups_keys.patch \
16 file://eglibc_fix_findidx_parameters.patch \
17 file://ppc_slow_ieee754_sqrt.patch \
18 file://fileops-without-wchar-io.patch \
19 file://add_resource_h_to_wait_h.patch \
20 file://0001-eglibc-menuconfig-support.patch \
21 file://0002-eglibc-menuconfig-hex-string-options.patch \
22 file://0003-eglibc-menuconfig-build-instructions.patch \
23 file://fsl-ppc-no-fsqrt.patch \
24 file://0001-R_ARM_TLS_DTPOFF32.patch \
25 file://0001-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
26 file://fix-tibetian-locales.patch \
27 file://ppce6500-32b_slow_ieee754_sqrt.patch \
28 "
29SRC_URI[md5sum] = "197836c2ba42fb146e971222647198dd"
30SRC_URI[sha256sum] = "baaa030531fc308f7820c46acdf8e1b2f8e3c1f40bcd28b6e440d1c95d170d4c"
31
32LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
33 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
34 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
35 file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
36
37SRC_URI_append_class-nativesdk = " file://ld-search-order.patch \
38 file://relocatable_sdk.patch \
39 file://relocatable_sdk_fix_openpath.patch \
40 "
41S = "${WORKDIR}/eglibc-${PV}/libc"
42B = "${WORKDIR}/build-${TARGET_SYS}"
43
44PACKAGES_DYNAMIC = ""
45
46# the -isystem in bitbake.conf screws up glibc do_stage
47BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
48TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
49
50GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1"
51
52FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/eglibc-${PV}', '${FILE_DIRNAME}/eglibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
53
54#
55# For now, we will skip building of a gcc package if it is a uclibc one
56# and our build is not a uclibc one, and we skip a glibc one if our build
57# is a uclibc build.
58#
59# See the note in gcc/gcc_3.4.0.oe
60#
61
62python __anonymous () {
63 import re
64 uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None)
65 if uc_os:
66 raise bb.parse.SkipPackage("incompatible with target %s" %
67 d.getVar('TARGET_OS', True))
68}
69
70export libc_cv_slibdir = "${base_libdir}"
71
72EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
73 --without-cvs --disable-profile \
74 --disable-debug --without-gd \
75 --enable-clocale=gnu \
76 --enable-add-ons \
77 --with-headers=${STAGING_INCDIR} \
78 --without-selinux \
79 --enable-obsolete-rpc \
80 --with-kconfig=${STAGING_BINDIR_NATIVE} \
81 ${GLIBC_EXTRA_OECONF}"
82
83EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
84
85do_patch_append() {
86 bb.build.exec_func('do_fix_readlib_c', d)
87}
88
89# for mips eglibc now builds syscall tables for all abi's
90# so we make sure that we choose right march option which is
91# compatible with o32,n32 and n64 abi's
92# e.g. -march=mips32 is not compatible with n32 and n64 therefore
93# we filter it out in such case -march=from-abi which will be
94# mips1 when using o32 and mips3 when using n32/n64
95
96TUNE_CCARGS_mips := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}"
97TUNE_CCARGS_mipsel := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}"
98
99do_fix_readlib_c () {
100 sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
101}
102
103do_configure () {
104# override this function to avoid the autoconf/automake/aclocal/autoheader
105# calls for now
106# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
107# version check and doesn't really help with anything
108 if [ -z "`which rpcgen`" ]; then
109 echo "rpcgen not found. Install glibc-devel."
110 exit 1
111 fi
112 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
113 find ${S} -name "configure" | xargs touch
114 CPPFLAGS="" oe_runconf
115}
116
117rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
118 yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
119 rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
120
121do_compile () {
122 # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
123 unset LDFLAGS
124 base_do_compile
125 (
126 cd ${S}/sunrpc/rpcsvc
127 for r in ${rpcsvc}; do
128 h=`echo $r|sed -e's,\.x$,.h,'`
129 rpcgen -h $r -o $h || bbwarn "unable to generate header for $r"
130 done
131 )
132 echo "Adjust ldd script"
133 if [ -n "${RTLDLIST}" ]
134 then
135 prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
136 if [ "${prevrtld}" != "${RTLDLIST}" ]
137 then
138 sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
139 fi
140 fi
141
142}
143
144require eglibc-package.inc
145
146BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch
new file mode 100644
index 0000000000..cdfeaeadd8
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/32and64bit.patch
@@ -0,0 +1,331 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3We run the ldconfig in the cross fashion. make the code bitsize aware so that
4we can cross build ldconfig cache for various architectures.
5
6Richard Purdie <richard.purdie@linuxfoundation.org> 2009/05/19
7Nitin A Kamble <nitin.a.kamble@intel.com> 2009/03/29
8
9Index: ldconfig-native-2.12.1/readelflib.c
10===================================================================
11--- ldconfig-native-2.12.1.orig/readelflib.c
12+++ ldconfig-native-2.12.1/readelflib.c
13@@ -40,39 +40,212 @@ do \
14
15 /* Returns 0 if everything is ok, != 0 in case of error. */
16 int
17-process_elf_file (const char *file_name, const char *lib, int *flag,
18+process_elf_file32 (const char *file_name, const char *lib, int *flag,
19 unsigned int *osversion, char **soname, void *file_contents,
20 size_t file_length)
21 {
22 int i;
23 unsigned int j;
24- ElfW(Addr) loadaddr;
25+ Elf32_Addr loadaddr;
26 unsigned int dynamic_addr;
27 size_t dynamic_size;
28 char *program_interpreter;
29
30- ElfW(Ehdr) *elf_header;
31- ElfW(Phdr) *elf_pheader, *segment;
32- ElfW(Dyn) *dynamic_segment, *dyn_entry;
33+ Elf32_Ehdr *elf_header;
34+ Elf32_Phdr *elf_pheader, *segment;
35+ Elf32_Dyn *dynamic_segment, *dyn_entry;
36 char *dynamic_strings;
37
38- elf_header = (ElfW(Ehdr) *) file_contents;
39+ elf_header = (Elf32_Ehdr *) file_contents;
40 *osversion = 0;
41
42- if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS))
43+ if (elf_header->e_type != ET_DYN)
44 {
45- if (opt_verbose)
46+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
47+ elf_header->e_type);
48+ return 1;
49+ }
50+
51+ /* Get information from elf program header. */
52+ elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
53+ check_ptr (elf_pheader);
54+
55+ /* The library is an elf library, now search for soname and
56+ libc5/libc6. */
57+ *flag = FLAG_ELF;
58+
59+ loadaddr = -1;
60+ dynamic_addr = 0;
61+ dynamic_size = 0;
62+ program_interpreter = NULL;
63+ for (i = 0, segment = elf_pheader;
64+ i < elf_header->e_phnum; i++, segment++)
65+ {
66+ check_ptr (segment);
67+
68+ switch (segment->p_type)
69 {
70- if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
71- error (0, 0, _("%s is a 32 bit ELF file.\n"), file_name);
72- else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
73- error (0, 0, _("%s is a 64 bit ELF file.\n"), file_name);
74- else
75- error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
76+ case PT_LOAD:
77+ if (loadaddr == (Elf32_Addr) -1)
78+ loadaddr = segment->p_vaddr - segment->p_offset;
79+ break;
80+
81+ case PT_DYNAMIC:
82+ if (dynamic_addr)
83+ error (0, 0, _("more than one dynamic segment\n"));
84+
85+ dynamic_addr = segment->p_offset;
86+ dynamic_size = segment->p_filesz;
87+ break;
88+
89+ case PT_INTERP:
90+ program_interpreter = (char *) (file_contents + segment->p_offset);
91+ check_ptr (program_interpreter);
92+
93+ /* Check if this is enough to classify the binary. */
94+ for (j = 0; j < sizeof (interpreters) / sizeof (interpreters [0]);
95+ ++j)
96+ if (strcmp (program_interpreter, interpreters[j].soname) == 0)
97+ {
98+ *flag = interpreters[j].flag;
99+ break;
100+ }
101+ break;
102+
103+ case PT_NOTE:
104+ if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
105+ {
106+ Elf32_Word *abi_note = (Elf32_Word *) (file_contents
107+ + segment->p_offset);
108+ Elf32_Addr size = segment->p_filesz;
109+
110+ while (abi_note [0] != 4 || abi_note [1] != 16
111+ || abi_note [2] != 1
112+ || memcmp (abi_note + 3, "GNU", 4) != 0)
113+ {
114+#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
115+ Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
116+ + ROUND (abi_note[0])
117+ + ROUND (abi_note[1]);
118+
119+ if (size - 32 < note_size || note_size == 0)
120+ {
121+ size = 0;
122+ break;
123+ }
124+ size -= note_size;
125+ abi_note = (void *) abi_note + note_size;
126+ }
127+
128+ if (size == 0)
129+ break;
130+
131+ *osversion = (abi_note [4] << 24) |
132+ ((abi_note [5] & 0xff) << 16) |
133+ ((abi_note [6] & 0xff) << 8) |
134+ (abi_note [7] & 0xff);
135+ }
136+ break;
137+
138+ default:
139+ break;
140+ }
141+
142+ }
143+ if (loadaddr == (Elf32_Addr) -1)
144+ {
145+ /* Very strange. */
146+ loadaddr = 0;
147+ }
148+
149+ /* Now we can read the dynamic sections. */
150+ if (dynamic_size == 0)
151+ return 1;
152+
153+ dynamic_segment = (Elf32_Dyn *) (file_contents + dynamic_addr);
154+ check_ptr (dynamic_segment);
155+
156+ /* Find the string table. */
157+ dynamic_strings = NULL;
158+ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
159+ ++dyn_entry)
160+ {
161+ check_ptr (dyn_entry);
162+ if (dyn_entry->d_tag == DT_STRTAB)
163+ {
164+ dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
165+ check_ptr (dynamic_strings);
166+ break;
167 }
168- return 1;
169 }
170
171+ if (dynamic_strings == NULL)
172+ return 1;
173+
174+ /* Now read the DT_NEEDED and DT_SONAME entries. */
175+ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
176+ ++dyn_entry)
177+ {
178+ if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
179+ {
180+ char *name = dynamic_strings + dyn_entry->d_un.d_val;
181+ check_ptr (name);
182+
183+ if (dyn_entry->d_tag == DT_NEEDED)
184+ {
185+
186+ if (*flag == FLAG_ELF)
187+ {
188+ /* Check if this is enough to classify the binary. */
189+ for (j = 0;
190+ j < sizeof (known_libs) / sizeof (known_libs [0]);
191+ ++j)
192+ if (strcmp (name, known_libs [j].soname) == 0)
193+ {
194+ *flag = known_libs [j].flag;
195+ break;
196+ }
197+ }
198+ }
199+
200+ else if (dyn_entry->d_tag == DT_SONAME)
201+ *soname = xstrdup (name);
202+
203+ /* Do we have everything we need? */
204+ if (*soname && *flag != FLAG_ELF)
205+ return 0;
206+ }
207+ }
208+
209+ /* We reach this point only if the file doesn't contain a DT_SONAME
210+ or if we can't classify the library. If it doesn't have a
211+ soname, return the name of the library. */
212+ if (*soname == NULL)
213+ *soname = xstrdup (lib);
214+
215+ return 0;
216+}
217+
218+int
219+process_elf_file64 (const char *file_name, const char *lib, int *flag,
220+ unsigned int *osversion, char **soname, void *file_contents,
221+ size_t file_length)
222+{
223+ int i;
224+ unsigned int j;
225+ Elf64_Addr loadaddr;
226+ unsigned int dynamic_addr;
227+ size_t dynamic_size;
228+ char *program_interpreter;
229+
230+ Elf64_Ehdr *elf_header;
231+ Elf64_Phdr *elf_pheader, *segment;
232+ Elf64_Dyn *dynamic_segment, *dyn_entry;
233+ char *dynamic_strings;
234+
235+ elf_header = (Elf64_Ehdr *) file_contents;
236+ *osversion = 0;
237+
238 if (elf_header->e_type != ET_DYN)
239 {
240 error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
241@@ -81,7 +254,7 @@ process_elf_file (const char *file_name,
242 }
243
244 /* Get information from elf program header. */
245- elf_pheader = (ElfW(Phdr) *) (elf_header->e_phoff + file_contents);
246+ elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
247 check_ptr (elf_pheader);
248
249 /* The library is an elf library, now search for soname and
250@@ -100,7 +273,7 @@ process_elf_file (const char *file_name,
251 switch (segment->p_type)
252 {
253 case PT_LOAD:
254- if (loadaddr == (ElfW(Addr)) -1)
255+ if (loadaddr == (Elf64_Addr) -1)
256 loadaddr = segment->p_vaddr - segment->p_offset;
257 break;
258
259@@ -129,16 +302,16 @@ process_elf_file (const char *file_name,
260 case PT_NOTE:
261 if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
262 {
263- ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents
264+ Elf64_Word *abi_note = (Elf64_Word *) (file_contents
265 + segment->p_offset);
266- ElfW(Addr) size = segment->p_filesz;
267+ Elf64_Addr size = segment->p_filesz;
268
269 while (abi_note [0] != 4 || abi_note [1] != 16
270 || abi_note [2] != 1
271 || memcmp (abi_note + 3, "GNU", 4) != 0)
272 {
273-#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
274- ElfW(Addr) note_size = 3 * sizeof (ElfW(Word))
275+#define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
276+ Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
277 + ROUND (abi_note[0])
278 + ROUND (abi_note[1]);
279
280@@ -166,7 +339,7 @@ process_elf_file (const char *file_name,
281 }
282
283 }
284- if (loadaddr == (ElfW(Addr)) -1)
285+ if (loadaddr == (Elf64_Addr) -1)
286 {
287 /* Very strange. */
288 loadaddr = 0;
289@@ -176,7 +349,7 @@ process_elf_file (const char *file_name,
290 if (dynamic_size == 0)
291 return 1;
292
293- dynamic_segment = (ElfW(Dyn) *) (file_contents + dynamic_addr);
294+ dynamic_segment = (Elf64_Dyn *) (file_contents + dynamic_addr);
295 check_ptr (dynamic_segment);
296
297 /* Find the string table. */
298@@ -233,3 +406,33 @@ process_elf_file (const char *file_name,
299
300 return 0;
301 }
302+/* Returns 0 if everything is ok, != 0 in case of error. */
303+int
304+process_elf_file (const char *file_name, const char *lib, int *flag,
305+ unsigned int *osversion, char **soname, void *file_contents,
306+ size_t file_length)
307+{
308+ int i;
309+ unsigned int j;
310+ ElfW(Addr) loadaddr;
311+ unsigned int dynamic_addr;
312+ size_t dynamic_size;
313+ char *program_interpreter;
314+
315+ ElfW(Ehdr) *elf_header;
316+ ElfW(Phdr) *elf_pheader, *segment;
317+ ElfW(Dyn) *dynamic_segment, *dyn_entry;
318+ char *dynamic_strings;
319+
320+ elf_header = (ElfW(Ehdr) *) file_contents;
321+ *osversion = 0;
322+
323+ if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
324+ return process_elf_file32(file_name, lib,flag, osversion, soname, file_contents, file_length);
325+ else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
326+ return process_elf_file64(file_name, lib,flag, osversion, soname, file_contents, file_length);
327+ error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
328+ return 1;
329+}
330+
331+
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README
new file mode 100644
index 0000000000..43fb983729
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/README
@@ -0,0 +1,8 @@
1The files are pulled verbatim from glibc 2.5 and then patched to allow
2standalone compilation of ldconfig.
3
4Richard Purdie
5OpenedHand Ltd.
6
7Upgraded the ldconfig recipe to eglibc 2.12.1
8Nitin A Kamble <nitin.a.kamble@intel.com> 2011/03/29
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch
new file mode 100644
index 0000000000..7f8e4db78a
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endian-ness_handling.patch
@@ -0,0 +1,454 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Do data input/output handling according to endien-ness of the library file. That
4enables use of ldconfig in the cross fashion for any architecture.
5
62011/04/04
7Richard Purdie <richard.purdie@linuxfoundation.org>
8Nitin Kamble <nitin.a.kamble@intel.com>
9
10Index: ldconfig-native-2.12.1/readelflib.c
11===================================================================
12--- ldconfig-native-2.12.1.orig/readelflib.c
13+++ ldconfig-native-2.12.1/readelflib.c
14@@ -38,6 +38,28 @@ do \
15 } \
16 while (0);
17
18+int be;
19+static uint16_t read16(uint16_t x, int be)
20+{
21+ if (be)
22+ return be16toh(x);
23+ return le16toh(x);
24+}
25+
26+static uint32_t read32(uint32_t x, int be)
27+{
28+ if (be)
29+ return be32toh(x);
30+ return le32toh(x);
31+}
32+
33+static uint64_t read64(uint64_t x, int be)
34+{
35+ if (be)
36+ return be64toh(x);
37+ return le64toh(x);
38+}
39+
40 /* Returns 0 if everything is ok, != 0 in case of error. */
41 int
42 process_elf_file32 (const char *file_name, const char *lib, int *flag,
43@@ -59,15 +81,17 @@ process_elf_file32 (const char *file_nam
44 elf_header = (Elf32_Ehdr *) file_contents;
45 *osversion = 0;
46
47- if (elf_header->e_type != ET_DYN)
48+ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
49+
50+ if (read16(elf_header->e_type, be) != ET_DYN)
51 {
52 error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
53- elf_header->e_type);
54+ read16(elf_header->e_type, be));
55 return 1;
56 }
57
58 /* Get information from elf program header. */
59- elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
60+ elf_pheader = (Elf32_Phdr *) (read32(elf_header->e_phoff, be) + file_contents);
61 check_ptr (elf_pheader);
62
63 /* The library is an elf library, now search for soname and
64@@ -79,27 +103,27 @@ process_elf_file32 (const char *file_nam
65 dynamic_size = 0;
66 program_interpreter = NULL;
67 for (i = 0, segment = elf_pheader;
68- i < elf_header->e_phnum; i++, segment++)
69+ i < read16(elf_header->e_phnum, be); i++, segment++)
70 {
71 check_ptr (segment);
72
73- switch (segment->p_type)
74+ switch (read32(segment->p_type, be))
75 {
76 case PT_LOAD:
77 if (loadaddr == (Elf32_Addr) -1)
78- loadaddr = segment->p_vaddr - segment->p_offset;
79+ loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be);
80 break;
81
82 case PT_DYNAMIC:
83 if (dynamic_addr)
84 error (0, 0, _("more than one dynamic segment\n"));
85
86- dynamic_addr = segment->p_offset;
87- dynamic_size = segment->p_filesz;
88+ dynamic_addr = read32(segment->p_offset, be);
89+ dynamic_size = read32(segment->p_filesz, be);
90 break;
91
92 case PT_INTERP:
93- program_interpreter = (char *) (file_contents + segment->p_offset);
94+ program_interpreter = (char *) (file_contents + read32(segment->p_offset, be));
95 check_ptr (program_interpreter);
96
97 /* Check if this is enough to classify the binary. */
98@@ -113,20 +137,20 @@ process_elf_file32 (const char *file_nam
99 break;
100
101 case PT_NOTE:
102- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
103+ if (!*osversion && read32(segment->p_filesz, be) >= 32 && segment->p_align >= 4)
104 {
105 Elf32_Word *abi_note = (Elf32_Word *) (file_contents
106- + segment->p_offset);
107- Elf32_Addr size = segment->p_filesz;
108+ + read32(segment->p_offset, be));
109+ Elf32_Addr size = read32(segment->p_filesz, be);
110
111- while (abi_note [0] != 4 || abi_note [1] != 16
112- || abi_note [2] != 1
113+ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
114+ || read32(abi_note [2], be) != 1
115 || memcmp (abi_note + 3, "GNU", 4) != 0)
116 {
117-#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
118- Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
119- + ROUND (abi_note[0])
120- + ROUND (abi_note[1]);
121+#define ROUND(len) (((len) + sizeof (Elf32_Word) - 1) & -sizeof (Elf32_Word))
122+ Elf32_Addr note_size = 3 * sizeof (Elf32_Word)
123+ + ROUND (read32(abi_note[0], be))
124+ + ROUND (read32(abi_note[1], be));
125
126 if (size - 32 < note_size || note_size == 0)
127 {
128@@ -140,10 +164,10 @@ process_elf_file32 (const char *file_nam
129 if (size == 0)
130 break;
131
132- *osversion = (abi_note [4] << 24) |
133- ((abi_note [5] & 0xff) << 16) |
134- ((abi_note [6] & 0xff) << 8) |
135- (abi_note [7] & 0xff);
136+ *osversion = (read32(abi_note [4], be) << 24) |
137+ ((read32(abi_note [5], be) & 0xff) << 16) |
138+ ((read32(abi_note [6], be) & 0xff) << 8) |
139+ (read32(abi_note [7], be) & 0xff);
140 }
141 break;
142
143@@ -167,13 +191,13 @@ process_elf_file32 (const char *file_nam
144
145 /* Find the string table. */
146 dynamic_strings = NULL;
147- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
148+ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
149 ++dyn_entry)
150 {
151 check_ptr (dyn_entry);
152- if (dyn_entry->d_tag == DT_STRTAB)
153+ if (read32(dyn_entry->d_tag, be) == DT_STRTAB)
154 {
155- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
156+ dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr);
157 check_ptr (dynamic_strings);
158 break;
159 }
160@@ -183,15 +207,15 @@ process_elf_file32 (const char *file_nam
161 return 1;
162
163 /* Now read the DT_NEEDED and DT_SONAME entries. */
164- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
165+ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
166 ++dyn_entry)
167 {
168- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
169+ if (read32(dyn_entry->d_tag, be) == DT_NEEDED || read32(dyn_entry->d_tag, be) == DT_SONAME)
170 {
171- char *name = dynamic_strings + dyn_entry->d_un.d_val;
172+ char *name = dynamic_strings + read32(dyn_entry->d_un.d_val, be);
173 check_ptr (name);
174
175- if (dyn_entry->d_tag == DT_NEEDED)
176+ if (read32(dyn_entry->d_tag, be) == DT_NEEDED)
177 {
178
179 if (*flag == FLAG_ELF)
180@@ -208,7 +232,7 @@ process_elf_file32 (const char *file_nam
181 }
182 }
183
184- else if (dyn_entry->d_tag == DT_SONAME)
185+ else if (read32(dyn_entry->d_tag, be) == DT_SONAME)
186 *soname = xstrdup (name);
187
188 /* Do we have everything we need? */
189@@ -246,15 +270,17 @@ process_elf_file64 (const char *file_nam
190 elf_header = (Elf64_Ehdr *) file_contents;
191 *osversion = 0;
192
193- if (elf_header->e_type != ET_DYN)
194+ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
195+
196+ if (read16(elf_header->e_type, be) != ET_DYN)
197 {
198 error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
199- elf_header->e_type);
200+ read16(elf_header->e_type, be));
201 return 1;
202 }
203
204 /* Get information from elf program header. */
205- elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
206+ elf_pheader = (Elf64_Phdr *) (read64(elf_header->e_phoff, be) + file_contents);
207 check_ptr (elf_pheader);
208
209 /* The library is an elf library, now search for soname and
210@@ -266,27 +292,27 @@ process_elf_file64 (const char *file_nam
211 dynamic_size = 0;
212 program_interpreter = NULL;
213 for (i = 0, segment = elf_pheader;
214- i < elf_header->e_phnum; i++, segment++)
215+ i < read16(elf_header->e_phnum, be); i++, segment++)
216 {
217 check_ptr (segment);
218
219- switch (segment->p_type)
220+ switch (read32(segment->p_type, be))
221 {
222 case PT_LOAD:
223 if (loadaddr == (Elf64_Addr) -1)
224- loadaddr = segment->p_vaddr - segment->p_offset;
225+ loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be);
226 break;
227
228 case PT_DYNAMIC:
229 if (dynamic_addr)
230 error (0, 0, _("more than one dynamic segment\n"));
231
232- dynamic_addr = segment->p_offset;
233- dynamic_size = segment->p_filesz;
234+ dynamic_addr = read64(segment->p_offset, be);
235+ dynamic_size = read32(segment->p_filesz, be);
236 break;
237
238 case PT_INTERP:
239- program_interpreter = (char *) (file_contents + segment->p_offset);
240+ program_interpreter = (char *) (file_contents + read64(segment->p_offset, be));
241 check_ptr (program_interpreter);
242
243 /* Check if this is enough to classify the binary. */
244@@ -300,20 +326,21 @@ process_elf_file64 (const char *file_nam
245 break;
246
247 case PT_NOTE:
248- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
249+ if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
250 {
251 Elf64_Word *abi_note = (Elf64_Word *) (file_contents
252- + segment->p_offset);
253- Elf64_Addr size = segment->p_filesz;
254+ + read64(segment->p_offset, be));
255+ Elf64_Addr size = read32(segment->p_filesz, be);
256
257- while (abi_note [0] != 4 || abi_note [1] != 16
258- || abi_note [2] != 1
259+ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
260+ || read32(abi_note [2], be) != 1
261 || memcmp (abi_note + 3, "GNU", 4) != 0)
262 {
263+#undef ROUND
264 #define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
265 Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
266- + ROUND (abi_note[0])
267- + ROUND (abi_note[1]);
268+ + ROUND (read32(abi_note[0], be))
269+ + ROUND (read32(abi_note[1], be));
270
271 if (size - 32 < note_size || note_size == 0)
272 {
273@@ -327,10 +354,10 @@ process_elf_file64 (const char *file_nam
274 if (size == 0)
275 break;
276
277- *osversion = (abi_note [4] << 24) |
278- ((abi_note [5] & 0xff) << 16) |
279- ((abi_note [6] & 0xff) << 8) |
280- (abi_note [7] & 0xff);
281+ *osversion = (read32(abi_note [4], be) << 24) |
282+ ((read32(abi_note [5], be) & 0xff) << 16) |
283+ ((read32(abi_note [6], be) & 0xff) << 8) |
284+ (read32(abi_note [7], be) & 0xff);
285 }
286 break;
287
288@@ -354,13 +381,13 @@ process_elf_file64 (const char *file_nam
289
290 /* Find the string table. */
291 dynamic_strings = NULL;
292- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
293+ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
294 ++dyn_entry)
295 {
296 check_ptr (dyn_entry);
297- if (dyn_entry->d_tag == DT_STRTAB)
298+ if (read64(dyn_entry->d_tag, be) == DT_STRTAB)
299 {
300- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
301+ dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr);
302 check_ptr (dynamic_strings);
303 break;
304 }
305@@ -370,15 +397,15 @@ process_elf_file64 (const char *file_nam
306 return 1;
307
308 /* Now read the DT_NEEDED and DT_SONAME entries. */
309- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
310+ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
311 ++dyn_entry)
312 {
313- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
314+ if (read64(dyn_entry->d_tag, be) == DT_NEEDED || read64(dyn_entry->d_tag, be) == DT_SONAME)
315 {
316- char *name = dynamic_strings + dyn_entry->d_un.d_val;
317+ char *name = dynamic_strings + read64(dyn_entry->d_un.d_val, be);
318 check_ptr (name);
319
320- if (dyn_entry->d_tag == DT_NEEDED)
321+ if (read64(dyn_entry->d_tag, be) == DT_NEEDED)
322 {
323
324 if (*flag == FLAG_ELF)
325@@ -395,7 +422,7 @@ process_elf_file64 (const char *file_nam
326 }
327 }
328
329- else if (dyn_entry->d_tag == DT_SONAME)
330+ else if (read64(dyn_entry->d_tag, be) == DT_SONAME)
331 *soname = xstrdup (name);
332
333 /* Do we have everything we need? */
334Index: ldconfig-native-2.12.1/readlib.c
335===================================================================
336--- ldconfig-native-2.12.1.orig/readlib.c
337+++ ldconfig-native-2.12.1/readlib.c
338@@ -169,7 +169,8 @@ process_file (const char *real_file_name
339 ret = 1;
340 }
341 /* Libraries have to be shared object files. */
342- else if (elf_header->e_type != ET_DYN)
343+ else if ((elf_header->e_ident[EI_DATA] == ELFDATA2MSB && be16toh(elf_header->e_type) != ET_DYN) ||
344+ (elf_header->e_ident[EI_DATA] == ELFDATA2LSB && le16toh(elf_header->e_type) != ET_DYN))
345 ret = 1;
346 else if (process_elf_file (file_name, lib, flag, osversion, soname,
347 file_contents, statbuf.st_size))
348Index: ldconfig-native-2.12.1/cache.c
349===================================================================
350--- ldconfig-native-2.12.1.orig/cache.c
351+++ ldconfig-native-2.12.1/cache.c
352@@ -39,6 +39,29 @@
353 # define N_(msgid) msgid
354 #define _(msg) msg
355
356+extern int be;
357+
358+static uint16_t write16(uint16_t x, int be)
359+{
360+ if (be)
361+ return htobe16(x);
362+ return htole16(x);
363+}
364+
365+static uint32_t write32(uint32_t x, int be)
366+{
367+ if (be)
368+ return htobe32(x);
369+ return htole32(x);
370+}
371+
372+static uint64_t write64(uint64_t x, int be)
373+{
374+ if (be)
375+ return htobe64(x);
376+ return htole64(x);
377+}
378+
379 struct cache_entry
380 {
381 char *lib; /* Library name. */
382@@ -279,7 +302,12 @@ save_cache (const char *cache_name)
383 /* Number of normal cache entries. */
384 int cache_entry_old_count = 0;
385
386- for (entry = entries; entry != NULL; entry = entry->next)
387+ if (be)
388+ printf("saving cache in big endian encoding\n");
389+ else
390+ printf("saving cache in little endian encoding\n");
391+
392+ for (entry = entries; entry != NULL; entry = entry->next)
393 {
394 /* Account the final NULs. */
395 total_strlen += strlen (entry->lib) + strlen (entry->path) + 2;
396@@ -310,7 +338,7 @@ save_cache (const char *cache_name)
397 memset (file_entries, '\0', sizeof (struct cache_file));
398 memcpy (file_entries->magic, CACHEMAGIC, sizeof CACHEMAGIC - 1);
399
400- file_entries->nlibs = cache_entry_old_count;
401+ file_entries->nlibs = write32(cache_entry_old_count, be);
402 }
403
404 struct cache_file_new *file_entries_new = NULL;
405@@ -330,8 +358,8 @@ save_cache (const char *cache_name)
406 memcpy (file_entries_new->version, CACHE_VERSION,
407 sizeof CACHE_VERSION - 1);
408
409- file_entries_new->nlibs = cache_entry_count;
410- file_entries_new->len_strings = total_strlen;
411+ file_entries_new->nlibs = write32(cache_entry_count, be);
412+ file_entries_new->len_strings = write32(total_strlen, be);
413 }
414
415 /* Pad for alignment of cache_file_new. */
416@@ -358,9 +386,9 @@ save_cache (const char *cache_name)
417 /* First the library. */
418 if (opt_format != 2 && entry->hwcap == 0)
419 {
420- file_entries->libs[idx_old].flags = entry->flags;
421+ file_entries->libs[idx_old].flags = write32(entry->flags, be);
422 /* XXX: Actually we can optimize here and remove duplicates. */
423- file_entries->libs[idx_old].key = str_offset + pad;
424+ file_entries->libs[idx_old].key = write32(str_offset + pad, be);
425 }
426 if (opt_format != 0)
427 {
428@@ -368,10 +396,10 @@ save_cache (const char *cache_name)
429 not doing so makes the code easier, the string table
430 always begins at the beginning of the the new cache
431 struct. */
432- file_entries_new->libs[idx_new].flags = entry->flags;
433- file_entries_new->libs[idx_new].osversion = entry->osversion;
434- file_entries_new->libs[idx_new].hwcap = entry->hwcap;
435- file_entries_new->libs[idx_new].key = str_offset;
436+ file_entries_new->libs[idx_new].flags = write32(entry->flags, be);
437+ file_entries_new->libs[idx_new].osversion = write32(entry->osversion, be);
438+ file_entries_new->libs[idx_new].hwcap = write64(entry->hwcap, be);
439+ file_entries_new->libs[idx_new].key = write32(str_offset, be);
440 }
441
442 size_t len = strlen (entry->lib) + 1;
443@@ -379,9 +407,9 @@ save_cache (const char *cache_name)
444 str_offset += len;
445 /* Then the path. */
446 if (opt_format != 2 && entry->hwcap == 0)
447- file_entries->libs[idx_old].value = str_offset + pad;
448+ file_entries->libs[idx_old].value = write32(str_offset + pad, be);
449 if (opt_format != 0)
450- file_entries_new->libs[idx_new].value = str_offset;
451+ file_entries_new->libs[idx_new].value = write32(str_offset, be);
452 len = strlen (entry->path) + 1;
453 str = mempcpy (str, entry->path, len);
454 str_offset += len;
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch
new file mode 100644
index 0000000000..a18b2c20de
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/endianess-header.patch
@@ -0,0 +1,113 @@
1Upstream-Status: Inappropriate [fix poky patch]
2
3This patch fixes build issues with a previous endian-ness_handling.patch on
4distros that don't have macros referenced
5
67/20/2011
7Matthew McClintock <msm@freescale.com>
8
9diff -purN ldconfig-native-2.12.1.orig/endian_extra.h ldconfig-native-2.12.1/endian_extra.h
10--- ldconfig-native-2.12.1.orig/endian_extra.h 1969-12-31 18:00:00.000000000 -0600
11+++ ldconfig-native-2.12.1/endian_extra.h 2011-07-19 18:09:14.323048417 -0500
12@@ -0,0 +1,64 @@
13+/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
14+ This file is part of the GNU C Library.
15+
16+ The GNU C Library is free software; you can redistribute it and/or
17+ modify it under the terms of the GNU Lesser General Public
18+ License as published by the Free Software Foundation; either
19+ version 2.1 of the License, or (at your option) any later version.
20+
21+ The GNU C Library is distributed in the hope that it will be useful,
22+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24+ Lesser General Public License for more details.
25+
26+ You should have received a copy of the GNU Lesser General Public
27+ License along with the GNU C Library; if not, write to the Free
28+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
29+ 02111-1307 USA. */
30+
31+#include <endian.h>
32+
33+#ifndef _ENDIAN_EXTRA_H
34+#define _ENDIAN_EXTRA_H 1
35+
36+/* Don't redefine these macros if they already exist */
37+#ifndef htobe16
38+#ifdef __USE_BSD
39+/* Conversion interfaces. */
40+# include <byteswap.h>
41+
42+# if __BYTE_ORDER == __LITTLE_ENDIAN
43+# define htobe16(x) __bswap_16 (x)
44+# define htole16(x) (x)
45+# define be16toh(x) __bswap_16 (x)
46+# define le16toh(x) (x)
47+
48+# define htobe32(x) __bswap_32 (x)
49+# define htole32(x) (x)
50+# define be32toh(x) __bswap_32 (x)
51+# define le32toh(x) (x)
52+
53+# define htobe64(x) __bswap_64 (x)
54+# define htole64(x) (x)
55+# define be64toh(x) __bswap_64 (x)
56+# define le64toh(x) (x)
57+# else
58+# define htobe16(x) (x)
59+# define htole16(x) __bswap_16 (x)
60+# define be16toh(x) (x)
61+# define le16toh(x) __bswap_16 (x)
62+
63+# define htobe32(x) (x)
64+# define htole32(x) __bswap_32 (x)
65+# define be32toh(x) (x)
66+# define le32toh(x) __bswap_32 (x)
67+
68+# define htobe64(x) (x)
69+# define htole64(x) __bswap_64 (x)
70+# define be64toh(x) (x)
71+# define le64toh(x) __bswap_64 (x)
72+# endif
73+#endif
74+#endif
75+
76+#endif /* endian_extra.h */
77diff -purN ldconfig-native-2.12.1.orig/cache.c ldconfig-native-2.12.1/cache.c
78--- ldconfig-native-2.12.1.orig/cache.c 2011-07-19 18:21:28.347041301 -0500
79+++ ldconfig-native-2.12.1/cache.c 2011-07-19 18:22:54.118048064 -0500
80@@ -39,6 +39,8 @@
81 # define N_(msgid) msgid
82 #define _(msg) msg
83
84+#include "endian_extra.h"
85+
86 extern int be;
87
88 static uint16_t write16(uint16_t x, int be)
89diff -purN ldconfig-native-2.12.1.orig/readelflib.c ldconfig-native-2.12.1/readelflib.c
90--- ldconfig-native-2.12.1.orig/readelflib.c 2011-07-19 18:21:28.346041593 -0500
91+++ ldconfig-native-2.12.1/readelflib.c 2011-07-19 18:23:05.324059875 -0500
92@@ -25,6 +25,9 @@
93
94 /* check_ptr checks that a pointer is in the mmaped file and doesn't
95 point outside it. */
96+
97+#include "endian_extra.h"
98+
99 #undef check_ptr
100 #define check_ptr(ptr) \
101 do \
102diff -purN ldconfig-native-2.12.1.orig/readlib.c ldconfig-native-2.12.1/readlib.c
103--- ldconfig-native-2.12.1.orig/readlib.c 2011-07-19 18:21:28.346041593 -0500
104+++ ldconfig-native-2.12.1/readlib.c 2011-07-19 18:23:23.877046210 -0500
105@@ -40,6 +40,8 @@
106
107 #include "ldconfig.h"
108
109+#include "endian_extra.h"
110+
111 #define _(msg) msg
112
113 #define Elf32_CLASS ELFCLASS32
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch
new file mode 100644
index 0000000000..4e9aab9416
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/flag_fix.patch
@@ -0,0 +1,24 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3The native version of ldconfig was using native definition of LD_SO (i.e.
4ld-linux-x86-64.so.2 ) which is not correct for doing the cross ldconfig.
5This was causing libc.so on the target marked as ELF lib rather than
6FLAG_ELF_LIBC6 in the ld.so.cache.
7
8Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/4
9
10Index: ldconfig-native-2.12.1/readlib.c
11===================================================================
12--- ldconfig-native-2.12.1.orig/readlib.c
13+++ ldconfig-native-2.12.1/readlib.c
14@@ -51,6 +51,10 @@ struct known_names
15 int flag;
16 };
17
18+/* don't use host's definition of LD_SO */
19+#undef LD_SO
20+#define LD_SO "ld.so.1"
21+
22 static struct known_names interpreters[] =
23 {
24 { "/lib/" LD_SO, FLAG_ELF_LIBC6 },
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
new file mode 100644
index 0000000000..dc1e79888e
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
Binary files differ
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch
new file mode 100644
index 0000000000..52986e61c7
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig.patch
@@ -0,0 +1,471 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3enable standalone building of ldconfig
4
5---
6 cache.c | 11 +-
7 chroot_canon.c | 7 +
8 dl-cache.c | 235 ---------------------------------------------------------
9 dl-cache.h | 3
10 ldconfig.c | 27 ++++--
11 readlib.c | 7 +
12 xstrdup.c | 11 --
13 7 files changed, 45 insertions(+), 256 deletions(-)
14
15Index: ldconfig-native-2.12.1/cache.c
16===================================================================
17--- ldconfig-native-2.12.1.orig/cache.c
18+++ ldconfig-native-2.12.1/cache.c
19@@ -16,6 +16,9 @@
20 along with this program; if not, write to the Free Software Foundation,
21 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22
23+#define _LARGEFILE64_SOURCE
24+#define _GNU_SOURCE
25+
26 #include <errno.h>
27 #include <error.h>
28 #include <dirent.h>
29@@ -31,8 +34,10 @@
30 #include <sys/stat.h>
31 #include <sys/types.h>
32
33-#include <ldconfig.h>
34-#include <dl-cache.h>
35+#include "ldconfig.h"
36+#include "dl-cache.h"
37+# define N_(msgid) msgid
38+#define _(msg) msg
39
40 struct cache_entry
41 {
42Index: ldconfig-native-2.12.1/chroot_canon.c
43===================================================================
44--- ldconfig-native-2.12.1.orig/chroot_canon.c
45+++ ldconfig-native-2.12.1/chroot_canon.c
46@@ -17,6 +17,9 @@
47 along with this program; if not, write to the Free Software Foundation,
48 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
49
50+#define _LARGEFILE64_SOURCE
51+#define _GNU_SOURCE
52+
53 #include <stdlib.h>
54 #include <string.h>
55 #include <unistd.h>
56@@ -27,7 +30,9 @@
57 #include <stddef.h>
58 #include <stdint.h>
59
60-#include <ldconfig.h>
61+#include "ldconfig.h"
62+
63+#define __set_errno(Val) errno = (Val)
64
65 #ifndef PATH_MAX
66 #define PATH_MAX 1024
67Index: ldconfig-native-2.12.1/dl-cache.c
68===================================================================
69--- ldconfig-native-2.12.1.orig/dl-cache.c
70+++ ldconfig-native-2.12.1/dl-cache.c
71@@ -20,12 +20,12 @@
72
73 #include <assert.h>
74 #include <unistd.h>
75-#include <ldsodefs.h>
76+//#include "ldsodefs.h"
77 #include <sys/mman.h>
78 #include <dl-cache.h>
79 #include <dl-procinfo.h>
80
81-#include <stdio-common/_itoa.h>
82+//#include "_itoa.h"
83
84 #ifndef _DL_PLATFORMS_COUNT
85 # define _DL_PLATFORMS_COUNT 0
86@@ -39,103 +39,7 @@ static size_t cachesize;
87 /* 1 if cache_data + PTR points into the cache. */
88 #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size)
89
90-#define SEARCH_CACHE(cache) \
91-/* We use binary search since the table is sorted in the cache file. \
92- The first matching entry in the table is returned. \
93- It is important to use the same algorithm as used while generating \
94- the cache file. */ \
95-do \
96- { \
97- left = 0; \
98- right = cache->nlibs - 1; \
99- \
100- while (left <= right) \
101- { \
102- __typeof__ (cache->libs[0].key) key; \
103- \
104- middle = (left + right) / 2; \
105- \
106- key = cache->libs[middle].key; \
107- \
108- /* Make sure string table indices are not bogus before using \
109- them. */ \
110- if (! _dl_cache_verify_ptr (key)) \
111- { \
112- cmpres = 1; \
113- break; \
114- } \
115- \
116- /* Actually compare the entry with the key. */ \
117- cmpres = _dl_cache_libcmp (name, cache_data + key); \
118- if (__builtin_expect (cmpres == 0, 0)) \
119- { \
120- /* Found it. LEFT now marks the last entry for which we \
121- know the name is correct. */ \
122- left = middle; \
123- \
124- /* There might be entries with this name before the one we \
125- found. So we have to find the beginning. */ \
126- while (middle > 0) \
127- { \
128- __typeof__ (cache->libs[0].key) key; \
129- \
130- key = cache->libs[middle - 1].key; \
131- /* Make sure string table indices are not bogus before \
132- using them. */ \
133- if (! _dl_cache_verify_ptr (key) \
134- /* Actually compare the entry. */ \
135- || _dl_cache_libcmp (name, cache_data + key) != 0) \
136- break; \
137- --middle; \
138- } \
139- \
140- do \
141- { \
142- int flags; \
143- __typeof__ (cache->libs[0]) *lib = &cache->libs[middle]; \
144- \
145- /* Only perform the name test if necessary. */ \
146- if (middle > left \
147- /* We haven't seen this string so far. Test whether the \
148- index is ok and whether the name matches. Otherwise \
149- we are done. */ \
150- && (! _dl_cache_verify_ptr (lib->key) \
151- || (_dl_cache_libcmp (name, cache_data + lib->key) \
152- != 0))) \
153- break; \
154- \
155- flags = lib->flags; \
156- if (_dl_cache_check_flags (flags) \
157- && _dl_cache_verify_ptr (lib->value)) \
158- { \
159- if (best == NULL || flags == GLRO(dl_correct_cache_id)) \
160- { \
161- HWCAP_CHECK; \
162- best = cache_data + lib->value; \
163- \
164- if (flags == GLRO(dl_correct_cache_id)) \
165- /* We've found an exact match for the shared \
166- object and no general `ELF' release. Stop \
167- searching. */ \
168- break; \
169- } \
170- } \
171- } \
172- while (++middle <= right); \
173- break; \
174- } \
175- \
176- if (cmpres < 0) \
177- left = middle + 1; \
178- else \
179- right = middle - 1; \
180- } \
181- } \
182-while (0)
183-
184-
185 int
186-internal_function
187 _dl_cache_libcmp (const char *p1, const char *p2)
188 {
189 while (*p1 != '\0')
190@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const
191 }
192 return *p1 - *p2;
193 }
194-
195-
196-/* Look up NAME in ld.so.cache and return the file name stored there,
197- or null if none is found. */
198-
199-const char *
200-internal_function
201-_dl_load_cache_lookup (const char *name)
202-{
203- int left, right, middle;
204- int cmpres;
205- const char *cache_data;
206- uint32_t cache_data_size;
207- const char *best;
208-
209- /* Print a message if the loading of libs is traced. */
210- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
211- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
212-
213- if (cache == NULL)
214- {
215- /* Read the contents of the file. */
216- void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
217- PROT_READ);
218-
219- /* We can handle three different cache file formats here:
220- - the old libc5/glibc2.0/2.1 format
221- - the old format with the new format in it
222- - only the new format
223- The following checks if the cache contains any of these formats. */
224- if (file != MAP_FAILED && cachesize > sizeof *cache
225- && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0)
226- {
227- size_t offset;
228- /* Looks ok. */
229- cache = file;
230-
231- /* Check for new version. */
232- offset = ALIGN_CACHE (sizeof (struct cache_file)
233- + cache->nlibs * sizeof (struct file_entry));
234-
235- cache_new = (struct cache_file_new *) ((void *) cache + offset);
236- if (cachesize < (offset + sizeof (struct cache_file_new))
237- || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW,
238- sizeof CACHEMAGIC_VERSION_NEW - 1) != 0)
239- cache_new = (void *) -1;
240- }
241- else if (file != MAP_FAILED && cachesize > sizeof *cache_new
242- && memcmp (file, CACHEMAGIC_VERSION_NEW,
243- sizeof CACHEMAGIC_VERSION_NEW - 1) == 0)
244- {
245- cache_new = file;
246- cache = file;
247- }
248- else
249- {
250- if (file != MAP_FAILED)
251- __munmap (file, cachesize);
252- cache = (void *) -1;
253- }
254-
255- assert (cache != NULL);
256- }
257-
258- if (cache == (void *) -1)
259- /* Previously looked for the cache file and didn't find it. */
260- return NULL;
261-
262- best = NULL;
263-
264- if (cache_new != (void *) -1)
265- {
266- uint64_t platform;
267-
268- /* This is where the strings start. */
269- cache_data = (const char *) cache_new;
270-
271- /* Now we can compute how large the string table is. */
272- cache_data_size = (const char *) cache + cachesize - cache_data;
273-
274- platform = _dl_string_platform (GLRO(dl_platform));
275- if (platform != (uint64_t) -1)
276- platform = 1ULL << platform;
277-
278-#define _DL_HWCAP_TLS_MASK (1LL << 63)
279- uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask))
280- | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
281-
282- /* Only accept hwcap if it's for the right platform. */
283-#define HWCAP_CHECK \
284- if (lib->hwcap & hwcap_exclude) \
285- continue; \
286- if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \
287- continue; \
288- if (_DL_PLATFORMS_COUNT \
289- && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \
290- && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \
291- continue
292- SEARCH_CACHE (cache_new);
293- }
294- else
295- {
296- /* This is where the strings start. */
297- cache_data = (const char *) &cache->libs[cache->nlibs];
298-
299- /* Now we can compute how large the string table is. */
300- cache_data_size = (const char *) cache + cachesize - cache_data;
301-
302-#undef HWCAP_CHECK
303-#define HWCAP_CHECK do {} while (0)
304- SEARCH_CACHE (cache);
305- }
306-
307- /* Print our result if wanted. */
308- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)
309- && best != NULL)
310- _dl_debug_printf (" trying file=%s\n", best);
311-
312- return best;
313-}
314-
315-#ifndef MAP_COPY
316-/* If the system does not support MAP_COPY we cannot leave the file open
317- all the time since this would create problems when the file is replaced.
318- Therefore we provide this function to close the file and open it again
319- once needed. */
320-void
321-_dl_unload_cache (void)
322-{
323- if (cache != NULL && cache != (struct cache_file *) -1)
324- {
325- __munmap (cache, cachesize);
326- cache = NULL;
327- }
328-}
329-#endif
330Index: ldconfig-native-2.12.1/dl-cache.h
331===================================================================
332--- ldconfig-native-2.12.1.orig/dl-cache.h
333+++ ldconfig-native-2.12.1/dl-cache.h
334@@ -101,5 +101,4 @@ struct cache_file_new
335 (((addr) + __alignof__ (struct cache_file_new) -1) \
336 & (~(__alignof__ (struct cache_file_new) - 1)))
337
338-extern int _dl_cache_libcmp (const char *p1, const char *p2)
339- internal_function;
340+extern int _dl_cache_libcmp (const char *p1, const char *p2);
341Index: ldconfig-native-2.12.1/ldconfig.c
342===================================================================
343--- ldconfig-native-2.12.1.orig/ldconfig.c
344+++ ldconfig-native-2.12.1/ldconfig.c
345@@ -16,6 +16,9 @@
346 along with this program; if not, write to the Free Software Foundation,
347 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
348
349+#define _LARGEFILE64_SOURCE
350+#define _GNU_SOURCE
351+
352 #define PROCINFO_CLASS static
353 #include <alloca.h>
354 #include <argp.h>
355@@ -39,10 +42,20 @@
356 #include <glob.h>
357 #include <libgen.h>
358
359-#include <ldconfig.h>
360-#include <dl-cache.h>
361+#include "ldconfig.h"
362+#include "dl-cache.h"
363+
364+#include "dl-procinfo.h"
365+
366+#include "argp.h"
367+
368+
369+#define SYSCONFDIR "/etc"
370+#define LIBDIR "/usr/lib"
371+#define SLIBDIR "/lib"
372+# define N_(msgid) msgid
373+#define _(msg) msg
374
375-#include <dl-procinfo.h>
376
377 #ifdef _DL_FIRST_PLATFORM
378 # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
379@@ -55,7 +68,7 @@
380 #endif
381
382 /* Get libc version number. */
383-#include <version.h>
384+#include "version.h"
385
386 #define PACKAGE _libc_intl_domainname
387
388@@ -152,8 +165,8 @@ static const struct argp_option options[
389 { NULL, 0, NULL, 0, NULL, 0 }
390 };
391
392-#define PROCINFO_CLASS static
393-#include <dl-procinfo.c>
394+//#define PROCINFO_CLASS static
395+//#include <dl-procinfo.c>
396
397 /* Short description of program. */
398 static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.");
399@@ -291,6 +304,7 @@ parse_opt (int key, char *arg, struct ar
400 return 0;
401 }
402
403+#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org"
404 /* Print bug-reporting information in the help message. */
405 static char *
406 more_help (int key, const char *text, void *input)
407@@ -315,7 +329,7 @@ For bug reporting instructions, please s
408 static void
409 print_version (FILE *stream, struct argp_state *state)
410 {
411- fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION);
412+ fprintf (stream, "ldconfig (Hacked Poky Version)\n");
413 fprintf (stream, gettext ("\
414 Copyright (C) %s Free Software Foundation, Inc.\n\
415 This is free software; see the source for copying conditions. There is NO\n\
416@@ -1233,6 +1247,7 @@ set_hwcap (void)
417 hwcap_mask = strtoul (mask, NULL, 0);
418 }
419
420+const char _libc_intl_domainname[] = "libc";
421
422 int
423 main (int argc, char **argv)
424Index: ldconfig-native-2.12.1/readlib.c
425===================================================================
426--- ldconfig-native-2.12.1.orig/readlib.c
427+++ ldconfig-native-2.12.1/readlib.c
428@@ -22,6 +22,9 @@
429 development version. Besides the simplification, it has also been
430 modified to read some other file formats. */
431
432+#define _LARGEFILE64_SOURCE
433+#define _GNU_SOURCE
434+
435 #include <a.out.h>
436 #include <elf.h>
437 #include <error.h>
438@@ -35,7 +38,9 @@
439 #include <sys/stat.h>
440 #include <gnu/lib-names.h>
441
442-#include <ldconfig.h>
443+#include "ldconfig.h"
444+
445+#define _(msg) msg
446
447 #define Elf32_CLASS ELFCLASS32
448 #define Elf64_CLASS ELFCLASS64
449Index: ldconfig-native-2.12.1/xstrdup.c
450===================================================================
451--- ldconfig-native-2.12.1.orig/xstrdup.c
452+++ ldconfig-native-2.12.1/xstrdup.c
453@@ -16,15 +16,10 @@
454 along with this program; if not, write to the Free Software Foundation,
455 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
456
457-#ifdef HAVE_CONFIG_H
458-# include <config.h>
459-#endif
460+#define _GNU_SOURCE
461+
462+#include <string.h>
463
464-#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC
465-# include <string.h>
466-#else
467-# include <strings.h>
468-#endif
469 void *xmalloc (size_t n) __THROW;
470 char *xstrdup (char *string) __THROW;
471
diff --git a/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
new file mode 100644
index 0000000000..27bc411078
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
@@ -0,0 +1,36 @@
1Upstream-Status: Pending
2
3Coming from this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11149
4
5Nitin A Kamble <nitin.a.kamble@intel.com>2011/03/29
6
7--- ldconfig-native-2.12.1.orig/ldconfig.c
8+++ ldconfig-native-2.12.1/ldconfig.c
9@@ -1359,14 +1359,9 @@ main (int argc, char **argv)
10
11 const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
12 if (opt_chroot)
13- {
14- aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
15- if (aux_cache_file == NULL)
16- error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
17- _PATH_LDCONFIG_AUX_CACHE);
18- }
19+ aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
20
21- if (! opt_ignore_aux_cache)
22+ if (! opt_ignore_aux_cache && aux_cache_file)
23 load_aux_cache (aux_cache_file);
24 else
25 init_aux_cache ();
26@@ -1376,7 +1371,8 @@ main (int argc, char **argv)
27 if (opt_build_cache)
28 {
29 save_cache (cache_file);
30- save_aux_cache (aux_cache_file);
31+ if (aux_cache_file)
32+ save_aux_cache (aux_cache_file);
33 }
34
35 return 0;
36
diff --git a/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb b/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb
new file mode 100644
index 0000000000..d7bc4446a8
--- /dev/null
+++ b/meta/recipes-core/eglibc/ldconfig-native_2.12.1.bb
@@ -0,0 +1,30 @@
1SUMMARY = "A standalone native ldconfig build"
2
3LICENSE = "GPLv2+"
4
5LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399"
6
7SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \
8 file://ldconfig.patch \
9 file://ldconfig_aux-cache_path_fix.patch \
10 file://32and64bit.patch \
11 file://endian-ness_handling.patch \
12 file://flag_fix.patch \
13 file://endianess-header.patch"
14
15PR = "r2"
16
17FILESPATH = "${FILE_DIRNAME}/${PN}-${PV}/"
18
19inherit native
20
21S = "${WORKDIR}/${PN}-${PV}"
22
23do_compile () {
24 $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig
25}
26
27do_install () {
28 install -d ${D}/${bindir}/
29 install ldconfig ${D}/${bindir}/
30}
diff --git a/meta/recipes-core/eglibc/site_config/funcs b/meta/recipes-core/eglibc/site_config/funcs
new file mode 100644
index 0000000000..ccc85392d7
--- /dev/null
+++ b/meta/recipes-core/eglibc/site_config/funcs
@@ -0,0 +1,474 @@
1a64l
2abs
3access
4__adjtimex
5alarm
6alphasort
7argz_append
8__argz_count
9argz_create_sep
10argz_insert
11__argz_next
12argz_next
13__argz_stringify
14argz_stringify
15asprintf
16atexit
17atof
18atoi
19bcmp
20bcopy
21bindresvport
22bind_textdomain_codeset
23btowc
24bzero
25calloc
26canonicalize_file_name
27catgets
28cfgetospeed
29cfsetispeed
30cfsetspeed
31chmod
32chown
33chroot
34clock
35close
36closedir
37closelog
38confstr
39connect
40daemon
41dcgettext
42difftime
43dirfd
44dirname
45dngettext
46dup2
47ecvt
48endgrent
49endmntent
50endpwent
51endutent
52endutxent
53epoll_ctl
54err
55ether_hostton
56ether_ntohost
57euidaccess
58execv
59fchdir
60fchmod
61fchmodat
62fchown
63fchownat
64fcntl
65fcvt
66fdatasync
67fdopendir
68feof_unlocked
69fgets_unlocked
70fgetxattr
71finite
72flistxattr
73flock
74flockfile
75fnmatch
76fork
77fpathconf
78__fpending
79fprintf
80free
81freeaddrinfo
82freeifaddrs
83fseeko
84__fsetlocking
85fsetxattr
86fstat64
87fstat
88fstatfs
89fsync
90ftello
91ftime
92ftruncate
93funlockfile
94futimes
95futimesat
96gai_strerror
97gcvt
98getaddrinfo
99getc_unlocked
100getcwd
101getdelim
102getdomainname
103getdtablesize
104getegid
105getenv
106geteuid
107getgid
108getgrent
109getgrent_r
110getgrgid_r
111getgrnam
112getgrnam_r
113getgrouplist
114getgroups
115gethostbyaddr_r
116gethostbyname2
117gethostbyname
118gethostbyname_r
119gethostent
120gethostid
121gethostname
122getifaddrs
123getline
124getloadavg
125getmntent
126getmsg
127getnameinfo
128getnetbyaddr_r
129getnetgrent_r
130getopt
131getopt_long
132getopt_long_only
133getpagesize
134getpass
135getpeername
136getpgrp
137getpid
138getppid
139getprotoent_r
140getpwent
141getpwent_r
142getpwnam
143getpwnam_r
144getpwuid
145getpwuid_r
146getresuid
147getrlimit
148getrusage
149getservbyname
150getservbyname_r
151getservbyport_r
152getservent
153getservent_r
154getspnam
155getspnam_r
156gettimeofday
157getttyent
158getttynam
159getuid
160getusershell
161getutent
162getutid
163getutline
164getutmp
165getutmpx
166getutxent
167getutxid
168getutxline
169getwd
170getxattr
171glob
172gmtime
173gmtime_r
174grantpt
175group_member
176herror
177hstrerror
178iconv
179iconv_open
180if_freenameindex
181if_indextoname
182if_nameindex
183if_nametoindex
184index
185inet_addr
186inet_aton
187inet_ntoa
188inet_ntop
189inet_pton
190initgroups
191innetgr
192iruserok
193isascii
194isatty
195isblank
196isgraph
197isinf
198isnan
199isprint
200isspace
201iswalnum
202iswcntrl
203iswctype
204iswprint
205iswspace
206iswupper
207isxdigit
208kill
209killpg
210lchown
211lckpwdf
212lgetxattr
213link
214listxattr
215llistxattr
216localtime
217localtime_r
218lockf
219lrand48
220lsearch
221lseek64
222lsetxattr
223lstat
224mallinfo
225malloc
226mblen
227mbrlen
228mbrtowc
229mbsinit
230mbsrtowcs
231mbtowc
232memalign
233memchr
234memcmp
235memcpy
236memmove
237mempcpy
238memrchr
239memset
240mkdir
241mkdirat
242mkdtemp
243mkfifo
244mknod
245mkstemp64
246mkstemp
247mktime
248mlock
249mmap
250mtrace
251munlock
252munmap
253nanosleep
254nice
255nl_langinfo
256ntp_adjtime
257ntp_gettime
258_obstack_free
259on_exit
260open64
261open
262openat
263opendir
264openlog
265pathconf
266pipe
267poll
268popen
269posix_memalign
270prctl
271pread
272printf
273__progname
274pselect
275pthread_mutex_lock
276ptsname
277putenv
278putgrent
279putpwent
280putspent
281pututline
282pututxline
283putwc
284pwrite
285qsort
286raise
287rand
288random
289rand_r
290read
291readdir
292readdir_r
293readlink
294realloc
295realpath
296re_comp
297recvmsg
298re_exec
299regcomp
300regexec
301remove
302rename
303re_search
304rmdir
305rpmatch
306rresvport_af
307ruserok
308ruserok_af
309sbrk
310scandir
311sched_setscheduler
312sched_yield
313__secure_getenv
314select
315semctl
316semget
317sendmsg
318setbuf
319setbuffer
320setegid
321setenv
322seteuid
323setgid
324setgroups
325sethostname
326setitimer
327_setjmp
328setjmp
329setlinebuf
330setlocale
331setmntent
332setpgid
333setpgrp
334setpriority
335setregid
336setresgid
337setresuid
338setreuid
339setrlimit
340setsid
341setsockopt
342settimeofday
343setuid
344setutent
345setutxent
346setvbuf
347setxattr
348sgetspent
349shmat
350shmctl
351shmdt
352shmget
353shutdown
354sigaction
355sigaddset
356sigaltstack
357sigblock
358sigemptyset
359sighold
360siginterrupt
361signal
362sigprocmask
363sigset
364sigsetmask
365sigstack
366sigsuspend
367sigvec
368snprintf
369socket
370socketpair
371sprintf
372srand48
373srand
374srandom
375sscanf
376stat
377statfs
378statvfs
379stime
380stpcpy
381strcasecmp
382strcasestr
383strchr
384strchrnul
385strcmp
386strcspn
387strdup
388strerror
389strerror_r
390strftime
391strlen
392strncasecmp
393strncmp
394strndup
395strnlen
396strpbrk
397strptime
398strrchr
399strsep
400strsignal
401strspn
402strstr
403strtod
404strtoimax
405strtok_r
406strtol
407strtoll
408strtoul
409strtoull
410strtoumax
411strverscmp
412strxfrm
413symlink
414sync
415sysconf
416sysctl
417sysinfo
418syslog
419_sys_siglist
420sys_siglist
421system
422tcgetattr
423tcgetpgrp
424tcsetattr
425tcsetpgrp
426time
427timegm
428times
429timezone
430tmpnam
431towlower
432towupper
433truncate
434tsearch
435ttyname
436tzset
437ulimit
438umask
439uname
440unlink
441unsetenv
442unshare
443updwtmp
444updwtmpx
445usleep
446ustat
447utime
448utimes
449utmpname
450utmpxname
451valloc
452vasprintf
453verrx
454vfork
455vfprintf
456vfscanf
457vhangup
458vprintf
459vsnprintf
460vsprintf
461wait3
462wait4
463waitpid
464wcrtomb
465wcscoll
466wcsdup
467wcslen
468wctob
469wctomb
470wctype
471wcwidth
472wmemchr
473wmemcpy
474wmempcpy
diff --git a/meta/recipes-core/eglibc/site_config/headers b/meta/recipes-core/eglibc/site_config/headers
new file mode 100644
index 0000000000..609ab53797
--- /dev/null
+++ b/meta/recipes-core/eglibc/site_config/headers
@@ -0,0 +1,156 @@
1aio.h
2alloca.h
3argz.h
4arpa/inet.h
5arpa/nameser.h
6asm/byteorder.h
7asm/ioctls.h
8asm/page.h
9asm/types.h
10assert.h
11byteswap.h
12crypt.h
13ctype.h
14dirent.h
15dlfcn.h
16elf.h
17endian.h
18err.h
19errno.h
20execinfo.h
21fcntl.h
22features.h
23float.h
24fstab.h
25ftw.h
26getopt.h
27glob.h
28grp.h
29iconv.h
30ifaddrs.h
31inttypes.h
32langinfo.h
33lastlog.h
34libgen.h
35libintl.h
36limits.h
37linux/capability.h
38linux/fd.h
39linux/fs.h
40linux/hayesesp.h
41linux/hdreg.h
42linux/icmp.h
43linux/in6.h
44linux/joystick.h
45linux/ptrace.h
46linux/serial.h
47linux/sonypi.h
48linux/unistd.h
49linux/utsname.h
50linux/version.h
51locale.h
52malloc.h
53math.h
54mcheck.h
55memory.h
56mntent.h
57mqueue.h
58netdb.h
59net/if.h
60netinet/ether.h
61netinet/in.h
62netinet/ip6.h
63netinet/ip.h
64netinet/tcp.h
65netinet/udp.h
66netipx/ipx.h
67net/route.h
68paths.h
69poll.h
70pthread.h
71pty.h
72pwd.h
73regex.h
74resolv.h
75rpc/rpc.h
76rpc/types.h
77sched.h
78scsi/scsi.h
79search.h
80semaphore.h
81setjmp.h
82sgtty.h
83shadow.h
84signal.h
85stdarg.h
86stdbool.h
87stdc
88stddef.h
89stdint.h
90stdio.h
91stdlib.h
92string.h
93strings.h
94stropts.h
95sys/bitypes.h
96sys/cdefs.h
97sys/dir.h
98sys/epoll.h
99sysexits.h
100sys/fcntl.h
101sys/file.h
102sys/fsuid.h
103sys/ioctl.h
104sys/ipc.h
105syslog.h
106sys/mman.h
107sys/mount.h
108sys/mtio.h
109sys/param.h
110sys/poll.h
111sys/prctl.h
112sys/ptrace.h
113sys/queue.h
114sys/reg.h
115sys/resource.h
116sys/select.h
117sys/sem.h
118sys/shm.h
119sys/signal.h
120sys/socket.h
121sys/socketvar.h
122sys/soundcard.h
123sys/statfs.h
124sys/stat.h
125sys/statvfs.h
126sys/stropts.h
127sys/swap.h
128sys/sysctl.h
129sys/sysinfo.h
130sys/sysmacros.h
131sys/termios.h
132sys/timeb.h
133sys/time.h
134sys/times.h
135sys/timex.h
136sys/types.h
137sys/uio.h
138sys/un.h
139sys/unistd.h
140sys/user.h
141sys/utsname.h
142sys/vfs.h
143sys/wait.h
144termio.h
145termios.h
146time.h
147ttyent.h
148ulimit.h
149unistd.h
150ustat.h
151utime.h
152utmp.h
153utmpx.h
154values.h
155wchar.h
156wctype.h
diff --git a/meta/recipes-core/eglibc/site_config/types b/meta/recipes-core/eglibc/site_config/types
new file mode 100644
index 0000000000..178bd85a00
--- /dev/null
+++ b/meta/recipes-core/eglibc/site_config/types
@@ -0,0 +1,21 @@
1char
2char *
3double
4float
5int
6long
7long double
8long int
9long long
10long long int
11short
12short int
13signed char
14unsigned char
15unsigned int
16unsigned long
17unsigned long int
18unsigned long long int
19unsigned short
20unsigned short int
21void *
diff --git a/meta/recipes-core/expat/expat-2.1.0/autotools.patch b/meta/recipes-core/expat/expat-2.1.0/autotools.patch
new file mode 100644
index 0000000000..0e599697a6
--- /dev/null
+++ b/meta/recipes-core/expat/expat-2.1.0/autotools.patch
@@ -0,0 +1,24 @@
1Avoid using expat's m4 files
2
3Upstream-Status: Inappropriate [Other]
4Workaround specific to our build system.
5
6Signed-off-by: Kevin Tian <kevin.tian@intel.com>
7Signed-off-by: Scott Garman <scott.a.garman@intel.com>
8
9Updated to apply over expat 2.1.0
10
11Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
12
13diff -Nurd expat-2.1.0/configure.in expat-2.1.0/configure.in
14--- expat-2.1.0/configure.in 2012-03-04 01:45:53.000000000 +0200
15+++ expat-2.1.0/configure.in 2012-05-10 21:04:44.000000000 +0300
16@@ -51,8 +51,6 @@
17
18 AC_CONFIG_HEADER(expat_config.h)
19
20-sinclude(conftools/ac_c_bigendian_cross.m4)
21-
22 AC_LIBTOOL_WIN32_DLL
23 AC_PROG_LIBTOOL
24
diff --git a/meta/recipes-core/expat/expat.inc b/meta/recipes-core/expat/expat.inc
new file mode 100644
index 0000000000..6dfafe94d2
--- /dev/null
+++ b/meta/recipes-core/expat/expat.inc
@@ -0,0 +1,20 @@
1SUMMARY = "A stream-oriented XML parser library"
2DESCRIPTION = "Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags)"
3HOMEPAGE = "http://expat.sourceforge.net/"
4SECTION = "libs"
5LICENSE = "MIT"
6
7SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.gz \
8 file://autotools.patch"
9
10inherit autotools lib_package gzipnative
11
12# This package uses an archive format known to have issue with some
13# versions of gzip
14do_unpack[depends] += "gzip-native:do_populate_sysroot"
15
16do_configure_prepend () {
17 rm -f ${S}/conftools/libtool.m4
18}
19
20BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/expat/expat_2.1.0.bb b/meta/recipes-core/expat/expat_2.1.0.bb
new file mode 100644
index 0000000000..b958742edc
--- /dev/null
+++ b/meta/recipes-core/expat/expat_2.1.0.bb
@@ -0,0 +1,5 @@
1require expat.inc
2LIC_FILES_CHKSUM = "file://COPYING;md5=1b71f681713d1256e1c23b0890920874"
3
4SRC_URI[md5sum] = "dd7dab7a5fea97d2a6a43f511449b7cd"
5SRC_URI[sha256sum] = "823705472f816df21c8f6aa026dd162b280806838bb55b3432b0fb1fcca7eb86"
diff --git a/meta/recipes-core/feed-config/poky-feed-config-opkg_1.0.bb b/meta/recipes-core/feed-config/poky-feed-config-opkg_1.0.bb
new file mode 100644
index 0000000000..fb312f8151
--- /dev/null
+++ b/meta/recipes-core/feed-config/poky-feed-config-opkg_1.0.bb
@@ -0,0 +1,44 @@
1SUMMARY = "Poky example feed configuration"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4PR = "r2"
5PACKAGE_ARCH = "${MACHINE_ARCH}"
6INHIBIT_DEFAULT_DEPS = "1"
7
8#FEEDNAMEPREFIX ?= "INVALID"
9#FEEDURIPREFIX ?= "INVALID"
10
11do_compile() {
12 mkdir -p ${S}/${sysconfdir}/opkg/
13
14 archconf=${S}/${sysconfdir}/opkg/arch.conf
15
16 rm -f $archconf
17 ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS}"
18 priority=1
19 for arch in $ipkgarchs; do
20 echo "arch $arch $priority" >> $archconf
21 priority=$(expr $priority + 5)
22 done
23
24 basefeedconf=${S}/${sysconfdir}/opkg/base-feeds.conf
25
26 rm -f $basefeedconf
27 touch $basefeedconf
28
29 #for arch in $ipkgarchs; do
30 # echo "src/gz ${FEEDNAMEPREFIX}-$arch http://pokylinux.org/${FEEDURIPREFIX}$arch" >> $basefeedconf
31 #done
32}
33
34
35do_install () {
36 install -d ${D}${sysconfdir}/opkg
37 install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
38}
39
40FILES_${PN} = "${sysconfdir}/opkg/ "
41
42CONFFILES_${PN} += "${sysconfdir}/opkg/base-feeds.conf \
43 ${sysconfdir}/opkg/arch.conf"
44
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch b/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
new file mode 100644
index 0000000000..e4c5f1566b
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
@@ -0,0 +1,39 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8Index: gettext-0.16.1/gettext-tools/configure.ac
9===================================================================
10--- gettext-0.16.1.orig/gettext-tools/configure.ac 2006-11-27 09:02:01.000000000 -0800
11+++ gettext-0.16.1/gettext-tools/configure.ac 2011-03-16 16:55:36.111396557 -0700
12@@ -36,27 +36,15 @@
13 gt_JAVA_CHOICE
14
15 gt_GCJ
16-if test -n "$HAVE_GCJ" && test "$JAVA_CHOICE" = yes; then
17- BUILDJAVAEXE=yes
18-else
19 BUILDJAVAEXE=no
20-fi
21 AC_SUBST(BUILDJAVAEXE)
22
23 gt_JAVAEXEC
24 gt_JAVACOMP([1.3])
25 AC_CHECK_PROG(JAR, jar, jar)
26-if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
27- BUILDJAVA=yes
28-else
29 BUILDJAVA=no
30-fi
31 AC_SUBST(BUILDJAVA)
32-if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then
33- TESTJAVA=yes
34-else
35 TESTJAVA=no
36-fi
37 AC_SUBST(TESTJAVA)
38
39 gt_CSHARPCOMP
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch b/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
new file mode 100644
index 0000000000..7293f5b08d
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
@@ -0,0 +1,110 @@
1
2This patch updates the required version number from 2.61 to the
3current 2.65 version of aclocal, this will need to be updated
4when we update aclocal
5
6Upstream-Status: Inappropriate [configuration]
7
8Signed-off-by Saul Wold <sgw@linux.intel.com>
9
10Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
11===================================================================
12--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4 2011-03-17 02:24:36.391519775 -0700
13+++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 2011-03-17 02:24:45.569526073 -0700
14@@ -148,7 +148,7 @@
15 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
16 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
17 dnl Autoconf >= 2.61 supports dots in --with options.
18- define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
19+ define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.65]),[-1],[translit([$1],[.],[_])],[$1])])
20 dnl By default, look in $includedir and $libdir.
21 use_additional=yes
22 AC_LIB_WITH_FINAL_PREFIX([
23Index: gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4
24===================================================================
25--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathly/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
26+++ gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4 2011-03-17 02:24:45.570526904 -0700
27@@ -11,8 +11,8 @@
28 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
29 # PARTICULAR PURPOSE.
30
31-m4_if(m4_PACKAGE_VERSION, [2.61],,
32-[m4_fatal([this file was generated for autoconf 2.61.
33+m4_if(m4_PACKAGE_VERSION, [2.65],,
34+[m4_fatal([this file was generated for autoconf 2.65.
35 You have another version of autoconf. If you want to use that,
36 you should regenerate the build system entirely.], [63])])
37
38Index: gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4
39===================================================================
40--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathx/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
41+++ gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4 2011-03-17 02:24:45.572525773 -0700
42@@ -11,8 +11,8 @@
43 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
44 # PARTICULAR PURPOSE.
45
46-m4_if(m4_PACKAGE_VERSION, [2.61],,
47-[m4_fatal([this file was generated for autoconf 2.61.
48+m4_if(m4_PACKAGE_VERSION, [2.65],,
49+[m4_fatal([this file was generated for autoconf 2.65.
50 You have another version of autoconf. If you want to use that,
51 you should regenerate the build system entirely.], [63])])
52
53Index: gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4
54===================================================================
55--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathy/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
56+++ gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4 2011-03-17 02:24:45.578394916 -0700
57@@ -11,7 +11,7 @@
58 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
59 # PARTICULAR PURPOSE.
60
61-m4_if(m4_PACKAGE_VERSION, [2.61],,
62+m4_if(m4_PACKAGE_VERSION, [2.65],,
63 [m4_fatal([this file was generated for autoconf 2.61.
64 You have another version of autoconf. If you want to use that,
65 you should regenerate the build system entirely.], [63])])
66Index: gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4
67===================================================================
68--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathz/aclocal.m4 2011-03-17 02:24:36.391519775 -0700
69+++ gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4 2011-03-17 02:24:45.586395416 -0700
70@@ -11,8 +11,8 @@
71 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
72 # PARTICULAR PURPOSE.
73
74-m4_if(m4_PACKAGE_VERSION, [2.61],,
75-[m4_fatal([this file was generated for autoconf 2.61.
76+m4_if(m4_PACKAGE_VERSION, [2.65],,
77+[m4_fatal([this file was generated for autoconf 2.65.
78 You have another version of autoconf. If you want to use that,
79 you should regenerate the build system entirely.], [63])])
80
81Index: gettext-0.16.1/gettext-tools/aclocal.m4
82===================================================================
83--- gettext-0.16.1.orig/gettext-tools/aclocal.m4 2006-11-27 09:34:32.000000000 -0800
84+++ gettext-0.16.1/gettext-tools/aclocal.m4 2011-03-17 02:27:01.135682807 -0700
85@@ -11,8 +11,8 @@
86 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
87 # PARTICULAR PURPOSE.
88
89-m4_if(m4_PACKAGE_VERSION, [2.61],,
90-[m4_fatal([this file was generated for autoconf 2.61.
91+m4_if(m4_PACKAGE_VERSION, [2.65],,
92+[m4_fatal([this file was generated for autoconf 2.65.
93 You have another version of autoconf. If you want to use that,
94 you should regenerate the build system entirely.], [63])])
95
96Index: gettext-0.16.1/gettext-tools/examples/aclocal.m4
97===================================================================
98--- gettext-0.16.1.orig/gettext-tools/examples/aclocal.m4 2006-11-27 09:16:23.000000000 -0800
99+++ gettext-0.16.1/gettext-tools/examples/aclocal.m4 2011-03-17 02:26:52.589396683 -0700
100@@ -11,8 +11,8 @@
101 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
102 # PARTICULAR PURPOSE.
103
104-m4_if(m4_PACKAGE_VERSION, [2.61],,
105-[m4_fatal([this file was generated for autoconf 2.61.
106+m4_if(m4_PACKAGE_VERSION, [2.65],,
107+[m4_fatal([this file was generated for autoconf 2.65.
108 You have another version of autoconf. If you want to use that,
109 you should regenerate the build system entirely.], [63])])
110
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch b/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
new file mode 100644
index 0000000000..06861492c0
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
@@ -0,0 +1,348 @@
1
2This patch removes the circular dependency on AC_GNU_SOURCE in
3AC_USE_SYSTEM_EXTENSIONS.
4
5Thanks to Mark Hatle for the timely pointers and fixes.
6
7Upstream-Status: Inappropriate [licensing]
8
9Signed-off-by Saul Wold <sgw@linux.intel.com>
10
11diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 gettext.patched/gettext-runtime/gnulib-m4/extensions.m4
12--- gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 2006-11-27 09:14:38.000000000 -0800
13+++ gettext.patched/gettext-runtime/gnulib-m4/extensions.m4 2011-03-16 23:54:01.711923448 -0700
14@@ -16,43 +16,47 @@
15 # ------------------------
16 # Enable extensions on systems that normally disable them,
17 # typically due to standards-conformance issues.
18-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
19-[
20- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
21- AC_BEFORE([$0], [AC_RUN_IFELSE])
22-
23- AC_REQUIRE([AC_GNU_SOURCE])
24- AC_REQUIRE([AC_AIX])
25- AC_REQUIRE([AC_MINIX])
26-
27- AH_VERBATIM([__EXTENSIONS__],
28-[/* Enable extensions on Solaris. */
29-#ifndef __EXTENSIONS__
30-# undef __EXTENSIONS__
31-#endif
32-#ifndef _POSIX_PTHREAD_SEMANTICS
33-# undef _POSIX_PTHREAD_SEMANTICS
34-#endif
35-#ifndef _TANDEM_SOURCE
36-# undef _TANDEM_SOURCE
37-#endif])
38- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
39- [ac_cv_safe_to_define___extensions__],
40- [AC_COMPILE_IFELSE(
41- [AC_LANG_PROGRAM([
42-# define __EXTENSIONS__ 1
43- AC_INCLUDES_DEFAULT])],
44- [ac_cv_safe_to_define___extensions__=yes],
45- [ac_cv_safe_to_define___extensions__=no])])
46- test $ac_cv_safe_to_define___extensions__ = yes &&
47- AC_DEFINE([__EXTENSIONS__])
48- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
49- AC_DEFINE([_TANDEM_SOURCE])
50-])
51+#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
52+#[
53+# AC_BEFORE([$0], [AC_COMPILE_IFELSE])
54+# AC_BEFORE([$0], [AC_RUN_IFELSE])
55+#
56+# AC_REQUIRE([AC_GNU_SOURCE])
57+# AC_REQUIRE([AC_AIX])
58+# AC_REQUIRE([AC_MINIX])
59+#
60+# AH_VERBATIM([__EXTENSIONS__],
61+#[/* Enable extensions on Solaris. */
62+##ifndef __EXTENSIONS__
63+## undef __EXTENSIONS__
64+##endif
65+##ifndef _POSIX_PTHREAD_SEMANTICS
66+## undef _POSIX_PTHREAD_SEMANTICS
67+##endif
68+##ifndef _TANDEM_SOURCE
69+## undef _TANDEM_SOURCE
70+##endif])
71+# AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
72+# [ac_cv_safe_to_define___extensions__],
73+# [AC_COMPILE_IFELSE(
74+# [AC_LANG_PROGRAM([
75+## define __EXTENSIONS__ 1
76+# AC_INCLUDES_DEFAULT])],
77+# [ac_cv_safe_to_define___extensions__=yes],
78+# [ac_cv_safe_to_define___extensions__=no])])
79+# test $ac_cv_safe_to_define___extensions__ = yes &&
80+# AC_DEFINE([__EXTENSIONS__])
81+# AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
82+# AC_DEFINE([_TANDEM_SOURCE])
83+#])
84
85 # gl_USE_SYSTEM_EXTENSIONS
86 # ------------------------
87 # Enable extensions on systems that normally disable them,
88 # typically due to standards-conformance issues.
89 AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
90- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
91+[
92+ AC_REQUIRE([AC_GNU_SOURCE])
93+
94+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
95+])
96diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4
97--- gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:19.000000000 -0800
98+++ gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4 2011-03-16 23:50:17.471531838 -0700
99@@ -25,7 +25,7 @@
100 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
101 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
102 AC_REQUIRE([AC_PROG_RANLIB])
103- AC_REQUIRE([AC_GNU_SOURCE])
104+ dnl AC_REQUIRE([AC_GNU_SOURCE])
105 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
106 ])
107
108diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4
109--- gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 2006-11-27 09:14:38.000000000 -0800
110+++ gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4 2011-03-16 23:50:10.814396529 -0700
111@@ -9,7 +9,7 @@
112
113 AC_DEFUN([gl_MBCHAR],
114 [
115- AC_REQUIRE([AC_GNU_SOURCE])
116+ dnl AC_REQUIRE([AC_GNU_SOURCE])
117 dnl The following line is that so the user can test HAVE_WCHAR_H
118 dnl before #include "mbchar.h".
119 AC_CHECK_HEADERS_ONCE([wchar.h])
120diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4
121--- gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 2006-11-27 09:14:38.000000000 -0800
122+++ gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4 2011-03-16 23:50:08.357396247 -0700
123@@ -7,7 +7,7 @@
124 AC_DEFUN([gl_FUNC_WCWIDTH],
125 [
126 dnl Persuade glibc <wchar.h> to declare wcwidth().
127- AC_REQUIRE([AC_GNU_SOURCE])
128+ dnl AC_REQUIRE([AC_GNU_SOURCE])
129
130 AC_REQUIRE([AC_C_INLINE])
131 AC_REQUIRE([gt_TYPE_WCHAR_T])
132diff -ru gettext-0.16.1/gettext-runtime/m4/lock.m4 gettext.patched/gettext-runtime/m4/lock.m4
133--- gettext-0.16.1/gettext-runtime/m4/lock.m4 2006-10-24 13:59:59.000000000 -0700
134+++ gettext.patched/gettext-runtime/m4/lock.m4 2011-03-16 23:50:04.355891676 -0700
135@@ -35,7 +35,7 @@
136 AC_BEFORE([$0], [gl_ARGP])dnl
137
138 AC_REQUIRE([AC_CANONICAL_HOST])
139- AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
140+ dnl AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
141 dnl Check for multithreading.
142 AC_ARG_ENABLE(threads,
143 AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
144diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 gettext.patched/gettext-tools/gnulib-m4/extensions.m4
145--- gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 2006-11-27 09:14:54.000000000 -0800
146+++ gettext.patched/gettext-tools/gnulib-m4/extensions.m4 2011-03-16 23:53:28.487671266 -0700
147@@ -16,43 +16,47 @@
148 # ------------------------
149 # Enable extensions on systems that normally disable them,
150 # typically due to standards-conformance issues.
151-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
152-[
153- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
154- AC_BEFORE([$0], [AC_RUN_IFELSE])
155-
156- AC_REQUIRE([AC_GNU_SOURCE])
157- AC_REQUIRE([AC_AIX])
158- AC_REQUIRE([AC_MINIX])
159-
160- AH_VERBATIM([__EXTENSIONS__],
161-[/* Enable extensions on Solaris. */
162-#ifndef __EXTENSIONS__
163-# undef __EXTENSIONS__
164-#endif
165-#ifndef _POSIX_PTHREAD_SEMANTICS
166-# undef _POSIX_PTHREAD_SEMANTICS
167-#endif
168-#ifndef _TANDEM_SOURCE
169-# undef _TANDEM_SOURCE
170-#endif])
171- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
172- [ac_cv_safe_to_define___extensions__],
173- [AC_COMPILE_IFELSE(
174- [AC_LANG_PROGRAM([
175-# define __EXTENSIONS__ 1
176- AC_INCLUDES_DEFAULT])],
177- [ac_cv_safe_to_define___extensions__=yes],
178- [ac_cv_safe_to_define___extensions__=no])])
179- test $ac_cv_safe_to_define___extensions__ = yes &&
180- AC_DEFINE([__EXTENSIONS__])
181- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
182- AC_DEFINE([_TANDEM_SOURCE])
183-])
184+#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
185+#[
186+# AC_BEFORE([$0], [AC_COMPILE_IFELSE])
187+# AC_BEFORE([$0], [AC_RUN_IFELSE])
188+#
189+# AC_REQUIRE([AC_GNU_SOURCE])
190+# AC_REQUIRE([AC_AIX])
191+# AC_REQUIRE([AC_MINIX])
192+#
193+# AH_VERBATIM([__EXTENSIONS__],
194+#[/* Enable extensions on Solaris. */
195+##ifndef __EXTENSIONS__
196+## undef __EXTENSIONS__
197+##endif
198+##ifndef _POSIX_PTHREAD_SEMANTICS
199+## undef _POSIX_PTHREAD_SEMANTICS
200+##endif
201+##ifndef _TANDEM_SOURCE
202+## undef _TANDEM_SOURCE
203+##endif])
204+# AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
205+# [ac_cv_safe_to_define___extensions__],
206+# [AC_COMPILE_IFELSE(
207+# [AC_LANG_PROGRAM([
208+## define __EXTENSIONS__ 1
209+# AC_INCLUDES_DEFAULT])],
210+# [ac_cv_safe_to_define___extensions__=yes],
211+# [ac_cv_safe_to_define___extensions__=no])])
212+# test $ac_cv_safe_to_define___extensions__ = yes &&
213+# AC_DEFINE([__EXTENSIONS__])
214+# AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
215+# AC_DEFINE([_TANDEM_SOURCE])
216+#])
217
218 # gl_USE_SYSTEM_EXTENSIONS
219 # ------------------------
220 # Enable extensions on systems that normally disable them,
221 # typically due to standards-conformance issues.
222 AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
223- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
224+[
225+ AC_REQUIRE([AC_GNU_SOURCE])
226+
227+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
228+])
229diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4
230--- gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 2006-11-27 09:14:54.000000000 -0800
231+++ gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4 2011-03-16 23:52:06.477463671 -0700
232@@ -91,7 +91,7 @@
233 AC_DEFUN([gl_FUNC_FNMATCH_GNU],
234 [
235 dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
236- AC_REQUIRE([AC_GNU_SOURCE])
237+ dnl AC_REQUIRE([AC_GNU_SOURCE])
238
239 FNMATCH_H=
240 _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
241diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 gettext.patched/gettext-tools/gnulib-m4/getdelim.m4
242--- gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 2006-11-27 09:14:54.000000000 -0800
243+++ gettext.patched/gettext-tools/gnulib-m4/getdelim.m4 2011-03-16 23:52:22.871674845 -0700
244@@ -12,7 +12,7 @@
245 [
246
247 dnl Persuade glibc <stdio.h> to declare getdelim().
248- AC_REQUIRE([AC_GNU_SOURCE])
249+ dnl AC_REQUIRE([AC_GNU_SOURCE])
250
251 AC_REPLACE_FUNCS(getdelim)
252 AC_CHECK_DECLS_ONCE(getdelim)
253diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 gettext.patched/gettext-tools/gnulib-m4/getline.m4
254--- gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 2006-11-27 09:14:54.000000000 -0800
255+++ gettext.patched/gettext-tools/gnulib-m4/getline.m4 2011-03-16 23:51:49.829971108 -0700
256@@ -16,7 +16,7 @@
257 AC_DEFUN([gl_FUNC_GETLINE],
258 [
259 dnl Persuade glibc <stdio.h> to declare getline().
260- AC_REQUIRE([AC_GNU_SOURCE])
261+ dnl AC_REQUIRE([AC_GNU_SOURCE])
262
263 AC_CHECK_DECLS([getline])
264
265diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4
266--- gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:36.000000000 -0800
267+++ gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4 2011-03-16 23:52:18.970450488 -0700
268@@ -25,7 +25,7 @@
269 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
270 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
271 AC_REQUIRE([AC_PROG_RANLIB])
272- AC_REQUIRE([AC_GNU_SOURCE])
273+ dnl AC_REQUIRE([AC_GNU_SOURCE])
274 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
275 AC_REQUIRE([gl_LOCK_EARLY])
276 ])
277diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 gettext.patched/gettext-tools/gnulib-m4/mbchar.m4
278--- gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 2006-11-27 09:14:55.000000000 -0800
279+++ gettext.patched/gettext-tools/gnulib-m4/mbchar.m4 2011-03-16 23:51:40.844410216 -0700
280@@ -9,7 +9,7 @@
281
282 AC_DEFUN([gl_MBCHAR],
283 [
284- AC_REQUIRE([AC_GNU_SOURCE])
285+ dnl AC_REQUIRE([AC_GNU_SOURCE])
286 dnl The following line is that so the user can test HAVE_WCHAR_H
287 dnl before #include "mbchar.h".
288 AC_CHECK_HEADERS_ONCE([wchar.h])
289diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4
290--- gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 2006-11-27 09:14:55.000000000 -0800
291+++ gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4 2011-03-16 23:52:14.691396045 -0700
292@@ -7,7 +7,7 @@
293 AC_DEFUN([gl_FUNC_STPCPY],
294 [
295 dnl Persuade glibc <string.h> to declare stpcpy().
296- AC_REQUIRE([AC_GNU_SOURCE])
297+ dnl AC_REQUIRE([AC_GNU_SOURCE])
298
299 AC_REPLACE_FUNCS(stpcpy)
300 if test $ac_cv_func_stpcpy = no; then
301diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4
302--- gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 2006-11-27 09:14:55.000000000 -0800
303+++ gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4 2011-03-16 23:52:10.356641459 -0700
304@@ -7,7 +7,7 @@
305 AC_DEFUN([gl_FUNC_STPNCPY],
306 [
307 dnl Persuade glibc <string.h> to declare stpncpy().
308- AC_REQUIRE([AC_GNU_SOURCE])
309+ dnl AC_REQUIRE([AC_GNU_SOURCE])
310
311 dnl Both glibc and AIX (4.3.3, 5.1) have an stpncpy() function
312 dnl declared in <string.h>. Its side effects are the same as those
313diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4
314--- gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 2006-11-27 09:14:55.000000000 -0800
315+++ gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4 2011-03-16 23:51:08.260324221 -0700
316@@ -7,7 +7,7 @@
317 AC_DEFUN([gl_FUNC_WCWIDTH],
318 [
319 dnl Persuade glibc <wchar.h> to declare wcwidth().
320- AC_REQUIRE([AC_GNU_SOURCE])
321+ dnl AC_REQUIRE([AC_GNU_SOURCE])
322
323 AC_REQUIRE([AC_C_INLINE])
324 AC_REQUIRE([gt_TYPE_WCHAR_T])
325diff -ru gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4
326--- gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 2006-11-27 09:33:45.000000000 -0800
327+++ gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 2011-03-16 23:51:02.036061317 -0700
328@@ -25,7 +25,7 @@
329 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
330 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
331 AC_REQUIRE([AC_PROG_RANLIB])
332- AC_REQUIRE([AC_GNU_SOURCE])
333+ dnl AC_REQUIRE([AC_GNU_SOURCE])
334 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
335 AC_REQUIRE([gl_LOCK_EARLY])
336 ])
337diff -ru gettext-0.16.1/gettext-tools/m4/regex.m4 gettext.patched/gettext-tools/m4/regex.m4
338--- gettext-0.16.1/gettext-tools/m4/regex.m4 2006-11-27 09:02:05.000000000 -0800
339+++ gettext.patched/gettext-tools/m4/regex.m4 2011-03-16 23:50:53.533477195 -0700
340@@ -116,7 +116,7 @@
341 dnl to get them.
342
343 dnl Persuade glibc <string.h> to declare mempcpy().
344- AC_REQUIRE([AC_GNU_SOURCE])
345+ dnl AC_REQUIRE([AC_GNU_SOURCE])
346
347 AC_REQUIRE([AC_C_RESTRICT])
348 AC_REQUIRE([AC_FUNC_ALLOCA])
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
new file mode 100644
index 0000000000..072fe5ff6c
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
@@ -0,0 +1,19 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8--- gettext-0.17/autoconf-lib-link/m4/lib-link.m4~ 2009-04-17 15:12:30.000000000 -0700
9+++ gettext-0.17/autoconf-lib-link/m4/lib-link.m4 2009-04-17 15:37:39.000000000 -0700
10@@ -267,6 +267,9 @@
11 fi
12 fi
13 fi
14+ dnl Just let the compiler find the library, the compiler and user are smarter then this script
15+ dnl when cross compiling and working with a relocated install.
16+ found_dir=""
17 if test "X$found_dir" = "X"; then
18 for x in $LDFLAGS $LTLIB[]NAME; do
19 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-error_print_progname.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-error_print_progname.patch
new file mode 100644
index 0000000000..93d91942f0
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/gettext-error_print_progname.patch
@@ -0,0 +1,19 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8diff -ur gettext-0.14.6/gettext-tools/lib/error.h gettext-0.14.6-patched/gettext-tools/lib/error.h
9--- gettext-0.14.6/gettext-tools/lib/error.h 2005-05-20 16:03:42.000000000 -0500
10+++ gettext-0.14.6-patched/gettext-tools/lib/error.h 2007-01-13 20:57:24.422168053 -0600
11@@ -50,7 +50,7 @@
12 /* If NULL, error will flush stdout, then print on stderr the program
13 name, a colon and a space. Otherwise, error will call this
14 function without parameters instead. */
15-extern DLL_VARIABLE void (*error_print_progname) (void);
16+void (*error_print_progname) (void);
17
18 /* This variable is incremented each time `error' is called. */
19 extern DLL_VARIABLE unsigned int error_message_count;
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
new file mode 100644
index 0000000000..f09e450efe
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
@@ -0,0 +1,20 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8Index: gettext-0.16.1/gettext-runtime/intl/Makefile.in
9===================================================================
10--- gettext-0.16.1.orig/gettext-runtime/intl/Makefile.in 2006-11-27 09:02:00.000000000 -0800
11+++ gettext-0.16.1/gettext-runtime/intl/Makefile.in 2011-03-16 16:04:49.175419930 -0700
12@@ -35,7 +35,7 @@
13 # 'make' does the wrong thing if GNU gettext was configured with
14 # "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
15 # files it finds in srcdir = ../../gettext-runtime/intl.
16-VPATH = $(srcdir)
17+#VPATH = $(srcdir)
18
19 prefix = @prefix@
20 exec_prefix = @exec_prefix@
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch b/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
new file mode 100644
index 0000000000..4da8dd4536
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
@@ -0,0 +1,51 @@
1
2This patch hardcodes in version 0.17 for the GETTEXT_MACRO_VERSION,
3the version check is only part of 0.17 and will not affect any 0.16.1
4operations
5
6Upstream-Status: Inappropriate [licensing]
7
8Signed-off-by: Saul Wold <sgw@linux.intel.com>
9
10Index: gettext-0.16.1/gettext-runtime/m4/po.m4
11===================================================================
12--- gettext-0.16.1.orig/gettext-runtime/m4/po.m4 2011-03-17 02:24:28.953520231 -0700
13+++ gettext-0.16.1/gettext-runtime/m4/po.m4 2011-03-17 02:28:25.455396862 -0700
14@@ -27,6 +27,9 @@
15 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
16 AC_REQUIRE([AM_NLS])dnl
17
18+ dnl Hardcode the MACRO_VERSION to 0.17 for gnutls
19+ AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
20+
21 dnl Perform the following tests also if --disable-nls has been given,
22 dnl because they are needed for "make dist" to work.
23
24Index: gettext-0.16.1/gettext-runtime/po/Makefile.in.in
25===================================================================
26--- gettext-0.16.1.orig/gettext-runtime/po/Makefile.in.in 2011-03-17 02:24:28.953520231 -0700
27+++ gettext-0.16.1/gettext-runtime/po/Makefile.in.in 2011-03-17 02:28:07.574395144 -0700
28@@ -10,6 +10,9 @@
29 #
30 # Origin: gettext-0.16
31
32+# Hardcode this value for gnutls building against gplv2 code
33+GETTEXT_MACRO_VERSION = 0.17
34+
35 PACKAGE = @PACKAGE@
36 VERSION = @VERSION@
37 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
38Index: gettext-0.16.1/gettext-tools/po/Makefile.in.in
39===================================================================
40--- gettext-0.16.1.orig/gettext-tools/po/Makefile.in.in 2011-03-17 02:24:28.953520231 -0700
41+++ gettext-0.16.1/gettext-tools/po/Makefile.in.in 2011-03-17 02:28:07.574395144 -0700
42@@ -10,6 +10,9 @@
43 #
44 # Origin: gettext-0.16
45
46+# Hardcode this value for gnutls building against gplv2 code
47+GETTEXT_MACRO_VERSION = 0.17
48+
49 PACKAGE = @PACKAGE@
50 VERSION = @VERSION@
51 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch b/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
new file mode 100644
index 0000000000..d921069711
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
@@ -0,0 +1,720 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
9===================================================================
10--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4 2006-11-27 09:01:58.000000000 -0800
11+++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4 2011-03-17 00:36:08.710836720 -0700
12@@ -6,12 +6,14 @@
13
14 dnl From Bruno Haible.
15
16-AC_PREREQ(2.50)
17+AC_PREREQ(2.54)
18
19 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
20 dnl the libraries corresponding to explicit and implicit dependencies.
21 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
22 dnl augments the CPPFLAGS variable.
23+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
24+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
25 AC_DEFUN([AC_LIB_LINKFLAGS],
26 [
27 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
28@@ -24,13 +26,16 @@
29 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
30 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
31 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
32+ ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
33 ])
34 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
35 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
36 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
37+ LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
38 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
39 AC_SUBST([LIB]NAME)
40 AC_SUBST([LTLIB]NAME)
41+ AC_SUBST([LIB]NAME[_PREFIX])
42 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
43 dnl results of this search when this library appears as a dependency.
44 HAVE_LIB[]NAME=yes
45@@ -46,6 +51,8 @@
46 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
47 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
48 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
49+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
50+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
51 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
52 [
53 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
54@@ -82,17 +89,24 @@
55 CPPFLAGS="$ac_save_CPPFLAGS"
56 LIB[]NAME=
57 LTLIB[]NAME=
58+ LIB[]NAME[]_PREFIX=
59+
60 fi
61 AC_SUBST([HAVE_LIB]NAME)
62 AC_SUBST([LIB]NAME)
63 AC_SUBST([LTLIB]NAME)
64+ AC_SUBST([LIB]NAME[_PREFIX])
65 undefine([Name])
66 undefine([NAME])
67 ])
68
69 dnl Determine the platform dependent parameters needed to use rpath:
70-dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
71-dnl hardcode_direct, hardcode_minus_L.
72+dnl acl_libext,
73+dnl acl_shlibext,
74+dnl acl_hardcode_libdir_flag_spec,
75+dnl acl_hardcode_libdir_separator,
76+dnl acl_hardcode_direct,
77+dnl acl_hardcode_minus_L.
78 AC_DEFUN([AC_LIB_RPATH],
79 [
80 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
81@@ -109,12 +123,14 @@
82 acl_cv_rpath=done
83 ])
84 wl="$acl_cv_wl"
85- libext="$acl_cv_libext"
86- shlibext="$acl_cv_shlibext"
87- hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
88- hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
89- hardcode_direct="$acl_cv_hardcode_direct"
90- hardcode_minus_L="$acl_cv_hardcode_minus_L"
91+ acl_libext="$acl_cv_libext"
92+ acl_shlibext="$acl_cv_shlibext"
93+ acl_libname_spec="$acl_cv_libname_spec"
94+ acl_library_names_spec="$acl_cv_library_names_spec"
95+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
96+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
97+ acl_hardcode_direct="$acl_cv_hardcode_direct"
98+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
99 dnl Determine whether the user wants rpath handling at all.
100 AC_ARG_ENABLE(rpath,
101 [ --disable-rpath do not hardcode runtime library paths],
102@@ -124,20 +140,24 @@
103 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
104 dnl the libraries corresponding to explicit and implicit dependencies.
105 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
106+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
107+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
108 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
109 [
110 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
111 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
112 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
113+ dnl Autoconf >= 2.61 supports dots in --with options.
114+ define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
115 dnl By default, look in $includedir and $libdir.
116 use_additional=yes
117 AC_LIB_WITH_FINAL_PREFIX([
118 eval additional_includedir=\"$includedir\"
119 eval additional_libdir=\"$libdir\"
120 ])
121- AC_LIB_ARG_WITH([lib$1-prefix],
122-[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
123- --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
124+ AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
125+[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
126+ --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
127 [
128 if test "X$withval" = "Xno"; then
129 use_additional=no
130@@ -158,6 +178,7 @@
131 LIB[]NAME=
132 LTLIB[]NAME=
133 INC[]NAME=
134+ LIB[]NAME[]_PREFIX=
135 rpathdirs=
136 ltrpathdirs=
137 names_already_handled=
138@@ -197,27 +218,53 @@
139 found_la=
140 found_so=
141 found_a=
142+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
143+ if test -n "$acl_shlibext"; then
144+ shrext=".$acl_shlibext" # typically: shrext=.so
145+ else
146+ shrext=
147+ fi
148 if test $use_additional = yes; then
149- if test -n "$shlibext" \
150- && { test -f "$additional_libdir/lib$name.$shlibext" \
151- || { test "$shlibext" = dll \
152- && test -f "$additional_libdir/lib$name.dll.a"; }; }; then
153- found_dir="$additional_libdir"
154- if test -f "$additional_libdir/lib$name.$shlibext"; then
155- found_so="$additional_libdir/lib$name.$shlibext"
156+ dir="$additional_libdir"
157+ dnl The same code as in the loop below:
158+ dnl First look for a shared library.
159+ if test -n "$acl_shlibext"; then
160+ if test -f "$dir/$libname$shrext"; then
161+ found_dir="$dir"
162+ found_so="$dir/$libname$shrext"
163 else
164- found_so="$additional_libdir/lib$name.dll.a"
165+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
166+ ver=`(cd "$dir" && \
167+ for f in "$libname$shrext".*; do echo "$f"; done \
168+ | sed -e "s,^$libname$shrext\\\\.,," \
169+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
170+ | sed 1q ) 2>/dev/null`
171+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
172+ found_dir="$dir"
173+ found_so="$dir/$libname$shrext.$ver"
174+ fi
175+ else
176+ eval library_names=\"$acl_library_names_spec\"
177+ for f in $library_names; do
178+ if test -f "$dir/$f"; then
179+ found_dir="$dir"
180+ found_so="$dir/$f"
181+ break
182+ fi
183+ done
184+ fi
185 fi
186- if test -f "$additional_libdir/lib$name.la"; then
187- found_la="$additional_libdir/lib$name.la"
188+ fi
189+ dnl Then look for a static library.
190+ if test "X$found_dir" = "X"; then
191+ if test -f "$dir/$libname.$acl_libext"; then
192+ found_dir="$dir"
193+ found_a="$dir/$libname.$acl_libext"
194 fi
195- else
196- if test -f "$additional_libdir/lib$name.$libext"; then
197- found_dir="$additional_libdir"
198- found_a="$additional_libdir/lib$name.$libext"
199- if test -f "$additional_libdir/lib$name.la"; then
200- found_la="$additional_libdir/lib$name.la"
201- fi
202+ fi
203+ if test "X$found_dir" != "X"; then
204+ if test -f "$dir/$libname.la"; then
205+ found_la="$dir/$libname.la"
206 fi
207 fi
208 fi
209@@ -227,26 +274,44 @@
210 case "$x" in
211 -L*)
212 dir=`echo "X$x" | sed -e 's/^X-L//'`
213- if test -n "$shlibext" \
214- && { test -f "$dir/lib$name.$shlibext" \
215- || { test "$shlibext" = dll \
216- && test -f "$dir/lib$name.dll.a"; }; }; then
217- found_dir="$dir"
218- if test -f "$dir/lib$name.$shlibext"; then
219- found_so="$dir/lib$name.$shlibext"
220+ dnl First look for a shared library.
221+ if test -n "$acl_shlibext"; then
222+ if test -f "$dir/$libname$shrext"; then
223+ found_dir="$dir"
224+ found_so="$dir/$libname$shrext"
225 else
226- found_so="$dir/lib$name.dll.a"
227- fi
228- if test -f "$dir/lib$name.la"; then
229- found_la="$dir/lib$name.la"
230+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
231+ ver=`(cd "$dir" && \
232+ for f in "$libname$shrext".*; do echo "$f"; done \
233+ | sed -e "s,^$libname$shrext\\\\.,," \
234+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
235+ | sed 1q ) 2>/dev/null`
236+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
237+ found_dir="$dir"
238+ found_so="$dir/$libname$shrext.$ver"
239+ fi
240+ else
241+ eval library_names=\"$acl_library_names_spec\"
242+ for f in $library_names; do
243+ if test -f "$dir/$f"; then
244+ found_dir="$dir"
245+ found_so="$dir/$f"
246+ break
247+ fi
248+ done
249+ fi
250 fi
251- else
252- if test -f "$dir/lib$name.$libext"; then
253+ fi
254+ dnl Then look for a static library.
255+ if test "X$found_dir" = "X"; then
256+ if test -f "$dir/$libname.$acl_libext"; then
257 found_dir="$dir"
258- found_a="$dir/lib$name.$libext"
259- if test -f "$dir/lib$name.la"; then
260- found_la="$dir/lib$name.la"
261- fi
262+ found_a="$dir/$libname.$acl_libext"
263+ fi
264+ fi
265+ if test "X$found_dir" != "X"; then
266+ if test -f "$dir/$libname.la"; then
267+ found_la="$dir/$libname.la"
268 fi
269 fi
270 ;;
271@@ -282,12 +347,12 @@
272 ltrpathdirs="$ltrpathdirs $found_dir"
273 fi
274 dnl The hardcoding into $LIBNAME is system dependent.
275- if test "$hardcode_direct" = yes; then
276+ if test "$acl_hardcode_direct" = yes; then
277 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
278 dnl resulting binary.
279 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
280 else
281- if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
282+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
283 dnl Use an explicit option to hardcode DIR into the resulting
284 dnl binary.
285 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
286@@ -318,13 +383,13 @@
287 if test -z "$haveit"; then
288 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
289 fi
290- if test "$hardcode_minus_L" != no; then
291+ if test "$acl_hardcode_minus_L" != no; then
292 dnl FIXME: Not sure whether we should use
293 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
294 dnl here.
295 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
296 else
297- dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
298+ dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
299 dnl here, because this doesn't fit in flags passed to the
300 dnl compiler. So give up. No hardcoding. This affects only
301 dnl very old systems.
302@@ -512,18 +577,18 @@
303 done
304 done
305 if test "X$rpathdirs" != "X"; then
306- if test -n "$hardcode_libdir_separator"; then
307+ if test -n "$acl_hardcode_libdir_separator"; then
308 dnl Weird platform: only the last -rpath option counts, the user must
309 dnl pass all path elements in one option. We can arrange that for a
310 dnl single library, but not when more than one $LIBNAMEs are used.
311 alldirs=
312 for found_dir in $rpathdirs; do
313- alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
314+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
315 done
316- dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
317+ dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
318 acl_save_libdir="$libdir"
319 libdir="$alldirs"
320- eval flag=\"$hardcode_libdir_flag_spec\"
321+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
322 libdir="$acl_save_libdir"
323 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
324 else
325@@ -531,7 +596,7 @@
326 for found_dir in $rpathdirs; do
327 acl_save_libdir="$libdir"
328 libdir="$found_dir"
329- eval flag=\"$hardcode_libdir_flag_spec\"
330+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
331 libdir="$acl_save_libdir"
332 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
333 done
334@@ -642,3 +707,79 @@
335 fi
336 AC_SUBST([$1])
337 ])
338+
339+dnl For those cases where a variable contains several -L and -l options
340+dnl referring to unknown libraries and directories, this macro determines the
341+dnl necessary additional linker options for the runtime path.
342+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
343+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
344+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
345+dnl otherwise linking without libtool is assumed.
346+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
347+[
348+ AC_REQUIRE([AC_LIB_RPATH])
349+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
350+ $1=
351+ if test "$enable_rpath" != no; then
352+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
353+ dnl Use an explicit option to hardcode directories into the resulting
354+ dnl binary.
355+ rpathdirs=
356+ next=
357+ for opt in $2; do
358+ if test -n "$next"; then
359+ dir="$next"
360+ dnl No need to hardcode the standard /usr/lib.
361+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
362+ rpathdirs="$rpathdirs $dir"
363+ fi
364+ next=
365+ else
366+ case $opt in
367+ -L) next=yes ;;
368+ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
369+ dnl No need to hardcode the standard /usr/lib.
370+ if test "X$dir" != "X/usr/$acl_libdirstem"; then
371+ rpathdirs="$rpathdirs $dir"
372+ fi
373+ next= ;;
374+ *) next= ;;
375+ esac
376+ fi
377+ done
378+ if test "X$rpathdirs" != "X"; then
379+ if test -n ""$3""; then
380+ dnl libtool is used for linking. Use -R options.
381+ for dir in $rpathdirs; do
382+ $1="${$1}${$1:+ }-R$dir"
383+ done
384+ else
385+ dnl The linker is used for linking directly.
386+ if test -n "$acl_hardcode_libdir_separator"; then
387+ dnl Weird platform: only the last -rpath option counts, the user
388+ dnl must pass all path elements in one option.
389+ alldirs=
390+ for dir in $rpathdirs; do
391+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
392+ done
393+ acl_save_libdir="$libdir"
394+ libdir="$alldirs"
395+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
396+ libdir="$acl_save_libdir"
397+ $1="$flag"
398+ else
399+ dnl The -rpath options are cumulative.
400+ for dir in $rpathdirs; do
401+ acl_save_libdir="$libdir"
402+ libdir="$dir"
403+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
404+ libdir="$acl_save_libdir"
405+ $1="${$1}${$1:+ }$flag"
406+ done
407+ fi
408+ fi
409+ fi
410+ fi
411+ fi
412+ AC_SUBST([$1])
413+])
414Index: gettext-0.16.1/autoconf-lib-link/config.rpath
415===================================================================
416--- gettext-0.16.1.orig/autoconf-lib-link/config.rpath 2006-11-27 09:01:58.000000000 -0800
417+++ gettext-0.16.1/autoconf-lib-link/config.rpath 2011-03-17 00:33:23.336539490 -0700
418@@ -2,7 +2,7 @@
419 # Output a system dependent set of variables, describing how to set the
420 # run time search path of shared libraries in an executable.
421 #
422-# Copyright 1996-2006 Free Software Foundation, Inc.
423+# Copyright 1996-2007 Free Software Foundation, Inc.
424 # Taken from GNU libtool, 2001
425 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
426 #
427@@ -47,6 +47,18 @@
428 done
429 cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
430
431+# Code taken from libtool.m4's _LT_CC_BASENAME.
432+
433+for cc_temp in $CC""; do
434+ case $cc_temp in
435+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
436+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
437+ \-*) ;;
438+ *) break;;
439+ esac
440+done
441+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
442+
443 # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
444
445 wl=
446@@ -64,7 +76,14 @@
447 ;;
448 esac
449 ;;
450- mingw* | pw32* | os2*)
451+ darwin*)
452+ case $cc_basename in
453+ xlc*)
454+ wl='-Wl,'
455+ ;;
456+ esac
457+ ;;
458+ mingw* | cygwin* | pw32* | os2*)
459 ;;
460 hpux9* | hpux10* | hpux11*)
461 wl='-Wl,'
462@@ -74,7 +93,7 @@
463 ;;
464 newsos6)
465 ;;
466- linux*)
467+ linux* | k*bsd*-gnu)
468 case $cc_basename in
469 icc* | ecc*)
470 wl='-Wl,'
471@@ -100,7 +119,7 @@
472 osf3* | osf4* | osf5*)
473 wl='-Wl,'
474 ;;
475- sco3.2v5*)
476+ rdos*)
477 ;;
478 solaris*)
479 wl='-Wl,'
480@@ -108,11 +127,14 @@
481 sunos4*)
482 wl='-Qoption ld '
483 ;;
484- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
485+ sysv4 | sysv4.2uw2* | sysv4.3*)
486 wl='-Wl,'
487 ;;
488 sysv4*MP*)
489 ;;
490+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
491+ wl='-Wl,'
492+ ;;
493 unicos*)
494 wl='-Wl,'
495 ;;
496@@ -141,6 +163,10 @@
497 # we just hope/assume this is gcc and not c89 (= MSVC++)
498 with_gnu_ld=yes
499 ;;
500+ interix*)
501+ # we just hope/assume this is gcc and not c89 (= MSVC++)
502+ with_gnu_ld=yes
503+ ;;
504 openbsd*)
505 with_gnu_ld=no
506 ;;
507@@ -189,11 +215,11 @@
508 ld_shlibs=no
509 fi
510 ;;
511- interix3*)
512+ interix[3-9]*)
513 hardcode_direct=no
514 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
515 ;;
516- linux*)
517+ gnu* | linux* | k*bsd*-gnu)
518 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
519 :
520 else
521@@ -280,7 +306,7 @@
522 strings "$collect2name" | grep resolve_lib_name >/dev/null
523 then
524 # We have reworked collect2
525- hardcode_direct=yes
526+ :
527 else
528 # We have old collect2
529 hardcode_direct=unsupported
530@@ -359,7 +385,7 @@
531 hardcode_direct=yes
532 hardcode_minus_L=yes
533 ;;
534- freebsd* | kfreebsd*-gnu | dragonfly*)
535+ freebsd* | dragonfly*)
536 hardcode_libdir_flag_spec='-R$libdir'
537 hardcode_direct=yes
538 ;;
539@@ -412,18 +438,22 @@
540 hardcode_libdir_separator=:
541 ;;
542 openbsd*)
543- hardcode_direct=yes
544- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
545- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
546+ if test -f /usr/libexec/ld.so; then
547+ hardcode_direct=yes
548+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
549+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
550+ else
551+ case "$host_os" in
552+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
553+ hardcode_libdir_flag_spec='-R$libdir'
554+ ;;
555+ *)
556+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
557+ ;;
558+ esac
559+ fi
560 else
561- case "$host_os" in
562- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
563- hardcode_libdir_flag_spec='-R$libdir'
564- ;;
565- *)
566- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
567- ;;
568- esac
569+ ld_shlibs=no
570 fi
571 ;;
572 os2*)
573@@ -471,7 +501,7 @@
574 ld_shlibs=yes
575 fi
576 ;;
577- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
578+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* |sco3.2v5.0.[024]*)
579 ;;
580 sysv5* | sco3.2v5* | sco5v6*)
581 hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
582@@ -488,33 +518,51 @@
583
584 # Check dynamic linker characteristics
585 # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
586+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
587+# only about the one the linker finds when passed -lNAME. This is the last
588+# element of library_names_spec in libtool.m4, or possibly two of them if the
589+# linker has special search rules.
590+library_names_spec= # the last element of library_names_spec in libtool.m4
591 libname_spec='lib$name'
592 case "$host_os" in
593 aix3*)
594+ library_names_spec='$libname.a'
595 ;;
596 aix4* | aix5*)
597+ library_names_spec='$libname$shrext'
598 ;;
599 amigaos*)
600+ library_names_spec='$libname.a'
601 ;;
602 beos*)
603+ library_names_spec='$libname$shrext'
604 ;;
605 bsdi[45]*)
606+ library_names_spec='$libname$shrext'
607 ;;
608 cygwin* | mingw* | pw32*)
609 shrext=.dll
610+ library_names_spec='$libname.dll.a $libname.lib'
611 ;;
612 darwin* | rhapsody*)
613 shrext=.dylib
614+ library_names_spec='$libname$shrext'
615 ;;
616 dgux*)
617+ library_names_spec='$libname$shrext'
618 ;;
619 freebsd1*)
620 ;;
621- kfreebsd*-gnu)
622- ;;
623 freebsd* | dragonfly*)
624+ case "$host_os" in
625+ freebsd[123]*)
626+ library_names_spec='$libname$shrext$versuffix' ;;
627+ *)
628+ library_names_spec='$libname$shrext' ;;
629+ esac
630 ;;
631 gnu*)
632+ library_names_spec='$libname$shrext'
633 ;;
634 hpux9* | hpux10* | hpux11*)
635 case $host_cpu in
636@@ -528,10 +576,13 @@
637 shrext=.sl
638 ;;
639 esac
640+ library_names_spec='$libname$shrext'
641 ;;
642- interix3*)
643+ interix[3-9]*)
644+ library_names_spec='$libname$shrext'
645 ;;
646 irix5* | irix6* | nonstopux*)
647+ library_names_spec='$libname$shrext'
648 case "$host_os" in
649 irix5* | nonstopux*)
650 libsuff= shlibsuff=
651@@ -548,33 +599,46 @@
652 ;;
653 linux*oldld* | linux*aout* | linux*coff*)
654 ;;
655- linux*)
656+ linux* | k*bsd*-gnu)
657+ library_names_spec='$libname$shrext'
658 ;;
659 knetbsd*-gnu)
660+ library_names_spec='$libname$shrext'
661 ;;
662 netbsd*)
663+ library_names_spec='$libname$shrext'
664 ;;
665 newsos6)
666+ library_names_spec='$libname$shrext'
667 ;;
668 nto-qnx*)
669+ library_names_spec='$libname$shrext'
670 ;;
671 openbsd*)
672+ library_names_spec='$libname$shrext$versuffix'
673 ;;
674 os2*)
675 libname_spec='$name'
676 shrext=.dll
677+ library_names_spec='$libname.a'
678 ;;
679 osf3* | osf4* | osf5*)
680+ library_names_spec='$libname$shrext'
681 ;;
682 solaris*)
683+ library_names_spec='$libname$shrext'
684 ;;
685 sunos4*)
686+ library_names_spec='$libname$shrext$versuffix'
687 ;;
688 sysv4 | sysv4.3*)
689+ library_names_spec='$libname$shrext'
690 ;;
691 sysv4*MP*)
692+ library_names_spec='$libname$shrext'
693 ;;
694 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
695+ library_names_spec='$libname$shrext'
696 ;;
697 uts4*)
698 ;;
699@@ -583,6 +647,8 @@
700 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
701 escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
702 shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
703+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
704+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
705 escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
706
707 LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
708@@ -596,6 +662,12 @@
709 # Shared library suffix (normally "so").
710 shlibext="$shlibext"
711
712+# Format of library name prefix.
713+libname_spec="$escaped_libname_spec"
714+
715+# Library names that the linker finds when passed -lNAME.
716+library_names_spec="$escaped_library_names_spec"
717+
718 # Flag to hardcode \$libdir into a binary during linking.
719 # This must work even if \$libdir does not exist.
720 hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
diff --git a/meta/recipes-core/gettext/gettext-0.18.3.2/parallel.patch b/meta/recipes-core/gettext/gettext-0.18.3.2/parallel.patch
new file mode 100644
index 0000000000..f2c567d188
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.18.3.2/parallel.patch
@@ -0,0 +1,36 @@
1instal libgettextlib.a before removing it
2
3In a multiple job build, Makefile can simultaneously
4be installing and removing libgettextlib.a. We serialize
5the operations.
6
7Upstream-Status: Pending
8
9Signed-off-by: Joe Slater <jslater@windriver.com>
10
11--- a/gettext-tools/gnulib-lib/Makefile.am
12+++ b/gettext-tools/gnulib-lib/Makefile.am
13@@ -57,6 +57,10 @@ endif
14 # Rules generated and collected by gnulib-tool.
15 include Makefile.gnulib
16
17+# defined in Makefile.gnulib but missing this dependency
18+#
19+install-exec-clean: install-libLTLIBRARIES
20+
21 # Which classes to export from the shared library.
22 MOOPPFLAGS += --dllexport=styled_ostream
23
24--- a/gettext-tools/src/Makefile.am
25+++ b/gettext-tools/src/Makefile.am
26@@ -229,8 +229,8 @@ libgettextsrc_la_LDFLAGS += -Wl,--export
27 endif
28
29 # No need to install libgettextsrc.a, except on AIX.
30-install-exec-local: install-libLTLIBRARIES install-exec-clean
31-install-exec-clean:
32+install-exec-local: install-exec-clean
33+install-exec-clean: install-libLTLIBRARIES
34 case "@host_os@" in \
35 aix*) ;; \
36 *) $(RM) $(DESTDIR)$(libdir)/libgettextsrc.a ;; \
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/COPYING b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/COPYING
new file mode 100644
index 0000000000..3485c5a2cb
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/COPYING
@@ -0,0 +1,4 @@
1dnl Copyright (C) 1997-2010 Free Software Foundation, Inc.
2dnl This file is free software; the Free Software Foundation
3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved.
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makefile.in.in b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makefile.in.in
new file mode 100644
index 0000000000..fabdc76c9c
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makefile.in.in
@@ -0,0 +1,454 @@
1# Makefile for PO directory in any package using GNU gettext.
2# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3#
4# This file can be copied and used freely without restrictions. It can
5# be used in projects which are not available under the GNU General Public
6# License but which still want to provide support for the GNU gettext
7# functionality.
8# Please note that the actual code of GNU gettext is covered by the GNU
9# General Public License and is *not* in the public domain.
10#
11# Origin: gettext-0.18.3
12GETTEXT_MACRO_VERSION = 0.18
13
14PACKAGE = @PACKAGE@
15VERSION = @VERSION@
16PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
17
18SED = @SED@
19SHELL = /bin/sh
20@SET_MAKE@
21
22srcdir = @srcdir@
23top_srcdir = @top_srcdir@
24VPATH = @srcdir@
25
26prefix = @prefix@
27exec_prefix = @exec_prefix@
28datarootdir = @datarootdir@
29datadir = @datadir@
30localedir = @localedir@
31gettextsrcdir = $(datadir)/gettext/po
32
33INSTALL = @INSTALL@
34INSTALL_DATA = @INSTALL_DATA@
35
36# We use $(mkdir_p).
37# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
38# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
39# @install_sh@ does not start with $(SHELL), so we add it.
40# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
41# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
42# versions, $(mkinstalldirs) and $(install_sh) are unused.
43mkinstalldirs = $(SHELL) @install_sh@ -d
44install_sh = $(SHELL) @install_sh@
45MKDIR_P = @MKDIR_P@
46mkdir_p = @mkdir_p@
47
48GMSGFMT_ = @GMSGFMT@
49GMSGFMT_no = @GMSGFMT@
50GMSGFMT_yes = @GMSGFMT_015@
51GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
52MSGFMT_ = @MSGFMT@
53MSGFMT_no = @MSGFMT@
54MSGFMT_yes = @MSGFMT_015@
55MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
56XGETTEXT_ = @XGETTEXT@
57XGETTEXT_no = @XGETTEXT@
58XGETTEXT_yes = @XGETTEXT_015@
59XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
60MSGMERGE = msgmerge
61MSGMERGE_UPDATE = @MSGMERGE@ --update
62MSGINIT = msginit
63MSGCONV = msgconv
64MSGFILTER = msgfilter
65
66POFILES = @POFILES@
67GMOFILES = @GMOFILES@
68UPDATEPOFILES = @UPDATEPOFILES@
69DUMMYPOFILES = @DUMMYPOFILES@
70DISTFILES.common = Makefile.in.in remove-potcdate.sin \
71$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
72DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
73$(POFILES) $(GMOFILES) \
74$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
75
76POTFILES = \
77
78CATALOGS = @CATALOGS@
79
80# Makevars gets inserted here. (Don't remove this line!)
81
82.SUFFIXES:
83.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
84
85.po.mo:
86 @echo "$(MSGFMT) -c -o $@ $<"; \
87 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
88
89.po.gmo:
90 @lang=`echo $* | sed -e 's,.*/,,'`; \
91 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
92 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
93 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
94
95.sin.sed:
96 sed -e '/^#/d' $< > t-$@
97 mv t-$@ $@
98
99
100all: all-@USE_NLS@
101
102all-yes: stamp-po
103all-no:
104
105# Ensure that the gettext macros and this Makefile.in.in are in sync.
106CHECK_MACRO_VERSION = \
107 test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
108 || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
109 exit 1; \
110 }
111
112# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
113# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
114# we don't want to bother translators with empty POT files). We assume that
115# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
116# In this case, stamp-po is a nop (i.e. a phony target).
117
118# stamp-po is a timestamp denoting the last time at which the CATALOGS have
119# been loosely updated. Its purpose is that when a developer or translator
120# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
121# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
122# invocations of "make" will do nothing. This timestamp would not be necessary
123# if updating the $(CATALOGS) would always touch them; however, the rule for
124# $(POFILES) has been designed to not touch files that don't need to be
125# changed.
126stamp-po: $(srcdir)/$(DOMAIN).pot
127 @$(CHECK_MACRO_VERSION)
128 test ! -f $(srcdir)/$(DOMAIN).pot || \
129 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
130 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
131 echo "touch stamp-po" && \
132 echo timestamp > stamp-poT && \
133 mv stamp-poT stamp-po; \
134 }
135
136# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
137# otherwise packages like GCC can not be built if only parts of the source
138# have been downloaded.
139
140# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
141# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
142# The determination of whether the package xyz is a GNU one is based on the
143# heuristic whether some file in the top level directory mentions "GNU xyz".
144# If GNU 'find' is available, we avoid grepping through monster files.
145$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
146 if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
147 LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \
148 else \
149 LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
150 fi; \
151 } | grep -v 'libtool:' >/dev/null; then \
152 package_gnu='GNU '; \
153 else \
154 package_gnu=''; \
155 fi; \
156 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
157 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
158 else \
159 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
160 fi; \
161 case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
162 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
163 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
164 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
165 --files-from=$(srcdir)/POTFILES.in \
166 --copyright-holder='$(COPYRIGHT_HOLDER)' \
167 --msgid-bugs-address="$$msgid_bugs_address" \
168 ;; \
169 *) \
170 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
171 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
172 --files-from=$(srcdir)/POTFILES.in \
173 --copyright-holder='$(COPYRIGHT_HOLDER)' \
174 --package-name="$${package_gnu}@PACKAGE@" \
175 --package-version='@VERSION@' \
176 --msgid-bugs-address="$$msgid_bugs_address" \
177 ;; \
178 esac
179 test ! -f $(DOMAIN).po || { \
180 if test -f $(srcdir)/$(DOMAIN).pot; then \
181 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
182 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
183 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
184 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
185 else \
186 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
187 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
188 fi; \
189 else \
190 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
191 fi; \
192 }
193
194# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
195# every "make" invocation, only create it when it is missing.
196# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
197$(srcdir)/$(DOMAIN).pot:
198 $(MAKE) $(DOMAIN).pot-update
199
200# This target rebuilds a PO file if $(DOMAIN).pot has changed.
201# Note that a PO file is not touched if it doesn't need to be changed.
202$(POFILES): $(srcdir)/$(DOMAIN).pot
203 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
204 if test -f "$(srcdir)/$${lang}.po"; then \
205 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
206 echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
207 cd $(srcdir) \
208 && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
209 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
210 $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
211 *) \
212 $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
213 esac; \
214 }; \
215 else \
216 $(MAKE) $${lang}.po-create; \
217 fi
218
219
220install: install-exec install-data
221install-exec:
222install-data: install-data-@USE_NLS@
223 if test "$(PACKAGE)" = "gettext-tools"; then \
224 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
225 for file in $(DISTFILES.common) Makevars.template; do \
226 $(INSTALL_DATA) $(srcdir)/$$file \
227 $(DESTDIR)$(gettextsrcdir)/$$file; \
228 done; \
229 for file in Makevars; do \
230 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
231 done; \
232 else \
233 : ; \
234 fi
235install-data-no: all
236install-data-yes: all
237 @catalogs='$(CATALOGS)'; \
238 for cat in $$catalogs; do \
239 cat=`basename $$cat`; \
240 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
241 dir=$(localedir)/$$lang/LC_MESSAGES; \
242 $(mkdir_p) $(DESTDIR)$$dir; \
243 if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
244 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
245 echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
246 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
247 if test -n "$$lc"; then \
248 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
249 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
250 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
251 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
252 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
253 for file in *; do \
254 if test -f $$file; then \
255 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
256 fi; \
257 done); \
258 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
259 else \
260 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
261 :; \
262 else \
263 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
264 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
265 fi; \
266 fi; \
267 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
268 ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
269 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
270 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
271 echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
272 fi; \
273 done; \
274 done
275
276install-strip: install
277
278installdirs: installdirs-exec installdirs-data
279installdirs-exec:
280installdirs-data: installdirs-data-@USE_NLS@
281 if test "$(PACKAGE)" = "gettext-tools"; then \
282 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
283 else \
284 : ; \
285 fi
286installdirs-data-no:
287installdirs-data-yes:
288 @catalogs='$(CATALOGS)'; \
289 for cat in $$catalogs; do \
290 cat=`basename $$cat`; \
291 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
292 dir=$(localedir)/$$lang/LC_MESSAGES; \
293 $(mkdir_p) $(DESTDIR)$$dir; \
294 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
295 if test -n "$$lc"; then \
296 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
297 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
298 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
299 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
300 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
301 for file in *; do \
302 if test -f $$file; then \
303 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
304 fi; \
305 done); \
306 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
307 else \
308 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
309 :; \
310 else \
311 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
312 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
313 fi; \
314 fi; \
315 fi; \
316 done; \
317 done
318
319# Define this as empty until I found a useful application.
320installcheck:
321
322uninstall: uninstall-exec uninstall-data
323uninstall-exec:
324uninstall-data: uninstall-data-@USE_NLS@
325 if test "$(PACKAGE)" = "gettext-tools"; then \
326 for file in $(DISTFILES.common) Makevars.template; do \
327 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
328 done; \
329 else \
330 : ; \
331 fi
332uninstall-data-no:
333uninstall-data-yes:
334 catalogs='$(CATALOGS)'; \
335 for cat in $$catalogs; do \
336 cat=`basename $$cat`; \
337 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
338 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
339 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
340 done; \
341 done
342
343check: all
344
345info dvi ps pdf html tags TAGS ctags CTAGS ID:
346
347mostlyclean:
348 rm -f remove-potcdate.sed
349 rm -f stamp-poT
350 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
351 rm -fr *.o
352
353clean: mostlyclean
354
355distclean: clean
356 rm -f Makefile Makefile.in POTFILES *.mo
357
358maintainer-clean: distclean
359 @echo "This command is intended for maintainers to use;"
360 @echo "it deletes files that may require special tools to rebuild."
361 rm -f stamp-po $(GMOFILES)
362
363distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
364dist distdir:
365 $(MAKE) update-po
366 @$(MAKE) dist2
367# This is a separate target because 'update-po' must be executed before.
368dist2: stamp-po $(DISTFILES)
369 dists="$(DISTFILES)"; \
370 if test "$(PACKAGE)" = "gettext-tools"; then \
371 dists="$$dists Makevars.template"; \
372 fi; \
373 if test -f $(srcdir)/$(DOMAIN).pot; then \
374 dists="$$dists $(DOMAIN).pot stamp-po"; \
375 fi; \
376 if test -f $(srcdir)/ChangeLog; then \
377 dists="$$dists ChangeLog"; \
378 fi; \
379 for i in 0 1 2 3 4 5 6 7 8 9; do \
380 if test -f $(srcdir)/ChangeLog.$$i; then \
381 dists="$$dists ChangeLog.$$i"; \
382 fi; \
383 done; \
384 if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
385 for file in $$dists; do \
386 if test -f $$file; then \
387 cp -p $$file $(distdir) || exit 1; \
388 else \
389 cp -p $(srcdir)/$$file $(distdir) || exit 1; \
390 fi; \
391 done
392
393update-po: Makefile
394 $(MAKE) $(DOMAIN).pot-update
395 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
396 $(MAKE) update-gmo
397
398# General rule for creating PO files.
399
400.nop.po-create:
401 @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
402 echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
403 exit 1
404
405# General rule for updating PO files.
406
407.nop.po-update:
408 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
409 if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
410 tmpdir=`pwd`; \
411 echo "$$lang:"; \
412 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
413 echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
414 cd $(srcdir); \
415 if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
416 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
417 $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
418 *) \
419 $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
420 esac; \
421 }; then \
422 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
423 rm -f $$tmpdir/$$lang.new.po; \
424 else \
425 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
426 :; \
427 else \
428 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
429 exit 1; \
430 fi; \
431 fi; \
432 else \
433 echo "msgmerge for $$lang.po failed!" 1>&2; \
434 rm -f $$tmpdir/$$lang.new.po; \
435 fi
436
437$(DUMMYPOFILES):
438
439update-gmo: Makefile $(GMOFILES)
440 @:
441
442# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
443# because execution permission bits may not work on the current file system.
444# Use @SHELL@, which is the shell determined by autoconf for the use by its
445# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
446Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
447 cd $(top_builddir) \
448 && @SHELL@ ./config.status $(subdir)/$@.in po-directories
449
450force:
451
452# Tell versions [3.59,3.63) of GNU make not to export all variables.
453# Otherwise a system limit (for SysV at least) may be exceeded.
454.NOEXPORT:
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makevars.template b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makevars.template
new file mode 100644
index 0000000000..4a9ff7d231
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/Makevars.template
@@ -0,0 +1,53 @@
1# Makefile variables for PO directory in any package using GNU gettext.
2
3# Usually the message domain is the same as the package name.
4DOMAIN = $(PACKAGE)
5
6# These two variables depend on the location of this directory.
7subdir = po
8top_builddir = ..
9
10# These options get passed to xgettext.
11XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
12
13# This is the copyright holder that gets inserted into the header of the
14# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
15# package. (Note that the msgstr strings, extracted from the package's
16# sources, belong to the copyright holder of the package.) Translators are
17# expected to transfer the copyright for their translations to this person
18# or entity, or to disclaim their copyright. The empty string stands for
19# the public domain; in this case the translators are expected to disclaim
20# their copyright.
21COPYRIGHT_HOLDER = Free Software Foundation, Inc.
22
23# This is the email address or URL to which the translators shall report
24# bugs in the untranslated strings:
25# - Strings which are not entire sentences, see the maintainer guidelines
26# in the GNU gettext documentation, section 'Preparing Strings'.
27# - Strings which use unclear terms or require additional context to be
28# understood.
29# - Strings which make invalid assumptions about notation of date, time or
30# money.
31# - Pluralisation problems.
32# - Incorrect English spelling.
33# - Incorrect formatting.
34# It can be your email address, or a mailing list address where translators
35# can write to without being subscribed, or the URL of a web page through
36# which the translators can contact you.
37MSGID_BUGS_ADDRESS =
38
39# This is the list of locale categories, beyond LC_MESSAGES, for which the
40# message catalogs shall be used. It is usually empty.
41EXTRA_LOCALE_CATEGORIES =
42
43# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
44# context. Possible values are "yes" and "no". Set this to yes if the
45# package uses functions taking also a message context, like pgettext(), or
46# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
47USE_MSGCTXT = no
48
49# These options get passed to msgmerge.
50# Useful options are in particular:
51# --previous to keep previous msgids of translated messages,
52# --quiet to reduce the verbosity.
53MSGMERGE_OPTIONS =
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/aclocal.tgz b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/aclocal.tgz
new file mode 100644
index 0000000000..e0335a3d1c
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/aclocal.tgz
Binary files differ
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/config.rpath b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/config.rpath
new file mode 100755
index 0000000000..c38b914d6b
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/config.rpath
@@ -0,0 +1,690 @@
1#! /bin/sh
2# Output a system dependent set of variables, describing how to set the
3# run time search path of shared libraries in an executable.
4#
5# Copyright 1996-2013 Free Software Foundation, Inc.
6# Taken from GNU libtool, 2001
7# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8#
9# This file is free software; the Free Software Foundation gives
10# unlimited permission to copy and/or distribute it, with or without
11# modifications, as long as this notice is preserved.
12#
13# The first argument passed to this file is the canonical host specification,
14# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
15# or
16# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
17# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
18# should be set by the caller.
19#
20# The set of defined variables is at the end of this script.
21
22# Known limitations:
23# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
24# than 256 bytes, otherwise the compiler driver will dump core. The only
25# known workaround is to choose shorter directory names for the build
26# directory and/or the installation directory.
27
28# All known linkers require a '.a' archive for static linking (except MSVC,
29# which needs '.lib').
30libext=a
31shrext=.so
32
33host="$1"
34host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
35host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
36host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
37
38# Code taken from libtool.m4's _LT_CC_BASENAME.
39
40for cc_temp in $CC""; do
41 case $cc_temp in
42 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
43 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
44 \-*) ;;
45 *) break;;
46 esac
47done
48cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
49
50# Code taken from libtool.m4's _LT_COMPILER_PIC.
51
52wl=
53if test "$GCC" = yes; then
54 wl='-Wl,'
55else
56 case "$host_os" in
57 aix*)
58 wl='-Wl,'
59 ;;
60 mingw* | cygwin* | pw32* | os2* | cegcc*)
61 ;;
62 hpux9* | hpux10* | hpux11*)
63 wl='-Wl,'
64 ;;
65 irix5* | irix6* | nonstopux*)
66 wl='-Wl,'
67 ;;
68 linux* | k*bsd*-gnu | kopensolaris*-gnu)
69 case $cc_basename in
70 ecc*)
71 wl='-Wl,'
72 ;;
73 icc* | ifort*)
74 wl='-Wl,'
75 ;;
76 lf95*)
77 wl='-Wl,'
78 ;;
79 nagfor*)
80 wl='-Wl,-Wl,,'
81 ;;
82 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
83 wl='-Wl,'
84 ;;
85 ccc*)
86 wl='-Wl,'
87 ;;
88 xl* | bgxl* | bgf* | mpixl*)
89 wl='-Wl,'
90 ;;
91 como)
92 wl='-lopt='
93 ;;
94 *)
95 case `$CC -V 2>&1 | sed 5q` in
96 *Sun\ F* | *Sun*Fortran*)
97 wl=
98 ;;
99 *Sun\ C*)
100 wl='-Wl,'
101 ;;
102 esac
103 ;;
104 esac
105 ;;
106 newsos6)
107 ;;
108 *nto* | *qnx*)
109 ;;
110 osf3* | osf4* | osf5*)
111 wl='-Wl,'
112 ;;
113 rdos*)
114 ;;
115 solaris*)
116 case $cc_basename in
117 f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
118 wl='-Qoption ld '
119 ;;
120 *)
121 wl='-Wl,'
122 ;;
123 esac
124 ;;
125 sunos4*)
126 wl='-Qoption ld '
127 ;;
128 sysv4 | sysv4.2uw2* | sysv4.3*)
129 wl='-Wl,'
130 ;;
131 sysv4*MP*)
132 ;;
133 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
134 wl='-Wl,'
135 ;;
136 unicos*)
137 wl='-Wl,'
138 ;;
139 uts4*)
140 ;;
141 esac
142fi
143
144# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
145
146hardcode_libdir_flag_spec=
147hardcode_libdir_separator=
148hardcode_direct=no
149hardcode_minus_L=no
150
151case "$host_os" in
152 cygwin* | mingw* | pw32* | cegcc*)
153 # FIXME: the MSVC++ port hasn't been tested in a loooong time
154 # When not using gcc, we currently assume that we are using
155 # Microsoft Visual C++.
156 if test "$GCC" != yes; then
157 with_gnu_ld=no
158 fi
159 ;;
160 interix*)
161 # we just hope/assume this is gcc and not c89 (= MSVC++)
162 with_gnu_ld=yes
163 ;;
164 openbsd*)
165 with_gnu_ld=no
166 ;;
167esac
168
169ld_shlibs=yes
170if test "$with_gnu_ld" = yes; then
171 # Set some defaults for GNU ld with shared library support. These
172 # are reset later if shared libraries are not supported. Putting them
173 # here allows them to be overridden if necessary.
174 # Unlike libtool, we use -rpath here, not --rpath, since the documented
175 # option of GNU ld is called -rpath, not --rpath.
176 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
177 case "$host_os" in
178 aix[3-9]*)
179 # On AIX/PPC, the GNU linker is very broken
180 if test "$host_cpu" != ia64; then
181 ld_shlibs=no
182 fi
183 ;;
184 amigaos*)
185 case "$host_cpu" in
186 powerpc)
187 ;;
188 m68k)
189 hardcode_libdir_flag_spec='-L$libdir'
190 hardcode_minus_L=yes
191 ;;
192 esac
193 ;;
194 beos*)
195 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
196 :
197 else
198 ld_shlibs=no
199 fi
200 ;;
201 cygwin* | mingw* | pw32* | cegcc*)
202 # hardcode_libdir_flag_spec is actually meaningless, as there is
203 # no search path for DLLs.
204 hardcode_libdir_flag_spec='-L$libdir'
205 if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
206 :
207 else
208 ld_shlibs=no
209 fi
210 ;;
211 haiku*)
212 ;;
213 interix[3-9]*)
214 hardcode_direct=no
215 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
216 ;;
217 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
218 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
219 :
220 else
221 ld_shlibs=no
222 fi
223 ;;
224 netbsd*)
225 ;;
226 solaris*)
227 if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
228 ld_shlibs=no
229 elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
230 :
231 else
232 ld_shlibs=no
233 fi
234 ;;
235 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
236 case `$LD -v 2>&1` in
237 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
238 ld_shlibs=no
239 ;;
240 *)
241 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
242 hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
243 else
244 ld_shlibs=no
245 fi
246 ;;
247 esac
248 ;;
249 sunos4*)
250 hardcode_direct=yes
251 ;;
252 *)
253 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
254 :
255 else
256 ld_shlibs=no
257 fi
258 ;;
259 esac
260 if test "$ld_shlibs" = no; then
261 hardcode_libdir_flag_spec=
262 fi
263else
264 case "$host_os" in
265 aix3*)
266 # Note: this linker hardcodes the directories in LIBPATH if there
267 # are no directories specified by -L.
268 hardcode_minus_L=yes
269 if test "$GCC" = yes; then
270 # Neither direct hardcoding nor static linking is supported with a
271 # broken collect2.
272 hardcode_direct=unsupported
273 fi
274 ;;
275 aix[4-9]*)
276 if test "$host_cpu" = ia64; then
277 # On IA64, the linker does run time linking by default, so we don't
278 # have to do anything special.
279 aix_use_runtimelinking=no
280 else
281 aix_use_runtimelinking=no
282 # Test if we are trying to use run time linking or normal
283 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
284 # need to do runtime linking.
285 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
286 for ld_flag in $LDFLAGS; do
287 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
288 aix_use_runtimelinking=yes
289 break
290 fi
291 done
292 ;;
293 esac
294 fi
295 hardcode_direct=yes
296 hardcode_libdir_separator=':'
297 if test "$GCC" = yes; then
298 case $host_os in aix4.[012]|aix4.[012].*)
299 collect2name=`${CC} -print-prog-name=collect2`
300 if test -f "$collect2name" && \
301 strings "$collect2name" | grep resolve_lib_name >/dev/null
302 then
303 # We have reworked collect2
304 :
305 else
306 # We have old collect2
307 hardcode_direct=unsupported
308 hardcode_minus_L=yes
309 hardcode_libdir_flag_spec='-L$libdir'
310 hardcode_libdir_separator=
311 fi
312 ;;
313 esac
314 fi
315 # Begin _LT_AC_SYS_LIBPATH_AIX.
316 echo 'int main () { return 0; }' > conftest.c
317 ${CC} ${LDFLAGS} conftest.c -o conftest
318 aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
319}'`
320 if test -z "$aix_libpath"; then
321 aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
322}'`
323 fi
324 if test -z "$aix_libpath"; then
325 aix_libpath="/usr/lib:/lib"
326 fi
327 rm -f conftest.c conftest
328 # End _LT_AC_SYS_LIBPATH_AIX.
329 if test "$aix_use_runtimelinking" = yes; then
330 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
331 else
332 if test "$host_cpu" = ia64; then
333 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
334 else
335 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
336 fi
337 fi
338 ;;
339 amigaos*)
340 case "$host_cpu" in
341 powerpc)
342 ;;
343 m68k)
344 hardcode_libdir_flag_spec='-L$libdir'
345 hardcode_minus_L=yes
346 ;;
347 esac
348 ;;
349 bsdi[45]*)
350 ;;
351 cygwin* | mingw* | pw32* | cegcc*)
352 # When not using gcc, we currently assume that we are using
353 # Microsoft Visual C++.
354 # hardcode_libdir_flag_spec is actually meaningless, as there is
355 # no search path for DLLs.
356 hardcode_libdir_flag_spec=' '
357 libext=lib
358 ;;
359 darwin* | rhapsody*)
360 hardcode_direct=no
361 if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
362 :
363 else
364 ld_shlibs=no
365 fi
366 ;;
367 dgux*)
368 hardcode_libdir_flag_spec='-L$libdir'
369 ;;
370 freebsd2.2*)
371 hardcode_libdir_flag_spec='-R$libdir'
372 hardcode_direct=yes
373 ;;
374 freebsd2*)
375 hardcode_direct=yes
376 hardcode_minus_L=yes
377 ;;
378 freebsd* | dragonfly*)
379 hardcode_libdir_flag_spec='-R$libdir'
380 hardcode_direct=yes
381 ;;
382 hpux9*)
383 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
384 hardcode_libdir_separator=:
385 hardcode_direct=yes
386 # hardcode_minus_L: Not really in the search PATH,
387 # but as the default location of the library.
388 hardcode_minus_L=yes
389 ;;
390 hpux10*)
391 if test "$with_gnu_ld" = no; then
392 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
393 hardcode_libdir_separator=:
394 hardcode_direct=yes
395 # hardcode_minus_L: Not really in the search PATH,
396 # but as the default location of the library.
397 hardcode_minus_L=yes
398 fi
399 ;;
400 hpux11*)
401 if test "$with_gnu_ld" = no; then
402 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
403 hardcode_libdir_separator=:
404 case $host_cpu in
405 hppa*64*|ia64*)
406 hardcode_direct=no
407 ;;
408 *)
409 hardcode_direct=yes
410 # hardcode_minus_L: Not really in the search PATH,
411 # but as the default location of the library.
412 hardcode_minus_L=yes
413 ;;
414 esac
415 fi
416 ;;
417 irix5* | irix6* | nonstopux*)
418 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
419 hardcode_libdir_separator=:
420 ;;
421 netbsd*)
422 hardcode_libdir_flag_spec='-R$libdir'
423 hardcode_direct=yes
424 ;;
425 newsos6)
426 hardcode_direct=yes
427 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
428 hardcode_libdir_separator=:
429 ;;
430 *nto* | *qnx*)
431 ;;
432 openbsd*)
433 if test -f /usr/libexec/ld.so; then
434 hardcode_direct=yes
435 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
436 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
437 else
438 case "$host_os" in
439 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
440 hardcode_libdir_flag_spec='-R$libdir'
441 ;;
442 *)
443 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
444 ;;
445 esac
446 fi
447 else
448 ld_shlibs=no
449 fi
450 ;;
451 os2*)
452 hardcode_libdir_flag_spec='-L$libdir'
453 hardcode_minus_L=yes
454 ;;
455 osf3*)
456 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
457 hardcode_libdir_separator=:
458 ;;
459 osf4* | osf5*)
460 if test "$GCC" = yes; then
461 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
462 else
463 # Both cc and cxx compiler support -rpath directly
464 hardcode_libdir_flag_spec='-rpath $libdir'
465 fi
466 hardcode_libdir_separator=:
467 ;;
468 solaris*)
469 hardcode_libdir_flag_spec='-R$libdir'
470 ;;
471 sunos4*)
472 hardcode_libdir_flag_spec='-L$libdir'
473 hardcode_direct=yes
474 hardcode_minus_L=yes
475 ;;
476 sysv4)
477 case $host_vendor in
478 sni)
479 hardcode_direct=yes # is this really true???
480 ;;
481 siemens)
482 hardcode_direct=no
483 ;;
484 motorola)
485 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
486 ;;
487 esac
488 ;;
489 sysv4.3*)
490 ;;
491 sysv4*MP*)
492 if test -d /usr/nec; then
493 ld_shlibs=yes
494 fi
495 ;;
496 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
497 ;;
498 sysv5* | sco3.2v5* | sco5v6*)
499 hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
500 hardcode_libdir_separator=':'
501 ;;
502 uts4*)
503 hardcode_libdir_flag_spec='-L$libdir'
504 ;;
505 *)
506 ld_shlibs=no
507 ;;
508 esac
509fi
510
511# Check dynamic linker characteristics
512# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
513# Unlike libtool.m4, here we don't care about _all_ names of the library, but
514# only about the one the linker finds when passed -lNAME. This is the last
515# element of library_names_spec in libtool.m4, or possibly two of them if the
516# linker has special search rules.
517library_names_spec= # the last element of library_names_spec in libtool.m4
518libname_spec='lib$name'
519case "$host_os" in
520 aix3*)
521 library_names_spec='$libname.a'
522 ;;
523 aix[4-9]*)
524 library_names_spec='$libname$shrext'
525 ;;
526 amigaos*)
527 case "$host_cpu" in
528 powerpc*)
529 library_names_spec='$libname$shrext' ;;
530 m68k)
531 library_names_spec='$libname.a' ;;
532 esac
533 ;;
534 beos*)
535 library_names_spec='$libname$shrext'
536 ;;
537 bsdi[45]*)
538 library_names_spec='$libname$shrext'
539 ;;
540 cygwin* | mingw* | pw32* | cegcc*)
541 shrext=.dll
542 library_names_spec='$libname.dll.a $libname.lib'
543 ;;
544 darwin* | rhapsody*)
545 shrext=.dylib
546 library_names_spec='$libname$shrext'
547 ;;
548 dgux*)
549 library_names_spec='$libname$shrext'
550 ;;
551 freebsd* | dragonfly*)
552 case "$host_os" in
553 freebsd[123]*)
554 library_names_spec='$libname$shrext$versuffix' ;;
555 *)
556 library_names_spec='$libname$shrext' ;;
557 esac
558 ;;
559 gnu*)
560 library_names_spec='$libname$shrext'
561 ;;
562 haiku*)
563 library_names_spec='$libname$shrext'
564 ;;
565 hpux9* | hpux10* | hpux11*)
566 case $host_cpu in
567 ia64*)
568 shrext=.so
569 ;;
570 hppa*64*)
571 shrext=.sl
572 ;;
573 *)
574 shrext=.sl
575 ;;
576 esac
577 library_names_spec='$libname$shrext'
578 ;;
579 interix[3-9]*)
580 library_names_spec='$libname$shrext'
581 ;;
582 irix5* | irix6* | nonstopux*)
583 library_names_spec='$libname$shrext'
584 case "$host_os" in
585 irix5* | nonstopux*)
586 libsuff= shlibsuff=
587 ;;
588 *)
589 case $LD in
590 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
591 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
592 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
593 *) libsuff= shlibsuff= ;;
594 esac
595 ;;
596 esac
597 ;;
598 linux*oldld* | linux*aout* | linux*coff*)
599 ;;
600 linux* | k*bsd*-gnu | kopensolaris*-gnu)
601 library_names_spec='$libname$shrext'
602 ;;
603 knetbsd*-gnu)
604 library_names_spec='$libname$shrext'
605 ;;
606 netbsd*)
607 library_names_spec='$libname$shrext'
608 ;;
609 newsos6)
610 library_names_spec='$libname$shrext'
611 ;;
612 *nto* | *qnx*)
613 library_names_spec='$libname$shrext'
614 ;;
615 openbsd*)
616 library_names_spec='$libname$shrext$versuffix'
617 ;;
618 os2*)
619 libname_spec='$name'
620 shrext=.dll
621 library_names_spec='$libname.a'
622 ;;
623 osf3* | osf4* | osf5*)
624 library_names_spec='$libname$shrext'
625 ;;
626 rdos*)
627 ;;
628 solaris*)
629 library_names_spec='$libname$shrext'
630 ;;
631 sunos4*)
632 library_names_spec='$libname$shrext$versuffix'
633 ;;
634 sysv4 | sysv4.3*)
635 library_names_spec='$libname$shrext'
636 ;;
637 sysv4*MP*)
638 library_names_spec='$libname$shrext'
639 ;;
640 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
641 library_names_spec='$libname$shrext'
642 ;;
643 tpf*)
644 library_names_spec='$libname$shrext'
645 ;;
646 uts4*)
647 library_names_spec='$libname$shrext'
648 ;;
649esac
650
651sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
652escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
653shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
654escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
655escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
656escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
657
658LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
659
660# How to pass a linker flag through the compiler.
661wl="$escaped_wl"
662
663# Static library suffix (normally "a").
664libext="$libext"
665
666# Shared library suffix (normally "so").
667shlibext="$shlibext"
668
669# Format of library name prefix.
670libname_spec="$escaped_libname_spec"
671
672# Library names that the linker finds when passed -lNAME.
673library_names_spec="$escaped_library_names_spec"
674
675# Flag to hardcode \$libdir into a binary during linking.
676# This must work even if \$libdir does not exist.
677hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
678
679# Whether we need a single -rpath flag with a separated argument.
680hardcode_libdir_separator="$hardcode_libdir_separator"
681
682# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
683# resulting binary.
684hardcode_direct="$hardcode_direct"
685
686# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
687# resulting binary.
688hardcode_minus_L="$hardcode_minus_L"
689
690EOF
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/iconv-m4-remove-the-test-to-convert-euc-jp.patch b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/iconv-m4-remove-the-test-to-convert-euc-jp.patch
new file mode 100644
index 0000000000..d453a74b51
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/iconv-m4-remove-the-test-to-convert-euc-jp.patch
@@ -0,0 +1,43 @@
1From 0bfade685783ccd193b2e1b94d0e4ef5ce449432 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Wed, 20 Nov 2013 17:52:50 +0800
4Subject: [PATCH] remove the test to convert euc-jp
5
6Remove the test "Test against HP-UX 11.11 bug:
7No converter from EUC-JP to UTF-8 is provided"
8since we don't support HP-UX and it causes
9guile-native compile failure if the euc-jp is not
10installed on the host
11
12Upstream-Status: Inappropriate [OE specific]
13
14Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
15---
16 iconv.m4 | 11 -----------
17 1 file changed, 11 deletions(-)
18
19diff --git a/iconv.m4 b/iconv.m4
20index a503646..dbe7ca1 100644
21--- a/iconv.m4
22+++ b/iconv.m4
23@@ -159,17 +159,6 @@ int main ()
24 }
25 }
26 #endif
27- /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
28- provided. */
29- if (/* Try standardized names. */
30- iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
31- /* Try IRIX, OSF/1 names. */
32- && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
33- /* Try AIX names. */
34- && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
35- /* Try HP-UX names. */
36- && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
37- result |= 16;
38 return result;
39 }]])],
40 [am_cv_func_iconv_works=yes],
41--
421.8.3
43
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/remove-potcdate.sin b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/remove-potcdate.sin
new file mode 100644
index 0000000000..2436c49e78
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.18.3.2/remove-potcdate.sin
@@ -0,0 +1,19 @@
1# Sed script that remove the POT-Creation-Date line in the header entry
2# from a POT file.
3#
4# The distinction between the first and the following occurrences of the
5# pattern is achieved by looking at the hold space.
6/^"POT-Creation-Date: .*"$/{
7x
8# Test if the hold space is empty.
9s/P/P/
10ta
11# Yes it was empty. First occurrence. Remove the line.
12g
13d
14bb
15:a
16# The hold space was nonempty. Following occurrences. Do nothing.
17x
18:b
19}
diff --git a/meta/recipes-core/gettext/gettext-minimal-native_0.18.3.2.bb b/meta/recipes-core/gettext/gettext-minimal-native_0.18.3.2.bb
new file mode 100644
index 0000000000..2b43b97022
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-native_0.18.3.2.bb
@@ -0,0 +1,32 @@
1SUMMARY = "Minimal gettext for supporting native autoconf/automake"
2DESCRIPTION = "Contains the m4 macros sufficient to support building \
3autoconf/automake. This provides a significant build time speedup by \
4the removal of gettext-native from most dependency chains (now only \
5needed for gettext for the target)."
6SRC_URI = "file://aclocal.tgz \
7 file://config.rpath \
8 file://Makefile.in.in \
9 file://remove-potcdate.sin \
10 file://COPYING \
11 file://iconv-m4-remove-the-test-to-convert-euc-jp.patch \
12"
13
14INHIBIT_DEFAULT_DEPS = "1"
15INHIBIT_AUTOTOOLS_DEPS = "1"
16
17LICENSE = "FSF-Unlimited"
18LIC_FILES_CHKSUM = "file://COPYING;md5=0854da868a929923087141d9d7aba7d5"
19
20inherit native
21
22
23S = "${WORKDIR}"
24
25do_install () {
26 install -d ${D}${datadir}/aclocal/
27 cp ${WORKDIR}/*.m4 ${D}${datadir}/aclocal/
28 install -d ${D}${datadir}/gettext/po/
29 cp ${WORKDIR}/config.rpath ${D}${datadir}/gettext/
30 cp ${WORKDIR}/Makefile.in.in ${D}${datadir}/gettext/po/
31 cp ${WORKDIR}/remove-potcdate.sin ${D}${datadir}/gettext/po/
32}
diff --git a/meta/recipes-core/gettext/gettext_0.16.1.bb b/meta/recipes-core/gettext/gettext_0.16.1.bb
new file mode 100644
index 0000000000..5725e7fe07
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext_0.16.1.bb
@@ -0,0 +1,109 @@
1SUMMARY = "Utilities and libraries for producing multi-lingual messages"
2DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
3HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
4SECTION = "libs"
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://COPYING;md5=9ea3144f04c41cd2eada5d3f472e6ea5"
7
8PR = "r6"
9DEPENDS = "virtual/libiconv"
10DEPENDS_class-native = ""
11PROVIDES = "virtual/libintl virtual/gettext"
12PROVIDES_class-native = ""
13
14SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
15 file://gettext-vpath.patch \
16 file://linklib_from_0.17.patch \
17 file://gettext-autoconf-lib-link-no-L.patch \
18 file://disable_java.patch \
19 file://fix_aclocal_version.patch \
20 file://fix_gnu_source_circular.patch \
21 file://hardcode_macro_version.patch \
22 "
23
24
25SRC_URI_append_linux-uclibc = " file://gettext-error_print_progname.patch"
26SRC_URI_append_linux-uclibceabi = " file://gettext-error_print_progname.patch"
27
28SRC_URI[md5sum] = "3d9ad24301c6d6b17ec30704a13fe127"
29SRC_URI[sha256sum] = "0bf850d1a079fb5a61f0a47b1a9efd35eb44032255375e1cedb0253bc27b376d"
30
31PARALLEL_MAKE = ""
32
33inherit autotools
34
35EXTRA_OECONF += "--without-lisp --disable-csharp --disable-openmp --without-emacs"
36acpaths = '-I ${S}/autoconf-lib-link/m4/ \
37 -I ${S}/gettext-runtime/m4 \
38 -I ${S}/gettext-tools/m4'
39
40do_configure_prepend() {
41 rm -f ${S}/config/m4/libtool.m4
42}
43
44# these lack the .x behind the .so, but shouldn't be in the -dev package
45# Otherwise you get the following results:
46# 7.4M glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
47# 25M uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
48# because gettext depends on gettext-dev, which pulls in more -dev packages:
49# 15228 KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk
50# 1300 KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk
51# 140 KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk
52# 4 KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
53
54PACKAGES =+ "libgettextlib libgettextsrc"
55FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
56FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
57
58PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-staticdev gettext-runtime-doc"
59
60FILES_${PN} += "${libdir}/${BPN}/*"
61
62FILES_gettext-runtime = "${bindir}/gettext \
63 ${bindir}/ngettext \
64 ${bindir}/envsubst \
65 ${bindir}/gettext.sh \
66 ${libdir}/libasprintf${SODEV} \
67 ${libdir}/GNU.Gettext.dll \
68 "
69FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \
70 ${libdir}/charset.alias \
71 "
72FILES_gettext-runtime-staticdev += "${libdir}/libasprintf.a"
73FILES_gettext-runtime-dev += "${includedir}/autosprintf.h \
74 ${libdir}/libasprintf${SOLIBDEV}"
75FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \
76 ${includedir}/libintl.h \
77 "
78FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
79 ${mandir}/man1/ngettext.* \
80 ${mandir}/man1/envsubst.* \
81 ${mandir}/man1/.* \
82 ${mandir}/man3/* \
83 ${docdir}/gettext/gettext.* \
84 ${docdir}/gettext/ngettext.* \
85 ${docdir}/gettext/envsubst.* \
86 ${docdir}/gettext/*.3.html \
87 ${datadir}/gettext/ABOUT-NLS \
88 ${docdir}/gettext/csharpdoc/* \
89 ${docdir}/libasprintf/autosprintf.html \
90 ${infodir}/autosprintf.info \
91 "
92
93
94do_install_append() {
95 rm -f ${D}${libdir}/preloadable_libintl.so
96}
97
98# Anyone inheriting gettext will have both gettext-native and gettext
99# available, and we don't want to use older macros from the target gettext in
100# a non-gplv3 build, so kill them and let dependent recipes rely on
101# gettext-native.
102
103SYSROOT_PREPROCESS_FUNCS += "remove_sysroot_m4_macros"
104
105remove_sysroot_m4_macros () {
106 rm -r "${SYSROOT_DESTDIR}${datadir}/aclocal"
107}
108
109BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/gettext/gettext_0.18.3.2.bb b/meta/recipes-core/gettext/gettext_0.18.3.2.bb
new file mode 100644
index 0000000000..553d52223e
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext_0.18.3.2.bb
@@ -0,0 +1,106 @@
1SUMMARY = "Utilities and libraries for producing multi-lingual messages"
2DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
3HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
4SECTION = "libs"
5LICENSE = "GPLv3+ & LGPL-2.1+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
7
8DEPENDS = "gettext-native virtual/libiconv expat"
9DEPENDS_class-native = "gettext-minimal-native"
10PROVIDES = "virtual/libintl virtual/gettext"
11PROVIDES_class-native = "virtual/gettext-native"
12RCONFLICTS_${PN} = "proxy-libintl"
13SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
14 file://parallel.patch \
15 "
16
17PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
18
19LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "
20
21SRC_URI[md5sum] = "241aba309d07aa428252c74b40a818ef"
22SRC_URI[sha256sum] = "d1a4e452d60eb407ab0305976529a45c18124bd518d976971ac6dc7aa8b4c5d7"
23
24inherit autotools
25
26EXTRA_OECONF += "--without-lispdir \
27 --disable-csharp \
28 --disable-libasprintf \
29 --disable-java \
30 --disable-native-java \
31 --disable-openmp \
32 --disable-acl \
33 --with-included-glib \
34 --without-emacs \
35 --without-cvs \
36 --without-git \
37 --with-included-libxml \
38 --with-included-libcroco \
39 --with-included-libunistring \
40 "
41
42acpaths = '-I ${S}/gettext-runtime/m4 \
43 -I ${S}/gettext-tools/m4'
44
45
46# these lack the .x behind the .so, but shouldn't be in the -dev package
47# Otherwise you get the following results:
48# 7.4M glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
49# 25M uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
50# because gettext depends on gettext-dev, which pulls in more -dev packages:
51# 15228 KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk
52# 1300 KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk
53# 140 KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk
54# 4 KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
55
56PACKAGES =+ "libgettextlib libgettextsrc"
57FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
58FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
59
60PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-doc"
61
62FILES_${PN} += "${libdir}/${BPN}/*"
63
64FILES_gettext-runtime = "${bindir}/gettext \
65 ${bindir}/ngettext \
66 ${bindir}/envsubst \
67 ${bindir}/gettext.sh \
68 ${libdir}/libasprintf.so* \
69 ${libdir}/GNU.Gettext.dll \
70 "
71FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \
72 ${libdir}/charset.alias \
73 "
74FILES_gettext-runtime-dev += "${libdir}/libasprintf.a \
75 ${includedir}/autosprintf.h \
76 "
77FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \
78 ${includedir}/libintl.h \
79 "
80FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
81 ${mandir}/man1/ngettext.* \
82 ${mandir}/man1/envsubst.* \
83 ${mandir}/man1/.* \
84 ${mandir}/man3/* \
85 ${docdir}/gettext/gettext.* \
86 ${docdir}/gettext/ngettext.* \
87 ${docdir}/gettext/envsubst.* \
88 ${docdir}/gettext/*.3.html \
89 ${datadir}/gettext/ABOUT-NLS \
90 ${docdir}/gettext/csharpdoc/* \
91 ${docdir}/libasprintf/autosprintf.html \
92 ${infodir}/autosprintf.info \
93 "
94
95do_install_append() {
96 rm -f ${D}${libdir}/preloadable_libintl.so
97}
98
99do_install_append_class-native () {
100 rm ${D}${datadir}/aclocal/*
101 rm ${D}${datadir}/gettext/config.rpath
102 rm ${D}${datadir}/gettext/po/Makefile.in.in
103 rm ${D}${datadir}/gettext/po/remove-potcdate.sin
104}
105
106BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch
new file mode 100644
index 0000000000..9b87d9d547
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch
@@ -0,0 +1,56 @@
1From 0167c3340d8201dca8e9031b61703bbc5ed6ce33 Mon Sep 17 00:00:00 2001
2From: Jan Schmidt <thaytan@noraisin.net>
3Date: Wed, 25 Sep 2013 19:22:26 +1000
4Subject: [PATCH] gio: Fix -Werror format string errors from mismatched ints.
5
6Upstream-Status: Backport
7
8---
9 gio/gdbusmessage.c | 8 ++++----
10 gio/gdbusprivate.c | 4 ++--
11 2 files changed, 6 insertions(+), 6 deletions(-)
12
13diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
14index ac233a3..ad77aa6 100644
15--- a/gio/gdbusmessage.c
16+++ b/gio/gdbusmessage.c
17@@ -3468,10 +3468,10 @@ g_dbus_message_print (GDBusMessage *message,
18 statbuf.st_mode);
19 g_string_append_printf (fs, "%s" "ino=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
20 (guint64) statbuf.st_ino);
21- g_string_append_printf (fs, "%s" "uid=%d", fs->len > 0 ? "," : "",
22- statbuf.st_uid);
23- g_string_append_printf (fs, "%s" "gid=%d", fs->len > 0 ? "," : "",
24- statbuf.st_gid);
25+ g_string_append_printf (fs, "%s" "uid=%u", fs->len > 0 ? "," : "",
26+ (guint) statbuf.st_uid);
27+ g_string_append_printf (fs, "%s" "gid=%u", fs->len > 0 ? "," : "",
28+ (guint) statbuf.st_gid);
29 g_string_append_printf (fs, "%s" "rdev=%d:%d", fs->len > 0 ? "," : "",
30 major (statbuf.st_rdev), minor (statbuf.st_rdev));
31 g_string_append_printf (fs, "%s" "size=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
32diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
33index 0e5bef2..785a0c0 100644
34--- a/gio/gdbusprivate.c
35+++ b/gio/gdbusprivate.c
36@@ -2155,7 +2155,7 @@ write_message_print_transport_debug (gssize bytes_written,
37 _g_dbus_debug_print_lock ();
38 g_print ("========================================================================\n"
39 "GDBus-debug:Transport:\n"
40- " >>>> WROTE %" G_GSIZE_FORMAT " bytes of message with serial %d and\n"
41+ " >>>> WROTE %" G_GSSIZE_FORMAT " bytes of message with serial %d and\n"
42 " size %" G_GSIZE_FORMAT " from offset %" G_GSIZE_FORMAT " on a %s\n",
43 bytes_written,
44 g_dbus_message_get_serial (data->message),
45@@ -2206,7 +2206,7 @@ read_message_print_transport_debug (gssize bytes_read,
46 _g_dbus_debug_print_lock ();
47 g_print ("========================================================================\n"
48 "GDBus-debug:Transport:\n"
49- " <<<< READ %" G_GSIZE_FORMAT " bytes of message with serial %d and\n"
50+ " <<<< READ %" G_GSSIZE_FORMAT " bytes of message with serial %d and\n"
51 " size %d to offset %" G_GSIZE_FORMAT " from a %s\n",
52 bytes_read,
53 serial,
54--
551.8.3.1
56
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch b/meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch
new file mode 100644
index 0000000000..3aac35a5d3
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch
@@ -0,0 +1,39 @@
1From 55253b55b9c65f3e0efbbe03cbab2a4c4014a16b Mon Sep 17 00:00:00 2001
2From: Song.Li <Song.Li@windriver.com>
3Date: Thu, 5 Jul 2012 15:09:41 +0800
4Subject: [PATCH] add -march=i486 into CFLAGS automatically
5
6Upstream-Status: Inappropriate [configuration]
7
8glib configure will check if current gcc need -march=i486,
9when gcc need -march=i486 but CFLAGS don't have,
10glib configure will abort and advise the user to add -march=i486 or later.
11This will break the build process,it's not good for automatic build system.
12so change this to adding -march=i485 automatically when it is needed.
13---
14 configure.ac | 6 ++++--
15 1 files changed, 4 insertions(+), 2 deletions(-)
16
17Index: glib-2.36.0/configure.ac
18===================================================================
19--- glib-2.36.0.orig/configure.ac
20+++ glib-2.36.0/configure.ac
21@@ -2378,7 +2378,7 @@ dnl
22 dnl Note that the atomic ops are only available with GCC on x86 when
23 dnl using -march=i486 or higher. If we detect that the atomic ops are
24 dnl not available but would be available given the right flags, we want
25-dnl to abort and advise the user to fix their CFLAGS. It's better to do
26+dnl to add -march=i486 automatically to fix their CFLAGS. It's better to do
27 dnl that then to silently fall back on emulated atomic ops just because
28 dnl the user had the wrong build environment.
29
30@@ -2401,7 +2401,8 @@ AC_CACHE_CHECK([for lock-free atomic int
31 AC_TRY_COMPILE([],
32 [volatile int atomic = 2;\
33 __sync_bool_compare_and_swap (&atomic, 2, 3);],
34- [AC_MSG_ERROR([GLib must be build with -march=i486 or later.])],
35+ [AC_MSG_WARN([GLib must be build with -march=i486 or later.])
36+ SAVE_CFLAGS="${SAVE_CFLAGS} -march=i486"],
37 [])
38 CFLAGS="${SAVE_CFLAGS}"
39 fi
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch b/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
new file mode 100644
index 0000000000..1d69a3f290
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
@@ -0,0 +1,60 @@
1From 1c5718648d49e795efee91c220a2bf9386c184f2 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Sat, 28 Apr 2012 18:24:50 +0200
4Subject: [PATCH] configure: use $host_alias-libtool instead of libtool
5 directly
6
7Poky renames libtool to $host_alias-libtool.
8./$host_alias-libtool isn't created until after configure runs with
9libtool >= 2.2.2
10so we can't call # it at this point. We can safely assume a version is
11available
12from PATH though
13
14Rebased to glib-2.27.3 by Dongxiao Xu <dongxiao.xu@intel.com>
15Rebased to glib-2.32.1 by Martin Jansa <Martin.Jansa@gmail.com>
16
17Upstream-Status: Inappropriate [configuration]
18
19Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
20---
21 configure.ac | 8 ++++----
22 1 files changed, 4 insertions(+), 4 deletions(-)
23
24diff --git a/configure.ac b/configure.ac
25index a6478c6..9a93d60 100644
26--- a/configure.ac
27+++ b/configure.ac
28@@ -1470,7 +1470,7 @@ if test x"$glib_native_win32" = xyes; then
29 G_MODULE_LDFLAGS=
30 else
31 export SED
32- G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
33+ G_MODULE_LDFLAGS=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
34 fi
35 dnl G_MODULE_IMPL= don't reset, so cmd-line can override
36 G_MODULE_NEED_USCORE=0
37@@ -1535,9 +1535,9 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then
38 LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
39 dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
40 echo "void glib_plugin_test(void) { }" > plugin.c
41- ${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
42+ ${SHELL} ./$host_alias-libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
43 ${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1
44- ${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
45+ ${SHELL} ./$host_alias-libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
46 ${LDFLAGS} -module -o plugin.la -export-dynamic \
47 -shrext ".o" -avoid-version plugin.lo \
48 -rpath /dont/care >/dev/null 2>&1
49@@ -1614,7 +1614,7 @@ fi
50
51 AC_MSG_CHECKING(for the suffix of module shared libraries)
52 export SED
53-shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
54+shrext_cmds=`./$host_alias-libtool --config | grep '^shrext_cmds='`
55 eval $shrext_cmds
56 module=yes eval std_shrext=$shrext_cmds
57 # chop the initial dot
58--
591.7.8.6
60
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch b/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch
new file mode 100644
index 0000000000..1571112b0e
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch
@@ -0,0 +1,35 @@
1Rename 'rand' variable to avoid conflict.
2
3Upstream-Status: pending
4Signed-off-by: Björn Stenberg <bjst@enea.com>
5
6diff -u glib-2.34.3/tests/refcount/signals.c~ glib-2.34.3/tests/refcount/signals.c
7--- glib-2.34.3/tests/refcount/signals.c 2012-11-26 17:52:48.000000000 +0100
8+++ glib-2.34.3/tests/refcount/signals.c 2013-02-08 14:24:10.052477546 +0100
9@@ -9,7 +9,7 @@
10 #define MY_IS_TEST_CLASS(tclass) (G_TYPE_CHECK_CLASS_TYPE ((tclass), G_TYPE_TEST))
11 #define MY_TEST_GET_CLASS(test) (G_TYPE_INSTANCE_GET_CLASS ((test), G_TYPE_TEST, GTestClass))
12
13-static GRand *rand;
14+static GRand *grand;
15
16 typedef struct _GTest GTest;
17 typedef struct _GTestClass GTestClass;
18@@ -84,7 +84,7 @@
19 NULL
20 };
21
22- rand = g_rand_new();
23+ grand = g_rand_new();
24
25 test_type = g_type_register_static (G_TYPE_OBJECT, "GTest",
26 &test_info, 0);
27@@ -218,7 +218,7 @@
28 static void
29 my_test_do_prop (GTest * test)
30 {
31- test->value = g_rand_int (rand);
32+ test->value = g_rand_int (grand);
33 g_object_notify (G_OBJECT (test), "test-prop");
34 }
35
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/gio-test-race.patch b/meta/recipes-core/glib-2.0/glib-2.0/gio-test-race.patch
new file mode 100644
index 0000000000..720ea6c328
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/gio-test-race.patch
@@ -0,0 +1,54 @@
1Upstream-Status: Submitted
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From a047a0270ee5faf1d9d6080cbc613defdf52baea Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@intel.com>
6Date: Tue, 4 Feb 2014 13:15:08 +0000
7Subject: [PATCH] gio/tests: fix race when generating code
8
9There is a race condition in the makefile that can result in build failures like this in parallel builds:
10
11| ./gdbus-test-codegen-generated.h:7:0: error: unterminated #ifndef
12| #ifndef __GDBUS_TEST_CODEGEN_GENERATED_H__
13
14This is because a rule like this:
15
16x.c x.h: prerequisites
17 @commands
18
19doesn't consider x.c and x.h together. Instead, it expands to two rules, one to
20generate x.c and one to generate x.h, which happen to run the same commands. In
21the worst case they execute in parallel, overwriting each other's output.
22
23Signed-off-by: Ross Burton <ross.burton@intel.com>
24
25https://bugzilla.gnome.org/show_bug.cgi?id=723616
26---
27 gio/tests/Makefile.am | 4 +++-
28 1 file changed, 3 insertions(+), 1 deletion(-)
29
30diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
31index 0beb239..270faf6 100644
32--- a/gio/tests/Makefile.am
33+++ b/gio/tests/Makefile.am
34@@ -436,7 +436,7 @@ gmenumodel_SOURCES = $(gdbus_sessionbus_sources) gmenumode
35 gnotification_SOURCES = $(gdbus_sessionbus_sources) gnotification.c gnotification-server.h gnotification-server.c
36
37 gdbus-test-codegen.o: gdbus-test-codegen-generated.h
38-gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
39+gdbus-test-codegen-generated.h: test-codegen.xml Makefile $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen
40 $(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
41 UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
42 $(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
43@@ -455,6 +455,8 @@ gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c: test-codegen.xml
44 --annotate "org.project.Bar::TestSignal[array_of_strings]" Key8 Value8 \
45 $(srcdir)/test-codegen.xml \
46 $(NULL)
47+gdbus-test-codegen-generated.c: gdbus-test-codegen-generated.h
48+ @: # Generated as side-effect of .h
49
50 EXTRA_DIST += test-codegen.xml
51 CLEANFILES += gdbus-test-codegen-generated.[ch] gdbus-test-codegen-generated-doc-*.xml
52--
531.7.10.4
54
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch b/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch
new file mode 100644
index 0000000000..9759d11e3c
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch
@@ -0,0 +1,29 @@
1configure.ac: change readlink -f to -m
2
3Change "readlink -f" to "readlink -m" since $libdir/$with_runtime_libdir
4may not exist.
5
6This patch should go to the upstream, I will send it sooner.
7
8Upstream-Status: Pending
9
10Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
11---
12 configure.ac | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/configure.ac b/configure.ac
16--- a/configure.ac
17+++ b/configure.ac
18@@ -271,7 +271,7 @@ AC_ARG_WITH(runtime-libdir,
19 [],
20 [with_runtime_libdir=""])
21 GLIB_RUNTIME_LIBDIR="$with_runtime_libdir"
22-ABS_GLIB_RUNTIME_LIBDIR="`readlink -f $libdir/$with_runtime_libdir`"
23+ABS_GLIB_RUNTIME_LIBDIR="`readlink -m $libdir/$with_runtime_libdir`"
24 AC_SUBST(GLIB_RUNTIME_LIBDIR)
25 AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR)
26 AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"])
27--
281.8.1.2
29
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch b/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch
new file mode 100644
index 0000000000..ee435111fc
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch
@@ -0,0 +1,24 @@
1# an very old patch cherry-picked in every glib-2.0 patch directory. The earliest container
2# for it is 2.6.5 in OE. The earliest commit for it is c8e5702127e507e82e6f68a4b8c546803accea9d
3# in OE side which ports from previous bitkeeper SCM. In OE side it's only used til 2.12.4.
4#
5# keep it since it's always cleaner to not hardcode destination path. Use @datadir@ is more
6# portable here. mark for upstream
7#
8# by Kevin Tian <kevin.tian@intel.com>, 06/25/2010
9# Rebased by Dongxiao Xu <dongxiao.xu@intel.com>, 11/16/2010
10
11Upstream-Status: Inappropriate [configuration]
12
13diff -ruN glib-2.27.3-orig/glib-gettextize.in glib-2.27.3/glib-gettextize.in
14--- glib-2.27.3-orig/glib-gettextize.in 2009-04-01 07:04:20.000000000 +0800
15+++ glib-2.27.3/glib-gettextize.in 2010-11-16 12:55:06.874605916 +0800
16@@ -52,7 +52,7 @@
17 datadir=@datadir@
18 datarootdir=@datarootdir@
19
20-gettext_dir=$prefix/share/glib-2.0/gettext
21+gettext_dir=@datadir@/glib-2.0/gettext
22
23 while test $# -gt 0; do
24 case "$1" in
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/gtest-skip-fixes.patch b/meta/recipes-core/glib-2.0/glib-2.0/gtest-skip-fixes.patch
new file mode 100644
index 0000000000..3dba0ee31b
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/gtest-skip-fixes.patch
@@ -0,0 +1,197 @@
1Fix the handling of skipped tests so that it follows what automake does.
2
3Upstream-Status: Backport [https://bugzilla.gnome.org/show_bug.cgi?id=720263]
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6diff --git a/glib/gtestutils.c b/glib/gtestutils.c
7index bc7bbcf..feaafa3 100644
8--- a/glib/gtestutils.c
9+++ b/glib/gtestutils.c
10@@ -607,9 +607,10 @@ static gchar *test_run_name = "";
11 static GSList **test_filename_free_list;
12 static guint test_run_forks = 0;
13 static guint test_run_count = 0;
14+static guint test_skipped_count = 0;
15 static GTestResult test_run_success = G_TEST_RUN_FAILURE;
16 static gchar *test_run_msg = NULL;
17-static guint test_skip_count = 0;
18+static guint test_startup_skip_count = 0;
19 static GTimer *test_user_timer = NULL;
20 static double test_user_stamp = 0;
21 static GSList *test_paths = NULL;
22@@ -765,6 +766,8 @@ g_test_log (GTestLogType lbit,
23 g_print ("Bail out!\n");
24 abort();
25 }
26+ if (largs[0] == G_TEST_RUN_SKIPPED)
27+ test_skipped_count++;
28 break;
29 case G_TEST_LOG_MIN_RESULT:
30 if (test_tap_log)
31@@ -869,11 +872,11 @@ parse_args (gint *argc_p,
32 {
33 gchar *equal = argv[i] + 16;
34 if (*equal == '=')
35- test_skip_count = g_ascii_strtoull (equal + 1, NULL, 0);
36+ test_startup_skip_count = g_ascii_strtoull (equal + 1, NULL, 0);
37 else if (i + 1 < argc)
38 {
39 argv[i++] = NULL;
40- test_skip_count = g_ascii_strtoull (argv[i], NULL, 0);
41+ test_startup_skip_count = g_ascii_strtoull (argv[i], NULL, 0);
42 }
43 argv[i] = NULL;
44 }
45@@ -1516,14 +1519,21 @@ g_test_get_root (void)
46 * g_test_run_suite() or g_test_run() may only be called once
47 * in a program.
48 *
49- * Returns: 0 on success
50+ * Returns: 0 on success, 1 on failure (assuming it returns at all),
51+ * 77 if all tests were skipped with g_test_skip().
52 *
53 * Since: 2.16
54 */
55 int
56 g_test_run (void)
57 {
58- return g_test_run_suite (g_test_get_root());
59+ if (g_test_run_suite (g_test_get_root()) != 0)
60+ return 1;
61+
62+ if (test_run_count > 0 && test_run_count == test_skipped_count)
63+ return 77;
64+ else
65+ return 0;
66 }
67
68 /**
69@@ -2063,7 +2073,7 @@ test_case_run (GTestCase *tc)
70 }
71 }
72
73- if (++test_run_count <= test_skip_count)
74+ if (++test_run_count <= test_startup_skip_count)
75 g_test_log (G_TEST_LOG_SKIP_CASE, test_run_name, NULL, 0, NULL);
76 else if (test_run_list)
77 {
78@@ -2117,7 +2127,8 @@ test_case_run (GTestCase *tc)
79 g_free (test_uri_base);
80 test_uri_base = old_base;
81
82- return success == G_TEST_RUN_SUCCESS;
83+ return (success == G_TEST_RUN_SUCCESS ||
84+ success == G_TEST_RUN_SKIPPED);
85 }
86
87 static int
88diff --git a/glib/tests/testing.c b/glib/tests/testing.c
89index 20c2e79..1025f12 100644
90--- a/glib/tests/testing.c
91+++ b/glib/tests/testing.c
92@@ -575,10 +575,93 @@ test_nonfatal (void)
93 g_test_trap_assert_stdout ("*The End*");
94 }
95
96+static void
97+test_skip (void)
98+{
99+ g_test_skip ("Skipped should count as passed, not failed");
100+}
101+
102+static void
103+test_pass (void)
104+{
105+}
106+
107+static const char *argv0;
108+
109+static void
110+test_skip_all (void)
111+{
112+ GPtrArray *argv;
113+ GError *error = NULL;
114+ int status;
115+
116+ argv = g_ptr_array_new ();
117+ g_ptr_array_add (argv, (char *) argv0);
118+ g_ptr_array_add (argv, "--GTestSubprocess");
119+ g_ptr_array_add (argv, "-p");
120+ g_ptr_array_add (argv, "/misc/skip");
121+ g_ptr_array_add (argv, NULL);
122+
123+ g_spawn_sync (NULL, (char **) argv->pdata, NULL,
124+ G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
125+ NULL, NULL, NULL, NULL, &status,
126+ &error);
127+ g_assert_no_error (error);
128+
129+ g_spawn_check_exit_status (status, &error);
130+ g_assert_error (error, G_SPAWN_EXIT_ERROR, 77);
131+ g_clear_error (&error);
132+
133+ g_ptr_array_set_size (argv, 0);
134+ g_ptr_array_add (argv, (char *) argv0);
135+ g_ptr_array_add (argv, "--GTestSubprocess");
136+ g_ptr_array_add (argv, "-p");
137+ g_ptr_array_add (argv, "/misc/skip");
138+ g_ptr_array_add (argv, "-p");
139+ g_ptr_array_add (argv, "/misc/skip-all/subprocess/skip1");
140+ g_ptr_array_add (argv, "-p");
141+ g_ptr_array_add (argv, "/misc/skip-all/subprocess/skip2");
142+ g_ptr_array_add (argv, NULL);
143+
144+ g_spawn_sync (NULL, (char **) argv->pdata, NULL,
145+ G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
146+ NULL, NULL, NULL, NULL, &status,
147+ &error);
148+ g_assert_no_error (error);
149+
150+ g_spawn_check_exit_status (status, &error);
151+ g_assert_error (error, G_SPAWN_EXIT_ERROR, 77);
152+ g_clear_error (&error);
153+
154+ g_ptr_array_set_size (argv, 0);
155+ g_ptr_array_add (argv, (char *) argv0);
156+ g_ptr_array_add (argv, "--GTestSubprocess");
157+ g_ptr_array_add (argv, "-p");
158+ g_ptr_array_add (argv, "/misc/skip");
159+ g_ptr_array_add (argv, "-p");
160+ g_ptr_array_add (argv, "/misc/skip-all/subprocess/pass");
161+ g_ptr_array_add (argv, "-p");
162+ g_ptr_array_add (argv, "/misc/skip-all/subprocess/skip1");
163+ g_ptr_array_add (argv, NULL);
164+
165+ g_spawn_sync (NULL, (char **) argv->pdata, NULL,
166+ G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
167+ NULL, NULL, NULL, NULL, &status,
168+ &error);
169+ g_assert_no_error (error);
170+
171+ g_spawn_check_exit_status (status, &error);
172+ g_assert_no_error (error);
173+
174+ g_ptr_array_unref (argv);
175+}
176+
177 int
178 main (int argc,
179 char *argv[])
180 {
181+ argv0 = argv[0];
182+
183 g_test_init (&argc, &argv, NULL);
184
185 g_test_add_func ("/random-generator/rand-1", test_rand1);
186@@ -633,5 +716,11 @@ main (int argc,
187
188 g_test_add_func ("/misc/nonfatal", test_nonfatal);
189
190+ g_test_add_func ("/misc/skip", test_skip);
191+ g_test_add_func ("/misc/skip-all", test_skip_all);
192+ g_test_add_func ("/misc/skip-all/subprocess/skip1", test_skip);
193+ g_test_add_func ("/misc/skip-all/subprocess/skip2", test_skip);
194+ g_test_add_func ("/misc/skip-all/subprocess/pass", test_pass);
195+
196 return g_test_run();
197 }
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch b/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch
new file mode 100644
index 0000000000..0db8fd1609
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/ptest-dbus.patch
@@ -0,0 +1,65 @@
1Fix dbus-appinfo from attempting to use the session's bus, and hanging if there
2isn't one present.
3
4Upstream-Status: Backport
5Signed-off-by: Ross Burton <ross.burton@intel.com>
6
7From 940fa98290812789d095d93ff1c550cd86fb2428 Mon Sep 17 00:00:00 2001
8From: Xavier Claessens <xavier.claessens@collabora.co.uk>
9Date: Mon, 28 Oct 2013 21:18:54 +0000
10Subject: Tests: add session_bus_run() and use it where possible
11
12This is to avoid having again the subtil bug in dbus-appinfo.c:
13session_bus_down() was called before g_test_run() so the test was
14running on the user's dbus session.
15
16https://bugzilla.gnome.org/show_bug.cgi?id=697348
17---
18diff --git a/gio/tests/dbus-appinfo.c b/gio/tests/dbus-appinfo.c
19index ca11e98..7698429 100644
20--- a/gio/tests/dbus-appinfo.c
21+++ b/gio/tests/dbus-appinfo.c
22@@ -280,11 +280,7 @@ main (int argc, char **argv)
23 {
24 g_test_init (&argc, &argv, NULL);
25
26- session_bus_up ();
27-
28 g_test_add_func ("/appinfo/dbusappinfo", test_dbus_appinfo);
29
30- session_bus_down ();
31-
32- return g_test_run ();
33+ return session_bus_run ();
34 }
35diff --git a/gio/tests/gdbus-sessionbus.c b/gio/tests/gdbus-sessionbus.c
36index 68c4449..13c2edb 100644
37--- a/gio/tests/gdbus-sessionbus.c
38+++ b/gio/tests/gdbus-sessionbus.c
39@@ -47,3 +47,14 @@ session_bus_down (void)
40 g_clear_object (&singleton);
41 }
42
43+gint
44+session_bus_run (void)
45+{
46+ gint ret;
47+
48+ session_bus_up ();
49+ ret = g_test_run ();
50+ session_bus_down ();
51+
52+ return ret;
53+}
54diff --git a/gio/tests/gdbus-sessionbus.h b/gio/tests/gdbus-sessionbus.h
55index 7ef3abd..284cd00 100644
56--- a/gio/tests/gdbus-sessionbus.h
57+++ b/gio/tests/gdbus-sessionbus.h
58@@ -30,6 +30,7 @@ G_BEGIN_DECLS
59 void session_bus_up (void);
60 void session_bus_stop (void);
61 void session_bus_down (void);
62+gint session_bus_run (void);
63
64 G_END_DECLS
65
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch b/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch
new file mode 100644
index 0000000000..f3be02770c
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch
@@ -0,0 +1,30 @@
1Instead of writing the temporary mapping files in the mappedfile test to the
2user runtime directory, write them to $TMP. The runtime directory may not
3currently exist if the test is executed on a non-desktop system and the test
4doesn't attempt to create the directory structure.
5
6Upstream-Status: Pending
7Signed-off-by: Ross Burton <ross.burton@intel.com>
8
9diff --git a/glib/tests/mappedfile.c b/glib/tests/mappedfile.c
10index 40e0e60..27a24be 100644
11--- a/glib/tests/mappedfile.c
12+++ b/glib/tests/mappedfile.c
13@@ -81,7 +81,7 @@ test_writable (void)
14 const gchar *new = "abcdefghijklmnopqrstuvxyz";
15 gchar *tmp_copy_path;
16
17- tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL);
18+ tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL);
19
20 g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error);
21 g_assert_no_error (error);
22@@ -125,7 +125,7 @@ test_writable_fd (void)
23 int fd;
24 gchar *tmp_copy_path;
25
26- tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL);
27+ tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL);
28
29 g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error);
30 g_assert_no_error (error);
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/run-ptest b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
new file mode 100644
index 0000000000..130ae09b6c
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
@@ -0,0 +1,3 @@
1#! /bin/sh
2
3gnome-desktop-testing-runner glib
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch b/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch
new file mode 100644
index 0000000000..2a154fdd4a
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch
@@ -0,0 +1,20 @@
1Fix DATADIRNAME on uclibc/Linux
2
3translation files are always installed under PREFIX/share/locale in uclibc
4based systems therefore lets set DATADIRNAME to "share".
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Upstream-Status: Pending
8Index: glib-2.38.2/m4macros/glib-gettext.m4
9===================================================================
10--- glib-2.38.2.orig/m4macros/glib-gettext.m4 2013-11-07 07:29:13.000000000 -0800
11+++ glib-2.38.2/m4macros/glib-gettext.m4 2014-03-15 14:51:54.712135644 -0700
12@@ -239,7 +239,7 @@
13 [CATOBJEXT=.mo
14 DATADIRNAME=lib])
15 ;;
16- *-*-openbsd*)
17+ *-*-openbsd* | *-*-linux-uclibc*)
18 CATOBJEXT=.mo
19 DATADIRNAME=share
20 ;;
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.38.2.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.38.2.bb
new file mode 100644
index 0000000000..40529503ba
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.38.2.bb
@@ -0,0 +1,24 @@
1require glib.inc
2
3PE = "1"
4
5SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
6
7SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
8 file://configure-libtool.patch \
9 file://fix-conflicting-rand.patch \
10 file://add-march-i486-into-CFLAGS-automatically.patch \
11 file://glib-2.0-configure-readlink.patch \
12 file://run-ptest \
13 file://0001-gio-Fix-Werror-format-string-errors-from-mismatched-.patch \
14 file://ptest-dbus.patch \
15 file://ptest-paths.patch \
16 file://gtest-skip-fixes.patch \
17 file://gio-test-race.patch \
18 file://uclibc.patch \
19 "
20
21SRC_URI_append_class-native = " file://glib-gettextize-dir.patch"
22
23SRC_URI[md5sum] = "26d1d08e478fc48c181ca8be44f5b69f"
24SRC_URI[sha256sum] = "056a9854c0966a0945e16146b3345b7a82562a5ba4d5516fd10398732aea5734"
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
new file mode 100644
index 0000000000..66bf290c2f
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib.inc
@@ -0,0 +1,98 @@
1SUMMARY = "A general-purpose utility library"
2DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on."
3# pcre is under BSD;
4# docs/reference/COPYING is with a 'public domai'-like license!
5LICENSE = "LGPLv2+ & BSD & PD"
6LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
7 file://glib/glib.h;beginline=4;endline=17;md5=62b7bd0d17b98573dfb87495ac1c5b4c \
8 file://gmodule/COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
9 file://gmodule/gmodule.h;beginline=4;endline=17;md5=62b7bd0d17b98573dfb87495ac1c5b4c \
10 file://glib/pcre/COPYING;md5=266ebc3ff74ee9ce6fad65577667c0f4 \
11 file://glib/pcre/pcre.h;beginline=11;endline=35;md5=de27f2bf633d20a2b7af0b1983423283 \
12 file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc"
13BUGTRACKER = "http://bugzilla.gnome.org"
14SECTION = "libs"
15
16BBCLASSEXTEND = "native nativesdk"
17
18DEPENDS = "glib-2.0-native virtual/libiconv libffi zlib"
19DEPENDS_append_class-target = "${@base_contains('DISTRO_FEATURES', 'ptest', ' dbus', '', d)}"
20DEPENDS_class-native = "pkgconfig-native gettext-native libffi-native zlib-native"
21DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-libffi nativesdk-zlib ${BPN}-native"
22
23PACKAGES =+ "${PN}-utils ${PN}-bash-completion ${PN}-codegen"
24
25LEAD_SONAME = "libglib-2.0.*"
26FILES_${PN}-utils = "${bindir}/* ${datadir}/glib-2.0/gettext"
27
28inherit autotools gettext gtk-doc pkgconfig ptest
29
30S = "${WORKDIR}/glib-${PV}"
31
32CORECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap --disable-man"
33
34PTEST_CONF = "${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-installed-tests', '--disable-installed-tests', d)}"
35EXTRA_OECONF = "--enable-included-printf=no ${CORECONF} ${PTEST_CONF}"
36EXTRA_OECONF_class-native = "${CORECONF} --disable-selinux"
37EXTRA_OECONF_append_libc-uclibc = " --with-libiconv=gnu"
38
39do_configure_prepend() {
40 sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
41}
42
43FILES_${PN} = "${libdir}/lib*${SOLIBS} ${libdir}/gio ${datadir}/glib-2.0/schemas \
44 ${datadir}/glib-2.0/gettext/mkinstalldirs ${datadir}/glib-2.0/gettext/po/Makefile.in.in"
45FILES_${PN}-dev += "${libdir}/glib-2.0/include \
46 ${libdir}/gio/modules/lib*${SOLIBSDEV} \
47 ${libdir}/gio/modules/*.la"
48FILES_${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb \
49 ${libdir}/gio/modules/.debug \
50 ${libdir}/glib-2.0/installed-tests/glib/.debug"
51FILES_${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py"
52FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d \
53 ${datadir}/bash-completion"
54FILES_${PN}-ptest += "${libdir}/glib-2.0/installed-tests \
55 ${datadir}/installed-tests/glib"
56
57ARM_INSTRUCTION_SET = "arm"
58USE_NLS = "yes"
59
60do_install_append () {
61 sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python|'
62
63 # Remove some unpackaged files
64 rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc
65 rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo
66
67 # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
68 # for target as /usr/bin/perl, so fix it to /usr/bin/perl.
69 if [ -f ${D}${bindir}/glib-mkenums ]; then
70 sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/glib-mkenums
71 fi
72}
73
74RDEPENDS_${PN}-ptest += "\
75 gnome-desktop-testing \
76 tzdata \
77 tzdata-americas \
78 tzdata-asia \
79 tzdata-europe \
80 tzdata-posix \
81 python-pygobject \
82 python-dbus \
83 shared-mime-info \
84 "
85
86RDEPENDS_${PN}-ptest_append_libc-glibc = "\
87 eglibc-gconv-utf-16 \
88 eglibc-charmap-utf-8 \
89 eglibc-gconv-cp1255 \
90 eglibc-charmap-cp1255 \
91 eglibc-gconv-utf-32 \
92 eglibc-gconv-utf-7 \
93 eglibc-gconv-euc-jp \
94 eglibc-gconv-iso8859-1 \
95 eglibc-gconv-iso8859-15 \
96 eglibc-charmap-invariant \
97 eglibc-localedata-translit-cjk-variants \
98 "
diff --git a/meta/recipes-core/glib-networking/glib-networking_2.38.0.bb b/meta/recipes-core/glib-networking/glib-networking_2.38.0.bb
new file mode 100644
index 0000000000..a9c1a4129a
--- /dev/null
+++ b/meta/recipes-core/glib-networking/glib-networking_2.38.0.bb
@@ -0,0 +1,32 @@
1SUMMARY = "GLib networking extensions"
2DESCRIPTION = "glib-networking contains the implementations of certain GLib networking features that cannot be implemented directly in GLib itself because of their dependencies."
3HOMEPAGE = "http://git.gnome.org/browse/glib-networking/"
4BUGTRACKER = "http://bugzilla.gnome.org"
5
6LICENSE = "LGPLv2"
7LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
8
9SECTION = "libs"
10DEPENDS = "glib-2.0 intltool-native"
11
12GNOME_COMPRESS_TYPE = "xz"
13
14SRC_URI[archive.md5sum] = "a22907deed3d956860d83aa3233e86ff"
15SRC_URI[archive.sha256sum] = "a43eacbf721b475cf6ba0cd2eab02a332014f71a4c41d0b44bd7bbf8ed1f840d"
16
17PACKAGECONFIG ??= "ca-certificates gnutls"
18
19# No explicit dependency as it works without ca-certificates installed
20PACKAGECONFIG[ca-certificates] = "--with-ca-certificates=${sysconfdir}/ssl/certs/ca-certificates.crt,--without-ca-certificates"
21PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
22PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy"
23PACKAGECONFIG[pkcs11] = "--with-pkcs11,--without-pkcs11,p11-kit"
24
25EXTRA_OECONF = "--without-gnome-proxy"
26
27inherit gnomebase
28
29FILES_${PN} += "${libdir}/gio/modules/libgio*.so ${datadir}/dbus-1/services/"
30FILES_${PN}-dbg += "${libdir}/gio/modules/.debug/"
31FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la"
32FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a"
diff --git a/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx
new file mode 100644
index 0000000000..b04a1b6a73
--- /dev/null
+++ b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx
@@ -0,0 +1,52 @@
1.encoding = "UTF-8"
2displayname = "Yocto Build Appliance"
3guestos = "other"
4tools.syncTime = "FALSE"
5virtualhw.version = "8"
6config.version = "8"
7numvcpus = "2"
8cpuid.coresPerSocket = "1"
9vcpu.hotadd = "TRUE"
10mem.hotadd = "TRUE"
11memsize = "4096"
12svga.autodetect = "TRUE"
13pciBridge0.present = "TRUE"
14mks.enable3d = "TRUE"
15pciBridge4.present = "TRUE"
16pciBridge4.virtualDev = "pcieRootPort"
17pciBridge4.functions = "8"
18pciBridge5.present = "TRUE"
19pciBridge5.virtualDev = "pcieRootPort"
20pciBridge5.functions = "8"
21pciBridge6.present = "TRUE"
22pciBridge6.virtualDev = "pcieRootPort"
23pciBridge6.functions = "8"
24pciBridge7.present = "TRUE"
25pciBridge7.virtualDev = "pcieRootPort"
26pciBridge7.functions = "8"
27vmci0.present = "TRUE"
28floppy0.present = "TRUE"
29floppy0.fileType = "device"
30floppy0.autodetect = "FALSE"
31floppy0.startConnected = "FALSE"
32ide1:0.present = "TRUE"
33ide1:0.deviceType = "atapi-cdrom"
34ide1:0.autodetect = "TRUE"
35ide1:0.startConnected = "FALSE"
36ide0:0.present = "TRUE"
37ide0:0.deviceType = "disk"
38ide0:0.fileName = "Yocto_Build_Appliance.vmdk"
39usb.present = "TRUE"
40scsi0.virtualDev = "lsilogic"
41scsi0.present = "TRUE"
42ethernet0.present = "TRUE"
43ethernet0.virtualDev = "e1000"
44ethernet0.connectionType = "bridged"
45ethernet0.startConnected = "TRUE"
46ethernet0.addressType = "generated"
47sound.present = "TRUE"
48sound.virtualDev = "es1371"
49sound.autodetect = "TRUE"
50extendedConfigFile = "Yocto_Build_Appliance.vmxf"
51sound.fileName = "-1"
52virtualHW.productCompatibility = "hosted"
diff --git a/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf
new file mode 100644
index 0000000000..ca3f0264d6
--- /dev/null
+++ b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf
@@ -0,0 +1,8 @@
1<?xml version="1.0"?>
2<Foundry>
3<VM>
4<VMId type="string">52 e4 0b df 7b 70 21 f8-88 56 a7 26 47 43 95 93</VMId>
5<ClientMetaData>
6<clientMetaDataAttributes/>
7<HistoryEventList/></ClientMetaData>
8<vmxPathName type="string">Yocto_Build_Appliance.vmx</vmxPathName></VM></Foundry>
diff --git a/meta/recipes-core/images/build-appliance-image_8.0.bb b/meta/recipes-core/images/build-appliance-image_8.0.bb
new file mode 100644
index 0000000000..420f30f337
--- /dev/null
+++ b/meta/recipes-core/images/build-appliance-image_8.0.bb
@@ -0,0 +1,93 @@
1SUMMARY = "An image containing the build system itself"
2DESCRIPTION = "An image containing the build system that you can boot and run using either VMware Player or VMware Workstation."
3HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance"
4
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
7 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
8
9IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted"
10
11IMAGE_FEATURES += "x11-base package-management splash"
12
13# Ensure there's enough space to do a core-image-sato build, with rm_work enabled
14IMAGE_ROOTFS_EXTRA_SPACE = "41943040"
15
16# Do a quiet boot with limited console messages
17APPEND += "quiet"
18
19DEPENDS = "zip-native"
20IMAGE_FSTYPES = "vmdk"
21
22inherit core-image
23
24SRCREV ?= "84d524c9386065d06e6b9c2368b93fc07dc1816f"
25SRC_URI = "git://git.yoctoproject.org/poky;branch=daisy \
26 file://Yocto_Build_Appliance.vmx \
27 file://Yocto_Build_Appliance.vmxf \
28 "
29
30IMAGE_CMD_ext3_append () {
31 # We don't need to reserve much space for root, 0.5% is more than enough
32 tune2fs -m 0.5 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext3
33}
34
35fakeroot do_populate_poky_src () {
36 # Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo
37 # will become invalid in the target.
38 rm -rf ${WORKDIR}/git/.git
39 rm -f ${WORKDIR}/git/.gitignore
40
41 cp -Rp ${WORKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky
42
43 mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf
44 mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads
45 cp -RpL ${DL_DIR}/* ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/
46
47 # Remove the git2_* tarballs -- this is ok since we still have the git2/.
48 rm -rf ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/git2_*
49
50 echo "/usr/bin" > ${IMAGE_ROOTFS}/home/builder/poky/build/pseudodone
51 echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
52 mkdir -p ${IMAGE_ROOTFS}/home/builder/pseudo
53 echo "export PSEUDO_PREFIX=/usr" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
54 echo "export PSEUDO_LOCALSTATEDIR=/home/builder/pseudo" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
55 echo "export PSEUDO_LIBDIR=/usr/lib/pseudo/lib64" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
56
57 chown builder.builder ${IMAGE_ROOTFS}/home/builder/pseudo
58
59 chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/poky
60
61 # Allow builder to use sudo to setup tap/tun
62 echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers
63
64 # Use Clearlooks GTK+ theme
65 mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0
66 echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc
67}
68
69IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; "
70
71addtask rootfs after do_unpack
72
73python () {
74 # Ensure we run these usually noexec tasks
75 d.delVarFlag("do_fetch", "noexec")
76 d.delVarFlag("do_unpack", "noexec")
77}
78
79create_bundle_files () {
80 cd ${WORKDIR}
81 mkdir -p Yocto_Build_Appliance
82 cp *.vmx* Yocto_Build_Appliance
83 ln -sf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk
84 zip -r ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance
85 ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance.zip
86}
87
88python do_bundle_files() {
89 bb.build.exec_func('create_bundle_files', d)
90}
91
92addtask bundle_files after do_vmdkimg before do_build
93do_bundle_files[nostamp] = "1"
diff --git a/meta/recipes-core/images/core-image-base.bb b/meta/recipes-core/images/core-image-base.bb
new file mode 100644
index 0000000000..75a08cfc92
--- /dev/null
+++ b/meta/recipes-core/images/core-image-base.bb
@@ -0,0 +1,8 @@
1SUMMARY = "A console-only image that fully supports the target device \
2hardware."
3
4IMAGE_FEATURES += "splash"
5
6LICENSE = "MIT"
7
8inherit core-image
diff --git a/meta/recipes-core/images/core-image-minimal-dev.bb b/meta/recipes-core/images/core-image-minimal-dev.bb
new file mode 100644
index 0000000000..93ead20553
--- /dev/null
+++ b/meta/recipes-core/images/core-image-minimal-dev.bb
@@ -0,0 +1,7 @@
1require core-image-minimal.bb
2
3DESCRIPTION = "A small image just capable of allowing a device to boot and \
4is suitable for development work."
5
6IMAGE_FEATURES += "dev-pkgs"
7
diff --git a/meta/recipes-core/images/core-image-minimal-initramfs.bb b/meta/recipes-core/images/core-image-minimal-initramfs.bb
new file mode 100644
index 0000000000..1f0fa9580b
--- /dev/null
+++ b/meta/recipes-core/images/core-image-minimal-initramfs.bb
@@ -0,0 +1,21 @@
1# Simple initramfs image. Mostly used for live images.
2DESCRIPTION = "Small image capable of booting a device. The kernel includes \
3the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
4first 'init' program more efficiently."
5
6PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install initramfs-live-install-efi busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
7
8# Do not pollute the initrd image with rootfs features
9IMAGE_FEATURES = ""
10
11export IMAGE_BASENAME = "core-image-minimal-initramfs"
12IMAGE_LINGUAS = ""
13
14LICENSE = "MIT"
15
16IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
17inherit core-image
18
19IMAGE_ROOTFS_SIZE = "8192"
20
21BAD_RECOMMENDATIONS += "busybox-syslog"
diff --git a/meta/recipes-core/images/core-image-minimal-mtdutils.bb b/meta/recipes-core/images/core-image-minimal-mtdutils.bb
new file mode 100644
index 0000000000..c92234c082
--- /dev/null
+++ b/meta/recipes-core/images/core-image-minimal-mtdutils.bb
@@ -0,0 +1,7 @@
1require core-image-minimal.bb
2
3DESCRIPTION = "Small image capable of booting a device with support for the \
4Minimal MTD Utilities, which let the user interact with the MTD subsystem in \
5the kernel to perform operations on flash devices."
6
7IMAGE_INSTALL += "mtd-utils"
diff --git a/meta/recipes-core/images/core-image-minimal.bb b/meta/recipes-core/images/core-image-minimal.bb
new file mode 100644
index 0000000000..9716274c34
--- /dev/null
+++ b/meta/recipes-core/images/core-image-minimal.bb
@@ -0,0 +1,12 @@
1SUMMARY = "A small image just capable of allowing a device to boot."
2
3IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"
4
5IMAGE_LINGUAS = " "
6
7LICENSE = "MIT"
8
9inherit core-image
10
11IMAGE_ROOTFS_SIZE ?= "8192"
12
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
new file mode 100644
index 0000000000..2a8e0d1264
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
@@ -0,0 +1,11 @@
1This package was created by Peter Tobias tobias@et-inf.fho-emden.de on
2Wed, 24 Aug 1994 21:33:28 +0200 and maintained by Anthony Towns
3<ajt@debian.org> until 2001.
4It is currently maintained by Marco d'Itri <md@linux.it>.
5
6Copyright 1994-2010 Peter Tobias, Anthony Towns and Marco d'Itri
7
8The programs in this package are distributed under the terms of the GNU
9General Public License, version 2 as distributed by the Free Software
10Foundation. On Debian systems, a copy of this license may be found in
11/usr/share/common-licenses/GPL-2.
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
new file mode 100644
index 0000000000..fb31c635be
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
@@ -0,0 +1,90 @@
1#!/bin/sh -e
2### BEGIN INIT INFO
3# Provides: networking
4# Required-Start: mountvirtfs $local_fs
5# Required-Stop: $local_fs
6# Should-Start: ifupdown
7# Should-Stop: ifupdown
8# Default-Start: S
9# Default-Stop: 0 6
10# Short-Description: Raise network interfaces.
11### END INIT INFO
12
13PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
14
15[ -x /sbin/ifup ] || exit 0
16
17check_network_file_systems() {
18 [ -e /proc/mounts ] || return 0
19
20 if [ -e /etc/iscsi/iscsi.initramfs ]; then
21 echo "not deconfiguring network interfaces: iSCSI root is mounted."
22 exit 0
23 fi
24
25 exec 9<&0 < /proc/mounts
26 while read DEV MTPT FSTYPE REST; do
27 case $DEV in
28 /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
29 echo "not deconfiguring network interfaces: network devices still mounted."
30 exit 0
31 ;;
32 esac
33 case $FSTYPE in
34 nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
35 echo "not deconfiguring network interfaces: network file systems still mounted."
36 exit 0
37 ;;
38 esac
39 done
40 exec 0<&9 9<&-
41}
42
43check_network_swap() {
44 [ -e /proc/swaps ] || return 0
45
46 exec 9<&0 < /proc/swaps
47 while read DEV MTPT FSTYPE REST; do
48 case $DEV in
49 /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
50 echo "not deconfiguring network interfaces: network swap still mounted."
51 exit 0
52 ;;
53 esac
54 done
55 exec 0<&9 9<&-
56}
57
58case "$1" in
59start)
60 echo -n "Configuring network interfaces... "
61 sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
62 ifup -a
63 echo "done."
64 ;;
65
66stop)
67 check_network_file_systems
68 check_network_swap
69
70 echo -n "Deconfiguring network interfaces... "
71 ifdown -a
72 echo "done."
73 ;;
74
75force-reload|restart)
76 echo "Running $0 $1 is deprecated because it may not enable again some interfaces"
77 echo "Reconfiguring network interfaces... "
78 ifdown -a || true
79 ifup -a
80 echo "done."
81 ;;
82
83*)
84 echo "Usage: /etc/init.d/networking {start|stop}"
85 exit 1
86 ;;
87esac
88
89exit 0
90
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
new file mode 100644
index 0000000000..0acf4cf441
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
@@ -0,0 +1,31 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7# Wireless interfaces
8iface wlan0 inet dhcp
9 wireless_mode managed
10 wireless_essid any
11 wpa-driver wext
12 wpa-conf /etc/wpa_supplicant.conf
13
14iface atml0 inet dhcp
15
16# Wired or wireless interfaces
17auto eth0
18iface eth0 inet dhcp
19iface eth1 inet dhcp
20
21# Ethernet/RNDIS gadget (g_ether)
22# ... or on host side, usbnet and random hwaddr
23iface usb0 inet static
24 address 192.168.7.2
25 netmask 255.255.255.0
26 network 192.168.7.0
27 gateway 192.168.7.1
28
29# Bluetooth networking
30iface bnep0 inet dhcp
31
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
new file mode 100644
index 0000000000..750c0a98f9
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
@@ -0,0 +1,39 @@
1#! /bin/sh
2
3# In case the interface is used as nfsroot, avoid ifup, otherwise
4# nfsroot may lose response
5
6nfsroot=0
7
8if test "x$IFACE" = xlo ; then
9 exit 0
10fi
11
12exec 9<&0 < /proc/mounts
13while read dev mtpt fstype rest; do
14 if test $mtpt = "/" ; then
15 case $fstype in
16 nfs | nfs4)
17 nfsroot=1
18 nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
19 break
20 ;;
21 *)
22 ;;
23 esac
24 fi
25done
26exec 0<&9 9<&-
27
28test $nfsroot -eq 0 && exit 0
29
30if [ -x /bin/ip -o -x /sbin/ip ] ; then
31 nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
32fi
33
34if test "x$IFACE" = "x$nfs_iface" ; then
35 echo "ifup skipped for nfsroot interface $nfs_iface"
36 exit 1
37fi
38
39exit 0
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
new file mode 100644
index 0000000000..16967763e5
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
@@ -0,0 +1,5 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
new file mode 100644
index 0000000000..16967763e5
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
@@ -0,0 +1,5 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
new file mode 100644
index 0000000000..16967763e5
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
@@ -0,0 +1,5 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
new file mode 100644
index 0000000000..3d88506c05
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
@@ -0,0 +1,39 @@
1SUMMARY = "Basic TCP/IP networking init scripts and configuration files"
2DESCRIPTION = "This package provides high level tools to configure network interfaces"
3HOMEPAGE = "http://packages.debian.org/ifupdown"
4SECTION = "base"
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
7PR = "r7"
8
9inherit update-rc.d
10
11INITSCRIPT_NAME = "networking"
12INITSCRIPT_PARAMS = "start 01 2 3 4 5 . stop 80 0 6 1 ."
13
14SRC_URI = "file://copyright \
15 file://init \
16 file://interfaces \
17 file://nfsroot"
18
19do_install () {
20 install -d ${D}${sysconfdir}/init.d \
21 ${D}${sysconfdir}/network/if-pre-up.d \
22 ${D}${sysconfdir}/network/if-up.d \
23 ${D}${sysconfdir}/network/if-down.d \
24 ${D}${sysconfdir}/network/if-post-down.d
25 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/networking
26 install -m 0644 ${WORKDIR}/interfaces ${D}${sysconfdir}/network/interfaces
27 install -m 0755 ${WORKDIR}/nfsroot ${D}${sysconfdir}/network/if-pre-up.d
28}
29
30do_install_append_qemuall () {
31 # Disable network manager on machines that commonly do NFS booting
32 touch ${D}${sysconfdir}/network/nm-disabled-eth0
33}
34
35PACKAGE_ARCH_qemuall = "${MACHINE_ARCH}"
36RDEPENDS_${PN} = "netbase"
37RCONFLICTS_${PN} = "netbase (< 1:5.0)"
38
39CONFFILES_${PN} = "${sysconfdir}/network/interfaces"
diff --git a/meta/recipes-core/initrdscripts/files/init-boot.sh b/meta/recipes-core/initrdscripts/files/init-boot.sh
new file mode 100644
index 0000000000..e82eba025d
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-boot.sh
@@ -0,0 +1,10 @@
1#!/bin/sh
2
3PATH=/sbin:/bin:/usr/sbin:/usr/bin
4
5mkdir /proc
6mkdir /sys
7mount -t proc proc /proc
8mount -t sysfs sysfs /sys
9
10exec sh
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
new file mode 100644
index 0000000000..2fea7610f9
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
@@ -0,0 +1,199 @@
1#!/bin/sh -e
2#
3# Copyright (c) 2012, Intel Corporation.
4# All rights reserved.
5#
6# install.sh [device_name] [rootfs_name]
7#
8
9PATH=/sbin:/bin:/usr/sbin:/usr/bin
10
11# We need 200 Mb for the boot partition
12boot_size=200
13
14# 50% for the second rootfs
15testfs_ratio=50
16
17found="no"
18
19echo "Searching for a hard drive..."
20for device in 'hda' 'hdb' 'sda' 'sdb' 'mmcblk0' 'mmcblk1'
21do
22 if [ -e /sys/block/${device}/removable ]; then
23 if [ "$(cat /sys/block/${device}/removable)" = "0" ]; then
24 found="yes"
25
26 while true; do
27 # Try sleeping here to avoid getting kernel messages
28 # obscuring/confusing user
29 sleep 5
30 echo "Found drive at /dev/${device}. Do you want to install this image there ? [y/n]"
31 read answer
32 if [ "$answer" = "y" ] ; then
33 break
34 fi
35
36 if [ "$answer" = "n" ] ; then
37 found=no
38 break
39 fi
40
41 echo "Please answer y or n"
42 done
43 fi
44 fi
45
46 if [ "$found" = "yes" ]; then
47 break;
48 fi
49
50done
51
52if [ "$found" = "no" ]; then
53 exit 1
54fi
55
56echo "Installing image on /dev/${device}"
57
58#
59# The udev automounter can cause pain here, kill it
60#
61rm -f /etc/udev/rules.d/automount.rules
62rm -f /etc/udev/scripts/mount*
63
64#
65# Unmount anything the automounter had mounted
66#
67umount /dev/${device}* 2> /dev/null || /bin/true
68
69mkdir -p /tmp
70cat /proc/mounts > /etc/mtab
71
72disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
73
74testfs_size=$((disk_size*testfs_ratio/100))
75rootfs_size=$((disk_size-boot_size-testfs_size))
76
77rootfs_start=$((boot_size))
78rootfs_end=$((rootfs_start+rootfs_size))
79testfs_start=$((rootfs_end))
80
81# MMC devices are special in a couple of ways
82# 1) they use a partition prefix character 'p'
83# 2) they are detected asynchronously (need rootwait)
84rootwait=""
85part_prefix=""
86if [ ! "${device#mmcblk}" = "${device}" ]; then
87 part_prefix="p"
88 rootwait="rootwait"
89fi
90bootfs=/dev/${device}${part_prefix}1
91rootfs=/dev/${device}${part_prefix}2
92testfs=/dev/${device}${part_prefix}3
93
94echo "*****************"
95echo "Boot partition size: $boot_size MB ($bootfs)"
96echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
97echo "Testfs partition size: $testfs_size MB ($testfs)"
98echo "*****************"
99echo "Deleting partition table on /dev/${device} ..."
100dd if=/dev/zero of=/dev/${device} bs=512 count=2
101
102echo "Creating new partition table on /dev/${device} ..."
103parted /dev/${device} mklabel gpt
104
105echo "Creating boot partition on $bootfs"
106parted /dev/${device} mkpart primary 0% $boot_size
107parted /dev/${device} set 1 boot on
108
109echo "Creating rootfs partition on $rootfs"
110parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
111
112echo "Creating testfs partition on $testfs"
113parted /dev/${device} mkpart primary $testfs_start 100%
114
115parted /dev/${device} print
116
117echo "Formatting $bootfs to vfat..."
118mkfs.vfat -n "boot" $bootfs
119
120echo "Formatting $rootfs to ext3..."
121mkfs.ext3 -L "platform" $rootfs
122
123echo "Formatting $testfs to ext3..."
124mkfs.ext3 -L "testrootfs" $testfs
125
126mkdir /ssd
127mkdir /rootmnt
128mkdir /bootmnt
129
130mount $rootfs /ssd
131mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt
132
133echo "Copying rootfs files..."
134cp -a /rootmnt/* /ssd
135
136touch /ssd/etc/masterimage
137
138if [ -d /ssd/etc/ ] ; then
139 # We dont want udev to mount our root device while we're booting...
140 if [ -d /ssd/etc/udev/ ] ; then
141 echo "/dev/${device}" >> /ssd/etc/udev/mount.blacklist
142 fi
143fi
144
145umount /ssd
146umount /rootmnt
147
148echo "Preparing boot partition..."
149mount $bootfs /ssd
150
151EFIDIR="/ssd/EFI/BOOT"
152mkdir -p $EFIDIR
153cp /media/$1/vmlinuz /ssd
154# Copy the efi loader
155cp /media/$1/EFI/BOOT/*.efi $EFIDIR
156
157if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then
158 GRUBCFG="$EFIDIR/grub.cfg"
159 cp /media/$1/EFI/BOOT/grub.cfg $GRUBCFG
160 # Update grub config for the installed image
161 # Delete the install entry
162 sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
163 # Delete the initrd lines
164 sed -i "/initrd /d" $GRUBCFG
165 # Delete any LABEL= strings
166 sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
167 # Delete any root= strings
168 sed -i "s/ root=[^ ]*/ /" $GRUBCFG
169 # Add the root= and other standard boot options
170 sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG
171fi
172
173if [ -d /media/$1/loader ]; then
174 GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf"
175 # copy config files for gummiboot
176 cp -dr /media/$1/loader /ssd
177 # delete the install entry
178 rm -f /ssd/loader/entries/install.conf
179 # delete the initrd lines
180 sed -i "/initrd /d" $GUMMIBOOT_CFGS
181 # delete any LABEL= strings
182 sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS
183 # delete any root= strings
184 sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS
185 # add the root= and other standard boot options
186 sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_CFGS
187 # Add the test label
188 echo -ne "title test\nlinux /test-kernel\noptions root=$testfs rw $rootwait quiet\n" > /ssd/loader/entries/test.conf
189fi
190
191umount /ssd
192sync
193
194echo "Remove your installation media, and press ENTER"
195
196read enter
197
198echo "Rebooting..."
199reboot -f
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
new file mode 100644
index 0000000000..ed3221b0a6
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -0,0 +1,197 @@
1#!/bin/sh -e
2#
3# Copyright (c) 2012, Intel Corporation.
4# All rights reserved.
5#
6# install.sh [device_name] [rootfs_name]
7#
8
9PATH=/sbin:/bin:/usr/sbin:/usr/bin
10
11# We need 20 Mb for the boot partition
12boot_size=20
13
14# 5% for swap
15swap_ratio=5
16
17found="no"
18
19echo "Searching for a hard drive..."
20for device in 'hda' 'hdb' 'sda' 'sdb' 'mmcblk0' 'mmcblk1'
21do
22 if [ -e /sys/block/${device}/removable ]; then
23 if [ "$(cat /sys/block/${device}/removable)" = "0" ]; then
24 found="yes"
25
26 while true; do
27 # Try sleeping here to avoid getting kernel messages
28 # obscuring/confusing user
29 sleep 5
30 echo "Found drive at /dev/${device}. Do you want to install this image there ? [y/n]"
31 read answer
32 if [ "$answer" = "y" ] ; then
33 break
34 fi
35
36 if [ "$answer" = "n" ] ; then
37 found=no
38 break
39 fi
40
41 echo "Please answer y or n"
42 done
43 fi
44 fi
45
46 if [ "$found" = "yes" ]; then
47 break;
48 fi
49
50done
51
52if [ "$found" = "no" ]; then
53 exit 1
54fi
55
56echo "Installing image on /dev/${device}"
57
58#
59# The udev automounter can cause pain here, kill it
60#
61rm -f /etc/udev/rules.d/automount.rules
62rm -f /etc/udev/scripts/mount*
63
64#
65# Unmount anything the automounter had mounted
66#
67umount /dev/${device}* 2> /dev/null || /bin/true
68
69mkdir -p /tmp
70cat /proc/mounts > /etc/mtab
71
72disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
73
74swap_size=$((disk_size*swap_ratio/100))
75rootfs_size=$((disk_size-boot_size-swap_size))
76
77rootfs_start=$((boot_size))
78rootfs_end=$((rootfs_start+rootfs_size))
79swap_start=$((rootfs_end))
80
81# MMC devices are special in a couple of ways
82# 1) they use a partition prefix character 'p'
83# 2) they are detected asynchronously (need rootwait)
84rootwait=""
85part_prefix=""
86if [ ! "${device#mmcblk}" = "${device}" ]; then
87 part_prefix="p"
88 rootwait="rootwait"
89fi
90bootfs=/dev/${device}${part_prefix}1
91rootfs=/dev/${device}${part_prefix}2
92swap=/dev/${device}${part_prefix}3
93
94echo "*****************"
95echo "Boot partition size: $boot_size MB ($bootfs)"
96echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
97echo "Swap partition size: $swap_size MB ($swap)"
98echo "*****************"
99echo "Deleting partition table on /dev/${device} ..."
100dd if=/dev/zero of=/dev/${device} bs=512 count=2
101
102echo "Creating new partition table on /dev/${device} ..."
103parted /dev/${device} mklabel gpt
104
105echo "Creating boot partition on $bootfs"
106parted /dev/${device} mkpart primary 0% $boot_size
107parted /dev/${device} set 1 boot on
108
109echo "Creating rootfs partition on $rootfs"
110parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
111
112echo "Creating swap partition on $swap"
113parted /dev/${device} mkpart primary $swap_start 100%
114
115parted /dev/${device} print
116
117echo "Formatting $bootfs to vfat..."
118mkfs.vfat $bootfs
119
120echo "Formatting $rootfs to ext3..."
121mkfs.ext3 $rootfs
122
123echo "Formatting swap partition...($swap)"
124mkswap $swap
125
126mkdir /ssd
127mkdir /rootmnt
128mkdir /bootmnt
129
130mount $rootfs /ssd
131mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt
132
133echo "Copying rootfs files..."
134cp -a /rootmnt/* /ssd
135
136if [ -d /ssd/etc/ ] ; then
137 echo "$swap swap swap defaults 0 0" >> /ssd/etc/fstab
138
139 # We dont want udev to mount our root device while we're booting...
140 if [ -d /ssd/etc/udev/ ] ; then
141 echo "/dev/${device}" >> /ssd/etc/udev/mount.blacklist
142 fi
143fi
144
145umount /ssd
146umount /rootmnt
147
148echo "Preparing boot partition..."
149mount $bootfs /ssd
150
151EFIDIR="/ssd/EFI/BOOT"
152mkdir -p $EFIDIR
153cp /media/$1/vmlinuz /ssd
154# Copy the efi loader
155cp /media/$1/EFI/BOOT/*.efi $EFIDIR
156
157if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then
158 GRUBCFG="$EFIDIR/grub.cfg"
159 cp /media/$1/EFI/BOOT/grub.cfg $GRUBCFG
160 # Update grub config for the installed image
161 # Delete the install entry
162 sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
163 # Delete the initrd lines
164 sed -i "/initrd /d" $GRUBCFG
165 # Delete any LABEL= strings
166 sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
167 # Delete any root= strings
168 sed -i "s/ root=[^ ]*/ /" $GRUBCFG
169 # Add the root= and other standard boot options
170 sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG
171fi
172
173if [ -d /media/$1/loader ]; then
174 GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf"
175 # copy config files for gummiboot
176 cp -dr /media/$1/loader /ssd
177 # delete the install entry
178 rm -f /ssd/loader/entries/install.conf
179 # delete the initrd lines
180 sed -i "/initrd /d" $GUMMIBOOT_CFGS
181 # delete any LABEL= strings
182 sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS
183 # delete any root= strings
184 sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS
185 # add the root= and other standard boot options
186 sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_CFGS
187fi
188
189umount /ssd
190sync
191
192echo "Remove your installation media, and press ENTER"
193
194read enter
195
196echo "Rebooting..."
197reboot -f
diff --git a/meta/recipes-core/initrdscripts/files/init-install-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
new file mode 100644
index 0000000000..d2f2420498
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
@@ -0,0 +1,211 @@
1#!/bin/sh -e
2#
3# Copyright (C) 2008-2011 Intel
4#
5# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode]
6#
7
8PATH=/sbin:/bin:/usr/sbin:/usr/bin
9
10# We need 20 Mb for the boot partition
11boot_size=200
12
13# 50% for the the test partition
14testfs_ratio=50
15
16# Get a list of hard drives
17hdnamelist=""
18live_dev_name=${1%%/*}
19
20echo "Searching for hard drives ..."
21
22for device in `ls /sys/block/`; do
23 case $device in
24 loop*)
25 # skip loop device
26 ;;
27 ram*)
28 # skip ram device
29 ;;
30 *)
31 # skip the device LiveOS is on
32 # Add valid hard drive name to the list
33 if [ $device != $live_dev_name -a -e /dev/$device ]; then
34 hdnamelist="$hdnamelist $device"
35 fi
36 ;;
37 esac
38done
39
40TARGET_DEVICE_NAME=""
41for hdname in $hdnamelist; do
42 # Display found hard drives and their basic info
43 echo "-------------------------------"
44 echo /dev/$hdname
45 if [ -r /sys/block/$hdname/device/vendor ]; then
46 echo -n "VENDOR="
47 cat /sys/block/$hdname/device/vendor
48 fi
49 echo -n "MODEL="
50 cat /sys/block/$hdname/device/model
51 cat /sys/block/$hdname/device/uevent
52 echo
53 # Get user choice
54 while true; do
55 echo -n "Do you want to install this image there? [y/n] "
56 read answer
57 if [ "$answer" = "y" -o "$answer" = "n" ]; then
58 break
59 fi
60 echo "Please answer y or n"
61 done
62 if [ "$answer" = "y" ]; then
63 TARGET_DEVICE_NAME=$hdname
64 break
65 fi
66done
67
68if [ -n "$TARGET_DEVICE_NAME" ]; then
69 echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
70else
71 echo "No hard drive selected. Installation aborted."
72 exit 1
73fi
74
75device=$TARGET_DEVICE_NAME
76
77#
78# The udev automounter can cause pain here, kill it
79#
80rm -f /etc/udev/rules.d/automount.rules
81rm -f /etc/udev/scripts/mount*
82
83#
84# Unmount anything the automounter had mounted
85#
86umount /dev/${device}* 2> /dev/null || /bin/true
87
88if [ ! -b /dev/loop0 ] ; then
89 mknod /dev/loop0 b 7 0
90fi
91
92mkdir -p /tmp
93cat /proc/mounts > /etc/mtab
94
95disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
96
97testfs_size=$((disk_size*testfs_ratio/100))
98rootfs_size=$((disk_size-boot_size-testfs_size))
99
100rootfs_start=$((boot_size))
101rootfs_end=$((rootfs_start+rootfs_size))
102testfs_start=$((rootfs_end))
103
104# MMC devices are special in a couple of ways
105# 1) they use a partition prefix character 'p'
106# 2) they are detected asynchronously (need rootwait)
107rootwait=""
108part_prefix=""
109if [ ! "${device#mmcblk}" = "${device}" ]; then
110 part_prefix="p"
111 rootwait="rootwait"
112fi
113bootfs=/dev/${device}${part_prefix}1
114rootfs=/dev/${device}${part_prefix}2
115testfs=/dev/${device}${part_prefix}3
116
117echo "*****************"
118echo "Boot partition size: $boot_size MB ($bootfs)"
119echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
120echo "Testfs partition size: $testfs_size MB ($testfs)"
121echo "*****************"
122echo "Deleting partition table on /dev/${device} ..."
123dd if=/dev/zero of=/dev/${device} bs=512 count=2
124
125echo "Creating new partition table on /dev/${device} ..."
126parted /dev/${device} mklabel msdos
127
128echo "Creating boot partition on $bootfs"
129parted /dev/${device} mkpart primary 0% $boot_size
130
131echo "Creating rootfs partition on $rootfs"
132parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
133
134echo "Creating testfs partition on $testfs"
135parted /dev/${device} mkpart primary $testfs_start 100%
136
137parted /dev/${device} print
138
139echo "Formatting $bootfs to ext3..."
140mkfs.ext3 -L "boot" $bootfs
141
142echo "Formatting $rootfs to ext3..."
143mkfs.ext3 -L "rootfs" $rootfs
144
145echo "Formatting $testfs to ext3..."
146mkfs.ext3 -L "testrootfs" $testfs
147
148mkdir /tgt_root
149mkdir /src_root
150mkdir -p /boot
151
152# Handling of the target root partition
153mount $rootfs /tgt_root
154mount -o rw,loop,noatime,nodiratime /media/$1/$2 /src_root
155echo "Copying rootfs files..."
156cp -a /src_root/* /tgt_root
157if [ -d /tgt_root/etc/ ] ; then
158 echo "$bootfs /boot ext3 defaults 1 2" >> /tgt_root/etc/fstab
159 # We dont want udev to mount our root device while we're booting...
160 if [ -d /tgt_root/etc/udev/ ] ; then
161 echo "/dev/${device}" >> /tgt_root/etc/udev/mount.blacklist
162 fi
163fi
164umount /tgt_root
165umount /src_root
166
167# Handling of the target boot partition
168mount $bootfs /boot
169echo "Preparing boot partition..."
170if [ -f /etc/grub.d/40_custom ] ; then
171 echo "Preparing custom grub2 menu..."
172 GRUBCFG="/boot/grub/grub.cfg"
173 mkdir -p $(dirname $GRUBCFG)
174 cp /etc/grub.d/40_custom $GRUBCFG
175 sed -i "s@__ROOTFS__@$rootfs $rootwait@g" $GRUBCFG
176 sed -i "s/__VIDEO_MODE__/$3/g" $GRUBCFG
177 sed -i "s/__VGA_MODE__/$4/g" $GRUBCFG
178 sed -i "s/__CONSOLE__/$5/g" $GRUBCFG
179 sed -i "/#/d" $GRUBCFG
180 sed -i "/exec tail/d" $GRUBCFG
181
182 # Add the test label
183 echo -ne "\nmenuentry 'test' {\nlinux /test-kernel root=$testfs rw $rootwait quiet\n}\n" >> $GRUBCFG
184
185 chmod 0444 $GRUBCFG
186fi
187grub-install /dev/${device}
188echo "(hd0) /dev/${device}" > /boot/grub/device.map
189
190# If grub.cfg doesn't exist, assume GRUB 0.97 and create a menu.lst
191if [ ! -f /boot/grub/grub.cfg ] ; then
192 echo "Preparing custom grub menu..."
193 echo "default 0" > /boot/grub/menu.lst
194 echo "timeout 30" >> /boot/grub/menu.lst
195 echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
196 echo "root (hd0,0)" >> /boot/grub/menu.lst
197 echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
198fi
199
200cp /media/$1/vmlinuz /boot/
201
202umount /boot
203
204sync
205
206echo "Remove your installation media, and press ENTER"
207
208read enter
209
210echo "Rebooting..."
211reboot -f
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
new file mode 100644
index 0000000000..8e433d5eda
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -0,0 +1,208 @@
1#!/bin/sh -e
2#
3# Copyright (C) 2008-2011 Intel
4#
5# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode]
6#
7
8PATH=/sbin:/bin:/usr/sbin:/usr/bin
9
10# We need 20 Mb for the boot partition
11boot_size=20
12
13# 5% for the swap
14swap_ratio=5
15
16# Get a list of hard drives
17hdnamelist=""
18live_dev_name=${1%%/*}
19
20echo "Searching for hard drives ..."
21
22for device in `ls /sys/block/`; do
23 case $device in
24 loop*)
25 # skip loop device
26 ;;
27 ram*)
28 # skip ram device
29 ;;
30 *)
31 # skip the device LiveOS is on
32 # Add valid hard drive name to the list
33 if [ $device != $live_dev_name -a -e /dev/$device ]; then
34 hdnamelist="$hdnamelist $device"
35 fi
36 ;;
37 esac
38done
39
40TARGET_DEVICE_NAME=""
41for hdname in $hdnamelist; do
42 # Display found hard drives and their basic info
43 echo "-------------------------------"
44 echo /dev/$hdname
45 if [ -r /sys/block/$hdname/device/vendor ]; then
46 echo -n "VENDOR="
47 cat /sys/block/$hdname/device/vendor
48 fi
49 echo -n "MODEL="
50 cat /sys/block/$hdname/device/model
51 cat /sys/block/$hdname/device/uevent
52 echo
53 # Get user choice
54 while true; do
55 echo -n "Do you want to install this image there? [y/n] "
56 read answer
57 if [ "$answer" = "y" -o "$answer" = "n" ]; then
58 break
59 fi
60 echo "Please answer y or n"
61 done
62 if [ "$answer" = "y" ]; then
63 TARGET_DEVICE_NAME=$hdname
64 break
65 fi
66done
67
68if [ -n "$TARGET_DEVICE_NAME" ]; then
69 echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
70else
71 echo "No hard drive selected. Installation aborted."
72 exit 1
73fi
74
75device=$TARGET_DEVICE_NAME
76
77#
78# The udev automounter can cause pain here, kill it
79#
80rm -f /etc/udev/rules.d/automount.rules
81rm -f /etc/udev/scripts/mount*
82
83#
84# Unmount anything the automounter had mounted
85#
86umount /dev/${device}* 2> /dev/null || /bin/true
87
88if [ ! -b /dev/loop0 ] ; then
89 mknod /dev/loop0 b 7 0
90fi
91
92mkdir -p /tmp
93cat /proc/mounts > /etc/mtab
94
95disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
96
97swap_size=$((disk_size*swap_ratio/100))
98rootfs_size=$((disk_size-boot_size-swap_size))
99
100rootfs_start=$((boot_size))
101rootfs_end=$((rootfs_start+rootfs_size))
102swap_start=$((rootfs_end))
103
104# MMC devices are special in a couple of ways
105# 1) they use a partition prefix character 'p'
106# 2) they are detected asynchronously (need rootwait)
107rootwait=""
108part_prefix=""
109if [ ! "${device#mmcblk}" = "${device}" ]; then
110 part_prefix="p"
111 rootwait="rootwait"
112fi
113bootfs=/dev/${device}${part_prefix}1
114rootfs=/dev/${device}${part_prefix}2
115swap=/dev/${device}${part_prefix}3
116
117echo "*****************"
118echo "Boot partition size: $boot_size MB ($bootfs)"
119echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
120echo "Swap partition size: $swap_size MB ($swap)"
121echo "*****************"
122echo "Deleting partition table on /dev/${device} ..."
123dd if=/dev/zero of=/dev/${device} bs=512 count=2
124
125echo "Creating new partition table on /dev/${device} ..."
126parted /dev/${device} mklabel msdos
127
128echo "Creating boot partition on $bootfs"
129parted /dev/${device} mkpart primary 0% $boot_size
130
131echo "Creating rootfs partition on $rootfs"
132parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
133
134echo "Creating swap partition on $swap"
135parted /dev/${device} mkpart primary $swap_start 100%
136
137parted /dev/${device} print
138
139echo "Formatting $bootfs to ext3..."
140mkfs.ext3 $bootfs
141
142echo "Formatting $rootfs to ext3..."
143mkfs.ext3 $rootfs
144
145echo "Formatting swap partition...($swap)"
146mkswap $swap
147
148mkdir /tgt_root
149mkdir /src_root
150mkdir -p /boot
151
152# Handling of the target root partition
153mount $rootfs /tgt_root
154mount -o rw,loop,noatime,nodiratime /media/$1/$2 /src_root
155echo "Copying rootfs files..."
156cp -a /src_root/* /tgt_root
157if [ -d /tgt_root/etc/ ] ; then
158 echo "$swap swap swap defaults 0 0" >> /tgt_root/etc/fstab
159 echo "$bootfs /boot ext3 defaults 1 2" >> /tgt_root/etc/fstab
160 # We dont want udev to mount our root device while we're booting...
161 if [ -d /tgt_root/etc/udev/ ] ; then
162 echo "/dev/${device}" >> /tgt_root/etc/udev/mount.blacklist
163 fi
164fi
165umount /tgt_root
166umount /src_root
167
168# Handling of the target boot partition
169mount $bootfs /boot
170echo "Preparing boot partition..."
171if [ -f /etc/grub.d/40_custom ] ; then
172 echo "Preparing custom grub2 menu..."
173 GRUBCFG="/boot/grub/grub.cfg"
174 mkdir -p $(dirname $GRUBCFG)
175 cp /etc/grub.d/40_custom $GRUBCFG
176 sed -i "s@__ROOTFS__@$rootfs $rootwait@g" $GRUBCFG
177 sed -i "s/__VIDEO_MODE__/$3/g" $GRUBCFG
178 sed -i "s/__VGA_MODE__/$4/g" $GRUBCFG
179 sed -i "s/__CONSOLE__/$5/g" $GRUBCFG
180 sed -i "/#/d" $GRUBCFG
181 sed -i "/exec tail/d" $GRUBCFG
182 chmod 0444 $GRUBCFG
183fi
184grub-install /dev/${device}
185echo "(hd0) /dev/${device}" > /boot/grub/device.map
186
187# If grub.cfg doesn't exist, assume GRUB 0.97 and create a menu.lst
188if [ ! -f /boot/grub/grub.cfg ] ; then
189 echo "Preparing custom grub menu..."
190 echo "default 0" > /boot/grub/menu.lst
191 echo "timeout 30" >> /boot/grub/menu.lst
192 echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
193 echo "root (hd0,0)" >> /boot/grub/menu.lst
194 echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
195fi
196
197cp /media/$1/vmlinuz /boot/
198
199umount /boot
200
201sync
202
203echo "Remove your installation media, and press ENTER"
204
205read enter
206
207echo "Rebooting..."
208reboot -f
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
new file mode 100644
index 0000000000..9e53a25a51
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -0,0 +1,223 @@
1#!/bin/sh
2
3PATH=/sbin:/bin:/usr/sbin:/usr/bin
4
5ROOT_MOUNT="/rootfs/"
6ROOT_IMAGE="rootfs.img"
7MOUNT="/bin/mount"
8UMOUNT="/bin/umount"
9ISOLINUX=""
10
11# Copied from initramfs-framework. The core of this script probably should be
12# turned into initramfs-framework modules to reduce duplication.
13udev_daemon() {
14 OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
15
16 for o in $OPTIONS; do
17 if [ -x "$o" ]; then
18 echo $o
19 return 0
20 fi
21 done
22
23 return 1
24}
25
26_UDEV_DAEMON=`udev_daemon`
27
28early_setup() {
29 mkdir -p /proc
30 mkdir -p /sys
31 mount -t proc proc /proc
32 mount -t sysfs sysfs /sys
33 mount -t devtmpfs none /dev
34
35 # support modular kernel
36 modprobe isofs 2> /dev/null
37
38 mkdir -p /run
39 mkdir -p /var/run
40
41 $_UDEV_DAEMON --daemon
42 udevadm trigger --action=add
43}
44
45read_args() {
46 [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
47 for arg in $CMDLINE; do
48 optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
49 case $arg in
50 root=*)
51 ROOT_DEVICE=$optarg ;;
52 rootimage=*)
53 ROOT_IMAGE=$optarg ;;
54 rootfstype=*)
55 modprobe $optarg 2> /dev/null ;;
56 LABEL=*)
57 label=$optarg ;;
58 video=*)
59 video_mode=$arg ;;
60 vga=*)
61 vga_mode=$arg ;;
62 console=*)
63 if [ -z "${console_params}" ]; then
64 console_params=$arg
65 else
66 console_params="$console_params $arg"
67 fi ;;
68 debugshell*)
69 if [ -z "$optarg" ]; then
70 shelltimeout=30
71 else
72 shelltimeout=$optarg
73 fi
74 esac
75 done
76}
77
78boot_live_root() {
79 # Watches the udev event queue, and exits if all current events are handled
80 udevadm settle --timeout=3 --quiet
81 killall "${_UDEV_DAEMON##*/}" 2>/dev/null
82
83 # Move the mount points of some filesystems over to
84 # the corresponding directories under the real root filesystem.
85 for dir in `awk '/\/dev.* \/media/{print $2}' /proc/mounts`; do
86 mkdir -p ${ROOT_MOUNT}/$dir
87 mount -n --move $dir ${ROOT_MOUNT}/$dir
88 done
89 mount -n --move /proc ${ROOT_MOUNT}/proc
90 mount -n --move /sys ${ROOT_MOUNT}/sys
91 mount -n --move /dev ${ROOT_MOUNT}/dev
92
93 cd $ROOT_MOUNT
94
95 # busybox switch_root supports -c option
96 exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init $CMDLINE ||
97 fatal "Couldn't switch_root, dropping to shell"
98}
99
100fatal() {
101 echo $1 >$CONSOLE
102 echo >$CONSOLE
103 exec sh
104}
105
106early_setup
107
108[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
109
110read_args
111
112echo "Waiting for removable media..."
113C=0
114while true
115do
116 for i in `ls /media 2>/dev/null`; do
117 if [ -f /media/$i/$ROOT_IMAGE ] ; then
118 found="yes"
119 break
120 elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then
121 found="yes"
122 ISOLINUX="isolinux"
123 break
124 fi
125 done
126 if [ "$found" = "yes" ]; then
127 break;
128 fi
129 # don't wait for more than $shelltimeout seconds, if it's set
130 if [ -n "$shelltimeout" ]; then
131 echo -n " " $(( $shelltimeout - $C ))
132 if [ $C -ge $shelltimeout ]; then
133 echo "..."
134 echo "Mounted filesystems"
135 mount | grep media
136 echo "Available block devices"
137 ls /dev/sd*
138 fatal "Cannot find $ROOT_IMAGE file in /media/* , dropping to a shell "
139 fi
140 C=$(( C + 1 ))
141 fi
142 sleep 1
143done
144
145# Try to mount the root image read-write and then boot it up.
146# This function distinguishes between a read-only image and a read-write image.
147# In the former case (typically an iso), it tries to make a union mount if possible.
148# In the latter case, the root image could be mounted and then directly booted up.
149mount_and_boot() {
150 mkdir $ROOT_MOUNT
151 mknod /dev/loop0 b 7 0 2>/dev/null
152
153 if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
154 fatal "Could not mount rootfs image"
155 fi
156
157 if touch $ROOT_MOUNT/bin 2>/dev/null; then
158 # The root image is read-write, directly boot it up.
159 boot_live_root
160 fi
161
162 # determine which unification filesystem to use
163 union_fs_type=""
164 if grep -q -w "overlayfs" /proc/filesystems; then
165 union_fs_type="overlayfs"
166 elif grep -q -w "aufs" /proc/filesystems; then
167 union_fs_type="aufs"
168 else
169 union_fs_type=""
170 fi
171
172 # make a union mount if possible
173 case $union_fs_type in
174 "overlayfs")
175 mkdir -p /rootfs.ro /rootfs.rw
176 if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
177 rm -rf /rootfs.ro /rootfs.rw
178 fatal "Could not move rootfs mount point"
179 else
180 mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
181 mount -t overlayfs -o "lowerdir=/rootfs.ro,upperdir=/rootfs.rw" overlayfs $ROOT_MOUNT
182 mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
183 mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
184 mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
185 fi
186 ;;
187 "aufs")
188 mkdir -p /rootfs.ro /rootfs.rw
189 if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
190 rm -rf /rootfs.ro /rootfs.rw
191 fatal "Could not move rootfs mount point"
192 else
193 mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
194 mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro" aufs $ROOT_MOUNT
195 mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
196 mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
197 mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
198 fi
199 ;;
200 "")
201 mount -t tmpfs -o rw,noatime,mode=755 tmpfs $ROOT_MOUNT/media
202 ;;
203 esac
204
205 # boot the image
206 boot_live_root
207}
208
209case $label in
210 boot)
211 mount_and_boot
212 ;;
213 install|install-efi)
214 if [ -f /media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
215 ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
216 else
217 fatal "Could not find $label script"
218 fi
219
220 # If we're getting here, we failed...
221 fatal "Installation image failed"
222 ;;
223esac
diff --git a/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb
new file mode 100644
index 0000000000..0ede20b15d
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb
@@ -0,0 +1,14 @@
1SUMMARY = "Extremely basic live image init script"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4SRC_URI = "file://init-boot.sh"
5
6PR = "r2"
7
8do_install() {
9 install -m 0755 ${WORKDIR}/init-boot.sh ${D}/init
10}
11
12inherit allarch
13
14FILES_${PN} += " /init "
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/debug b/meta/recipes-core/initrdscripts/initramfs-framework/debug
new file mode 100644
index 0000000000..00bfd7d3f5
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/debug
@@ -0,0 +1,82 @@
1#!/bin/sh
2# Copyright (C) 2011 O.S. Systems Software LTDA.
3# Licensed on MIT
4
5# Adds support to dynamic debugging of initramfs using bootparam in
6# following format:
7# shell : starts a shell before and after each module
8# shell=before:<module> : starts a shell before <module> is loaded and run
9# shell=after:<module> : starts a shell after <module> is loaded and run
10#
11# shell-debug : run set -x as soon as possible
12# shell-debug=before:<module> : run set -x before <module> is loaded and run
13# shell-debug=after:<module> : run set -x after <module> is loaded and run
14
15DEBUG_SHELL="false"
16
17debug_hook_handler() {
18 status=$1
19 module=$2
20
21 if [ -n "$bootparam_shell" ] && [ "$bootparam_shell" != "true" ]; then
22 shell_wanted_status=`expr $bootparam_shell : '\(.*\):.*'`
23 shell_wanted_module=`expr $bootparam_shell : '.*:\(.*\)'`
24
25 if [ "$shell_wanted_status" = "before" ]; then
26 shell_wanted_status=pre
27 else
28 shell_wanted_status=post
29 fi
30 fi
31
32 if [ "$bootparam_shell" = "true" ] ||
33 ( [ "$status" = "$shell_wanted_status" ] &&
34 [ "$module" = "$shell_wanted_module" ] ); then
35 if [ "$status" = "pre" ]; then
36 status_msg="before"
37 else
38 status_msg="after"
39 fi
40
41 msg "Starting shell $status_msg $module..."
42 sh
43 fi
44
45 if [ -n "$bootparam_shell_debug" ] && [ "$bootparam_shell_debug" != "true" ]; then
46 shell_debug_wanted_status=`expr $bootparam_shell_debug : '\(.*\):.*'`
47 shell_debug_wanted_module=`expr $bootparam_shell_debug : '.*:\(.*\)'`
48
49 if [ "$shell_debug_wanted_status" = "before" ]; then
50 shell_debug_wanted_status=pre
51 else
52 shell_debug_wanted_status=post
53 fi
54 fi
55
56 if [ "$bootparam_shell_debug" = "true" ] ||
57 ( [ "$status" = "$shell_debug_wanted_status" ] &&
58 [ "$module" = "$shell_debug_wanted_module" ] ); then
59 if [ "$DEBUG_SHELL" = "true" ]; then
60 return 0
61 fi
62
63 if [ "$status" = "pre" ]; then
64 status_msg="before"
65 else
66 status_msg="after"
67 fi
68
69 msg "Starting shell debugging $status_msg $module..."
70 DEBUG_SHELL="true"
71 set -x
72 fi
73}
74
75debug_enabled() {
76 return 0
77}
78
79debug_run() {
80 add_module_pre_hook "debug_hook_handler"
81 add_module_post_hook "debug_hook_handler"
82}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/e2fs b/meta/recipes-core/initrdscripts/initramfs-framework/e2fs
new file mode 100755
index 0000000000..29f801a7bd
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/e2fs
@@ -0,0 +1,28 @@
1#!/bin/sh
2# Copyright (C) 2011 O.S. Systems Software LTDA.
3# Licensed on MIT
4
5e2fs_enabled() {
6 return 0
7}
8
9e2fs_run() {
10 filesystems="ext4 ext3 ext2"
11
12 # load modules
13 for fs in $filesystems; do
14 load_kernel_module $fs
15 done
16
17 for fs in $filesystems; do
18 eval "fs_options=\$bootparam_${fs}"
19 if [ -n "$fs_options" ]; then
20 dev=`expr "$fs_options" : '\([^:]*\).*'`
21 path=`expr "$fs_options" : '[^:]*:\([^:]*\).*'`
22
23 info "Mounting $dev as $fs on $path as $fs..."
24 mkdir -p $path
25 mount -t $fs $dev $path
26 fi
27 done
28}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/finish b/meta/recipes-core/initrdscripts/initramfs-framework/finish
new file mode 100755
index 0000000000..325f47be40
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/finish
@@ -0,0 +1,47 @@
1#!/bin/sh
2# Copyright (C) 2011 O.S. Systems Software LTDA.
3# Licensed on MIT
4
5finish_enabled() {
6 return 0
7}
8
9finish_run() {
10 if [ -n "$ROOTFS_DIR" ]; then
11 if [ -n "$bootparam_rootdelay" ]; then
12 debug "Sleeping for $rootdelay second(s) to wait root to settle..."
13 sleep $bootparam_rootdelay
14 fi
15
16 if [ -n "$bootparam_root" ]; then
17 debug "No e2fs compatible filesystem has been mounted, mounting $bootparam_root..."
18
19 if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then
20 root_uuid=`echo $bootparam_root | cut -c6-`
21 bootparam_root="/dev/disk/by-uuid/$root_uuid"
22 fi
23
24 if [ -e "$bootparam_root" ]; then
25 mount $bootparam_root $ROOTFS_DIR
26 else
27 debug "root '$bootparam_root' doesn't exist."
28 fi
29 fi
30
31 if [ ! -d $ROOTFS_DIR/dev ]; then
32 fatal "ERROR: There's no '/dev' on rootfs."
33 fi
34
35 info "Switching root to '$ROOTFS_DIR'..."
36
37 debug "Moving /dev, /proc and /sys onto rootfs..."
38 mount --move /dev $ROOTFS_DIR/dev
39 mount --move /proc $ROOTFS_DIR/proc
40 mount --move /sys $ROOTFS_DIR/sys
41
42 cd $ROOTFS_DIR
43 exec switch_root -c /dev/console $ROOTFS_DIR /sbin/init
44 else
45 debug "No rootfs has been set"
46 fi
47}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init
new file mode 100755
index 0000000000..95fa9fb1a0
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/init
@@ -0,0 +1,140 @@
1#!/bin/sh
2# Copyright (C) 2011 O.S. Systems Software LTDA.
3# Licensed on MIT
4#
5# Provides the API to be used by the initramfs modules
6#
7# Modules need to provide the following functions:
8#
9# <module>_enabled : check if the module ought to run (return 1 to skip)
10# <module>_run : do what is need
11#
12# Boot parameters are available on environment in the as:
13#
14# 'foo=value' as 'bootparam_foo=value'
15# 'foo' as 'bootparam_foo=true'
16
17# Register a function to be called before running a module
18# The hook is called as:
19# <function> pre <module>
20add_module_pre_hook() {
21 MODULE_PRE_HOOKS="$MODULE_PRE_HOOKS $1"
22}
23
24# Register a function to be called after running a module
25# The hook is called as:
26# <function> post <module>
27add_module_post_hook() {
28 MODULE_POST_HOOKS="$MODULE_POST_HOOKS $1"
29}
30
31# Load kernel module
32load_kernel_module() {
33 if modprobe $1 >/dev/null 2>&1; then
34 info "Loaded module $1"
35 else
36 debug "Failed to load module $1"
37 fi
38}
39
40# Prints information
41msg() {
42 echo "$@" >/dev/console
43}
44
45# Prints information if verbose bootparam is used
46info() {
47 [ -n "$bootparam_verbose" ] && echo "$@" >/dev/console
48}
49
50# Prints information if debug bootparam is used
51debug() {
52 [ -n "$bootparam_debug" ] && echo "DEBUG: $@" >/dev/console
53}
54
55# Prints a message and start a endless loop
56fatal() {
57 echo $1 >/dev/console
58 echo >/dev/console
59
60 while [ "true" ]; do
61 sleep 3600
62 done
63}
64
65# Variables shared amoung modules
66ROOTFS_DIR="/rootfs" # where to do the switch root
67MODULE_PRE_HOOKS="" # functions to call before running each module
68MODULE_POST_HOOKS="" # functions to call after running each module
69MODULES_DIR=/init.d # place to look for modules
70
71# make mount stop complaining about missing /etc/fstab
72touch /etc/fstab
73
74# initialize /proc, /sys and /var/lock
75mkdir -p /proc /sys /var/lock
76mount -t proc proc /proc
77mount -t sysfs sysfs /sys
78
79# populate bootparam environment
80for p in `cat /proc/cmdline`; do
81 opt=`echo $p | cut -d'=' -f1`
82 opt=`echo $opt | sed -e 's/-/_/'`
83 if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then
84 eval "bootparam_${opt}=true"
85 else
86 value="`echo $p | cut -d'=' -f2-`"
87 eval "bootparam_${opt}=\"${value}\""
88 fi
89done
90
91# use /dev with devtmpfs
92if grep -q devtmpfs /proc/filesystems; then
93 mkdir -p /dev
94 mount -t devtmpfs devtmpfs /dev
95else
96 if [ ! -d /dev ]; then
97 fatal "ERROR: /dev doesn't exist and kernel doesn't has devtmpfs enabled."
98 fi
99fi
100
101mkdir $ROOTFS_DIR
102
103# Load and run modules
104for m in $MODULES_DIR/*; do
105 # Skip backup files
106 if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
107 continue
108 fi
109
110 module=`basename $m | cut -d'-' -f 2`
111 debug "Loading module $module"
112
113 # pre hooks
114 for h in $MODULE_PRE_HOOKS; do
115 debug "Calling module hook (pre): $h"
116 eval "$h pre $module"
117 debug "Finished module hook (pre): $h"
118 done
119
120 # process module
121 . $m
122
123 if ! eval "${module}_enabled"; then
124 debug "Skipping module $module"
125 continue
126 fi
127
128 debug "Running ${module}_run"
129 eval "${module}_run"
130
131 # post hooks
132 for h in $MODULE_POST_HOOKS; do
133 debug "Calling module hook (post): $h"
134 eval "$h post $module"
135 debug "Finished module hook (post): $h"
136 done
137done
138
139# Catch all
140fatal "ERROR: Initramfs failed to initialize the system."
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/mdev b/meta/recipes-core/initrdscripts/initramfs-framework/mdev
new file mode 100644
index 0000000000..a5df1d717a
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/mdev
@@ -0,0 +1,30 @@
1#!/bin/sh
2# Copyright (C) 2011 O.S. Systems Software LTDA.
3# Licensed on MIT
4
5mdev_enabled() {
6 if [ ! -e /sbin/mdev ]; then
7 debug "/sbin/mdev doesn't exist"
8 return 1
9 fi
10
11 return 0
12}
13
14mdev_run() {
15 # setup the environment
16 mount -t tmpfs tmpfs /dev
17
18 mkdir -m 1777 /dev/shm
19
20 mkdir -m 0755 /dev/pts
21 mount -t devpts devpts /dev/pts
22
23 echo /sbin/mdev > /proc/sys/kernel/hotplug
24 mdev -s
25
26 # load modules for devices
27 find /sys -name modalias | while read m; do
28 load_kernel_module $(cat $m)
29 done
30}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev
new file mode 100644
index 0000000000..bb462dc448
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev
@@ -0,0 +1,45 @@
1#!/bin/sh
2# Copyright (C) 2011, 2012 O.S. Systems Software LTDA.
3# Licensed on MIT
4
5udev_shutdown_hook_handler() {
6 status=$1
7 module=$2
8 if [ "$status" = "pre" ] && [ "$module" = "finish" ]; then
9 killall `basename $_UDEV_DAEMON` 2>/dev/null
10 fi
11}
12
13udev_daemon() {
14 OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
15
16 for o in $OPTIONS; do
17 if [ -x "$o" ]; then
18 echo $o
19 return 0
20 fi
21 done
22
23 return 1
24}
25
26_UDEV_DAEMON=`udev_daemon`
27
28udev_enabled() {
29 if [ -z "$_UDEV_DAEMON" ]; then
30 msg "WARNING: Cannot find the udev daemon; daemon will not be started in initramfs."
31 return 1
32 fi
33
34 return 0
35}
36
37udev_run() {
38 add_module_pre_hook "udev_shutdown_hook_handler"
39
40 mkdir -p /run
41
42 $_UDEV_DAEMON --daemon
43 udevadm trigger --action=add
44 udevadm settle
45}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
new file mode 100644
index 0000000000..861bec363f
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
@@ -0,0 +1,59 @@
1SUMMARY = "Modular initramfs system"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4RDEPENDS_${PN} += "busybox"
5
6PR = "r2"
7
8inherit allarch
9
10SRC_URI = "file://init \
11 file://finish \
12 file://mdev \
13 file://udev \
14 file://e2fs \
15 file://debug"
16
17do_install() {
18 install -d ${D}/init.d
19
20 # base
21 install -m 0755 ${WORKDIR}/init ${D}/init
22 install -m 0755 ${WORKDIR}/finish ${D}/init.d/99-finish
23
24 # mdev
25 install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev
26
27 # udev
28 install -m 0755 ${WORKDIR}/udev ${D}/init.d/01-udev
29
30 # e2fs
31 install -m 0755 ${WORKDIR}/e2fs ${D}/init.d/10-e2fs
32
33 # debug
34 install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug
35}
36
37PACKAGES = "${PN}-base \
38 initramfs-module-mdev \
39 initramfs-module-udev \
40 initramfs-module-e2fs \
41 initramfs-module-debug"
42
43FILES_${PN}-base = "/init /init.d/99-finish"
44
45SUMMARY_initramfs-module-mdev = "initramfs support for mdev"
46RDEPENDS_initramfs-module-mdev = "${PN}-base"
47FILES_initramfs-module-mdev = "/init.d/01-mdev"
48
49SUMMARY_initramfs-module-udev = "initramfs support for udev"
50RDEPENDS_initramfs-module-udev = "${PN}-base udev udev-utils"
51FILES_initramfs-module-udev = "/init.d/01-udev"
52
53SUMMARY_initramfs-module-e2fs = "initramfs support for ext4/ext3/ext2 filesystems"
54RDEPENDS_initramfs-module-e2fs = "${PN}-base"
55FILES_initramfs-module-e2fs = "/init.d/10-e2fs"
56
57SUMMARY_initramfs-module-debug = "initramfs dynamic debug support"
58RDEPENDS_initramfs-module-debug = "${PN}-base"
59FILES_initramfs-module-debug = "/init.d/00-debug"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
new file mode 100644
index 0000000000..2d378e2101
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
@@ -0,0 +1,17 @@
1SUMMARY = "Live image init script"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4DEPENDS = "virtual/kernel"
5RDEPENDS_${PN} = "udev udev-extraconf"
6SRC_URI = "file://init-live.sh"
7
8PR = "r11"
9
10do_install() {
11 install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
12}
13
14FILES_${PN} += " /init "
15
16# Due to kernel depdendency
17PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb
new file mode 100644
index 0000000000..a54960c596
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb
@@ -0,0 +1,14 @@
1SUMMARY = "Live image install script for with a second rootfs/kernel option"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4SRC_URI = "file://init-install-efi-testfs.sh"
5
6RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools"
7
8do_install() {
9 install -m 0755 ${WORKDIR}/init-install-efi-testfs.sh ${D}/install-efi.sh
10}
11
12INHIBIT_DEFAULT_DEPS = "1"
13FILES_${PN} = " /install-efi.sh "
14COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb
new file mode 100644
index 0000000000..7195dc2718
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb
@@ -0,0 +1,22 @@
1SUMMARY = "Live image install script for grub-efi"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4SRC_URI = "file://init-install-efi.sh"
5
6PR = "r1"
7
8RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools"
9
10do_install() {
11 install -m 0755 ${WORKDIR}/init-install-efi.sh ${D}/install-efi.sh
12}
13
14# While this package maybe an allarch due to it being a
15# simple script, reality is that it is Host specific based
16# on the COMPATIBLE_HOST below, which needs to take precedence
17#inherit allarch
18INHIBIT_DEFAULT_DEPS = "1"
19
20FILES_${PN} = " /install-efi.sh "
21
22COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb
new file mode 100644
index 0000000000..db4cf544e8
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb
@@ -0,0 +1,14 @@
1SUMMARY = "Live image install script with a second rootfs/kernel"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4SRC_URI = "file://init-install-testfs.sh"
5
6RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs"
7
8do_install() {
9 install -m 0755 ${WORKDIR}/init-install-testfs.sh ${D}/install.sh
10}
11
12INHIBIT_DEFAULT_DEPS = "1"
13FILES_${PN} = " /install.sh "
14COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
new file mode 100644
index 0000000000..7bf31c9cf8
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
@@ -0,0 +1,22 @@
1SUMMARY = "Live image install script for grub"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4SRC_URI = "file://init-install.sh"
5
6PR = "r9"
7
8RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs"
9
10do_install() {
11 install -m 0755 ${WORKDIR}/init-install.sh ${D}/install.sh
12}
13
14# While this package maybe an allarch due to it being a
15# simple script, reality is that it is Host specific based
16# on the COMPATIBLE_HOST below, which needs to take precedence
17#inherit allarch
18INHIBIT_DEFAULT_DEPS = "1"
19
20FILES_${PN} = " /install.sh "
21
22COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch b/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch
new file mode 100644
index 0000000000..1ee8181f12
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch
@@ -0,0 +1,347 @@
1Upstream-Status: Inappropriate [licensing]
2
3diff --git a/COPYING b/COPYING
4new file mode 100644
5index 0000000..d511905
6--- /dev/null
7+++ b/COPYING
8@@ -0,0 +1,339 @@
9+ GNU GENERAL PUBLIC LICENSE
10+ Version 2, June 1991
11+
12+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
13+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14+ Everyone is permitted to copy and distribute verbatim copies
15+ of this license document, but changing it is not allowed.
16+
17+ Preamble
18+
19+ The licenses for most software are designed to take away your
20+freedom to share and change it. By contrast, the GNU General Public
21+License is intended to guarantee your freedom to share and change free
22+software--to make sure the software is free for all its users. This
23+General Public License applies to most of the Free Software
24+Foundation's software and to any other program whose authors commit to
25+using it. (Some other Free Software Foundation software is covered by
26+the GNU Lesser General Public License instead.) You can apply it to
27+your programs, too.
28+
29+ When we speak of free software, we are referring to freedom, not
30+price. Our General Public Licenses are designed to make sure that you
31+have the freedom to distribute copies of free software (and charge for
32+this service if you wish), that you receive source code or can get it
33+if you want it, that you can change the software or use pieces of it
34+in new free programs; and that you know you can do these things.
35+
36+ To protect your rights, we need to make restrictions that forbid
37+anyone to deny you these rights or to ask you to surrender the rights.
38+These restrictions translate to certain responsibilities for you if you
39+distribute copies of the software, or if you modify it.
40+
41+ For example, if you distribute copies of such a program, whether
42+gratis or for a fee, you must give the recipients all the rights that
43+you have. You must make sure that they, too, receive or can get the
44+source code. And you must show them these terms so they know their
45+rights.
46+
47+ We protect your rights with two steps: (1) copyright the software, and
48+(2) offer you this license which gives you legal permission to copy,
49+distribute and/or modify the software.
50+
51+ Also, for each author's protection and ours, we want to make certain
52+that everyone understands that there is no warranty for this free
53+software. If the software is modified by someone else and passed on, we
54+want its recipients to know that what they have is not the original, so
55+that any problems introduced by others will not reflect on the original
56+authors' reputations.
57+
58+ Finally, any free program is threatened constantly by software
59+patents. We wish to avoid the danger that redistributors of a free
60+program will individually obtain patent licenses, in effect making the
61+program proprietary. To prevent this, we have made it clear that any
62+patent must be licensed for everyone's free use or not licensed at all.
63+
64+ The precise terms and conditions for copying, distribution and
65+modification follow.
66+
67+ GNU GENERAL PUBLIC LICENSE
68+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
69+
70+ 0. This License applies to any program or other work which contains
71+a notice placed by the copyright holder saying it may be distributed
72+under the terms of this General Public License. The "Program", below,
73+refers to any such program or work, and a "work based on the Program"
74+means either the Program or any derivative work under copyright law:
75+that is to say, a work containing the Program or a portion of it,
76+either verbatim or with modifications and/or translated into another
77+language. (Hereinafter, translation is included without limitation in
78+the term "modification".) Each licensee is addressed as "you".
79+
80+Activities other than copying, distribution and modification are not
81+covered by this License; they are outside its scope. The act of
82+running the Program is not restricted, and the output from the Program
83+is covered only if its contents constitute a work based on the
84+Program (independent of having been made by running the Program).
85+Whether that is true depends on what the Program does.
86+
87+ 1. You may copy and distribute verbatim copies of the Program's
88+source code as you receive it, in any medium, provided that you
89+conspicuously and appropriately publish on each copy an appropriate
90+copyright notice and disclaimer of warranty; keep intact all the
91+notices that refer to this License and to the absence of any warranty;
92+and give any other recipients of the Program a copy of this License
93+along with the Program.
94+
95+You may charge a fee for the physical act of transferring a copy, and
96+you may at your option offer warranty protection in exchange for a fee.
97+
98+ 2. You may modify your copy or copies of the Program or any portion
99+of it, thus forming a work based on the Program, and copy and
100+distribute such modifications or work under the terms of Section 1
101+above, provided that you also meet all of these conditions:
102+
103+ a) You must cause the modified files to carry prominent notices
104+ stating that you changed the files and the date of any change.
105+
106+ b) You must cause any work that you distribute or publish, that in
107+ whole or in part contains or is derived from the Program or any
108+ part thereof, to be licensed as a whole at no charge to all third
109+ parties under the terms of this License.
110+
111+ c) If the modified program normally reads commands interactively
112+ when run, you must cause it, when started running for such
113+ interactive use in the most ordinary way, to print or display an
114+ announcement including an appropriate copyright notice and a
115+ notice that there is no warranty (or else, saying that you provide
116+ a warranty) and that users may redistribute the program under
117+ these conditions, and telling the user how to view a copy of this
118+ License. (Exception: if the Program itself is interactive but
119+ does not normally print such an announcement, your work based on
120+ the Program is not required to print an announcement.)
121+
122+These requirements apply to the modified work as a whole. If
123+identifiable sections of that work are not derived from the Program,
124+and can be reasonably considered independent and separate works in
125+themselves, then this License, and its terms, do not apply to those
126+sections when you distribute them as separate works. But when you
127+distribute the same sections as part of a whole which is a work based
128+on the Program, the distribution of the whole must be on the terms of
129+this License, whose permissions for other licensees extend to the
130+entire whole, and thus to each and every part regardless of who wrote it.
131+
132+Thus, it is not the intent of this section to claim rights or contest
133+your rights to work written entirely by you; rather, the intent is to
134+exercise the right to control the distribution of derivative or
135+collective works based on the Program.
136+
137+In addition, mere aggregation of another work not based on the Program
138+with the Program (or with a work based on the Program) on a volume of
139+a storage or distribution medium does not bring the other work under
140+the scope of this License.
141+
142+ 3. You may copy and distribute the Program (or a work based on it,
143+under Section 2) in object code or executable form under the terms of
144+Sections 1 and 2 above provided that you also do one of the following:
145+
146+ a) Accompany it with the complete corresponding machine-readable
147+ source code, which must be distributed under the terms of Sections
148+ 1 and 2 above on a medium customarily used for software interchange; or,
149+
150+ b) Accompany it with a written offer, valid for at least three
151+ years, to give any third party, for a charge no more than your
152+ cost of physically performing source distribution, a complete
153+ machine-readable copy of the corresponding source code, to be
154+ distributed under the terms of Sections 1 and 2 above on a medium
155+ customarily used for software interchange; or,
156+
157+ c) Accompany it with the information you received as to the offer
158+ to distribute corresponding source code. (This alternative is
159+ allowed only for noncommercial distribution and only if you
160+ received the program in object code or executable form with such
161+ an offer, in accord with Subsection b above.)
162+
163+The source code for a work means the preferred form of the work for
164+making modifications to it. For an executable work, complete source
165+code means all the source code for all modules it contains, plus any
166+associated interface definition files, plus the scripts used to
167+control compilation and installation of the executable. However, as a
168+special exception, the source code distributed need not include
169+anything that is normally distributed (in either source or binary
170+form) with the major components (compiler, kernel, and so on) of the
171+operating system on which the executable runs, unless that component
172+itself accompanies the executable.
173+
174+If distribution of executable or object code is made by offering
175+access to copy from a designated place, then offering equivalent
176+access to copy the source code from the same place counts as
177+distribution of the source code, even though third parties are not
178+compelled to copy the source along with the object code.
179+
180+ 4. You may not copy, modify, sublicense, or distribute the Program
181+except as expressly provided under this License. Any attempt
182+otherwise to copy, modify, sublicense or distribute the Program is
183+void, and will automatically terminate your rights under this License.
184+However, parties who have received copies, or rights, from you under
185+this License will not have their licenses terminated so long as such
186+parties remain in full compliance.
187+
188+ 5. You are not required to accept this License, since you have not
189+signed it. However, nothing else grants you permission to modify or
190+distribute the Program or its derivative works. These actions are
191+prohibited by law if you do not accept this License. Therefore, by
192+modifying or distributing the Program (or any work based on the
193+Program), you indicate your acceptance of this License to do so, and
194+all its terms and conditions for copying, distributing or modifying
195+the Program or works based on it.
196+
197+ 6. Each time you redistribute the Program (or any work based on the
198+Program), the recipient automatically receives a license from the
199+original licensor to copy, distribute or modify the Program subject to
200+these terms and conditions. You may not impose any further
201+restrictions on the recipients' exercise of the rights granted herein.
202+You are not responsible for enforcing compliance by third parties to
203+this License.
204+
205+ 7. If, as a consequence of a court judgment or allegation of patent
206+infringement or for any other reason (not limited to patent issues),
207+conditions are imposed on you (whether by court order, agreement or
208+otherwise) that contradict the conditions of this License, they do not
209+excuse you from the conditions of this License. If you cannot
210+distribute so as to satisfy simultaneously your obligations under this
211+License and any other pertinent obligations, then as a consequence you
212+may not distribute the Program at all. For example, if a patent
213+license would not permit royalty-free redistribution of the Program by
214+all those who receive copies directly or indirectly through you, then
215+the only way you could satisfy both it and this License would be to
216+refrain entirely from distribution of the Program.
217+
218+If any portion of this section is held invalid or unenforceable under
219+any particular circumstance, the balance of the section is intended to
220+apply and the section as a whole is intended to apply in other
221+circumstances.
222+
223+It is not the purpose of this section to induce you to infringe any
224+patents or other property right claims or to contest validity of any
225+such claims; this section has the sole purpose of protecting the
226+integrity of the free software distribution system, which is
227+implemented by public license practices. Many people have made
228+generous contributions to the wide range of software distributed
229+through that system in reliance on consistent application of that
230+system; it is up to the author/donor to decide if he or she is willing
231+to distribute software through any other system and a licensee cannot
232+impose that choice.
233+
234+This section is intended to make thoroughly clear what is believed to
235+be a consequence of the rest of this License.
236+
237+ 8. If the distribution and/or use of the Program is restricted in
238+certain countries either by patents or by copyrighted interfaces, the
239+original copyright holder who places the Program under this License
240+may add an explicit geographical distribution limitation excluding
241+those countries, so that distribution is permitted only in or among
242+countries not thus excluded. In such case, this License incorporates
243+the limitation as if written in the body of this License.
244+
245+ 9. The Free Software Foundation may publish revised and/or new versions
246+of the General Public License from time to time. Such new versions will
247+be similar in spirit to the present version, but may differ in detail to
248+address new problems or concerns.
249+
250+Each version is given a distinguishing version number. If the Program
251+specifies a version number of this License which applies to it and "any
252+later version", you have the option of following the terms and conditions
253+either of that version or of any later version published by the Free
254+Software Foundation. If the Program does not specify a version number of
255+this License, you may choose any version ever published by the Free Software
256+Foundation.
257+
258+ 10. If you wish to incorporate parts of the Program into other free
259+programs whose distribution conditions are different, write to the author
260+to ask for permission. For software which is copyrighted by the Free
261+Software Foundation, write to the Free Software Foundation; we sometimes
262+make exceptions for this. Our decision will be guided by the two goals
263+of preserving the free status of all derivatives of our free software and
264+of promoting the sharing and reuse of software generally.
265+
266+ NO WARRANTY
267+
268+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
269+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
270+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
271+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
272+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
273+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
274+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
275+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
276+REPAIR OR CORRECTION.
277+
278+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
279+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
280+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
281+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
282+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
283+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
284+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
285+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
286+POSSIBILITY OF SUCH DAMAGES.
287+
288+ END OF TERMS AND CONDITIONS
289+
290+ How to Apply These Terms to Your New Programs
291+
292+ If you develop a new program, and you want it to be of the greatest
293+possible use to the public, the best way to achieve this is to make it
294+free software which everyone can redistribute and change under these terms.
295+
296+ To do so, attach the following notices to the program. It is safest
297+to attach them to the start of each source file to most effectively
298+convey the exclusion of warranty; and each file should have at least
299+the "copyright" line and a pointer to where the full notice is found.
300+
301+ <one line to give the program's name and a brief idea of what it does.>
302+ Copyright (C) <year> <name of author>
303+
304+ This program is free software; you can redistribute it and/or modify
305+ it under the terms of the GNU General Public License as published by
306+ the Free Software Foundation; either version 2 of the License, or
307+ (at your option) any later version.
308+
309+ This program is distributed in the hope that it will be useful,
310+ but WITHOUT ANY WARRANTY; without even the implied warranty of
311+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
312+ GNU General Public License for more details.
313+
314+ You should have received a copy of the GNU General Public License along
315+ with this program; if not, write to the Free Software Foundation, Inc.,
316+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
317+
318+Also add information on how to contact you by electronic and paper mail.
319+
320+If the program is interactive, make it output a short notice like this
321+when it starts in an interactive mode:
322+
323+ Gnomovision version 69, Copyright (C) year name of author
324+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
325+ This is free software, and you are welcome to redistribute it
326+ under certain conditions; type `show c' for details.
327+
328+The hypothetical commands `show w' and `show c' should show the appropriate
329+parts of the General Public License. Of course, the commands you use may
330+be called something other than `show w' and `show c'; they could even be
331+mouse-clicks or menu items--whatever suits your program.
332+
333+You should also get your employer (if you work as a programmer) or your
334+school, if any, to sign a "copyright disclaimer" for the program, if
335+necessary. Here is a sample; alter the names:
336+
337+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
338+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
339+
340+ <signature of Ty Coon>, 1 April 1989
341+ Ty Coon, President of Vice
342+
343+This General Public License does not permit incorporating your program into
344+proprietary programs. If your program is a subroutine library, you may
345+consider it more useful to permit linking proprietary applications with the
346+library. If this is what you want to do, use the GNU Lesser General
347+Public License instead of this License.
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh b/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh
new file mode 100644
index 0000000000..b577b9a03a
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh
@@ -0,0 +1,13 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: alignment
4# Required-Start: mountkernfs
5# Required-Stop: mountkernfs
6# Default-Start: S
7# Default-Stop:
8### END INIT INFO
9
10if [ -e /proc/cpu/alignment ]; then
11 echo "3" > /proc/cpu/alignment
12fi
13
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/banner.sh b/meta/recipes-core/initscripts/initscripts-1.0/banner.sh
new file mode 100644
index 0000000000..9e2b091252
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/banner.sh
@@ -0,0 +1,24 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: banner
4# Required-Start:
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8### END INIT INFO
9
10if [ ! -e /dev/tty ]; then
11 /bin/mknod -m 0666 /dev/tty c 5 0
12fi
13
14if ( > /dev/tty0 ) 2>/dev/null; then
15 vtmaster=/dev/tty0
16elif ( > /dev/vc/0 ) 2>/dev/null; then
17 vtmaster=/dev/vc/0
18elif ( > /dev/console ) 2>/dev/null; then
19 vtmaster=/dev/console
20else
21 vtmaster=/dev/null
22fi
23echo > $vtmaster
24echo "Please wait: booting..." > $vtmaster
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
new file mode 100755
index 0000000000..3b5a47fcdd
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -0,0 +1,71 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: bootmisc
4# Required-Start: $local_fs mountvirtfs
5# Required-Stop: $local_fs
6# Default-Start: S
7# Default-Stop: 0 6
8# Short-Description: Misc and other.
9### END INIT INFO
10
11. /etc/default/rcS
12#
13# Put a nologin file in /etc to prevent people from logging in before
14# system startup is complete.
15#
16if test "$DELAYLOGIN" = yes
17then
18 echo "System bootup in progress - please wait" > /etc/nologin
19 cp /etc/nologin /etc/nologin.boot
20fi
21
22#
23# Set pseudo-terminal access permissions.
24#
25if test -c /dev/ttyp0
26then
27 chmod 666 /dev/tty[p-za-e][0-9a-f]
28 chown root:tty /dev/tty[p-za-e][0-9a-f]
29fi
30
31#
32# Apply /proc settings if defined
33#
34SYSCTL_CONF="/etc/sysctl.conf"
35if [ -f "${SYSCTL_CONF}" ]
36then
37 if [ -x "/sbin/sysctl" ]
38 then
39 /sbin/sysctl -p "${SYSCTL_CONF}"
40 else
41 echo "To have ${SYSCTL_CONF} applied during boot, install package <procps>."
42 fi
43fi
44
45#
46# Update /etc/motd.
47#
48if test "$EDITMOTD" != no
49then
50 uname -a > /etc/motd.tmp
51 sed 1d /etc/motd >> /etc/motd.tmp
52 mv /etc/motd.tmp /etc/motd
53fi
54
55#
56# This is as good a place as any for a sanity check
57#
58# Set the system clock from hardware clock
59# If the timestamp is more recent than the current time,
60# use the timestamp instead.
61test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start
62if test -e /etc/timestamp
63then
64 SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M`
65 read TIMESTAMP < /etc/timestamp
66 if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
67 date -u ${TIMESTAMP#????}${TIMESTAMP%????????}
68 test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop
69 fi
70fi
71: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
new file mode 100755
index 0000000000..62869451b7
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
@@ -0,0 +1,50 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: checkfs
4# Required-Start: checkroot
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# Short-Description: Check all other file systems
9### END INIT INFO
10
11. /etc/default/rcS
12
13#
14# Check the rest of the filesystems.
15#
16if test ! -f /fastboot
17then
18 if test -f /forcefsck
19 then
20 force="-f"
21 else
22 force=""
23 fi
24 if test "$FSCKFIX" = yes
25 then
26 fix="-y"
27 else
28 fix="-a"
29 fi
30 spinner="-C"
31 case "$TERM" in
32 dumb|network|unknown|"") spinner="" ;;
33 esac
34 test "`uname -m`" = "s390" && spinner="" # This should go away
35 test "$VERBOSE" != no && echo "Checking all filesystems..."
36 fsck $spinner -R -A $fix $force
37 if test "$?" -gt 1
38 then
39 echo
40 echo "fsck failed. Please repair manually."
41 echo
42 echo "CONTROL-D will exit from this shell and continue system startup."
43 echo
44 # Start a single user shell on the console
45 /sbin/sulogin $CONSOLE
46 fi
47fi
48rm -f /fastboot /forcefsck
49
50: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
new file mode 100755
index 0000000000..dfee2afaad
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
@@ -0,0 +1,148 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: checkroot
4# Required-Start: udev
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# Short-Description: Check to root file system.
9### END INIT INFO
10
11. /etc/default/rcS
12
13#
14# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
15# from this script *before anything else* with a timeout, like SCO does.
16#
17test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
18
19#
20# Read /etc/fstab.
21#
22exec 9< /etc/fstab
23rootmode=rw
24rootopts=rw
25rootcheck=$ENABLE_ROOTFS_FSCK
26swap_on_md=no
27devfs=
28while read fs mnt type opts dump pass junk <&9
29do
30 case "$fs" in
31 ""|\#*)
32 continue;
33 ;;
34 /dev/md*)
35 # Swap on md device.
36 test "$type" = swap && swap_on_md=yes
37 ;;
38 /dev/*)
39 ;;
40 *)
41 # Might be a swapfile.
42 test "$type" = swap && swap_on_md=yes
43 ;;
44 esac
45 test "$type" = devfs && devfs="$fs"
46 test "$mnt" != / && continue
47 rootopts="$opts"
48 test "$pass" = 0 -o "$pass" = "" && rootcheck=no
49 case "$opts" in
50 ro|ro,*|*,ro|*,ro,*)
51 rootmode=ro
52 ;;
53 esac
54done
55exec 0>&9 9>&-
56
57# Check for conflicting configurations
58if [ "$rootmode" = "ro" -a "$ROOTFS_READ_ONLY" = "no" ] || \
59 [ "$rootmode" = "rw" -a "$ROOTFS_READ_ONLY" = "yes" ]; then
60 echo ""
61 echo "WARN: conflicting configurations in /etc/fstab and /etc/default/rcS"
62 echo " regarding the writability of rootfs. Please fix one of them."
63 echo ""
64fi
65
66
67#
68# Activate the swap device(s) in /etc/fstab. This needs to be done
69# before fsck, since fsck can be quite memory-hungry.
70#
71test "$VERBOSE" != no && echo "Activating swap"
72swapon -a 2> /dev/null
73
74#
75# Check the root filesystem.
76#
77if test -f /fastboot || test $rootcheck = no
78then
79 test $rootcheck = yes && echo "Fast boot, no filesystem check"
80else
81 #
82 # Ensure that root is quiescent and read-only before fsck'ing.
83 #
84 mount -n -o remount,ro /
85 if test $? = 0
86 then
87 if test -f /forcefsck
88 then
89 force="-f"
90 else
91 force=""
92 fi
93 if test "$FSCKFIX" = yes
94 then
95 fix="-y"
96 else
97 fix="-a"
98 fi
99 spinner="-C"
100 case "$TERM" in
101 dumb|network|unknown|"") spinner="" ;;
102 esac
103 test `uname -m` = s390 && spinner="" # This should go away
104 test "$VERBOSE" != no && echo "Checking root filesystem..."
105 fsck $spinner $force $fix /
106 #
107 # If there was a failure, drop into single-user mode.
108 #
109 # NOTE: "failure" is defined as exiting with a return code of
110 # 2 or larger. A return code of 1 indicates that filesystem
111 # errors were corrected but that the boot may proceed.
112 #
113 if test "$?" -gt 1
114 then
115 # Surprise! Re-directing from a HERE document (as in
116 # "cat << EOF") won't work, because the root is read-only.
117 echo
118 echo "fsck failed. Please repair manually and reboot. Please note"
119 echo "that the root filesystem is currently mounted read-only. To"
120 echo "remount it read-write:"
121 echo
122 echo " # mount -n -o remount,rw /"
123 echo
124 echo "CONTROL-D will exit from this shell and REBOOT the system."
125 echo
126 # Start a single user shell on the console
127 /sbin/sulogin $CONSOLE
128 reboot -f
129 fi
130 else
131 echo "*** ERROR! Cannot fsck root fs because it is not mounted read-only!"
132 echo
133 fi
134fi
135
136#
137# If the root filesystem was not marked as read-only in /etc/fstab,
138# remount the rootfs rw but do not try to change mtab because it
139# is on a ro fs until the remount succeeded. Then clean up old mtabs
140# and finally write the new mtab.
141#
142mount -n -o remount,$rootmode /
143if test "$rootmode" = rw
144then
145 ln -sf /proc/mounts /dev/mtab
146fi
147
148: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/devpts b/meta/recipes-core/initscripts/initscripts-1.0/devpts
new file mode 100644
index 0000000000..4a0978b404
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/devpts
@@ -0,0 +1,5 @@
1# GID of the `tty' group
2TTYGRP=5
3
4# Set to 600 to have `mesg n' be the default
5TTYMODE=620
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh b/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh
new file mode 100755
index 0000000000..c6043fb1e6
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh
@@ -0,0 +1,28 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: devpts
4# Required-Start: udev
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# Short-Description: Mount /dev/pts file systems.
9### END INIT INFO
10
11. /etc/default/devpts
12
13if grep -q devpts /proc/filesystems
14then
15 #
16 # Create multiplexor device.
17 #
18 test -c /dev/ptmx || mknod -m 666 /dev/ptmx c 5 2
19
20 #
21 # Mount /dev/pts if needed.
22 #
23 if ! grep -q devpts /proc/mounts
24 then
25 mkdir -p /dev/pts
26 mount -t devpts devpts /dev/pts -ogid=${TTYGRP},mode=${TTYMODE}
27 fi
28fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
new file mode 100644
index 0000000000..a97b0681e1
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
@@ -0,0 +1,17 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: dmesg
4# Required-Start:
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8### END INIT INFO
9
10if [ -f /var/log/dmesg ]; then
11 if [ -f /usr/sbin/logrotate ]; then
12 logrotate -f /etc/logrotate-dmesg.conf
13 else
14 mv -f /var/log/dmesg /var/log/dmesg.old
15 fi
16fi
17dmesg -s 131072 > /var/log/dmesg
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/functions b/meta/recipes-core/initscripts/initscripts-1.0/functions
new file mode 100755
index 0000000000..01ad1edd3e
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/functions
@@ -0,0 +1,91 @@
1# -*-Shell-script-*-
2#
3# functions This file contains functions to be used by most or all
4# shell scripts in the /etc/init.d directory.
5#
6
7NORMAL="\\033[0;39m" # Standard console grey
8SUCCESS="\\033[1;32m" # Success is green
9WARNING="\\033[1;33m" # Warnings are yellow
10FAILURE="\\033[1;31m" # Failures are red
11INFO="\\033[1;36m" # Information is light cyan
12BRACKET="\\033[1;34m" # Brackets are blue
13
14# NOTE: The pidofproc () doesn't support the process which is a script unless
15# the pidof supports "-x" option. If you want to use it for such a
16# process:
17# 1) If there is no "pidof -x", replace the "pidof $1" with another
18# command like(for core-image-minimal):
19# ps | awk '/'"$1"'/ {print $1}'
20# Or
21# 2) If there is "pidof -x", replace "pidof" with "pidof -x".
22#
23# pidofproc - print the pid of a process
24# $1: the name of the process
25pidofproc () {
26
27 # pidof output null when no program is running, so no "2>/dev/null".
28 pid=`pidof $1`
29 status=$?
30 case $status in
31 0)
32 echo $pid
33 return 0
34 ;;
35 127)
36 echo "ERROR: command pidof not found" >&2
37 exit 127
38 ;;
39 *)
40 return $status
41 ;;
42 esac
43}
44
45machine_id() { # return the machine ID
46 awk 'BEGIN { FS=": " } /Hardware/ \
47 { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo
48}
49
50killproc() { # kill the named process(es)
51 pid=`pidofproc $1` && kill $pid
52}
53
54status() {
55 local pid
56 if [ "$#" = 0 ]; then
57 echo "Usage: status {program}"
58 return 1
59 fi
60 pid=`pidofproc $1`
61 if [ -n "$pid" ]; then
62 echo "$1 (pid $pid) is running..."
63 return 0
64 else
65 echo "$1 is stopped"
66 fi
67 return 3
68}
69
70success() {
71 echo -n -e "${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
72 return 0
73}
74
75failure() {
76 local rc=$*
77 echo -n -e "${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
78 return $rc
79}
80
81warning() {
82 local rc=$*
83 echo -n -e "${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
84 return $rc
85}
86
87passed() {
88 local rc=$*
89 echo -n -e "${BRACKET}[${SUCCESS} PASS ${BRACKET}]${NORMAL}"
90 return $rc
91}
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/halt b/meta/recipes-core/initscripts/initscripts-1.0/halt
new file mode 100755
index 0000000000..a56f73421b
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/halt
@@ -0,0 +1,29 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: halt
4# Required-Start:
5# Required-Stop:
6# Default-Start:
7# Default-Stop: 0
8# Short-Description: Execute the halt command.
9# Description:
10### END INIT INFO
11
12PATH=/sbin:/bin:/usr/sbin:/usr/bin
13
14# See if we need to cut the power.
15if test -x /etc/init.d/ups-monitor
16then
17 /etc/init.d/ups-monitor poweroff
18fi
19
20# Don't shut down drives if we're using RAID.
21hddown="-h"
22if grep -qs '^md.*active' /proc/mdstat
23then
24 hddown=""
25fi
26
27halt SED_HALTARGS -p $hddown
28
29: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh b/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
new file mode 100755
index 0000000000..78fb91c409
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
@@ -0,0 +1,22 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: hostname
4# Required-Start:
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# Short-Description: Set hostname based on /etc/hostname
9### END INIT INFO
10HOSTNAME=$(/bin/hostname)
11
12hostname -b -F /etc/hostname 2> /dev/null
13if [ $? -eq 0 ]; then
14 exit
15fi
16
17# Busybox hostname doesn't support -b so we need implement it on our own
18if [ -f /etc/hostname ];then
19 hostname -F /etc/hostname
20elif [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" -o ! -z "`echo $HOSTNAME | sed -n '/^[0-9]*\.[0-9].*/p'`" ] ; then
21 hostname localhost
22fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf b/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf
new file mode 100644
index 0000000000..6f46e4216f
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf
@@ -0,0 +1,9 @@
1# see "man logrotate" for details
2# rotate dmesg, and keep 5 versions.
3
4/var/log/dmesg {
5 create
6 rotate 5
7 nodateext
8}
9
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
new file mode 100755
index 0000000000..94bae420c0
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
@@ -0,0 +1,39 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: mountall
4# Required-Start: mountvirtfs
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# Short-Description: Mount all filesystems.
9# Description:
10### END INIT INFO
11
12. /etc/default/rcS
13
14#
15# Mount local filesystems in /etc/fstab. For some reason, people
16# might want to mount "proc" several times, and mount -v complains
17# about this. So we mount "proc" filesystems without -v.
18#
19test "$VERBOSE" != no && echo "Mounting local filesystems..."
20mount -at nonfs,nosmbfs,noncpfs 2>/dev/null
21
22#
23# We might have mounted something over /dev, see if /dev/initctl is there.
24#
25if test ! -p /dev/initctl
26then
27 rm -f /dev/initctl
28 mknod -m 600 /dev/initctl p
29fi
30kill -USR1 1
31
32#
33# Execute swapon command again, in case we want to swap to
34# a file on a now mounted filesystem.
35#
36swapon -a 2> /dev/null
37
38: exit 0
39
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
new file mode 100755
index 0000000000..fe6c19605f
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
@@ -0,0 +1,88 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: mountnfs
4# Required-Start: $local_fs $network $rpcbind
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8### END INIT INFO
9
10#
11# Run in a subshell because of I/O redirection.
12#
13test -f /etc/fstab && (
14
15#
16# Read through fstab line by line. If it is NFS, set the flag
17# for mounting NFS filesystems. If any NFS partition is found and it
18# not mounted with the nolock option, we start the rpcbind.
19#
20rpcbind=no
21mount_nfs=no
22mount_smb=no
23mount_ncp=no
24mount_cifs=no
25while read device mountpt fstype options
26do
27 case "$device" in
28 ""|\#*)
29 continue
30 ;;
31 esac
32
33 case "$options" in
34 *noauto*)
35 continue
36 ;;
37 esac
38
39 if test "$fstype" = nfs
40 then
41 mount_nfs=yes
42 case "$options" in
43 *nolock*)
44 ;;
45 *)
46 rpcbind=yes
47 ;;
48 esac
49 fi
50 if test "$fstype" = smbfs
51 then
52 mount_smb=yes
53 fi
54 if test "$fstype" = ncpfs
55 then
56 mount_ncp=yes
57 fi
58 if test "$fstype" = cifs
59 then
60 mount_cifs=yes
61 fi
62done
63
64exec 0>&1
65
66if test "$rpcbind" = yes
67then
68 if test -x /usr/sbin/rpcbind
69 then
70 echo -n "Starting rpcbind... "
71 start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
72 sleep 2
73 fi
74fi
75
76if test "$mount_nfs" = yes || test "$mount_smb" = yes || test "$mount_ncp" = yes || test "$mount_cifs" = yes
77then
78 echo "Mounting remote filesystems..."
79 test "$mount_nfs" = yes && mount -a -t nfs
80 test "$mount_smb" = yes && mount -a -t smbfs
81 test "$mount_ncp" = yes && mount -a -t ncpfs
82 test "$mount_cifs" = yes && mount -a -t cifs
83fi
84
85) < /etc/fstab
86
87: exit 0
88
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
new file mode 100755
index 0000000000..6ffe1f2171
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -0,0 +1,220 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: volatile
4# Required-Start: $local_fs
5# Required-Stop: $local_fs
6# Default-Start: S
7# Default-Stop:
8# Short-Description: Populate the volatile filesystem
9### END INIT INFO
10
11# Get ROOT_DIR
12DIRNAME=`dirname $0`
13ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'`
14
15[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS
16# When running populate-volatile.sh at rootfs time, disable cache.
17[ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no
18# If rootfs is read-only, disable cache.
19[ "$ROOTFS_READ_ONLY" = "yes" ] && VOLATILE_ENABLE_CACHE=no
20
21CFGDIR="${ROOT_DIR}/etc/default/volatiles"
22TMPROOT="${ROOT_DIR}/var/volatile/tmp"
23COREDEF="00_core"
24
25[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems."
26
27create_file() {
28 EXEC="
29 touch \"$1\";
30 chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
31 chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
32
33 test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
34
35 [ -e "$1" ] && {
36 [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
37 } || {
38 if [ -z "$ROOT_DIR" ]; then
39 eval $EXEC &
40 else
41 # Creating some files at rootfs time may fail and should fail,
42 # but these failures should not be logged to make sure the do_rootfs
43 # process doesn't fail. This does no harm, as this script will
44 # run on target to set up the correct files and directories.
45 eval $EXEC > /dev/null 2>&1
46 fi
47 }
48}
49
50mk_dir() {
51 EXEC="
52 mkdir -p \"$1\";
53 chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
54 chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
55
56 test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
57 [ -e "$1" ] && {
58 [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
59 } || {
60 if [ -z "$ROOT_DIR" ]; then
61 eval $EXEC
62 else
63 # For the same reason with create_file(), failures should
64 # not be logged.
65 eval $EXEC > /dev/null 2>&1
66 fi
67 }
68}
69
70link_file() {
71 EXEC="
72 if [ -L \"$2\" ]; then
73 [ \"\$(readlink -f \"$2\")\" != \"\$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
74 elif [ -d \"$2\" ]; then
75 cp -a $2/* $1 2>/dev/null;
76 cp -a $2/.[!.]* $1 2>/dev/null;
77 rm -rf \"$2\";
78 ln -sf \"$1\" \"$2\";
79 else
80 ln -sf \"$1\" \"$2\";
81 fi
82 "
83
84 test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/volatile.cache.build
85
86 if [ -z "$ROOT_DIR" ]; then
87 eval $EXEC &
88 else
89 # For the same reason with create_file(), failures should
90 # not be logged.
91 eval $EXEC > /dev/null 2>&1
92 fi
93}
94
95check_requirements() {
96 cleanup() {
97 rm "${TMP_INTERMED}"
98 rm "${TMP_DEFINED}"
99 rm "${TMP_COMBINED}"
100 }
101
102 CFGFILE="$1"
103 [ `basename "${CFGFILE}"` = "${COREDEF}" ] && return 0
104
105 TMP_INTERMED="${TMPROOT}/tmp.$$"
106 TMP_DEFINED="${TMPROOT}/tmpdefined.$$"
107 TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
108
109 cat ${ROOT_DIR}/etc/passwd | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
110 cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 > "${TMP_INTERMED}"
111 cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
112 NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
113 NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`"
114
115 [ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && {
116 echo "Undefined users:"
117 diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
118 cleanup
119 return 1
120 }
121
122
123 cat ${ROOT_DIR}/etc/group | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
124 cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 > "${TMP_INTERMED}"
125 cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
126
127 NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`"
128 NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`"
129
130 [ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && {
131 echo "Undefined groups:"
132 diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
133 cleanup
134 return 1
135 }
136
137 # Add checks for required directories here
138
139 cleanup
140 return 0
141}
142
143apply_cfgfile() {
144 CFGFILE="$1"
145
146 check_requirements "${CFGFILE}" || {
147 echo "Skipping ${CFGFILE}"
148 return 1
149 }
150
151 cat ${CFGFILE} | grep -v "^#" | \
152 while read LINE; do
153 eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
154 TNAME=${ROOT_DIR}${TNAME}
155 [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
156
157 [ "${TTYPE}" = "l" ] && {
158 TSOURCE="$TLTARGET"
159 [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
160 link_file "${TSOURCE}" "${TNAME}"
161 continue
162 }
163
164 [ -L "${TNAME}" ] && {
165 [ "${VERBOSE}" != "no" ] && echo "Found link."
166 NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'`
167 echo ${NEWNAME} | grep -v "^/" >/dev/null && {
168 TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}"
169 [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-."
170 } || {
171 TNAME="${NEWNAME}"
172 [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-."
173 }
174 }
175
176 case "${TTYPE}" in
177 "f") [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
178 create_file "${TNAME}" &
179 ;;
180 "d") [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-."
181 mk_dir "${TNAME}"
182 # Add check to see if there's an entry in fstab to mount.
183 ;;
184 *) [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-."
185 continue
186 ;;
187 esac
188 done
189 return 0
190}
191
192clearcache=0
193exec 9</proc/cmdline
194while read line <&9
195do
196 case "$line" in
197 *clearcache*) clearcache=1
198 ;;
199 *) continue
200 ;;
201 esac
202done
203exec 9>&-
204
205if test -e ${ROOT_DIR}/etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0"
206then
207 sh ${ROOT_DIR}/etc/volatile.cache
208else
209 rm -f ${ROOT_DIR}/etc/volatile.cache ${ROOT_DIR}/etc/volatile.cache.build
210 for file in `ls -1 "${CFGDIR}" | sort`; do
211 apply_cfgfile "${CFGDIR}/${file}"
212 done
213
214 [ -e ${ROOT_DIR}/etc/volatile.cache.build ] && sync && mv ${ROOT_DIR}/etc/volatile.cache.build ${ROOT_DIR}/etc/volatile.cache
215fi
216
217if [ -z "${ROOT_DIR}" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ]
218then
219 ln -s /etc/ld.so.cache /var/run/ld.so.cache
220fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
new file mode 100644
index 0000000000..1a0328d63e
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
@@ -0,0 +1,38 @@
1#!/bin/sh
2
3. /etc/default/rcS
4
5[ "$ROOTFS_READ_ONLY" = "no" ] && exit 0
6
7is_on_read_only_partition () {
8 DIRECTORY=$1
9 dir=`readlink -f $DIRECTORY`
10 while true; do
11 if [ ! -d "$dir" ]; then
12 echo "ERROR: $dir is not a directory"
13 exit 1
14 else
15 for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \
16 END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do
17 [ "$flag" = "FOUND" ] && partition="read-write"
18 [ "$flag" = "ro" ] && { partition="read-only"; break; }
19 done
20 if [ "$dir" = "/" -o -n "$partition" ]; then
21 break
22 else
23 dir=`dirname $dir`
24 fi
25 fi
26 done
27 [ "$partition" = "read-only" ] && echo "yes" || echo "no"
28}
29
30if [ "$1" = "start" ] ; then
31 if [ `is_on_read_only_partition /var/lib` = "yes" ]; then
32 grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile
33 mkdir -p /var/volatile/lib
34 cp -a /var/lib/* /var/volatile/lib
35 mount --bind /var/volatile/lib /var/lib
36 fi
37fi
38
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/reboot b/meta/recipes-core/initscripts/initscripts-1.0/reboot
new file mode 100755
index 0000000000..087d8d5da4
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/reboot
@@ -0,0 +1,15 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: reboot
4# Required-Start:
5# Required-Stop:
6# Default-Start:
7# Default-Stop: 6
8# Short-Description: Execute the reboot command.
9# Description:
10### END INIT INFO
11
12PATH=/sbin:/bin:/usr/sbin:/usr/bin
13
14echo -n "Rebooting... "
15reboot SED_HALTARGS
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh b/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh
new file mode 100755
index 0000000000..76de3418ac
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh
@@ -0,0 +1,20 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: rmnologin
4# Required-Start: $remote_fs $all
5# Required-Stop:
6# Default-Start: 2 3 4 5
7# Default-Stop:
8# Short-Description: Remove /etc/nologin at boot
9# Description: This script removes the /etc/nologin file as the
10# last step in the boot process, if DELAYLOGIN=yes.
11# If DELAYLOGIN=no, /etc/nologin was not created by
12# bootmisc earlier in the boot process.
13### END INIT INFO
14
15if test -f /etc/nologin.boot
16then
17 rm -f /etc/nologin /etc/nologin.boot
18fi
19
20: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
new file mode 100644
index 0000000000..1f804e2374
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
@@ -0,0 +1,13 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: save-rtc
4# Required-Start:
5# Required-Stop: $local_fs hwclock
6# Default-Start: S
7# Default-Stop: 0 6
8# Short-Description: Store system clock into file
9# Description:
10### END INIT INFO
11
12# Update the timestamp
13date -u +%4Y%2m%2d%2H%2M > /etc/timestamp
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/sendsigs b/meta/recipes-core/initscripts/initscripts-1.0/sendsigs
new file mode 100755
index 0000000000..34e1b7714b
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/sendsigs
@@ -0,0 +1,21 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: sendsigs
4# Required-Start:
5# Required-Stop: umountnfs
6# Default-Start:
7# Default-Stop: 0 6
8# Short-Description: Kill all remaining processes.
9# Description:
10### END INIT INFO
11
12PATH=/sbin:/bin:/usr/sbin:/usr/bin
13
14# Kill all processes.
15echo "Sending all processes the TERM signal..."
16killall5 -15
17sleep 5
18echo "Sending all processes the KILL signal..."
19killall5 -9
20
21: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/single b/meta/recipes-core/initscripts/initscripts-1.0/single
new file mode 100755
index 0000000000..da82d178a1
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/single
@@ -0,0 +1,24 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: single
4# Required-Start: $local_fs $all killprocs
5# Required-Stop:
6# Default-Start: 1
7# Default-Stop:
8# Short-Description: executed by init(8) upon entering runlevel 1 (single).
9### END INIT INFO
10
11PATH="/sbin:/bin:/usr/sbin:/usr/bin"
12
13# Kill all processes.
14echo "Sending all processes the TERM signal..."
15killall5 -15
16sleep 5
17echo "Sending all processes the KILL signal..."
18killall5 -9
19
20# We start update here, since we just killed it.
21test -x /sbin/update && update
22
23echo "Entering single-user mode..."
24exec init -t1 S
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
new file mode 100644
index 0000000000..0cfe76e230
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
@@ -0,0 +1,23 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: mountvirtfs
4# Required-Start:
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# Short-Description: Mount kernel virtual file systems.
9# Description: Mount initial set of virtual filesystems the kernel
10# provides and that are required by everything.
11### END INIT INFO
12
13if [ -e /proc ] && ! [ -e /proc/mounts ]; then
14 mount -t proc proc /proc
15fi
16
17if [ -e /sys ] && grep -q sysfs /proc/filesystems && ! [ -e /sys/class ]; then
18 mount -t sysfs sysfs /sys
19fi
20
21if [ -e /sys/kernel/debug ] && grep -q debugfs /proc/filesystems; then
22 mount -t debugfs debugfs /sys/kernel/debug
23fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/umountfs b/meta/recipes-core/initscripts/initscripts-1.0/umountfs
new file mode 100755
index 0000000000..61324c630b
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/umountfs
@@ -0,0 +1,24 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: umountfs
4# Required-Start:
5# Required-Stop:
6# Default-Start:
7# Default-Stop: 0 6
8# Short-Description: Turn off swap and unmount all local file systems.
9# Description:
10### END INIT INFO
11
12PATH=/sbin:/bin:/usr/sbin:/usr/bin
13
14echo "Deactivating swap..."
15swapoff -a
16
17# We leave /proc mounted.
18echo "Unmounting local filesystems..."
19grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram
20mount -o remount,ro /
21
22umount -f -a -r > /dev/null 2>&1
23
24: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh
new file mode 100755
index 0000000000..af075407fd
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh
@@ -0,0 +1,33 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: umountnfs
4# Required-Start:
5# Required-Stop: umountfs
6# Should-Stop: $network $portmap
7# Default-Start:
8# Default-Stop: 0 6
9# Short-Description: Unmount all network filesystems
10### END INIT INFO
11
12PATH=/sbin:/bin:/usr/sbin:/usr/bin
13
14# Write a reboot record to /var/log/wtmp before unmounting
15halt -w
16
17echo "Unmounting remote filesystems..."
18
19test -f /etc/fstab && (
20
21#
22# Read through fstab line by line and unount network file systems
23#
24while read device mountpt fstype options
25do
26 if test "$fstype" = nfs || test "$fstype" = smbfs || test "$fstype" = ncpfs || test "$fstype" = cifs
27 then
28 umount -f $mountpt
29 fi
30done
31) < /etc/fstab
32
33: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/urandom b/meta/recipes-core/initscripts/initscripts-1.0/urandom
new file mode 100755
index 0000000000..eb3a7c3359
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/urandom
@@ -0,0 +1,46 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: urandom
4# Required-Start: $local_fs mountvirtfs
5# Required-Stop: $local_fs
6# Default-Start: S
7# Default-Stop: 0 6
8# Short-Description: Save and restore the random seed
9# Description: Save the random seed on shutdown and restore it on boot,
10# to ensure that the seed isn't predicable on startup
11# (because the boot process is predictable)
12### END INIT INFO
13
14test -c /dev/urandom || exit 0
15. /etc/default/rcS
16
17case "$1" in
18 start|"")
19 test "$VERBOSE" != no && echo "Initializing random number generator..."
20 # Load and then save 512 bytes,
21 # which is the size of the entropy pool
22 if test -f /var/lib/urandom/random-seed
23 then
24 cat /var/lib/urandom/random-seed >/dev/urandom
25 fi
26 rm -f /var/lib/urandom/random-seed
27 umask 077
28 dd if=/dev/urandom of=/var/lib/urandom/random-seed count=1 \
29 >/dev/null 2>&1 || echo "urandom start: failed."
30 umask 022
31 ;;
32 stop)
33 # Carry a random seed from shut-down to start-up;
34 # see documentation in linux/drivers/char/random.c
35 test "$VERBOSE" != no && echo "Saving random seed..."
36 umask 077
37 dd if=/dev/urandom of=/var/lib/urandom/random-seed count=1 \
38 >/dev/null 2>&1 || echo "urandom stop: failed."
39 ;;
40 *)
41 echo "Usage: urandom {start|stop}" >&2
42 exit 1
43 ;;
44esac
45
46exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
new file mode 100644
index 0000000000..297245d0e4
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -0,0 +1,36 @@
1# This configuration file lists filesystem objects that should get verified
2# during startup and be created if missing.
3#
4# Every line must either be a comment starting with #
5# or a definition of format:
6# <type> <owner> <group> <mode> <path> <linksource>
7# where the items are separated by whitespace !
8#
9# <type> : d|f|l : (d)irectory|(f)ile|(l)ink
10#
11# A linking example:
12# l root root 0777 /var/test /tmp/testfile
13# f root root 0644 /var/test none
14#
15# Understanding links:
16# When populate-volatile is to verify/create a directory or file, it will first
17# check it's existence. If a link is found to exist in the place of the target,
18# the path of the target is replaced with the target the link points to.
19# Thus, if a link is in the place to be verified, the object will be created
20# in the place the link points to instead.
21# This explains the order of "link before object" as in the example above, where
22# a link will be created at /var/test pointing to /tmp/testfile and due to this
23# link the file defined as /var/test will actually be created as /tmp/testfile.
24d root root 1777 /run/lock none
25d root root 0755 /var/volatile/log none
26d root root 1777 /var/volatile/tmp none
27l root root 1777 /var/lock /run/lock
28l root root 0755 /var/log /var/volatile/log
29l root root 0755 /var/run /run
30l root root 1777 /var/tmp /var/volatile/tmp
31l root root 1777 /tmp /var/tmp
32d root root 0755 /var/lock/subsys none
33f root root 0664 /var/log/wtmp none
34f root root 0664 /var/run/utmp none
35l root root 0644 /etc/resolv.conf /var/run/resolv.conf
36f root root 0644 /var/run/resolv.conf none
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
new file mode 100644
index 0000000000..62d0eae9f9
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -0,0 +1,160 @@
1SUMMARY = "SysV init scripts"
2DESCRIPTION = "Initscripts provide the basic system startup initialization scripts for the system. These scripts include actions such as filesystem mounting, fsck, RTC manipulation and other actions routinely performed at system startup. In addition, the scripts are also used during system shutdown to reverse the actions performed at startup."
3SECTION = "base"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6PR = "r154"
7
8INHIBIT_DEFAULT_DEPS = "1"
9
10SRC_URI = "file://functions \
11 file://halt \
12 file://umountfs \
13 file://devpts.sh \
14 file://devpts \
15 file://hostname.sh \
16 file://mountall.sh \
17 file://banner.sh \
18 file://bootmisc.sh \
19 file://mountnfs.sh \
20 file://reboot \
21 file://checkfs.sh \
22 file://single \
23 file://sendsigs \
24 file://urandom \
25 file://rmnologin.sh \
26 file://checkroot.sh \
27 file://umountnfs.sh \
28 file://sysfs.sh \
29 file://populate-volatile.sh \
30 file://read-only-rootfs-hook.sh \
31 file://volatiles \
32 file://save-rtc.sh \
33 file://GPLv2.patch \
34 file://dmesg.sh \
35 file://logrotate-dmesg.conf \
36"
37
38SRC_URI_append_arm = " file://alignment.sh"
39
40KERNEL_VERSION = ""
41
42inherit update-alternatives
43DEPENDS_append = " update-rc.d-native"
44DEPENDS_append = " ${@base_contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
45
46PACKAGES =+ "${PN}-functions"
47RDEPENDS_${PN} = "${PN}-functions"
48FILES_${PN}-functions = "${sysconfdir}/init.d/functions*"
49
50ALTERNATIVE_PRIORITY_${PN}-functions = "90"
51ALTERNATIVE_${PN}-functions = "functions"
52ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions"
53
54HALTARGS ?= "-d -f"
55
56do_configure() {
57 sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/halt
58 sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/reboot
59}
60
61do_install () {
62#
63# Create directories and install device independent scripts
64#
65 install -d ${D}${sysconfdir}/init.d
66 install -d ${D}${sysconfdir}/rcS.d
67 install -d ${D}${sysconfdir}/rc0.d
68 install -d ${D}${sysconfdir}/rc1.d
69 install -d ${D}${sysconfdir}/rc2.d
70 install -d ${D}${sysconfdir}/rc3.d
71 install -d ${D}${sysconfdir}/rc4.d
72 install -d ${D}${sysconfdir}/rc5.d
73 install -d ${D}${sysconfdir}/rc6.d
74 install -d ${D}${sysconfdir}/default
75 install -d ${D}${sysconfdir}/default/volatiles
76 # Holds state information pertaining to urandom
77 install -d ${D}/var/lib/urandom
78
79 install -m 0644 ${WORKDIR}/functions ${D}${sysconfdir}/init.d
80 install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d
81 install -m 0755 ${WORKDIR}/checkroot.sh ${D}${sysconfdir}/init.d
82 install -m 0755 ${WORKDIR}/halt ${D}${sysconfdir}/init.d
83 install -m 0755 ${WORKDIR}/hostname.sh ${D}${sysconfdir}/init.d
84 install -m 0755 ${WORKDIR}/mountall.sh ${D}${sysconfdir}/init.d
85 install -m 0755 ${WORKDIR}/mountnfs.sh ${D}${sysconfdir}/init.d
86 install -m 0755 ${WORKDIR}/reboot ${D}${sysconfdir}/init.d
87 install -m 0755 ${WORKDIR}/rmnologin.sh ${D}${sysconfdir}/init.d
88 install -m 0755 ${WORKDIR}/sendsigs ${D}${sysconfdir}/init.d
89 install -m 0755 ${WORKDIR}/single ${D}${sysconfdir}/init.d
90 install -m 0755 ${WORKDIR}/umountnfs.sh ${D}${sysconfdir}/init.d
91 install -m 0755 ${WORKDIR}/urandom ${D}${sysconfdir}/init.d
92 install -m 0755 ${WORKDIR}/devpts.sh ${D}${sysconfdir}/init.d
93 install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default
94 install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d
95 install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
96 install -m 0755 ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d
97 install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d
98 install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core
99 install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d
100 install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
101
102 if [ "${TARGET_ARCH}" = "arm" ]; then
103 install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
104 fi
105#
106# Install device dependent scripts
107#
108 install -m 0755 ${WORKDIR}/banner.sh ${D}${sysconfdir}/init.d/banner.sh
109 install -m 0755 ${WORKDIR}/umountfs ${D}${sysconfdir}/init.d/umountfs
110#
111# Create runlevel links
112#
113 update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 .
114 update-rc.d -r ${D} sendsigs start 20 0 6 .
115 update-rc.d -r ${D} urandom start 30 S 0 6 .
116 update-rc.d -r ${D} umountnfs.sh start 31 0 1 6 .
117 update-rc.d -r ${D} umountfs start 40 0 6 .
118 update-rc.d -r ${D} reboot start 90 6 .
119 update-rc.d -r ${D} halt start 90 0 .
120 update-rc.d -r ${D} save-rtc.sh start 25 0 6 .
121 update-rc.d -r ${D} banner.sh start 02 S .
122 update-rc.d -r ${D} checkroot.sh start 06 S .
123 update-rc.d -r ${D} mountall.sh start 03 S .
124 update-rc.d -r ${D} hostname.sh start 39 S .
125 update-rc.d -r ${D} mountnfs.sh start 15 2 3 4 5 .
126 update-rc.d -r ${D} bootmisc.sh start 55 S .
127 update-rc.d -r ${D} sysfs.sh start 02 S .
128 update-rc.d -r ${D} populate-volatile.sh start 37 S .
129 update-rc.d -r ${D} read-only-rootfs-hook.sh start 29 S .
130 update-rc.d -r ${D} devpts.sh start 38 S .
131 if [ "${TARGET_ARCH}" = "arm" ]; then
132 update-rc.d -r ${D} alignment.sh start 06 S .
133 fi
134 # We wish to have /var/log ready at this stage so execute this after
135 # populate-volatile.sh
136 update-rc.d -r ${D} dmesg.sh start 38 S .
137}
138
139MASKED_SCRIPTS = " \
140 banner \
141 bootmisc \
142 checkroot \
143 devpts \
144 hostname \
145 mountall \
146 mountnfs \
147 rmnologin \
148 sysfs \
149 urandom"
150
151pkg_postinst_${PN} () {
152 if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
153 if [ -n "$D" ]; then
154 OPTS="--root=$D"
155 fi
156 for SERVICE in ${MASKED_SCRIPTS}; do
157 systemctl $OPTS mask $SERVICE.service
158 done
159 fi
160}
diff --git a/meta/recipes-core/jpeg/jpeg-8d/debian-libjpeg7_7-1.diff b/meta/recipes-core/jpeg/jpeg-8d/debian-libjpeg7_7-1.diff
new file mode 100644
index 0000000000..3b8fa6980a
--- /dev/null
+++ b/meta/recipes-core/jpeg/jpeg-8d/debian-libjpeg7_7-1.diff
@@ -0,0 +1,1070 @@
1This is a well-known debian patch used by many Linux distribution, but not
2accepted by upstream yet.
3Upstream-Status: Pending
4
5--- libjpeg7-7.orig/config.sub
6+++ libjpeg7-7/config.sub
7@@ -1,4 +1,10 @@
8 #! /bin/sh
9+# autotools-dev hack (<ballombe@debian.org>, Wed, 14 Nov 2001 10:13:10 +0100)
10+if [ -x /usr/share/misc/config.sub ]; then
11+ /usr/share/misc/config.sub $*
12+ exit $?
13+fi
14+
15 # Configuration validation subroutine script.
16 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
17 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
18--- libjpeg7-7.orig/config.guess
19+++ libjpeg7-7/config.guess
20@@ -1,4 +1,10 @@
21 #! /bin/sh
22+# autotools-dev hack (<ballombe@debian.org>, Wed, 14 Nov 2001 10:13:10 +0100)
23+if [ -x /usr/share/misc/config.guess ]; then
24+ /usr/share/misc/config.guess $*
25+ exit $?
26+fi
27+
28 # Attempt to guess a canonical system name.
29 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
30 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
31--- libjpeg7-7.orig/debian/libjpeg7-dev.files
32+++ libjpeg7-7/debian/libjpeg7-dev.files
33@@ -0,0 +1,4 @@
34+usr/include
35+usr/lib/libjpeg.a
36+usr/lib/libjpeg.la
37+usr/lib/libjpeg.so
38--- libjpeg7-7.orig/debian/libjpeg-progs.README.Debian
39+++ libjpeg7-7/debian/libjpeg-progs.README.Debian
40@@ -0,0 +1,13 @@
41+libjpeg-progs for Debian
42+========================
43+
44+This package contains programs for manipulating JPEG files:
45+ cjpeg/djpeg: convert to/from the JPEG file format
46+ rdjpgcom/wrjpgcom: read/write comments in JPEG files
47+ jpegtran: lossless transformations of JPEG files
48+ jpegexiforient/exifautotran: manipulate EXIF orientation tag
49+
50+Thanks for using Debian!
51+
52+--
53+Bill Allombert <ballombe@debian.org> Sun, 05 Jul 2009 15:18:59 +0200
54--- libjpeg7-7.orig/debian/shlibs.local
55+++ libjpeg7-7/debian/shlibs.local
56@@ -0,0 +1 @@
57+libjpeg 7 libjpeg7
58--- libjpeg7-7.orig/debian/rules
59+++ libjpeg7-7/debian/rules
60@@ -0,0 +1,71 @@
61+#!/usr/bin/make -f
62+# Made with the aid of debmake, by Christoph Lameter,
63+# based on the sample debian/rules file for GNU hello by Ian Jackson.
64+
65+package=libjpeg
66+
67+export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
68+export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
69+
70+export CFLAGS=-D_REENTRANT -g -Wall
71+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
72+CFLAGS += -O0
73+else
74+CFLAGS += -O2
75+endif
76+
77+#export DH_VERBOSE=1
78+
79+build: build-stamp
80+build-stamp:
81+ dh_testdir
82+ ./configure --prefix=/usr --mandir=/usr/share/man \
83+ --enable-static --enable-shared \
84+ --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
85+ $(MAKE)
86+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
87+ $(MAKE) check
88+endif
89+ $(MAKE) -C debian/extra
90+
91+ touch build-stamp
92+
93+clean:
94+ dh_testdir
95+ dh_testroot
96+ -rm -f build-stamp
97+ if [ -f Makefile ]; then $(MAKE) distclean; fi
98+ $(MAKE) clean -C debian/extra
99+ dh_clean
100+
101+binary-indep:
102+
103+binary-arch: build
104+ dh_testdir
105+ dh_testroot
106+ dh_clean -k
107+ dh_installdirs
108+ $(MAKE) install DESTDIR=`pwd`/debian/tmp
109+ $(MAKE) install -C debian/extra prefix=/usr DESTDIR=`pwd`/debian/tmp
110+ # fix jconfig.h
111+ rm debian/tmp/usr/include/jconfig.h
112+ sed -e "s/#\(undef\|define\) HAVE_\(LOCALE\|\(STD\(DEF\|LIB\)\)\)_H 1//g" \
113+ jconfig.h > debian/tmp/usr/include/jconfig.h
114+ # separate out lib package
115+ dh_movefiles
116+ # Finish it off with debhelper
117+ dh_installdocs README
118+ dh_installexamples
119+ dh_installchangelogs change.log
120+ dh_strip --dbg-package=libjpeg7-dbg
121+ dh_compress
122+ dh_fixperms
123+ dh_installdeb
124+ dh_shlibdeps -l`pwd`/debian/libjpeg7/usr/lib
125+ dh_gencontrol
126+ dh_md5sums
127+ dh_builddeb
128+
129+binary: binary-indep binary-arch
130+
131+.PHONY: clean binary-indep binary-arch binary build
132--- libjpeg7-7.orig/debian/libjpeg7-dev.README.Debian
133+++ libjpeg7-7/debian/libjpeg7-dev.README.Debian
134@@ -0,0 +1,18 @@
135+IJG JPEG for Debian
136+===================
137+
138+The following patch has been applied to the headers files:
139+
140+--- jconfig.h: Remove unused symbol HAVE_STDDEF_H, HAVE_STDLIB_H and
141+HAVE_LOCALE_H since they are not used by the installed headers files and cause
142+problem with autoconf.
143+
144+This can theoretically cause problems if your software relies on theses symbols
145+being defined by this header. If it ever happens, please define them manually.
146+
147+Note: this is not Debian-specific, others distributions apply similar patches.
148+
149+Thanks for using Debian!
150+
151+---
152+Bill Allombert <ballombe@debian.org> Sun, 05 Jul 2009 15:17:56 +0200
153--- libjpeg7-7.orig/debian/shlibs
154+++ libjpeg7-7/debian/shlibs
155@@ -0,0 +1 @@
156+libjpeg 7 libjpeg7
157--- libjpeg7-7.orig/debian/control
158+++ libjpeg7-7/debian/control
159@@ -0,0 +1,52 @@
160+Source: libjpeg7
161+Maintainer: Bill Allombert <ballombe@debian.org>
162+Section: graphics
163+Priority: optional
164+Build-Depends: debhelper (>= 5), autotools-dev
165+Standards-Version: 3.8.2
166+
167+Package: libjpeg7
168+Architecture: any
169+Section: libs
170+Description: The Independent JPEG Group's JPEG runtime library
171+ The Independent JPEG Group's JPEG library is a library for handling
172+ JPEG files.
173+ .
174+ This package contains the shared library.
175+Depends: ${shlibs:Depends}
176+
177+Package: libjpeg7-dev
178+Architecture: any
179+Section: libdevel
180+Description: Development files for the IJG JPEG library
181+ The Independent JPEG Group's JPEG library is a library for handling
182+ JPEG files.
183+ .
184+ This package contains the static library, headers and documentation.
185+Depends: libjpeg7 (=${binary:Version}), libc-dev
186+Conflicts: libjpeg62-dev
187+Replaces: libjpeg62-dev
188+
189+Package: libjpeg7-dbg
190+Architecture: any
191+Section: debug
192+Priority: extra
193+Description: Development files for the IJG JPEG library
194+ The Independent JPEG Group's JPEG library is a library for handling
195+ JPEG files.
196+ .
197+ This package contains the debugging symbols for libjpeg.
198+Provides: libjpeg-dbg
199+Depends: libjpeg7 (=${binary:Version})
200+Conflicts: libjpeg62-dbg
201+Replaces: libjpeg62-dbg
202+
203+Package: libjpeg-progs
204+Architecture: any
205+Description: Programs for manipulating JPEG files
206+ This package contains programs for manipulating JPEG files:
207+ cjpeg/djpeg: convert to/from the JPEG file format
208+ rdjpgcom/wrjpgcom: read/write comments in JPEG files
209+ jpegtran: lossless transformations of JPEG files
210+ jpegexiforient/exifautotran: manipulate EXIF orientation tag
211+Depends: ${shlibs:Depends}
212--- libjpeg7-7.orig/debian/libjpeg7.files
213+++ libjpeg7-7/debian/libjpeg7.files
214@@ -0,0 +1,2 @@
215+/usr/lib/libjpeg.so.7.0.0
216+/usr/lib/libjpeg.so.7
217--- libjpeg7-7.orig/debian/postinst
218+++ libjpeg7-7/debian/postinst
219@@ -0,0 +1,8 @@
220+#!/bin/sh -e
221+
222+#DEBHELPER#
223+
224+if [ "$1" = "configure" ]; then
225+ ldconfig
226+fi
227+
228--- libjpeg7-7.orig/debian/compat
229+++ libjpeg7-7/debian/compat
230@@ -0,0 +1 @@
231+5
232--- libjpeg7-7.orig/debian/libjpeg7-dev.examples
233+++ libjpeg7-7/debian/libjpeg7-dev.examples
234@@ -0,0 +1 @@
235+example.c
236--- libjpeg7-7.orig/debian/changelog
237+++ libjpeg7-7/debian/changelog
238@@ -0,0 +1,245 @@
239+libjpeg7 (7-1) unstable; urgency=low
240+
241+ * The "Yoan" release.
242+ * New upstream release. closes: #535350
243+ - This release includes configure.ac and Makefile.am. closes: #346126
244+ - All patches merged upstream.
245+ - Remove dpatch support.
246+ * debian/control:
247+ - Remove Build-Dependency on libtool and sharutils.
248+ - Move libjpeg7-dbg to debug section.
249+ - Bump standard version to 3.8.2.
250+ * Skip test-suite if nocheck is set. closes: #451222
251+
252+ -- Bill Allombert <ballombe@debian.org> Sun, 05 Jul 2009 15:29:27 +0200
253+
254+libjpeg6b (6b-14) unstable; urgency=low
255+
256+ * The "Lino" release.
257+ * exifautotran:
258+ - fix typo in manpage. closes: #376371, thanks Reuben Thomas.
259+ - preserve file mode. closes: #383379, thanks Vincent Arkesteijn.
260+ * debian/control, debian/rules, debian/compat:
261+ + switch to debhelper v5
262+ + add libjpeg-dbg debugging package.
263+ * debian/rules: remove - before "make clean" rules.
264+ * Add patch 204_jpegtran_man to improve readability of manpage.
265+ closes: #437453. Thanks Jorgen Grahn.
266+ * jpegexiforient.1: Apply patch from Jorgen Grahn to improve formatting.
267+ closes: #437446.
268+
269+ -- Bill Allombert <ballombe@debian.org> Thu, 16 Aug 2007 22:59:21 +0200
270+
271+libjpeg6b (6b-13) unstable; urgency=low
272+
273+ * The "If at first you don't succeed..." release.
274+ * Change --enable-maxmem to 1024, following Guido advice.
275+ This should fix the slowdowns with large files (for large < 1Gb):
276+ closes: #356556, #365025, Thanks Nicolas.
277+ If you hit performance problems, please set the JPEGMEM variable to
278+ about half your available RAM, see jpegtran(1).
279+ * Update libjpeg-progs README.Debian to reflect the new patch set and
280+ the JPEGMEM feature.
281+ * Bump standard version to 3.7.2.
282+
283+ -- Bill Allombert <ballombe@debian.org> Fri, 5 May 2006 19:14:25 +0200
284+
285+libjpeg6b (6b-12) unstable; urgency=low
286+
287+ * The "vote for me" release
288+ * Bump standard version to 3.6.2.
289+ * Run 'make test' instead of home-made test-suite.
290+ * Switch to debhelper v4.
291+ * libjpeg is now configured with --enable-maxmem=32. This limits the memory
292+ usage to 32Mb and it can be overrided by JPEGMEM. Without this flag
293+ JPEGMEM is ignored and there were no limits.
294+ closes: #346023. Thanks C. Scott Ananian.
295+
296+ -- Bill Allombert <ballombe@debian.org> Thu, 2 Mar 2006 18:52:44 +0100
297+
298+libjpeg6b (6b-11) unstable; urgency=high
299+
300+ * The "Silencio" release
301+ * exifautotran: Apply patch by Uwe Zeisberger to fix bad temporary file
302+ handling. closes: #340079
303+
304+ -- Bill Allombert <ballombe@debian.org> Sun, 20 Nov 2005 20:57:07 +0100
305+
306+libjpeg6b (6b-10) unstable; urgency=low
307+
308+ * The "timeout" release.
309+ * Rebuild with current toolchain.
310+ * Depends on libc-dev instead of libc6-dev. closes: #294696
311+ Thanks Joel Aelwyn for discussing thoroughly the matter.
312+ * Instead of copying /usr/bin/libtool, we replace it by a script that
313+ call libtool (using standard path search). Remarked by Jesus Climent.
314+ * debian/control: remove pre-hamm cruft.
315+ * Add jpegexiforient and jpegautotran by Guido Vollbeding
316+ <http://sylvana.net/jpegcrop/exif_orientation.html> as proposed by Philip
317+ Armstrong. closes: #257061.
318+ * Run the test-suite at build time instead of shipping it in the package:
319+ - /usr/share/doc/libjpeg-progs/tests: removed.
320+ - debian/control: Add Build-Depends on sharutils for uuencode.
321+ - debian/libjpeg-progs.dirs: removed.
322+ - debian/libjpeg-progs.test: removed.
323+
324+ -- Bill Allombert <ballombe@debian.org> Tue, 1 Mar 2005 19:43:26 +0100
325+
326+libjpeg6b (6b-9) unstable; urgency=low
327+
328+ * The "I'm all for aggressive goals" release.
329+ * Rebuild with new libtool. closes: #201943.
330+ * patch 100_crop: Updated from Guido Vollbeding <guido@jpegclub.org>
331+ to include patches 203_jpegtran_errmsg,204_perfect.
332+ * patch 200_crop_man: Include 205_perfect_man.
333+ * patches 203_jpegtran_errmsg, 204_perfect, 205_perfect_man: removed
334+ * Add patch 203_rdppm: fix cjpeg issue with 16-bit PPM files. closes: #208937
335+ * Bump standard version to 3.6.1.
336+ * Update debian/edit-patch.
337+
338+ -- Bill Allombert <ballombe@debian.org> Mon, 8 Sep 2003 16:22:08 +0200
339+
340+libjpeg6b (6b-8) unstable; urgency=low
341+
342+ * The "I *hate* when that happens" release.
343+ * Move libjpeg62-dev to libdevel section.
344+ * See debian/README.sources for detail about the (d)patch system.
345+ * debian/rules: avoid to run configure twice.
346+ * Add patches 204_perfect and 205_perfect_man. They implement the
347+ -perfect jpegtran option as proposed by Mark W. Eichin. closes: #189027
348+ * Bump standard version to 3.5.10.
349+ * Use /usr/bin/libtool instead of ldconfig-generated libtool, and remove
350+ various libtool related kludges, including patch 301_configure.
351+ closes: #195281. Thanks Robert Millan for the suggestion.
352+ * Remove patch 302_makefile. Fix debian/rules instead.
353+
354+ -- Bill Allombert <ballombe@debian.org> Sat, 31 May 2003 16:16:59 +0200
355+
356+libjpeg6b (6b-7) unstable; urgency=low
357+
358+ * Rebuild with new gcc/new glibc/new debhelper.
359+ * Add -g to build options according to new policy.
360+ * Add support for DEB_BUILD_OPTIONS noopt. nostrip is handled by dh_strip.
361+ * Bump standard version to 3.5.9.
362+ * Extend description a bit (If you have a better one please email me!).
363+ * Use dpatch to handle the patches.
364+
365+ -- Bill Allombert <ballombe@debian.org> Sun, 16 Mar 2003 12:19:36 +0100
366+
367+libjpeg6b (6b-6) unstable; urgency=low
368+
369+ * The "Try to break sarge before it even got a name" release
370+ * jpegtran: better error messages when opening files.
371+ closes: #147516 Thanks Mark W. Eichin.
372+ * Add debian/patch dir with my patches.
373+ * Add extern "C" if we are under C++.
374+ closes: #113167 Thanks, Fredrik Jagenheim.
375+ * Remove HAVE_STD{LIB,DEF}_H from jconfig.h since they are not used and
376+ conflict with autoconf. closes: #109516 Thanks <Benedikt.Roth@gmx.net>
377+ * Add README.Debian in /usr/share/libjpeg62-dev
378+
379+ -- Bill Allombert <ballombe@debian.org> Mon, 3 Jun 2002 19:34:08 +0200
380+
381+libjpeg6b (6b-5) unstable; urgency=low
382+
383+ * jpeg-->JPEG in libjpeg-progs description.
384+ * Add lib path to dh_shlibdeps to avoid warning.
385+ * Apply patch from <http://sylvana.net/jpegcrop/croppatch.tar.gz> by
386+ <guido@jpegclub.org> closes: #129412 Thanks, Colin Marquardt.
387+
388+ -- Bill Allombert <ballombe@debian.org> Mon, 20 May 2002 11:55:22 +0200
389+
390+libjpeg6b (6b-4) unstable; urgency=low
391+
392+ * Avoid bashism in debian/rules.
393+ * Update libtool to 1.3.5. (1.4 will break).
394+ closes: #52095 Thanks, <Marcus.Brinkmann@ruhr-uni-bochum.de>
395+ * Patch config.guess to use version in the autotools-dev package.
396+ * Correct Section: field of libjpeg62 and libjpeg62-dev.
397+
398+ -- Bill Allombert <ballombe@debian.org> Tue, 20 Nov 2001 10:23:47 +0100
399+
400+libjpeg6b (6b-3) unstable; urgency=low
401+
402+ * The "Where is ltconfig ?" release.
403+ * Remove jconfig.h in debian/rules clean and do some clean up.
404+ * Install libjpeg.la per Policy 11.2.
405+ * Remove duplicate wizard.doc file in libjpeg62-dev.
406+ * Use dpkg-architecture instead of config.guess.
407+ * Patch config.sub to use version in the autotools-dev package.
408+ closes: #85558, #120039
409+ * Patch rdjpgcom.c to use locales for isprint check on comment chars.
410+ closes: #116589 Thanks, Neal H Walfield <neal@cs.uml.edu>
411+ * Apply patch from <http://sylvana.net/jpegcrop/transupp.c> by
412+ <guido@jpegclub.org> closes: #114415 Thanks, <Jean-Marc.Notin@loria.fr>
413+
414+ -- Bill Allombert <ballombe@debian.org> Tue, 13 Nov 2001 21:41:49 +0000
415+
416+libjpeg6b (6b-2) unstable; urgency=low
417+
418+ * New Maintainer. Mark, If you want back the package, just ask!
419+ * Acknowledge previous NMU:
420+ Jordi: closes: #74087, #24330, #24291
421+ Colin: closes: #80752
422+ Joel: closes: #25324, #27033, #28341
423+ * Write source location as a valid URL in debian/copyright.
424+ closes: #118628 Thanks, Doug Porter <dsp@debian.org>.
425+ * Fix formating of description of libjpeg-progs.
426+ closes: #114378 Thanks, Colin Watson <cjwatson@flatline.org.uk>.
427+ * Install jpegint.h header needed by some apps. closes: #100171
428+ * Remove unused/empty debian/postrm.
429+ closes: #24849 Thanks, Adrian Bridgett <adrian.bridgett@zetnet.co.uk>.
430+ * Install wizard.doc file. closes: #64807 Thanks <amc@arwen.cs.berkeley.edu>.
431+ * Fix libjpeg-progs test.sh.
432+ * Fix lintian bugs: typo in copyright, emacs user info in changelog.
433+ * Fix false lintian bug: unsafe ldconfig in postinst, by reformatting.
434+ * Remove "-g" from CFLAGS per Policy 11.1, hoping m68k is fixed now.
435+ * Remove libtool and Makefile in debian/rules clean.
436+ * Fix the test system. As a side effect,
437+ closes: #109195 Thanks Daniel Schepler <schepler@math.berkeley.edu>
438+ * Standards-Version is now 3.5.6.
439+
440+ -- Bill Allombert <ballombe@debian.org> Fri, 9 Nov 2001 22:40:16 +0100
441+
442+libjpeg6b (6b-1.3) frozen unstable; urgency=low
443+
444+ * Non-Maintainer Upload.
445+ * Added Build-Depends.
446+ * Gil Bahat <coutal@netvision.net.il> did the rest of the changes.
447+ * Close bug regarding non-standard jpegs not being processed
448+ (closes: #74087).
449+ * The output gifs are uncompressed, so have no UNISYS patent issues.
450+ (closes: #24330, #24291).
451+ * Standards-Version is now 3.0.0.
452+
453+ -- Jordi Mallach <jordi@debian.org> Sat, 24 Feb 2001 22:17:38 +0100
454+
455+libjpeg6b (6b-1.2) frozen unstable; urgency=low (HIGH for m68k)
456+
457+ * Non-maintainer release.
458+ * Recompile for m68k since existing djpeg binary claims all jpegs I have
459+ are invalid (yet hamm djpeg has no problem with them).
460+ Specifically, added "-O2 -g -Wall" to CFLAGS -- possible gcc bug?
461+
462+ -- Chris Lawrence <lawrencc@debian.org> Tue, 10 Nov 1998 20:57:38 -0600
463+
464+libjpeg6b (6b-1.1) frozen unstable; urgency=high
465+
466+ * Non-maintainer release.
467+ * Use upstream library soname (62).
468+ * Removed libjpeg-gif package, as the source notes
469+ that the GIF reading has been removed, and the GIFs written
470+ do not infringe on the LZW patent.
471+
472+ -- Joel Klecker <espy@debian.org> Thu, 22 Oct 1998 05:49:48 -0700
473+
474+libjpeg6b (6b-1) unstable; urgency=low
475+
476+ * New binary packages for 6b
477+ * New upstream release
478+
479+ -- Mark Mickan <mmickan@debian.org> Tue, 7 Jul 1998 22:27:10 +0930
480+
481+Local variables:
482+mode: debian-changelog
483+End:
484--- libjpeg7-7.orig/debian/libjpeg-progs.files
485+++ libjpeg7-7/debian/libjpeg-progs.files
486@@ -0,0 +1,2 @@
487+usr/bin
488+usr/share/man/man1
489--- libjpeg7-7.orig/debian/libjpeg7-dev.docs
490+++ libjpeg7-7/debian/libjpeg7-dev.docs
491@@ -0,0 +1,3 @@
492+libjpeg.txt
493+structure.txt
494+coderules.txt
495--- libjpeg7-7.orig/debian/libjpeg-progs.docs
496+++ libjpeg7-7/debian/libjpeg-progs.docs
497@@ -0,0 +1,2 @@
498+usage.txt
499+wizard.txt
500--- libjpeg7-7.orig/debian/copyright
501+++ libjpeg7-7/debian/copyright
502@@ -0,0 +1,96 @@
503+This is Debian's prepackaged version of the `jpeg library' by the Independent
504+JPEG Group.
505+
506+This package was created by Mark Mickan <mmickan@debian.org> from sources
507+which can be found at ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
508+
509+It is partly based on the libjpeg6a package originally put together by
510+Andy Guy <awpguy@acs.ucalgary.ca> and later maintained by Mark Mickan.
511+
512+Current Debian maintainer is Bill Allombert <ballombe@debian.org>.
513+
514+LEGAL ISSUES [ from README supplied with source - MM ]
515+============
516+
517+In plain English:
518+
519+1. We don't promise that this software works. (But if you find any bugs,
520+ please let us know!)
521+2. You can use this software for whatever you want. You don't have to pay us.
522+3. You may not pretend that you wrote this software. If you use it in a
523+ program, you must acknowledge somewhere in your documentation that
524+ you've used the IJG code.
525+
526+In legalese:
527+
528+The authors make NO WARRANTY or representation, either express or implied,
529+with respect to this software, its quality, accuracy, merchantability, or
530+fitness for a particular purpose. This software is provided "AS IS", and you,
531+its user, assume the entire risk as to its quality and accuracy.
532+
533+This software is copyright (C) 1991-2009, Thomas G. Lane, Guido Vollbeding.
534+All Rights Reserved except as specified below.
535+
536+Permission is hereby granted to use, copy, modify, and distribute this
537+software (or portions thereof) for any purpose, without fee, subject to these
538+conditions:
539+(1) If any part of the source code for this software is distributed, then this
540+README file must be included, with this copyright and no-warranty notice
541+unaltered; and any additions, deletions, or changes to the original files
542+must be clearly indicated in accompanying documentation.
543+(2) If only executable code is distributed, then the accompanying
544+documentation must state that "this software is based in part on the work of
545+the Independent JPEG Group".
546+(3) Permission for use of this software is granted only if the user accepts
547+full responsibility for any undesirable consequences; the authors accept
548+NO LIABILITY for damages of any kind.
549+
550+These conditions apply to any software derived from or based on the IJG code,
551+not just to the unmodified library. If you use our work, you ought to
552+acknowledge us.
553+
554+Permission is NOT granted for the use of any IJG author's name or company name
555+in advertising or publicity relating to this software or products derived from
556+it. This software may be referred to only as "the Independent JPEG Group's
557+software".
558+
559+We specifically permit and encourage the use of this software as the basis of
560+commercial products, provided that all warranty or liability claims are
561+assumed by the product vendor.
562+
563+
564+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
565+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
566+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
567+by the usual distribution terms of the Free Software Foundation; principally,
568+that you must include source code if you redistribute it. (See the file
569+ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
570+of any program generated from the IJG code, this does not limit you more than
571+the foregoing paragraphs do.
572+
573+The Unix configuration script "configure" was produced with GNU Autoconf.
574+It is copyright by the Free Software Foundation but is freely distributable.
575+The same holds for its supporting scripts (config.guess, config.sub,
576+ltconfig, ltmain.sh). Another support script, install-sh, is copyright
577+by M.I.T. but is also freely distributable.
578+
579+It appears that the arithmetic coding option of the JPEG spec is covered by
580+patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
581+legally be used without obtaining one or more licenses. For this reason,
582+support for arithmetic coding has been removed from the free JPEG software.
583+(Since arithmetic coding provides only a marginal gain over the unpatented
584+Huffman mode, it is unlikely that very many implementations will support it.)
585+So far as we are aware, there are no patent restrictions on the remaining
586+code.
587+
588+The IJG distribution formerly included code to read and write GIF files.
589+To avoid entanglement with the Unisys LZW patent, GIF reading support has
590+been removed altogether, and the GIF writer has been simplified to produce
591+"uncompressed GIFs". This technique does not use the LZW algorithm; the
592+resulting GIF files are larger than usual, but are readable by all standard
593+GIF decoders.
594+
595+We are required to state that
596+ "The Graphics Interchange Format(c) is the Copyright property of
597+ CompuServe Incorporated. GIF(sm) is a Service Mark property of
598+ CompuServe Incorporated."
599--- libjpeg7-7.orig/debian/extra/jpegexiforient.c
600+++ libjpeg7-7/debian/extra/jpegexiforient.c
601@@ -0,0 +1,299 @@
602+/*
603+ * jpegexiforient.c
604+ *
605+ * This is a utility program to get and set the Exif Orientation Tag.
606+ * It can be used together with jpegtran in scripts for automatic
607+ * orientation correction of digital camera pictures.
608+ *
609+ * The Exif orientation value gives the orientation of the camera
610+ * relative to the scene when the image was captured. The relation
611+ * of the '0th row' and '0th column' to visual position is shown as
612+ * below.
613+ *
614+ * Value | 0th Row | 0th Column
615+ * ------+-------------+-----------
616+ * 1 | top | left side
617+ * 2 | top | rigth side
618+ * 3 | bottom | rigth side
619+ * 4 | bottom | left side
620+ * 5 | left side | top
621+ * 6 | right side | top
622+ * 7 | right side | bottom
623+ * 8 | left side | bottom
624+ *
625+ * For convenience, here is what the letter F would look like if it were
626+ * tagged correctly and displayed by a program that ignores the orientation
627+ * tag:
628+ *
629+ * 1 2 3 4 5 6 7 8
630+ *
631+ * 888888 888888 88 88 8888888888 88 88 8888888888
632+ * 88 88 88 88 88 88 88 88 88 88 88 88
633+ * 8888 8888 8888 8888 88 8888888888 8888888888 88
634+ * 88 88 88 88
635+ * 88 88 888888 888888
636+ *
637+ */
638+
639+#include <stdio.h>
640+#include <stdlib.h>
641+
642+static FILE * myfile; /* My JPEG file */
643+
644+static unsigned char exif_data[65536L];
645+
646+/* Return next input byte, or EOF if no more */
647+#define NEXTBYTE() getc(myfile)
648+
649+/* Error exit handler */
650+#define ERREXIT(msg) (exit(0))
651+
652+/* Read one byte, testing for EOF */
653+static int
654+read_1_byte (void)
655+{
656+ int c;
657+
658+ c = NEXTBYTE();
659+ if (c == EOF)
660+ ERREXIT("Premature EOF in JPEG file");
661+ return c;
662+}
663+
664+/* Read 2 bytes, convert to unsigned int */
665+/* All 2-byte quantities in JPEG markers are MSB first */
666+static unsigned int
667+read_2_bytes (void)
668+{
669+ int c1, c2;
670+
671+ c1 = NEXTBYTE();
672+ if (c1 == EOF)
673+ ERREXIT("Premature EOF in JPEG file");
674+ c2 = NEXTBYTE();
675+ if (c2 == EOF)
676+ ERREXIT("Premature EOF in JPEG file");
677+ return (((unsigned int) c1) << 8) + ((unsigned int) c2);
678+}
679+
680+static const char * progname; /* program name for error messages */
681+
682+static void
683+usage (FILE *out)
684+/* complain about bad command line */
685+{
686+ fprintf(out, "jpegexiforient reads or writes the Exif Orientation Tag ");
687+ fprintf(out, "in a JPEG Exif file.\n");
688+
689+ fprintf(out, "Usage: %s [switches] jpegfile\n", progname);
690+
691+ fprintf(out, "Switches:\n");
692+ fprintf(out, " --help display this help and exit\n");
693+ fprintf(out, " --version output version information and exit\n");
694+ fprintf(out, " -n Do not output the trailing newline\n");
695+ fprintf(out, " -1 .. -8 Set orientation value 1 .. 8\n");
696+}
697+
698+/*
699+ * The main program.
700+ */
701+
702+int
703+main (int argc, char **argv)
704+{
705+ int n_flag, set_flag;
706+ unsigned int length, i;
707+ int is_motorola; /* Flag for byte order */
708+ unsigned int offset, number_of_tags, tagnum;
709+
710+ progname = argv[0];
711+ if (progname == NULL || progname[0] == 0)
712+ progname = "jpegexiforient"; /* in case C library doesn't provide it */
713+
714+ if (argc < 2) { usage(stderr); return 1; }
715+
716+ n_flag = 0; set_flag = 0;
717+
718+ i = 1;
719+ while (argv[i][0] == '-') {
720+ switch (argv[i][1]) {
721+ case '-':
722+ switch (argv[i][2]) {
723+ case 'h': usage(stdout); return 0;
724+ case 'v': fprintf(stdout,"jpegexiforient\n"); return 0;
725+ }
726+ case 'n':
727+ n_flag = 1;
728+ break;
729+ case '1':
730+ case '2':
731+ case '3':
732+ case '4':
733+ case '5':
734+ case '6':
735+ case '7':
736+ case '8':
737+ set_flag = argv[i][1] - '0';
738+ break;
739+ default:
740+ usage(stderr); return 1;
741+ }
742+ if (++i >= argc) { usage(stderr); return 1; }
743+ }
744+
745+ if (set_flag) {
746+ if ((myfile = fopen(argv[i], "rb+")) == NULL) {
747+ fprintf(stderr, "%s: can't open %s\n", progname, argv[i]);
748+ return 0;
749+ }
750+ } else {
751+ if ((myfile = fopen(argv[i], "rb")) == NULL) {
752+ fprintf(stderr, "%s: can't open %s\n", progname, argv[i]);
753+ return 0;
754+ }
755+ }
756+
757+ /* Read File head, check for JPEG SOI + Exif APP1 */
758+ for (i = 0; i < 4; i++)
759+ exif_data[i] = (unsigned char) read_1_byte();
760+ if (exif_data[0] != 0xFF ||
761+ exif_data[1] != 0xD8 ||
762+ exif_data[2] != 0xFF ||
763+ exif_data[3] != 0xE1)
764+ return 0;
765+
766+ /* Get the marker parameter length count */
767+ length = read_2_bytes();
768+ /* Length includes itself, so must be at least 2 */
769+ /* Following Exif data length must be at least 6 */
770+ if (length < 8)
771+ return 0;
772+ length -= 8;
773+ /* Read Exif head, check for "Exif" */
774+ for (i = 0; i < 6; i++)
775+ exif_data[i] = (unsigned char) read_1_byte();
776+ if (exif_data[0] != 0x45 ||
777+ exif_data[1] != 0x78 ||
778+ exif_data[2] != 0x69 ||
779+ exif_data[3] != 0x66 ||
780+ exif_data[4] != 0 ||
781+ exif_data[5] != 0)
782+ return 0;
783+ /* Read Exif body */
784+ for (i = 0; i < length; i++)
785+ exif_data[i] = (unsigned char) read_1_byte();
786+
787+ if (length < 12) return 0; /* Length of an IFD entry */
788+
789+ /* Discover byte order */
790+ if (exif_data[0] == 0x49 && exif_data[1] == 0x49)
791+ is_motorola = 0;
792+ else if (exif_data[0] == 0x4D && exif_data[1] == 0x4D)
793+ is_motorola = 1;
794+ else
795+ return 0;
796+
797+ /* Check Tag Mark */
798+ if (is_motorola) {
799+ if (exif_data[2] != 0) return 0;
800+ if (exif_data[3] != 0x2A) return 0;
801+ } else {
802+ if (exif_data[3] != 0) return 0;
803+ if (exif_data[2] != 0x2A) return 0;
804+ }
805+
806+ /* Get first IFD offset (offset to IFD0) */
807+ if (is_motorola) {
808+ if (exif_data[4] != 0) return 0;
809+ if (exif_data[5] != 0) return 0;
810+ offset = exif_data[6];
811+ offset <<= 8;
812+ offset += exif_data[7];
813+ } else {
814+ if (exif_data[7] != 0) return 0;
815+ if (exif_data[6] != 0) return 0;
816+ offset = exif_data[5];
817+ offset <<= 8;
818+ offset += exif_data[4];
819+ }
820+ if (offset > length - 2) return 0; /* check end of data segment */
821+
822+ /* Get the number of directory entries contained in this IFD */
823+ if (is_motorola) {
824+ number_of_tags = exif_data[offset];
825+ number_of_tags <<= 8;
826+ number_of_tags += exif_data[offset+1];
827+ } else {
828+ number_of_tags = exif_data[offset+1];
829+ number_of_tags <<= 8;
830+ number_of_tags += exif_data[offset];
831+ }
832+ if (number_of_tags == 0) return 0;
833+ offset += 2;
834+
835+ /* Search for Orientation Tag in IFD0 */
836+ for (;;) {
837+ if (offset > length - 12) return 0; /* check end of data segment */
838+ /* Get Tag number */
839+ if (is_motorola) {
840+ tagnum = exif_data[offset];
841+ tagnum <<= 8;
842+ tagnum += exif_data[offset+1];
843+ } else {
844+ tagnum = exif_data[offset+1];
845+ tagnum <<= 8;
846+ tagnum += exif_data[offset];
847+ }
848+ if (tagnum == 0x0112) break; /* found Orientation Tag */
849+ if (--number_of_tags == 0) return 0;
850+ offset += 12;
851+ }
852+
853+ if (set_flag) {
854+ /* Set the Orientation value */
855+ if (is_motorola) {
856+ exif_data[offset+2] = 0; /* Format = unsigned short (2 octets) */
857+ exif_data[offset+3] = 3;
858+ exif_data[offset+4] = 0; /* Number Of Components = 1 */
859+ exif_data[offset+5] = 0;
860+ exif_data[offset+6] = 0;
861+ exif_data[offset+7] = 1;
862+ exif_data[offset+8] = 0;
863+ exif_data[offset+9] = (unsigned char)set_flag;
864+ exif_data[offset+10] = 0;
865+ exif_data[offset+11] = 0;
866+ } else {
867+ exif_data[offset+2] = 3; /* Format = unsigned short (2 octets) */
868+ exif_data[offset+3] = 0;
869+ exif_data[offset+4] = 1; /* Number Of Components = 1 */
870+ exif_data[offset+5] = 0;
871+ exif_data[offset+6] = 0;
872+ exif_data[offset+7] = 0;
873+ exif_data[offset+8] = (unsigned char)set_flag;
874+ exif_data[offset+9] = 0;
875+ exif_data[offset+10] = 0;
876+ exif_data[offset+11] = 0;
877+ }
878+ fseek(myfile, (4 + 2 + 6 + 2) + offset, SEEK_SET);
879+ fwrite(exif_data + 2 + offset, 1, 10, myfile);
880+ } else {
881+ /* Get the Orientation value */
882+ if (is_motorola) {
883+ if (exif_data[offset+8] != 0) return 0;
884+ set_flag = exif_data[offset+9];
885+ } else {
886+ if (exif_data[offset+9] != 0) return 0;
887+ set_flag = exif_data[offset+8];
888+ }
889+ if (set_flag > 8) return 0;
890+ }
891+
892+ /* Write out Orientation value */
893+ if (n_flag)
894+ printf("%c", '0' + set_flag);
895+ else
896+ printf("%c\n", '0' + set_flag);
897+
898+ /* All done. */
899+ return 0;
900+}
901--- libjpeg7-7.orig/debian/extra/exifautotran.1
902+++ libjpeg7-7/debian/extra/exifautotran.1
903@@ -0,0 +1,13 @@
904+.TH EXIFAUTOTRAN "1" "February 2005" "exifautotran" "User Commands"
905+.SH NAME
906+exifautotran \- Transforms Exif files so that Orientation becomes 1
907+.SH DESCRIPTION
908+exifautotran [list of files]
909+.PP
910+Take a list of files as input and transform them in place so that the
911+Orientation becomes 1.
912+.SH "AUTHOR"
913+ Guido Vollbeding <guido@jpegclub.org>
914+.SH "SEE ALSO"
915+.BR jpegtran(1)
916+.BR jpegexiforient(1)
917--- libjpeg7-7.orig/debian/extra/jpegexiforient.1
918+++ libjpeg7-7/debian/extra/jpegexiforient.1
919@@ -0,0 +1,73 @@
920+.TH JPEGEXIFORIENT "1" "February 2005" "jpegexiforient" "User Commands"
921+.SH NAME
922+jpegexiforient \- reads or writes the Exif Orientation Tag
923+.SH SYNOPSIS
924+.B jpegexiforient
925+[\fIswitches\fR] \fIjpegfile\fR
926+.SH DESCRIPTION
927+.
928+This is a utility program to get and set the Exif Orientation Tag.
929+It can be used together with jpegtran in scripts for automatic
930+orientation correction of digital camera pictures.
931+.PP
932+The Exif orientation value gives the orientation of the camera
933+relative to the scene when the image was captured. The relation
934+of the '0th row' and '0th column' to visual position is shown as
935+below.
936+.IP
937+.nf
938+.ft CR
939+Value | 0th Row | 0th Column
940+------+-------------+-----------
941+ 1 | top | left side
942+ 2 | top | rigth side
943+ 3 | bottom | rigth side
944+ 4 | bottom | left side
945+ 5 | left side | top
946+ 6 | right side | top
947+ 7 | right side | bottom
948+ 8 | left side | bottom
949+.fi
950+.PP
951+For convenience, here is what the letter F would look like if it were
952+tagged correctly and displayed by a program that ignores the orientation
953+tag:
954+.IP
955+.nf
956+.ft CB
957+ 1 2 3 4
958+
959+888888 888888 88 88
960+88 88 88 88
961+8888 8888 8888 8888
962+88 88 88 88
963+88 88 888888 888888
964+
965+ 5 6 7 8
966+
967+8888888888 88 88 8888888888
968+88 88 88 88 88 88 88 88
969+88 8888888888 8888888888 88
970+.fi
971+.PP
972+jpegexiforient output the Exif Orientation Tag in a JPEG Exif file.
973+With the options -1 .. -8, it can also be used to set the tag.
974+.
975+.SS "OPTIONS"
976+.TP
977+\fB\-\-help\fR
978+display this help and exit
979+.TP
980+\fB\-\-version\fR
981+output version information and exit
982+.TP
983+\fB\-n\fR
984+Do not output the trailing newline
985+.TP
986+\fB\-1\fR .. \fB\-8\fR
987+Set orientation value 1 .. 8
988+.SH "AUTHOR"
989+ Guido Vollbeding <guido@jpegclub.org>
990+.SH "SEE ALSO"
991+.BR jpegtran(1)
992+.BR exifautotran(1)
993--- libjpeg7-7.orig/debian/extra/exifautotran
994+++ libjpeg7-7/debian/extra/exifautotran
995@@ -0,0 +1,50 @@
996+#!/bin/sh
997+# exifautotran [list of files]
998+#
999+# Transforms Exif files so that Orientation becomes 1
1000+#
1001+
1002+trap "if test -n \"\$tempfile\"; then rm -f \"\$tempfile\"; fi" INT QUIT TERM
1003+
1004+for i
1005+do
1006+ case $i in
1007+ -v|--version) echo "exifautotran"; exit 0;;
1008+ -h|--help)
1009+ cat <<EOF
1010+exifautotran [list of files]
1011+
1012+Transforms Exif files so that Orientation becomes 1
1013+EOF
1014+ exit 0;;
1015+ esac
1016+
1017+ case `jpegexiforient -n "$i"` in
1018+ 1) transform="";;
1019+ 2) transform="-flip horizontal";;
1020+ 3) transform="-rotate 180";;
1021+ 4) transform="-flip vertical";;
1022+ 5) transform="-transpose";;
1023+ 6) transform="-rotate 90";;
1024+ 7) transform="-transverse";;
1025+ 8) transform="-rotate 270";;
1026+ *) transform="";;
1027+ esac
1028+ if test -n "$transform"; then
1029+ tempfile=`mktemp`;
1030+ if test "$?" -ne "0"; then
1031+ echo "Failed to create temporary file" >&2
1032+ exit 1;
1033+ fi
1034+ echo Executing: jpegtran -copy all $transform $i >&2
1035+ jpegtran -copy all $transform "$i" > $tempfile
1036+ if test $? -ne 0; then
1037+ echo Error while transforming $i - skipped. >&2
1038+ rm "$tempfile"
1039+ else
1040+ cp "$tempfile" "$i"
1041+ rm "$tempfile"
1042+ jpegexiforient -1 "$i" > /dev/null
1043+ fi
1044+ fi
1045+done
1046--- libjpeg7-7.orig/debian/extra/Makefile
1047+++ libjpeg7-7/debian/extra/Makefile
1048@@ -0,0 +1,22 @@
1049+CFLAGS = -O2 -Wall -g
1050+CC = cc
1051+INSTALL = install -m755 -o root -g root
1052+INSTALLDIR = install -m755 -o root -g root -d
1053+DESTDIR =
1054+prefix = /usr/local
1055+bindir = $(prefix)/bin
1056+mandir = $(prefix)/share/man/man1
1057+
1058+all: jpegexiforient
1059+
1060+jpegexiforient: jpegexiforient.c
1061+ $(CC) $(CFLAGS) -o jpegexiforient jpegexiforient.c
1062+clean:
1063+ -rm -f jpegexiforient
1064+install:
1065+ $(INSTALLDIR) $(DESTDIR)$(bindir)
1066+ $(INSTALLDIR) $(DESTDIR)$(mandir)
1067+ $(INSTALL) jpegexiforient $(DESTDIR)$(bindir)
1068+ $(INSTALL) jpegexiforient.1 $(DESTDIR)$(mandir)
1069+ $(INSTALL) exifautotran $(DESTDIR)$(bindir)
1070+ $(INSTALL) exifautotran.1 $(DESTDIR)$(mandir)
diff --git a/meta/recipes-core/jpeg/jpeg-8d/fix_for_automake_1.12.1.patch b/meta/recipes-core/jpeg/jpeg-8d/fix_for_automake_1.12.1.patch
new file mode 100644
index 0000000000..3a970ea477
--- /dev/null
+++ b/meta/recipes-core/jpeg/jpeg-8d/fix_for_automake_1.12.1.patch
@@ -0,0 +1,44 @@
1Upstream-Status: Pending
2
3The support for automatic de-ANSI-fication has been deprecated in
4automake 1.11.2, and will be removed altogether in automake 1.12
5
6This avoids this error:
7| configure.ac:24: automatic de-ANSI-fication support is deprecated
8| autoreconf: automake failed with exit status: 1
9| ERROR: autoreconf execution failed.
10NOTE: package jpeg-native-8c-r2: task do_configure: Failed
11
12Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
132011/12/28
14
15
16Index: jpeg-8d/configure.ac
17===================================================================
18--- jpeg-8d.orig/configure.ac
19+++ jpeg-8d/configure.ac
20@@ -21,7 +21,7 @@ AC_CANONICAL_TARGET
21
22 # Initialize Automake
23 # Don't require all the GNU mandated files
24-AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obsolete ansi2knr no-dist foreign])
25+AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obsolete no-dist foreign])
26
27 # Make --enable-silent-rules the default.
28 # To get verbose build output you may configure
29@@ -29,7 +29,14 @@ AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obs
30 AM_SILENT_RULES([yes])
31
32 # This is required when using the de-ANSI-fication feature.
33-AM_C_PROTOTYPES
34+#AM_C_PROTOTYPES
35+# add following to avoid this error:
36+#| automake: warnings are treated as errors
37+#| /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libjpeg.la': linking libtool libraries using a non-POSIX
38+#| /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
39+#| Makefile.am:65: while processing Libtool library 'libjpeg.la'
40+#| autoreconf: automake failed with exit status: 1
41+AM_PROG_AR
42
43 # Add configure option --enable-maintainer-mode which enables
44 # dependency checking and generation useful to package maintainers.
diff --git a/meta/recipes-core/jpeg/jpeg_8d.bb b/meta/recipes-core/jpeg/jpeg_8d.bb
new file mode 100644
index 0000000000..da23302149
--- /dev/null
+++ b/meta/recipes-core/jpeg/jpeg_8d.bb
@@ -0,0 +1,51 @@
1SUMMARY = "libjpeg is a library for handling the JPEG (JFIF) image format"
2DESCRIPTION = "libjpeg contains a library for handling the JPEG (JFIF) image format, as well as related programs for accessing the libjpeg functions."
3HOMEPAGE = "http://www.ijg.org/"
4
5LICENSE ="BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://README;md5=4f46756b064c225fae088903300e5c98"
7
8SECTION = "libs"
9
10DEPENDS = "libtool-cross"
11DEPENDS_class-native = "libtool-native"
12
13PR = "r1"
14
15SRC_URI = "http://www.ijg.org/files/jpegsrc.v${PV}.tar.gz \
16 file://debian-libjpeg7_7-1.diff \
17 file://fix_for_automake_1.12.1.patch"
18
19SRC_URI[md5sum] = "52654eb3b2e60c35731ea8fc87f1bd29"
20SRC_URI[sha256sum] = "00029b1473f0f0ea72fbca3230e8cb25797fbb27e58ae2e46bb8bf5a806fe0b3"
21
22inherit autotools
23
24EXTRA_OECONF="--enable-static --enable-shared"
25EXTRA_OEMAKE='"LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"'
26
27CFLAGS_append = " -D_REENTRANT"
28
29do_configure_prepend () {
30 rm -f ${S}/ltconfig
31 rm -f ${S}/ltmain.sh
32}
33
34do_install() {
35 install -d ${D}${bindir} ${D}${includedir} \
36 ${D}${mandir}/man1 ${D}${libdir}
37 oe_runmake 'DESTDIR=${D}' install
38}
39
40PACKAGES =+ "jpeg-tools "
41DESCRIPTION_jpeg-tools = "The jpeg-tools package includes the client programs for access libjpeg functionality. These tools allow for the compression, decompression, transformation and display of JPEG files."
42FILES_jpeg-tools = "${bindir}/*"
43
44BBCLASSEXTEND = "native"
45
46pkg_postinst_${PN}_linuxstdbase () {
47 if [ ! -e $D${libdir}/libjpeg.so.62 ]; then
48 JPEG=`find $D${libdir} -type f -name libjpeg.so.\*.\*.\*`
49 ln -sf `basename $JPEG` $D${libdir}/libjpeg.so.62
50 fi
51}
diff --git a/meta/recipes-core/kbd/kbd/uclibc-stdarg.patch b/meta/recipes-core/kbd/kbd/uclibc-stdarg.patch
new file mode 100644
index 0000000000..be7f324acc
--- /dev/null
+++ b/meta/recipes-core/kbd/kbd/uclibc-stdarg.patch
@@ -0,0 +1,36 @@
1In file included from keymap.h:5:0,
2 from ksyms.c:6:
3./keymap/common.h:65:38: error: unknown type name 'va_list'
4 const char *format, va_list args),
5 ^
6./keymap/common.h:66:3: error: expected ';', ',' or ')' before 'const'
7 const void *data);
8 ^
9
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Index: kbd-2.0.0/src/libkeymap/contextP.h
13===================================================================
14--- kbd-2.0.0.orig/src/libkeymap/contextP.h 2013-08-13 06:46:23.000000000 -0700
15+++ kbd-2.0.0/src/libkeymap/contextP.h 2013-11-05 22:33:49.200528226 -0800
16@@ -2,7 +2,7 @@
17 #define LK_CONTEXTP_H
18
19 #include "keymap.h"
20-
21+#include <stdarg.h>
22 /**
23 * @brief Copy of struct kbdiacruc.
24 */
25Index: kbd-2.0.0/src/libkeymap/keymap/common.h
26===================================================================
27--- kbd-2.0.0.orig/src/libkeymap/keymap/common.h 2013-08-13 06:46:23.000000000 -0700
28+++ kbd-2.0.0/src/libkeymap/keymap/common.h 2013-11-05 22:33:59.964528438 -0800
29@@ -6,6 +6,7 @@
30 */
31
32 #include <keymap/context.h>
33+#include <stdarg.h>
34
35 /** Initializes the structures necessary to read and/or parse keymap.
36 *
diff --git a/meta/recipes-core/kbd/kbd_2.0.1.bb b/meta/recipes-core/kbd/kbd_2.0.1.bb
new file mode 100644
index 0000000000..998a2d39b2
--- /dev/null
+++ b/meta/recipes-core/kbd/kbd_2.0.1.bb
@@ -0,0 +1,35 @@
1SUMMARY = "Keytable files and keyboard utilities"
2# everything minus console-fonts is GPLv2+
3LICENSE = "GPLv2+"
4LIC_FILES_CHKSUM = "file://COPYING;md5=a5fcc36121d93e1f69d96a313078c8b5"
5DEPENDS = "libcheck"
6
7inherit autotools gettext ptest
8
9RREPLACES_${PN} = "console-tools"
10RPROVIDES_${PN} = "console-tools"
11RCONFLICTS_${PN} = "console-tools"
12
13SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.bz2 \
14 file://uclibc-stdarg.patch \
15 "
16
17SRC_URI[md5sum] = "f80b93a6abddb6cc2a3652daaf7562ba"
18SRC_URI[sha256sum] = "223d60bb6882323cca161aeb5965590768b2f590fd7cddbf27511ad0ba7a429e"
19
20PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
21PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam,"
22
23PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans"
24
25FILES_${PN}-consolefonts = "${datadir}/consolefonts"
26FILES_${PN}-consoletrans = "${datadir}/consoletrans"
27FILES_${PN}-keymaps = "${datadir}/keymaps"
28FILES_${PN}-unimaps = "${datadir}/unimaps"
29
30inherit update-alternatives
31
32ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt"
33ALTERNATIVE_PRIORITY = "100"
34
35BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/libcgroup/libcgroup_0.41.bb b/meta/recipes-core/libcgroup/libcgroup_0.41.bb
new file mode 100644
index 0000000000..76b0b585fb
--- /dev/null
+++ b/meta/recipes-core/libcgroup/libcgroup_0.41.bb
@@ -0,0 +1,41 @@
1SUMMARY = "Linux control group abstraction library"
2DESCRIPTION = "libcgroup is a library that abstracts the control group file system \
3in Linux. Control groups allow you to limit, account and isolate resource usage \
4(CPU, memory, disk I/O, etc.) of groups of processes."
5SECTION = "libs"
6LICENSE = "LGPLv2.1"
7LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
8
9inherit autotools pkgconfig
10
11DEPENDS = "bison-native flex-native ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
12
13SRC_URI = "${SOURCEFORGE_MIRROR}/project/libcg/${BPN}/v0.41/${BPN}-${PV}.tar.bz2"
14
15SRC_URI[md5sum] = "3dea9d50b8a5b73ff0bf1cdcb210f63f"
16SRC_URI[sha256sum] = "e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51"
17
18EXTRA_OECONF = "${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes', '--enable-pam=no', d)}"
19
20# http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg21444.html
21PARALLEL_MAKE = ""
22
23PACKAGES =+ "cgroups-pam-plugin"
24FILES_cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*"
25FILES_${PN}-dbg += "${base_libdir}/security/.debug"
26FILES_${PN}-dev += "${base_libdir}/security/*.la"
27
28do_install_append() {
29 # Moving libcgroup to base_libdir
30 if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
31 mkdir -p ${D}/${base_libdir}/
32 mv -f ${D}${libdir}/libcgroup.so.* ${D}${base_libdir}/
33 rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
34 ln -sf ${rel_lib_prefix}${base_libdir}/libcgroup.so.1 ${D}${libdir}/libcgroup.so
35 fi
36 # pam modules in ${base_libdir}/security/ should be binary .so files, not symlinks.
37 if [ -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ]; then
38 mv -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ${D}${base_libdir}/security/pam_cgroup.so
39 rm -f ${D}${base_libdir}/security/pam_cgroup.so.*
40 fi
41}
diff --git a/meta/recipes-core/libxml/libxml2.inc b/meta/recipes-core/libxml/libxml2.inc
new file mode 100644
index 0000000000..60bb6b8539
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2.inc
@@ -0,0 +1,61 @@
1SUMMARY = "XML C Parser Library and Toolkit"
2DESCRIPTION = "The XML Parser Library allows for manipulation of XML files. Libxml2 exports Push and Pull type parser interfaces for both XML and HTML. It can do DTD validation at parse time, on a parsed document instance or with an arbitrary DTD. Libxml2 includes complete XPath, XPointer and Xinclude implementations. It also has a SAX like interface, which is designed to be compatible with Expat."
3HOMEPAGE = "http://www.xmlsoft.org/"
4BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2"
5SECTION = "libs"
6LICENSE = "MIT"
7LIC_FILES_CHKSUM = "file://Copyright;md5=2044417e2e5006b65a8b9067b683fcf1 \
8 file://hash.c;beginline=6;endline=15;md5=96f7296605eae807670fb08947829969 \
9 file://list.c;beginline=4;endline=13;md5=cdbfa3dee51c099edb04e39f762ee907 \
10 file://trio.c;beginline=5;endline=14;md5=6c025753c86d958722ec76e94cae932e"
11
12DEPENDS_class-nativesdk = "nativesdk-python"
13DEPENDS_class-native = "python-native"
14DEPENDS =+ "zlib"
15
16SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \
17 file://libxml-64bit.patch \
18 file://ansidecl.patch \
19 file://runtest.patch \
20 file://run-ptest \
21 file://libxml2-CVE-2014-0191-fix.patch \
22 "
23
24inherit autotools pkgconfig binconfig pythonnative ptest
25
26RDEPENDS_${PN}-ptest_append_libc-glibc += "eglibc-gconv-ebcdic-us eglibc-gconv-ibm1141"
27
28# We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header
29do_configure_prepend () {
30 sed -i -e '/.*ansidecl.h.*/d' ${S}/configure.in
31}
32
33EXTRA_OECONF = "--without-python --without-debug --without-legacy --without-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions"
34EXTRA_OECONF_class-native = "--with-python=${STAGING_BINDIR}/python --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma"
35EXTRA_OECONF_class-nativesdk = "--with-python=${STAGING_BINDIR}/python --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma"
36EXTRA_OECONF_linuxstdbase = "--without-python --with-debug --with-legacy --with-catalog --with-docbook --with-c14n --without-lzma"
37
38# required for pythong binding
39export HOST_SYS
40export BUILD_SYS
41export STAGING_LIBDIR
42export STAGING_INCDIR
43
44export LDFLAGS += "-ldl"
45
46python populate_packages_prepend () {
47 # autonamer would call this libxml2-2, but we don't want that
48 if d.getVar('DEBIAN_NAMES', True):
49 d.setVar('PKG_libxml2', '${MLPREFIX}libxml2')
50}
51
52PACKAGES += "${PN}-utils"
53
54FILES_${PN}-dev += "${libdir}/xml2Conf.sh"
55FILES_${PN}-utils += "${bindir}/*"
56
57do_install_ptest () {
58 cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH}
59}
60
61BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/libxml/libxml2/ansidecl.patch b/meta/recipes-core/libxml/libxml2/ansidecl.patch
new file mode 100644
index 0000000000..2452d780d5
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/ansidecl.patch
@@ -0,0 +1,25 @@
1Sadly cmake is broken. If it sees this reference and ansidecl is present, it will add a
2dependency upon it, even if HAVE_ANSIDEC_H is never set.
3
4The easiest solution is to remove these lines, otherwise recipes like libzypp can have a
5dependency on the ansidecl.h header via cmake. This can lead to odd results if the
6header is removed (clean binutils) and then the code is recompiled.
7
8RP 2012/7/10
9
10Upstream-Status: Inappropriate [its really a cmake bug]
11
12Index: libxml2-2.8.0/include/libxml/xmlversion.h.in
13===================================================================
14--- libxml2-2.8.0.orig/include/libxml/xmlversion.h.in 2012-07-10 11:51:52.460750573 +0000
15+++ libxml2-2.8.0/include/libxml/xmlversion.h.in 2012-07-10 11:52:41.436749397 +0000
16@@ -401,9 +401,6 @@
17 #endif
18
19 #ifdef __GNUC__
20-#ifdef HAVE_ANSIDECL_H
21-#include <ansidecl.h>
22-#endif
23
24 /**
25 * ATTRIBUTE_UNUSED:
diff --git a/meta/recipes-core/libxml/libxml2/libxml-64bit.patch b/meta/recipes-core/libxml/libxml2/libxml-64bit.patch
new file mode 100644
index 0000000000..1147017b61
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/libxml-64bit.patch
@@ -0,0 +1,22 @@
1Upstream-Status: Backport [from debian: bugs.debian.org/439843]
2
3---
4 libxml.h | 3 +++
5 1 file changed, 3 insertions(+)
6
7--- libxml2-2.6.29.orig/libxml.h
8+++ libxml2-2.6.29/libxml.h
9@@ -11,10 +11,13 @@
10
11 #ifndef NO_LARGEFILE_SOURCE
12 #ifndef _LARGEFILE_SOURCE
13 #define _LARGEFILE_SOURCE
14 #endif
15+#ifndef _LARGEFILE64_SOURCE
16+#define _LARGEFILE64_SOURCE
17+#endif
18 #ifndef _FILE_OFFSET_BITS
19 #define _FILE_OFFSET_BITS 64
20 #endif
21 #endif
22
diff --git a/meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch b/meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch
new file mode 100644
index 0000000000..1c05ae649e
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch
@@ -0,0 +1,37 @@
1From: Daniel Veillard <veillard@redhat.com>
2Date: Tue, 22 Apr 2014 15:30:56 +0800
3Subject: Do not fetch external parameter entities
4
5Unless explicitely asked for when validating or replacing entities
6with their value. Problem pointed out by Daniel Berrange <berrange@redhat.com>
7
8Upstream-Status: Backport
9Reference: https://access.redhat.com/security/cve/CVE-2014-0191
10
11Signed-off-by: Daniel Veillard <veillard@redhat.com>
12Signed-off-by: Maxin B. John <maxin.john@enea.com>
13---
14diff -Naur libxml2-2.9.1-orig/parser.c libxml2-2.9.1/parser.c
15--- libxml2-2.9.1-orig/parser.c 2013-04-16 15:39:18.000000000 +0200
16+++ libxml2-2.9.1/parser.c 2014-05-07 13:35:46.883687946 +0200
17@@ -2595,6 +2595,20 @@
18 xmlCharEncoding enc;
19
20 /*
21+ * Note: external parsed entities will not be loaded, it is
22+ * not required for a non-validating parser, unless the
23+ * option of validating, or substituting entities were
24+ * given. Doing so is far more secure as the parser will
25+ * only process data coming from the document entity by
26+ * default.
27+ */
28+ if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
29+ ((ctxt->options & XML_PARSE_NOENT) == 0) &&
30+ ((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
31+ (ctxt->validate == 0))
32+ return;
33+
34+ /*
35 * handle the extra spaces added before and after
36 * c.f. http://www.w3.org/TR/REC-xml#as-PE
37 * this is done independently.
diff --git a/meta/recipes-core/libxml/libxml2/run-ptest b/meta/recipes-core/libxml/libxml2/run-ptest
new file mode 100644
index 0000000000..473d0b67a7
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3make -k runtests
diff --git a/meta/recipes-core/libxml/libxml2/runtest.patch b/meta/recipes-core/libxml/libxml2/runtest.patch
new file mode 100644
index 0000000000..397ab20c30
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/runtest.patch
@@ -0,0 +1,820 @@
1Add 'install-ptest' rule.
2Print a standard result line for each test.
3
4Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
5Upstream-Status: Pending
6
7diff -uNr a/Makefile.am b/Makefile.am
8--- a/Makefile.am 2013-04-17 14:51:42.633386477 +0200
9+++ b/Makefile.am 2013-04-19 14:47:51.544720568 +0200
10@@ -202,10 +202,19 @@
11 #testOOM_DEPENDENCIES = $(DEPS)
12 #testOOM_LDADD= $(LDADDS)
13
14+install-ptest:
15+ @(if [ -d .libs ] ; then cd .libs; fi; \
16+ install $(noinst_PROGRAMS) $(DESTDIR))
17+ cp -r $(srcdir)/test $(DESTDIR)
18+ cp -r $(srcdir)/result $(DESTDIR)
19+ cp -r $(srcdir)/python $(DESTDIR)
20+ cp Makefile $(DESTDIR)
21+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
22+
23 runtests:
24 [ -d test ] || $(LN_S) $(srcdir)/test .
25 [ -d result ] || $(LN_S) $(srcdir)/result .
26- $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
27+ ./runtest$(EXEEXT) ; ./testrecurse$(EXEEXT) ; ./testapi$(EXEEXT) ; ./testchar$(EXEEXT) ; ./testdict$(EXEEXT) ; ./runxmlconf$(EXEEXT)
28 @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
29 $(MAKE) tests ; fi)
30
31diff -uNr a/runsuite.c b/runsuite.c
32--- a/runsuite.c 2013-04-12 16:17:11.462823238 +0200
33+++ b/runsuite.c 2013-04-17 14:07:24.352693211 +0200
34@@ -1162,6 +1162,7 @@
35
36 if (logfile != NULL)
37 fclose(logfile);
38+ printf("%s: runsuite\n\n", (ret == 0) ? "PASS" : "FAIL");
39 return(ret);
40 }
41 #else /* !SCHEMAS */
42diff -uNr a/runtest.c b/runtest.c
43--- a/runtest.c 2013-04-16 13:19:15.087997290 +0200
44+++ b/runtest.c 2013-04-17 14:08:29.529949655 +0200
45@@ -4386,6 +4386,7 @@
46 err++;
47 }
48 }
49+ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
50 return(err);
51 }
52
53@@ -4455,6 +4456,7 @@
54 xmlCleanupParser();
55 xmlMemoryDump();
56
57+ printf("%s: runtest\n\n", (ret == 0) ? "PASS" : "FAIL");
58 return(ret);
59 }
60
61diff -uNr a/runxmlconf.c b/runxmlconf.c
62--- a/runxmlconf.c 2013-04-16 12:53:49.900982990 +0200
63+++ b/runxmlconf.c 2013-04-17 14:09:21.111778104 +0200
64@@ -595,6 +595,7 @@
65
66 if (logfile != NULL)
67 fclose(logfile);
68+ printf("%s: runxmlconf\n", (ret == 0) ? "PASS" : "FAIL");
69 return(ret);
70 }
71
72diff -uNr a/testapi.c b/testapi.c
73--- a/testapi.c 2013-04-12 16:16:57.763417659 +0200
74+++ b/testapi.c 2013-04-17 14:10:28.876924881 +0200
75@@ -1245,49 +1245,91 @@
76 testlibxml2(void)
77 {
78 int test_ret = 0;
79+ int ret = 0;
80
81- test_ret += test_HTMLparser();
82- test_ret += test_HTMLtree();
83- test_ret += test_SAX2();
84- test_ret += test_c14n();
85- test_ret += test_catalog();
86- test_ret += test_chvalid();
87- test_ret += test_debugXML();
88- test_ret += test_dict();
89- test_ret += test_encoding();
90- test_ret += test_entities();
91- test_ret += test_hash();
92- test_ret += test_list();
93- test_ret += test_nanoftp();
94- test_ret += test_nanohttp();
95- test_ret += test_parser();
96- test_ret += test_parserInternals();
97- test_ret += test_pattern();
98- test_ret += test_relaxng();
99- test_ret += test_schemasInternals();
100- test_ret += test_schematron();
101- test_ret += test_tree();
102- test_ret += test_uri();
103- test_ret += test_valid();
104- test_ret += test_xinclude();
105- test_ret += test_xmlIO();
106- test_ret += test_xmlautomata();
107- test_ret += test_xmlerror();
108- test_ret += test_xmlmodule();
109- test_ret += test_xmlreader();
110- test_ret += test_xmlregexp();
111- test_ret += test_xmlsave();
112- test_ret += test_xmlschemas();
113- test_ret += test_xmlschemastypes();
114- test_ret += test_xmlstring();
115- test_ret += test_xmlunicode();
116- test_ret += test_xmlwriter();
117- test_ret += test_xpath();
118- test_ret += test_xpathInternals();
119- test_ret += test_xpointer();
120+ test_ret += (ret = test_HTMLparser());
121+ printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL");
122+ test_ret += (ret = test_HTMLtree());
123+ printf("%s: HTMLtree\n", (ret == 0) ? "PASS" : "FAIL");
124+ test_ret += (ret = test_SAX2());
125+ printf("%s: SAX2\n", (ret == 0) ? "PASS" : "FAIL");
126+ test_ret += (ret = test_c14n());
127+ printf("%s: c14n\n", (ret == 0) ? "PASS" : "FAIL");
128+ test_ret += (ret = test_catalog());
129+ printf("%s: catalog\n", (ret == 0) ? "PASS" : "FAIL");
130+ test_ret += (ret = test_chvalid());
131+ printf("%s: chvalid\n", (ret == 0) ? "PASS" : "FAIL");
132+ test_ret += (ret = test_debugXML());
133+ printf("%s: debugXML\n", (ret == 0) ? "PASS" : "FAIL");
134+ test_ret += (ret = test_dict());
135+ printf("%s: dict\n", (ret == 0) ? "PASS" : "FAIL");
136+ test_ret += (ret = test_encoding());
137+ printf("%s: encoding\n", (ret == 0) ? "PASS" : "FAIL");
138+ test_ret += (ret = test_entities());
139+ printf("%s: entities\n", (ret == 0) ? "PASS" : "FAIL");
140+ test_ret += (ret = test_hash());
141+ printf("%s: hash\n", (ret == 0) ? "PASS" : "FAIL");
142+ test_ret += (ret = test_list());
143+ printf("%s: list\n", (ret == 0) ? "PASS" : "FAIL");
144+ test_ret += (ret = test_nanoftp());
145+ printf("%s: nanoftp\n", (ret == 0) ? "PASS" : "FAIL");
146+ test_ret += (ret = test_nanohttp());
147+ printf("%s: nanohttp\n", (ret == 0) ? "PASS" : "FAIL");
148+ test_ret += (ret = test_parser());
149+ printf("%s: parser\n", (ret == 0) ? "PASS" : "FAIL");
150+ test_ret += (ret = test_parserInternals());
151+ printf("%s: parserInternals\n", (ret == 0) ? "PASS" : "FAIL");
152+ test_ret += (ret = test_pattern());
153+ printf("%s: pattern\n", (ret == 0) ? "PASS" : "FAIL");
154+ test_ret += (ret = test_relaxng());
155+ printf("%s: relaxng\n", (ret == 0) ? "PASS" : "FAIL");
156+ test_ret += (ret = test_schemasInternals());
157+ printf("%s: schemasInternals\n", (ret == 0) ? "PASS" : "FAIL");
158+ test_ret += (ret = test_schematron());
159+ printf("%s: schematron\n", (ret == 0) ? "PASS" : "FAIL");
160+ test_ret += (ret = test_tree());
161+ printf("%s: tree\n", (ret == 0) ? "PASS" : "FAIL");
162+ test_ret += (ret = test_uri());
163+ printf("%s: uri\n", (ret == 0) ? "PASS" : "FAIL");
164+ test_ret += (ret = test_valid());
165+ printf("%s: valid\n", (ret == 0) ? "PASS" : "FAIL");
166+ test_ret += (ret = test_xinclude());
167+ printf("%s: xinclude\n", (ret == 0) ? "PASS" : "FAIL");
168+ test_ret += (ret = test_xmlIO());
169+ printf("%s: xmlIO\n", (ret == 0) ? "PASS" : "FAIL");
170+ test_ret += (ret = test_xmlautomata());
171+ printf("%s: xmlautomata\n", (ret == 0) ? "PASS" : "FAIL");
172+ test_ret += (ret = test_xmlerror());
173+ printf("%s: xmlerror\n", (ret == 0) ? "PASS" : "FAIL");
174+ test_ret += (ret = test_xmlmodule());
175+ printf("%s: xmlmodule\n", (ret == 0) ? "PASS" : "FAIL");
176+ test_ret += (ret = test_xmlreader());
177+ printf("%s: xmlreader\n", (ret == 0) ? "PASS" : "FAIL");
178+ test_ret += (ret = test_xmlregexp());
179+ printf("%s: xmlregexp\n", (ret == 0) ? "PASS" : "FAIL");
180+ test_ret += (ret = test_xmlsave());
181+ printf("%s: xmlsave\n", (ret == 0) ? "PASS" : "FAIL");
182+ test_ret += (ret = test_xmlschemas());
183+ printf("%s: xmlschemas\n", (ret == 0) ? "PASS" : "FAIL");
184+ test_ret += (ret = test_xmlschemastypes());
185+ printf("%s: xmlschemastypes\n", (ret == 0) ? "PASS" : "FAIL");
186+ test_ret += (ret = test_xmlstring());
187+ printf("%s: xmlstring\n", (ret == 0) ? "PASS" : "FAIL");
188+ test_ret += (ret = test_xmlunicode());
189+ printf("%s: xmlunicode\n", (ret == 0) ? "PASS" : "FAIL");
190+ test_ret += (ret = test_xmlwriter());
191+ printf("%s: xmlwriter\n", (ret == 0) ? "PASS" : "FAIL");
192+ test_ret += (ret = test_xpath());
193+ printf("%s: xpath\n", (ret == 0) ? "PASS" : "FAIL");
194+ test_ret += (ret = test_xpathInternals());
195+ printf("%s: xpathInternals\n", (ret == 0) ? "PASS" : "FAIL");
196+ test_ret += (ret = test_xpointer());
197+ printf("%s: xpointer\n", (ret == 0) ? "PASS" : "FAIL");
198
199 printf("Total: %d functions, %d tests, %d errors\n",
200 function_tests, call_tests, test_ret);
201+
202+ printf("%s: testapi\n\n", (test_ret == 0) ? "PASS" : "FAIL");
203 return(test_ret);
204 }
205
206diff -uNr a/testchar.c b/testchar.c
207--- a/testchar.c 2013-04-17 10:50:30.250147418 +0200
208+++ b/testchar.c 2013-04-18 16:11:28.455733800 +0200
209@@ -23,7 +23,7 @@
210 char document1[100] = "<doc>XXXX</doc>";
211 char document2[100] = "<doc foo='XXXX'/>";
212
213-static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
214+static int testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
215 int len, char *data, int forbid1, int forbid2) {
216 int i;
217 xmlDocPtr res;
218@@ -37,33 +37,41 @@
219 res = xmlReadMemory(document, len, "test", NULL, 0);
220
221 if ((i == forbid1) || (i == forbid2)) {
222- if ((lastError == 0) || (res != NULL))
223+ if ((lastError == 0) || (res != NULL)) {
224 fprintf(stderr,
225 "Failed to detect invalid char for Byte 0x%02X: %c\n",
226 i, i);
227+ return(1);
228+ }
229 }
230
231 else if ((i == '<') || (i == '&')) {
232- if ((lastError == 0) || (res != NULL))
233+ if ((lastError == 0) || (res != NULL)) {
234 fprintf(stderr,
235 "Failed to detect illegal char %c for Byte 0x%02X\n", i, i);
236+ return(1);
237+ }
238 }
239 else if (((i < 0x20) || (i >= 0x80)) &&
240 (i != 0x9) && (i != 0xA) && (i != 0xD)) {
241- if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL))
242+ if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) {
243 fprintf(stderr,
244 "Failed to detect invalid char for Byte 0x%02X\n", i);
245+ return(1);
246+ }
247 }
248 else if (res == NULL) {
249 fprintf(stderr,
250 "Failed to parse valid char for Byte 0x%02X : %c\n", i, i);
251+ return(1);
252 }
253 if (res != NULL)
254 xmlFreeDoc(res);
255 }
256+ return(0);
257 }
258
259-static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
260+static int testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
261 int len, char *data) {
262 int i, j;
263 xmlDocPtr res;
264@@ -80,10 +88,12 @@
265
266 /* if first bit of first char is set, then second bit must too */
267 if ((i & 0x80) && ((i & 0x40) == 0)) {
268- if ((lastError == 0) || (res != NULL))
269+ if ((lastError == 0) || (res != NULL)) {
270 fprintf(stderr,
271 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
272 i, j);
273+ return(1);
274+ }
275 }
276
277 /*
278@@ -91,10 +101,12 @@
279 * bits must be 10
280 */
281 else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
282- if ((lastError == 0) || (res != NULL))
283+ if ((lastError == 0) || (res != NULL)) {
284 fprintf(stderr,
285 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
286 i, j);
287+ return(1);
288+ }
289 }
290
291 /*
292@@ -102,10 +114,12 @@
293 * than 0x80, i.e. one of bits 5 to 1 of i must be set
294 */
295 else if ((i & 0x80) && ((i & 0x1E) == 0)) {
296- if ((lastError == 0) || (res != NULL))
297+ if ((lastError == 0) || (res != NULL)) {
298 fprintf(stderr,
299 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
300 i, j);
301+ return(1);
302+ }
303 }
304
305 /*
306@@ -113,10 +127,12 @@
307 * at least 3 bytes, but we give only 2 !
308 */
309 else if ((i & 0xE0) == 0xE0) {
310- if ((lastError == 0) || (res != NULL))
311+ if ((lastError == 0) || (res != NULL)) {
312 fprintf(stderr,
313 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
314 i, j);
315+ return(1);
316+ }
317 }
318
319 /*
320@@ -125,11 +141,13 @@
321 else if ((lastError != 0) || (res == NULL)) {
322 fprintf(stderr,
323 "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j);
324+ return(1);
325 }
326 if (res != NULL)
327 xmlFreeDoc(res);
328 }
329 }
330+ return(0);
331 }
332
333 /**
334@@ -141,9 +159,10 @@
335 * CDATA in text or in attribute values.
336 */
337
338-static void testDocumentRanges(void) {
339+static int testDocumentRanges(void) {
340 xmlParserCtxtPtr ctxt;
341 char *data;
342+ int test_ret = 0;
343
344 /*
345 * Set up a parsing context using the first document as
346@@ -152,7 +171,7 @@
347 ctxt = xmlNewParserCtxt();
348 if (ctxt == NULL) {
349 fprintf(stderr, "Failed to allocate parser context\n");
350- return;
351+ return(1);
352 }
353
354 printf("testing 1 byte char in document: 1");
355@@ -163,7 +182,7 @@
356 data[2] = ' ';
357 data[3] = ' ';
358 /* test 1 byte injection at beginning of area */
359- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
360+ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
361 data, -1, -1);
362 printf(" 2");
363 fflush(stdout);
364@@ -172,7 +191,7 @@
365 data[2] = ' ';
366 data[3] = ' ';
367 /* test 1 byte injection at end of area */
368- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
369+ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
370 data + 3, -1, -1);
371
372 printf(" 3");
373@@ -183,7 +202,7 @@
374 data[2] = ' ';
375 data[3] = ' ';
376 /* test 1 byte injection at beginning of area */
377- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
378+ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
379 data, '\'', -1);
380 printf(" 4");
381 fflush(stdout);
382@@ -192,7 +211,7 @@
383 data[2] = ' ';
384 data[3] = ' ';
385 /* test 1 byte injection at end of area */
386- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
387+ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
388 data + 3, '\'', -1);
389 printf(" done\n");
390
391@@ -204,7 +223,7 @@
392 data[2] = ' ';
393 data[3] = ' ';
394 /* test 2 byte injection at beginning of area */
395- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
396+ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
397 data);
398 printf(" 2");
399 fflush(stdout);
400@@ -213,7 +232,7 @@
401 data[2] = ' ';
402 data[3] = ' ';
403 /* test 2 byte injection at end of area */
404- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
405+ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
406 data + 2);
407
408 printf(" 3");
409@@ -224,7 +243,7 @@
410 data[2] = ' ';
411 data[3] = ' ';
412 /* test 2 byte injection at beginning of area */
413- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
414+ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
415 data);
416 printf(" 4");
417 fflush(stdout);
418@@ -233,14 +252,15 @@
419 data[2] = ' ';
420 data[3] = ' ';
421 /* test 2 byte injection at end of area */
422- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
423+ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
424 data + 2);
425 printf(" done\n");
426
427 xmlFreeParserCtxt(ctxt);
428+ return(test_ret);
429 }
430
431-static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
432+static int testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
433 int i = 0;
434 int len, c;
435
436@@ -255,19 +275,25 @@
437 c = xmlCurrentChar(ctxt, &len);
438 if ((i == 0) || (i >= 0x80)) {
439 /* we must see an error there */
440- if (lastError != XML_ERR_INVALID_CHAR)
441+ if (lastError != XML_ERR_INVALID_CHAR) {
442 fprintf(stderr,
443 "Failed to detect invalid char for Byte 0x%02X\n", i);
444+ return(1);
445+ }
446 } else if (i == 0xD) {
447- if ((c != 0xA) || (len != 1))
448+ if ((c != 0xA) || (len != 1)) {
449 fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i);
450+ return(1);
451+ }
452 } else if ((c != i) || (len != 1)) {
453 fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i);
454+ return(1);
455 }
456 }
457+ return(0);
458 }
459
460-static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
461+static int testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
462 int i, j;
463 int len, c;
464
465@@ -284,10 +310,12 @@
466
467 /* if first bit of first char is set, then second bit must too */
468 if ((i & 0x80) && ((i & 0x40) == 0)) {
469- if (lastError != XML_ERR_INVALID_CHAR)
470+ if (lastError != XML_ERR_INVALID_CHAR) {
471 fprintf(stderr,
472 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
473 i, j);
474+ return(1);
475+ }
476 }
477
478 /*
479@@ -295,10 +323,12 @@
480 * bits must be 10
481 */
482 else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
483- if (lastError != XML_ERR_INVALID_CHAR)
484+ if (lastError != XML_ERR_INVALID_CHAR) {
485 fprintf(stderr,
486 "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
487 i, j, c);
488+ return(1);
489+ }
490 }
491
492 /*
493@@ -306,10 +336,12 @@
494 * than 0x80, i.e. one of bits 5 to 1 of i must be set
495 */
496 else if ((i & 0x80) && ((i & 0x1E) == 0)) {
497- if (lastError != XML_ERR_INVALID_CHAR)
498+ if (lastError != XML_ERR_INVALID_CHAR) {
499 fprintf(stderr,
500 "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
501 i, j, c);
502+ return(1);
503+ }
504 }
505
506 /*
507@@ -317,10 +349,12 @@
508 * at least 3 bytes, but we give only 2 !
509 */
510 else if ((i & 0xE0) == 0xE0) {
511- if (lastError != XML_ERR_INVALID_CHAR)
512+ if (lastError != XML_ERR_INVALID_CHAR) {
513 fprintf(stderr,
514 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
515 i, j);
516+ return(1);
517+ }
518 }
519
520 /*
521@@ -329,6 +363,7 @@
522 else if ((lastError != 0) || (len != 2)) {
523 fprintf(stderr,
524 "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j);
525+ return(1);
526 }
527
528 /*
529@@ -338,12 +373,14 @@
530 fprintf(stderr,
531 "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n",
532 i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c);
533+ return(1);
534 }
535 }
536 }
537+ return(0);
538 }
539
540-static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
541+static int testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
542 int i, j, k, K;
543 int len, c;
544 unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
545@@ -368,20 +405,24 @@
546 * at least 4 bytes, but we give only 3 !
547 */
548 if ((i & 0xF0) == 0xF0) {
549- if (lastError != XML_ERR_INVALID_CHAR)
550+ if (lastError != XML_ERR_INVALID_CHAR) {
551 fprintf(stderr,
552 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
553 i, j, K, data[3]);
554+ return(1);
555+ }
556 }
557
558 /*
559 * The second and the third bytes must start with 10
560 */
561 else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) {
562- if (lastError != XML_ERR_INVALID_CHAR)
563+ if (lastError != XML_ERR_INVALID_CHAR) {
564 fprintf(stderr,
565 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
566 i, j, K);
567+ return(1);
568+ }
569 }
570
571 /*
572@@ -390,10 +431,12 @@
573 * the 6th byte of data[1] must be set
574 */
575 else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) {
576- if (lastError != XML_ERR_INVALID_CHAR)
577+ if (lastError != XML_ERR_INVALID_CHAR) {
578 fprintf(stderr,
579 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
580 i, j, K);
581+ return(1);
582+ }
583 }
584
585 /*
586@@ -401,10 +444,12 @@
587 */
588 else if (((value > 0xD7FF) && (value <0xE000)) ||
589 ((value > 0xFFFD) && (value <0x10000))) {
590- if (lastError != XML_ERR_INVALID_CHAR)
591+ if (lastError != XML_ERR_INVALID_CHAR) {
592 fprintf(stderr,
593 "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n",
594 value, i, j, K);
595+ return(1);
596+ }
597 }
598
599 /*
600@@ -414,6 +459,7 @@
601 fprintf(stderr,
602 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
603 i, j, K);
604+ return(1);
605 }
606
607 /*
608@@ -423,13 +469,15 @@
609 fprintf(stderr,
610 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
611 i, j, data[2], value, c);
612+ return(1);
613 }
614 }
615 }
616 }
617+ return(0);
618 }
619
620-static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
621+static int testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
622 int i, j, k, K, l, L;
623 int len, c;
624 unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
625@@ -458,10 +506,12 @@
626 * at least 5 bytes, but we give only 4 !
627 */
628 if ((i & 0xF8) == 0xF8) {
629- if (lastError != XML_ERR_INVALID_CHAR)
630+ if (lastError != XML_ERR_INVALID_CHAR) {
631 fprintf(stderr,
632 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
633 i, j, K, data[3]);
634+ return(1);
635+ }
636 }
637
638 /*
639@@ -469,10 +519,12 @@
640 */
641 else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) ||
642 ((L & 0xC0) != 0x80)) {
643- if (lastError != XML_ERR_INVALID_CHAR)
644+ if (lastError != XML_ERR_INVALID_CHAR) {
645 fprintf(stderr,
646 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
647 i, j, K, L);
648+ return(1);
649+ }
650 }
651
652 /*
653@@ -481,10 +533,12 @@
654 * the 6 or 5th byte of j must be set
655 */
656 else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) {
657- if (lastError != XML_ERR_INVALID_CHAR)
658+ if (lastError != XML_ERR_INVALID_CHAR) {
659 fprintf(stderr,
660 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
661 i, j, K, L);
662+ return(1);
663+ }
664 }
665
666 /*
667@@ -493,10 +547,12 @@
668 else if (((value > 0xD7FF) && (value <0xE000)) ||
669 ((value > 0xFFFD) && (value <0x10000)) ||
670 (value > 0x10FFFF)) {
671- if (lastError != XML_ERR_INVALID_CHAR)
672+ if (lastError != XML_ERR_INVALID_CHAR) {
673 fprintf(stderr,
674 "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
675 value, i, j, K, L);
676+ return(1);
677+ }
678 }
679
680 /*
681@@ -506,6 +562,7 @@
682 fprintf(stderr,
683 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
684 i, j, K);
685+ return(1);
686 }
687
688 /*
689@@ -515,11 +572,13 @@
690 fprintf(stderr,
691 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
692 i, j, data[2], value, c);
693+ return(1);
694 }
695 }
696 }
697 }
698 }
699+ return(0);
700 }
701
702 /**
703@@ -530,11 +589,12 @@
704 * cover the full range of UTF-8 chars accepted by XML-1.0
705 */
706
707-static void testCharRanges(void) {
708+static int testCharRanges(void) {
709 char data[5];
710 xmlParserCtxtPtr ctxt;
711 xmlParserInputBufferPtr buf;
712 xmlParserInputPtr input;
713+ int test_ret = 0;
714
715 memset(data, 0, 5);
716
717@@ -545,17 +605,19 @@
718 ctxt = xmlNewParserCtxt();
719 if (ctxt == NULL) {
720 fprintf(stderr, "Failed to allocate parser context\n");
721- return;
722+ return(1);
723 }
724 buf = xmlParserInputBufferCreateStatic(data, sizeof(data),
725 XML_CHAR_ENCODING_NONE);
726 if (buf == NULL) {
727 fprintf(stderr, "Failed to allocate input buffer\n");
728+ test_ret = 1;
729 goto error;
730 }
731 input = xmlNewInputStream(ctxt);
732 if (input == NULL) {
733 xmlFreeParserInputBuffer(buf);
734+ test_ret = 1;
735 goto error;
736 }
737 input->filename = NULL;
738@@ -567,25 +629,28 @@
739
740 printf("testing char range: 1");
741 fflush(stdout);
742- testCharRangeByte1(ctxt, data);
743+ test_ret += testCharRangeByte1(ctxt, data);
744 printf(" 2");
745 fflush(stdout);
746- testCharRangeByte2(ctxt, data);
747+ test_ret += testCharRangeByte2(ctxt, data);
748 printf(" 3");
749 fflush(stdout);
750- testCharRangeByte3(ctxt, data);
751+ test_ret += testCharRangeByte3(ctxt, data);
752 printf(" 4");
753 fflush(stdout);
754- testCharRangeByte4(ctxt, data);
755+ test_ret += testCharRangeByte4(ctxt, data);
756 printf(" done\n");
757 fflush(stdout);
758
759 error:
760 xmlFreeParserCtxt(ctxt);
761+ return(test_ret);
762 }
763
764 int main(void) {
765
766+ int ret = 0;
767+
768 /*
769 * this initialize the library and check potential ABI mismatches
770 * between the version it was compiled for and the actual shared
771@@ -602,8 +667,9 @@
772 /*
773 * Run the tests
774 */
775- testCharRanges();
776- testDocumentRanges();
777+ ret += testCharRanges();
778+ ret += testDocumentRanges();
779+ printf("%s: testchar\n\n", (ret == 0) ? "PASS" : "FAIL");
780
781 /*
782 * Cleanup function for the XML library.
783diff -uNr a/testdict.c b/testdict.c
784--- a/testdict.c 2013-04-16 15:08:42.971177193 +0200
785+++ b/testdict.c 2013-04-18 15:59:00.699482439 +0200
786@@ -440,5 +440,6 @@
787 clean_strings();
788 xmlCleanupParser();
789 xmlMemoryDump();
790+ printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL");
791 return(ret);
792 }
793diff -uNr a/testlimits.c b/testlimits.c
794--- a/testlimits.c 2013-04-12 16:16:36.180354177 +0200
795+++ b/testlimits.c 2013-04-17 14:03:17.203092987 +0200
796@@ -1630,5 +1630,6 @@
797 xmlCleanupParser();
798 xmlMemoryDump();
799
800+ printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL");
801 return(ret);
802 }
803diff -uNr a/testrecurse.c b/testrecurse.c
804--- a/testrecurse.c 2013-04-16 13:19:49.366536295 +0200
805+++ b/testrecurse.c 2013-04-17 14:06:27.367091622 +0200
806@@ -892,6 +892,7 @@
807 err++;
808 }
809 }
810+ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
811 return(err);
812 }
813
814@@ -961,5 +962,6 @@
815 xmlCleanupParser();
816 xmlMemoryDump();
817
818+ printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL");
819 return(ret);
820 }
diff --git a/meta/recipes-core/libxml/libxml2_2.9.1.bb b/meta/recipes-core/libxml/libxml2_2.9.1.bb
new file mode 100644
index 0000000000..0b6ac5d5c6
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2_2.9.1.bb
@@ -0,0 +1,8 @@
1require libxml2.inc
2
3SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;name=testtar"
4
5SRC_URI[libtar.md5sum] = "9c0cfef285d5c4a5c80d00904ddab380"
6SRC_URI[libtar.sha256sum] = "fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb"
7SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a"
8SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7"
diff --git a/meta/recipes-core/meta/buildtools-tarball.bb b/meta/recipes-core/meta/buildtools-tarball.bb
new file mode 100644
index 0000000000..c54d9e8699
--- /dev/null
+++ b/meta/recipes-core/meta/buildtools-tarball.bb
@@ -0,0 +1,71 @@
1DESCRIPTION = "SDK type target for building a standalone tarball containing python, chrpath, make, git and tar. The \
2 tarball can be used to run bitbake builds on systems which don't meet the usual version requirements."
3SUMMARY = "Standalone tarball for running builds on systems with inadequate software"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
6 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
7
8TOOLCHAIN_TARGET_TASK ?= ""
9
10TOOLCHAIN_HOST_TASK ?= "\
11 nativesdk-python-core \
12 nativesdk-python-textutils \
13 nativesdk-python-sqlite3 \
14 nativesdk-python-pickle \
15 nativesdk-python-logging \
16 nativesdk-python-elementtree \
17 nativesdk-python-curses \
18 nativesdk-python-compile \
19 nativesdk-python-compiler \
20 nativesdk-python-fcntl \
21 nativesdk-python-shell \
22 nativesdk-python-misc \
23 nativesdk-python-multiprocessing \
24 nativesdk-python-subprocess \
25 nativesdk-python-xmlrpc \
26 nativesdk-python-netclient \
27 nativesdk-python-netserver \
28 nativesdk-python-distutils \
29 nativesdk-python-unixadmin \
30 nativesdk-python-compression \
31 nativesdk-python-json \
32 nativesdk-python-unittest \
33 nativesdk-python-mmap \
34 nativesdk-python-difflib \
35 nativesdk-python-pprint \
36 nativesdk-python-git \
37 nativesdk-python-pkgutil \
38 nativesdk-ncurses-terminfo-base \
39 nativesdk-chrpath \
40 nativesdk-tar \
41 nativesdk-git \
42 nativesdk-pigz \
43 nativesdk-make \
44 nativesdk-wget \
45 "
46
47TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-buildtools-nativesdk-standalone-${DISTRO_VERSION}"
48
49RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
50
51EXCLUDE_FROM_WORLD = "1"
52
53inherit meta
54inherit populate_sdk
55
56create_sdk_files_append () {
57 rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-*
58 rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-*
59 rm -f ${SDK_OUTPUT}/${SDKPATH}/version-*
60
61 # Generate new (mini) sdk-environment-setup file
62 script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}}
63 touch $script
64 echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $script
65 # In order for the self-extraction script to correctly extract and set up things,
66 # we need a 'OECORE_NATIVE_SYSROOT=xxx' line in environment setup script.
67 # However, buildtools-tarball is inherently a tool set instead of a fully functional SDK,
68 # so instead of exporting the variable, we use a comment here.
69 echo '#OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
70 toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS}
71}
diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb
new file mode 100644
index 0000000000..cf142ef5ca
--- /dev/null
+++ b/meta/recipes-core/meta/meta-environment.bb
@@ -0,0 +1,51 @@
1SUMMARY = "Package of environment files for SDK"
2LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
3 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4LICENSE = "MIT"
5PR = "r8"
6
7EXCLUDE_FROM_WORLD = "1"
8
9inherit toolchain-scripts
10TOOLCHAIN_NEED_CONFIGSITE_CACHE += "zlib"
11REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
12
13SDK_DIR = "${WORKDIR}/sdk"
14SDK_OUTPUT = "${SDK_DIR}/image"
15SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}"
16
17inherit cross-canadian
18
19do_generate_content[nostamp] = "1"
20do_generate_content() {
21
22 rm -rf ${SDK_OUTPUT}
23 mkdir -p ${SDK_OUTPUT}/${SDKPATH}
24
25 toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS}
26
27 toolchain_create_sdk_env_script ${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} ${REAL_MULTIMACH_TARGET_SYS} '##SDKTARGETSYSROOT##' ${target_libdir}
28
29 # Add version information
30 toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS}
31}
32addtask generate_content before do_install after do_compile
33
34do_install[nostamp] = "1"
35do_install() {
36 install -d ${D}/${SDKPATH}
37 install -m 0644 -t ${D}/${SDKPATH} ${SDK_OUTPUT}/${SDKPATH}/*
38}
39
40PN = "meta-environment-${MACHINE}"
41PACKAGES = "${PN}"
42FILES_${PN}= " \
43 ${SDKPATH}/* \
44 "
45
46do_fetch[noexec] = "1"
47do_unpack[noexec] = "1"
48do_patch[noexec] = "1"
49do_configure[noexec] = "1"
50do_compile[noexec] = "1"
51do_populate_sysroot[noexec] = "1"
diff --git a/meta/recipes-core/meta/meta-ide-support.bb b/meta/recipes-core/meta/meta-ide-support.bb
new file mode 100644
index 0000000000..40bda28949
--- /dev/null
+++ b/meta/recipes-core/meta/meta-ide-support.bb
@@ -0,0 +1,18 @@
1SUMMARY = "Integrated Development Environment support"
2DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
5 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
6
7DEPENDS = "virtual/libc gdb-cross qemu-native qemu-helper-native unfs3-native"
8PR = "r3"
9
10inherit meta toolchain-scripts
11
12do_populate_ide_support () {
13 toolchain_create_tree_env_script
14}
15
16do_populate_ide_support[nostamp] = "1"
17do_populate_ide_support[recrdeptask] = "do_package_write"
18addtask populate_ide_support before do_build after do_install
diff --git a/meta/recipes-core/meta/meta-toolchain.bb b/meta/recipes-core/meta/meta-toolchain.bb
new file mode 100644
index 0000000000..ba9fd88805
--- /dev/null
+++ b/meta/recipes-core/meta/meta-toolchain.bb
@@ -0,0 +1,9 @@
1SUMMARY = "Meta package for building a installable toolchain"
2LICENSE = "MIT"
3
4PR = "r7"
5
6LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
7 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
8
9inherit populate_sdk
diff --git a/meta/recipes-core/meta/package-index.bb b/meta/recipes-core/meta/package-index.bb
new file mode 100644
index 0000000000..27b6d8ea9f
--- /dev/null
+++ b/meta/recipes-core/meta/package-index.bb
@@ -0,0 +1,29 @@
1SUMMARY = "Rebuilds the package index"
2LICENSE = "MIT"
3
4INHIBIT_DEFAULT_DEPS = "1"
5PACKAGES = ""
6
7do_fetch[noexec] = "1"
8do_unpack[noexec] = "1"
9do_patch[noexec] = "1"
10do_configure[noexec] = "1"
11do_compile[noexec] = "1"
12do_install[noexec] = "1"
13do_package[noexec] = "1"
14do_packagedata[noexec] = "1"
15do_package_write[noexec] = "1"
16do_package_write_ipk[noexec] = "1"
17do_package_write_rpm[noexec] = "1"
18do_package_write_deb[noexec] = "1"
19do_populate_sysroot[noexec] = "1"
20
21do_package_index[nostamp] = "1"
22do_package_index[depends] += "${PACKAGEINDEXDEPS}"
23
24python do_package_index() {
25 from oe.rootfs import generate_index_files
26 generate_index_files(d)
27}
28addtask do_package_index before do_build
29EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-core/ncurses/ncurses-5.9/config.cache b/meta/recipes-core/ncurses/ncurses-5.9/config.cache
new file mode 100644
index 0000000000..6a9217d5bb
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses-5.9/config.cache
@@ -0,0 +1,4 @@
1#! /bin/sh
2
3cf_cv_func_nanosleep=yes
4cf_cv_func_mkstemp=yes
diff --git a/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch b/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch
new file mode 100644
index 0000000000..cba89d26f5
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch
@@ -0,0 +1,27 @@
1Upstream-Status: Inappropriate [configuration]
2
3'tic' of some linux distributions (e.g. fedora 11) hang in an infinite
4loop when processing the original file.
5
6Index: ncurses-5.7/misc/terminfo.src
7===================================================================
8--- ncurses-5.7.orig/misc/terminfo.src
9+++ ncurses-5.7/misc/terminfo.src
10@@ -3706,12 +3706,11 @@ konsole-xf3x|KDE console window with key
11 # The value for kbs reflects local customization rather than the settings used
12 # for XFree86 xterm.
13 konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm,
14- kend=\EOF, khome=\EOH, use=konsole+pcfkeys,
15- use=konsole-vt100,
16-# Konsole does not implement shifted cursor-keys.
17-konsole+pcfkeys|konsole subset of xterm+pcfkeys,
18- kLFT@, kRIT@, kcbt=\E[Z, kind@, kri@, kDN@, kUP@, use=xterm+pcc2,
19- use=xterm+pcf0,
20+ kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R,
21+ kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~,
22+ kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
23+ kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS,
24+ khome=\EOH, use=konsole-vt100,
25 # KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but
26 # it is still useful for deriving the other entries.
27 konsole-vt100|KDE console window with vt100 (sic) keyboard,
diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc
new file mode 100644
index 0000000000..f0a4044345
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses.inc
@@ -0,0 +1,292 @@
1SUMMARY = "The New Curses library"
2DESCRIPTION = "SVr4 and XSI-Curses compatible curses library and terminfo tools including tic, infocmp, captoinfo. Supports color, multiple highlights, forms-drawing characters, and automatic recognition of keypad and function-key sequences. Extensions include resizable windows and mouse support on both xterm and Linux console using the gpm library."
3HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66"
6SECTION = "libs"
7DEPENDS = "ncurses-native"
8DEPENDS_class-native = ""
9INC_PR = "r15"
10
11inherit autotools binconfig multilib_header
12
13# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/
14SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz"
15
16EXTRA_AUTORECONF = "-I m4"
17CONFIG_SITE =+ "${WORKDIR}/config.cache"
18
19# Whether to enable separate widec libraries; must be 'true' or 'false'
20#
21# TODO: remove this variable when widec is supported in every setup?
22ENABLE_WIDEC ?= "true"
23
24# _GNU_SOURCE is required for widec stuff and is detected automatically
25# for target objects. But it must be set manually for native and sdk
26# builds.
27BUILD_CPPFLAGS += "-D_GNU_SOURCE"
28
29# natives don't generally look in base_libdir
30base_libdir_class-native = "${libdir}"
31
32# Display corruption occurs on 64 bit hosts without these settings
33# This was derrived from the upstream debian ncurses which uses
34# these settings for 32 and 64 bit hosts.
35EXCONFIG_ARGS = ""
36EXCONFIG_ARGS_class-native = " \
37 --disable-lp64 \
38 --with-chtype='long' \
39 --with-mmask-t='long'"
40EXCONFIG_ARGS_class-nativesdk = " \
41 --disable-lp64 \
42 --with-chtype='long' \
43 --with-mmask-t='long'"
44
45PACKAGES_DYNAMIC = "^${PN}-lib.*"
46
47# Fall back to the host termcap / terminfo for -nativesdk and -native
48# The reality is a work around for strange problems with things like
49# "bitbake -c menuconfig busybox" where it cannot find the terminfo
50# because the sstate had a hard coded search path. Until this is fixed
51# another way this is deemed good enough.
52EX_TERMCAP = ""
53EX_TERMCAP_class-native = ":/etc/termcap:/usr/share/misc/termcap"
54EX_TERMCAP_class-nativesdk = ":/etc/termcap:/usr/share/misc/termcap"
55EX_TERMINFO = ""
56EX_TERMINFO_class-native = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
57EX_TERMINFO_class-nativesdk = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
58
59# Helper function for do_configure to allow multiple configurations
60# $1 the directory to run configure in
61# $@ the arguments to pass to configure
62ncurses_configure() {
63 mkdir -p $1
64 cd $1
65 shift
66 oe_runconf \
67 --disable-static \
68 --without-debug \
69 --without-ada \
70 --without-gpm \
71 --enable-hard-tabs \
72 --enable-xmc-glitch \
73 --enable-colorfgbg \
74 --with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap${EX_TERMCAP}' \
75 --with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo${EX_TERMINFO}' \
76 --with-shared \
77 --disable-big-core \
78 --program-prefix= \
79 --with-ticlib \
80 --with-termlib=tinfo \
81 --enable-sigwinch \
82 --enable-pc-files \
83 --disable-rpath-hack \
84 ${EXCONFIG_ARGS} \
85 --with-manpage-format=normal \
86 "$@" || return 1
87 cd ..
88}
89
90# Override the function from the autotools class; ncurses requires a
91# patched autoconf213 to generate the configure script. This autoconf
92# is not available so that the shipped script will be used.
93do_configure() {
94 # check does not work with cross-compiling and is generally
95 # broken because it requires stdin to be pollable (which is
96 # not the case for /dev/null redirections)
97 export cf_cv_working_poll=yes
98
99 ( cd ${S}; gnu-configize --force )
100 ncurses_configure "narrowc" || \
101 return 1
102 ! ${ENABLE_WIDEC} || \
103 ncurses_configure "widec" "--enable-widec" "--without-progs"
104}
105
106do_compile() {
107 oe_runmake -C narrowc libs
108 oe_runmake -C narrowc/progs
109
110 ! ${ENABLE_WIDEC} || \
111 oe_runmake -C widec libs
112}
113
114# set of expected differences between narrowc and widec header
115#
116# TODO: the NCURSES_CH_T difference can cause real problems :(
117_unifdef_cleanup = " \
118 -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \
119 -e '/^#define NCURSES_CH_T /d' \
120 -e '/^#include <wchar.h>/d' \
121 -e '\!^/\* .* \*/!d' \
122"
123
124do_test[depends] = "unifdef-native:do_populate_sysroot"
125do_test[dirs] = "${S}"
126do_test() {
127 ${ENABLE_WIDEC} || return 0
128
129 # make sure that the narrow and widec header are compatible
130 # and differ only in minor details.
131 unifdef -k narrowc/include/curses.h | \
132 sed ${_unifdef_cleanup} > curses-narrowc.h
133 unifdef -k widec/include/curses.h | \
134 sed ${_unifdef_cleanup} > curses-widec.h
135
136 diff curses-narrowc.h curses-widec.h
137}
138
139# Split original _install_opts to two parts.
140# One is the options to install contents, the other is the parameters \
141# when running command "make install"
142_install_opts = "\
143 install.libs install.includes install.man \
144"
145_install_cfgs = "\
146 DESTDIR='${D}' \
147 PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
148"
149
150do_install() {
151 # Order of installation is important; widec installs a 'curses.h'
152 # header with more definitions and must be installed last hence.
153 # Compatibility of these headers will be checked in 'do_test()'.
154 oe_runmake -C narrowc ${_install_cfgs} ${_install_opts} \
155 install.progs
156
157 # The install.data should run after install.libs, otherwise
158 # there would be a race issue in a very critical conditon, since
159 # tic will be run by install.data, and tic needs libtinfo.so
160 # which would be regenerated by install.libs.
161 oe_runmake -C narrowc ${_install_cfgs} \
162 install.data
163
164
165 ! ${ENABLE_WIDEC} || \
166 oe_runmake -C widec ${_install_cfgs} ${_install_opts}
167
168 cd narrowc
169
170 # include some basic terminfo files
171 # stolen ;) from gentoo and modified a bit
172 for x in ansi console dumb linux rxvt screen sun vt52 vt100 vt102 vt200 vt220 xterm-color xterm-xfree86 xterm-256color
173 do
174 local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
175 local basedir="$(basename $(dirname "${termfile}"))"
176
177 if [ -n "${termfile}" ]
178 then
179 install -d ${D}${sysconfdir}/terminfo/${basedir}
180 mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
181 ln -s /etc/terminfo/${basedir}/${x} \
182 ${D}${datadir}/terminfo/${basedir}/${x}
183 fi
184 done
185 # i think we can use xterm-color as default xterm
186 if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
187 then
188 ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
189 fi
190
191 rm -f ${D}${libdir}/terminfo
192
193 # create linker scripts for libcurses.so and libncurses to
194 # link against -ltinfo when needed. Some builds might break
195 # else when '-Wl,--no-copy-dt-needed-entries' has been set in
196 # linker flags.
197 for i in libncurses libncursesw; do
198 f=${D}${libdir}/$i.so
199 test -h $f || continue
200 rm -f $f
201 echo '/* GNU ld script */' >$f
202 echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f
203 done
204
205 # Make sure that libcurses is linked so that it gets -ltinfo
206 # also, this should be addressed upstream really.
207 ln -sf libncurses.so ${D}${libdir}/libcurses.so
208
209 # create libtermcap.so linker script for backward compatibility
210 f=${D}${libdir}/libtermcap.so
211 echo '/* GNU ld script */' >$f
212 echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f
213
214 if [ ! -d "${D}${base_libdir}" ]; then
215 # Setting base_libdir to libdir as is done in the -native
216 # case will skip this code
217 mkdir ${D}${base_libdir}
218 mv ${D}${libdir}/libncurses.so.* ${D}${base_libdir}
219 ! ${ENABLE_WIDEC} || \
220 mv ${D}${libdir}/libncursesw.so.* ${D}${base_libdir}
221
222 mv ${D}${libdir}/libtinfo.so.* ${D}${base_libdir}
223 rm ${D}${libdir}/libtinfo.so
224
225 # Use lnr to ensure this is a relative link despite absolute paths
226 # (as we can't know the relationship between base_libdir and libdir).
227 # At some point we can rely on coreutils 8.16 which has ln -r.
228 lnr ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so
229 fi
230
231 oe_multilib_header curses.h
232}
233
234python populate_packages_prepend () {
235 libdir = d.expand("${libdir}")
236 base_libdir = d.expand("${base_libdir}")
237 pnbase = d.expand("${PN}-lib%s")
238 do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
239 if libdir is not base_libdir:
240 do_split_packages(d, base_libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
241}
242
243
244inherit update-alternatives
245
246ALTERNATIVE_PRIORITY = "100"
247
248ALTERNATIVE_ncurses-tools_class-target = "clear reset"
249
250BBCLASSEXTEND = "native nativesdk"
251
252PACKAGES += " \
253 ${PN}-tools \
254 ${PN}-terminfo \
255 ${PN}-terminfo-base \
256"
257
258FILES_${PN} = "\
259 ${bindir}/tput \
260 ${bindir}/tset \
261 ${bindir}/ncurses5-config \
262 ${bindir}/ncursesw5-config \
263 ${datadir}/tabset \
264"
265
266# This keeps only tput/tset in ncurses
267# clear/reset are in already busybox
268FILES_${PN}-tools = "\
269 ${bindir}/tic \
270 ${bindir}/toe \
271 ${bindir}/infotocap \
272 ${bindir}/captoinfo \
273 ${bindir}/infocmp \
274 ${bindir}/clear${@['', '.${BPN\x7d']['${CLASSOVERRIDE}' == 'class-target']} \
275 ${bindir}/reset${@['', '.${BPN\x7d']['${CLASSOVERRIDE}' == 'class-target']} \
276 ${bindir}/tack \
277 ${bindir}/tabs \
278"
279
280# 'reset' is a symlink to 'tset' which is in the 'ncurses' package
281RDEPENDS_${PN}-tools = "${PN}"
282
283FILES_${PN}-terminfo = "\
284 ${datadir}/terminfo \
285"
286
287FILES_${PN}-terminfo-base = "\
288 ${sysconfdir}/terminfo \
289"
290
291RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo"
292RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base"
diff --git a/meta/recipes-core/ncurses/ncurses_5.9.bb b/meta/recipes-core/ncurses/ncurses_5.9.bb
new file mode 100644
index 0000000000..6d23c0c7ea
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses_5.9.bb
@@ -0,0 +1,10 @@
1require ncurses.inc
2
3PR = "${INC_PR}.1"
4
5SRC_URI += "file://tic-hang.patch \
6 file://config.cache \
7"
8
9SRC_URI[md5sum] = "8cb9c412e5f2d96bc6f459aa8c6282a1"
10SRC_URI[sha256sum] = "9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b"
diff --git a/meta/recipes-core/ncurses/site_config/headers b/meta/recipes-core/ncurses/site_config/headers
new file mode 100644
index 0000000000..087b7bfd5e
--- /dev/null
+++ b/meta/recipes-core/ncurses/site_config/headers
@@ -0,0 +1,5 @@
1curses.h
2ncurses/curses.h
3ncurses.h
4ncurses/termcap.h
5
diff --git a/meta/recipes-core/netbase/netbase/hosts b/meta/recipes-core/netbase/netbase/hosts
new file mode 100644
index 0000000000..2f332451b5
--- /dev/null
+++ b/meta/recipes-core/netbase/netbase/hosts
@@ -0,0 +1,2 @@
1127.0.0.1 localhost.localdomain localhost
2
diff --git a/meta/recipes-core/netbase/netbase_5.2.bb b/meta/recipes-core/netbase/netbase_5.2.bb
new file mode 100644
index 0000000000..ab7ae6527c
--- /dev/null
+++ b/meta/recipes-core/netbase/netbase_5.2.bb
@@ -0,0 +1,23 @@
1SUMMARY = "Basic TCP/IP networking support"
2DESCRIPTION = "This package provides the necessary infrastructure for basic TCP/IP based networking"
3HOMEPAGE = "http://packages.debian.org/netbase"
4SECTION = "base"
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
7PE = "1"
8
9SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
10 file://hosts"
11
12SRC_URI[md5sum] = "3a01bfce6a28e1743412198abd241262"
13SRC_URI[sha256sum] = "d62ba56d62b9b121664828175c2a237a7014ef32df8a4116ea33cff332de3307"
14
15do_install () {
16 install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
17 install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
18 install -m 0644 etc-rpc ${D}${sysconfdir}/rpc
19 install -m 0644 etc-protocols ${D}${sysconfdir}/protocols
20 install -m 0644 etc-services ${D}${sysconfdir}/services
21}
22
23CONFFILES_${PN} = "${sysconfdir}/hosts"
diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
new file mode 100644
index 0000000000..0c6a530be6
--- /dev/null
+++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -0,0 +1,33 @@
1#
2# Copyright (C) 2007 OpenedHand Ltd
3#
4
5SUMMARY = "Host packages for the standalone SDK or external toolchain"
6PR = "r12"
7LICENSE = "MIT"
8
9inherit packagegroup nativesdk
10
11PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
12
13RDEPENDS_${PN} = "\
14 nativesdk-pkgconfig \
15 nativesdk-qemu \
16 nativesdk-qemu-helper \
17 nativesdk-pseudo \
18 nativesdk-unfs3 \
19 nativesdk-opkg \
20 nativesdk-libtool \
21 nativesdk-autoconf \
22 nativesdk-automake \
23 nativesdk-shadow \
24 nativesdk-makedevs \
25 nativesdk-smartpm \
26 nativesdk-postinst-intercept \
27 "
28
29RDEPENDS_${PN}_darwin = "\
30 nativesdk-pkgconfig \
31 nativesdk-opkg \
32 nativesdk-libtool \
33 "
diff --git a/meta/recipes-core/packagegroups/packagegroup-base.bb b/meta/recipes-core/packagegroups/packagegroup-base.bb
new file mode 100644
index 0000000000..368c318f01
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-base.bb
@@ -0,0 +1,373 @@
1SUMMARY = "Merge machine and distro options to create a basic machine task/package"
2LICENSE = "MIT"
3PR = "r83"
4
5inherit packagegroup
6
7PROVIDES = "${PACKAGES}"
8PACKAGES = ' \
9 packagegroup-base \
10 packagegroup-base-extended \
11 packagegroup-distro-base \
12 packagegroup-machine-base \
13 \
14 ${@base_contains("MACHINE_FEATURES", "acpi", "packagegroup-base-acpi", "",d)} \
15 ${@base_contains("MACHINE_FEATURES", "alsa", "packagegroup-base-alsa", "", d)} \
16 ${@base_contains("MACHINE_FEATURES", "apm", "packagegroup-base-apm", "", d)} \
17 ${@base_contains("MACHINE_FEATURES", "ext2", "packagegroup-base-ext2", "", d)} \
18 ${@base_contains("MACHINE_FEATURES", "vfat", "packagegroup-base-vfat", "", d)} \
19 ${@base_contains("MACHINE_FEATURES", "irda", "packagegroup-base-irda", "",d)} \
20 ${@base_contains("MACHINE_FEATURES", "keyboard", "packagegroup-base-keyboard", "", d)} \
21 ${@base_contains("MACHINE_FEATURES", "pci", "packagegroup-base-pci", "",d)} \
22 ${@base_contains("MACHINE_FEATURES", "pcmcia", "packagegroup-base-pcmcia", "", d)} \
23 ${@base_contains("MACHINE_FEATURES", "phone", "packagegroup-base-phone", "", d)} \
24 ${@base_contains("MACHINE_FEATURES", "serial", "packagegroup-base-serial", "", d)} \
25 ${@base_contains("MACHINE_FEATURES", "usbgadget", "packagegroup-base-usbgadget", "", d)} \
26 ${@base_contains("MACHINE_FEATURES", "usbhost", "packagegroup-base-usbhost", "", d)} \
27 \
28 ${@base_contains("DISTRO_FEATURES", "bluetooth", "packagegroup-base-bluetooth", "", d)} \
29 ${@base_contains("DISTRO_FEATURES", "wifi", "packagegroup-base-wifi", "", d)} \
30 ${@base_contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "", d)} \
31 ${@base_contains("DISTRO_FEATURES", "nfc", "packagegroup-base-nfc", "", d)} \
32 ${@base_contains("DISTRO_FEATURES", "cramfs", "packagegroup-base-cramfs", "", d)} \
33 ${@base_contains("DISTRO_FEATURES", "ipsec", "packagegroup-base-ipsec", "", d)} \
34 ${@base_contains("DISTRO_FEATURES", "ipv6", "packagegroup-base-ipv6", "", d)} \
35 ${@base_contains("DISTRO_FEATURES", "nfs", "packagegroup-base-nfs", "", d)} \
36 ${@base_contains("DISTRO_FEATURES", "ppp", "packagegroup-base-ppp", "", d)} \
37 ${@base_contains("DISTRO_FEATURES", "smbfs", "packagegroup-base-smbfs", "", d)} \
38 ${@base_contains("DISTRO_FEATURES", "zeroconf", "packagegroup-base-zeroconf", "", d)} \
39 \
40 '
41
42#
43# packages which content depend on MACHINE_FEATURES need to be MACHINE_ARCH
44#
45PACKAGE_ARCH = "${MACHINE_ARCH}"
46
47# Override by distro if needed
48VIRTUAL-RUNTIME_keymaps ?= "keymaps"
49
50#
51# packagegroup-base contain stuff needed for base system (machine related)
52#
53RDEPENDS_packagegroup-base = "\
54 packagegroup-distro-base \
55 packagegroup-machine-base \
56 \
57 sysfsutils \
58 module-init-tools \
59 ${@base_contains('MACHINE_FEATURES', 'apm', 'packagegroup-base-apm', '',d)} \
60 ${@base_contains('MACHINE_FEATURES', 'acpi', 'packagegroup-base-acpi', '',d)} \
61 ${@base_contains('MACHINE_FEATURES', 'keyboard', 'packagegroup-base-keyboard', '',d)} \
62 ${@base_contains('MACHINE_FEATURES', 'phone', 'packagegroup-base-phone', '',d)} \
63 \
64 ${@base_contains('COMBINED_FEATURES', 'alsa', 'packagegroup-base-alsa', '',d)} \
65 ${@base_contains('COMBINED_FEATURES', 'ext2', 'packagegroup-base-ext2', '',d)} \
66 ${@base_contains('COMBINED_FEATURES', 'vfat', 'packagegroup-base-vfat', '',d)} \
67 ${@base_contains('COMBINED_FEATURES', 'irda', 'packagegroup-base-irda', '',d)} \
68 ${@base_contains('COMBINED_FEATURES', 'pci', 'packagegroup-base-pci', '',d)} \
69 ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'packagegroup-base-pcmcia', '',d)} \
70 ${@base_contains('COMBINED_FEATURES', 'usbgadget', 'packagegroup-base-usbgadget', '',d)} \
71 ${@base_contains('COMBINED_FEATURES', 'usbhost', 'packagegroup-base-usbhost', '',d)} \
72 ${@base_contains('COMBINED_FEATURES', 'bluetooth', 'packagegroup-base-bluetooth', '',d)} \
73 ${@base_contains('COMBINED_FEATURES', 'wifi', 'packagegroup-base-wifi', '',d)} \
74 ${@base_contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g', '',d)} \
75 ${@base_contains('COMBINED_FEATURES', 'nfc', 'packagegroup-base-nfc', '',d)} \
76 \
77 ${@base_contains('DISTRO_FEATURES', 'nfs', 'packagegroup-base-nfs', '',d)} \
78 ${@base_contains('DISTRO_FEATURES', 'cramfs', 'packagegroup-base-cramfs', '',d)} \
79 ${@base_contains('DISTRO_FEATURES', 'smbfs', 'packagegroup-base-smbfs', '',d)} \
80 ${@base_contains('DISTRO_FEATURES', 'ipv6', 'packagegroup-base-ipv6', '',d)} \
81 ${@base_contains('DISTRO_FEATURES', 'ipsec', 'packagegroup-base-ipsec', '',d)} \
82 ${@base_contains('DISTRO_FEATURES', 'ppp', 'packagegroup-base-ppp', '',d)} \
83 ${@base_contains('DISTRO_FEATURES', 'zeroconf', 'packagegroup-base-zeroconf', '',d)} \
84 "
85
86
87RRECOMMENDS_packagegroup-base = "\
88 kernel-module-nls-utf8 \
89 kernel-module-input \
90 kernel-module-uinput \
91 kernel-module-rtc-dev \
92 kernel-module-rtc-proc \
93 kernel-module-rtc-sysfs \
94 kernel-module-unix"
95
96RDEPENDS_packagegroup-base-extended = "\
97 packagegroup-base \
98 ${ADD_WIFI} \
99 ${ADD_BT} \
100 ${ADD_3G} \
101 ${ADD_NFC} \
102 "
103
104ADD_WIFI = ""
105ADD_BT = ""
106ADD_3G = ""
107ADD_NFC = ""
108
109python __anonymous () {
110 # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them)
111 # then include packagegroup-base-wifi in packagegroup-base
112
113 distro_features = set(d.getVar("DISTRO_FEATURES", True).split())
114 machine_features= set(d.getVar("MACHINE_FEATURES", True).split())
115
116 if "bluetooth" in distro_features and not "bluetooth" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
117 d.setVar("ADD_BT", "packagegroup-base-bluetooth")
118
119 if "wifi" in distro_features and not "wifi" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
120 d.setVar("ADD_WIFI", "packagegroup-base-wifi")
121
122 if "3g" in distro_features and not "3g" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
123 d.setVar("ADD_3G", "packagegroup-base-3g")
124
125 if "nfc" in distro_features and not "nfc" in machine_features and ("usbhost" in machine_features):
126 d.setVar("ADD_NFC", "packagegroup-base-nfc")
127
128 # For backwards compatibility after rename
129 packages = d.getVar("PACKAGES", True).split()
130 for pkg in packages:
131 d.appendVar("RPROVIDES_%s" % pkg, pkg.replace("packagegroup-", "task-"))
132 d.appendVar("RREPLACES_%s" % pkg, pkg.replace("packagegroup-", "task-"))
133 d.appendVar("RCONFLICTS_%s" % pkg, pkg.replace("packagegroup-", "task-"))
134}
135
136#
137# packages added by distribution
138#
139SUMMARY_packagegroup-distro-base = "${DISTRO} extras"
140DEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_DEPENDS}"
141RDEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RDEPENDS}"
142RRECOMMENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RRECOMMENDS}"
143
144#
145# packages added by machine config
146#
147SUMMARY_packagegroup-machine-base = "${MACHINE} extras"
148SUMMARY_packagegroup-machine-base = "Extra packages required to fully support ${MACHINE} hardware"
149RDEPENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RDEPENDS}"
150RRECOMMENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RRECOMMENDS}"
151
152SUMMARY_packagegroup-base-keyboard = "Keyboard support"
153RDEPENDS_packagegroup-base-keyboard = "\
154 ${VIRTUAL-RUNTIME_keymaps}"
155
156SUMMARY_packagegroup-base-pci = "PCI bus support"
157RDEPENDS_packagegroup-base-pci = "\
158 pciutils"
159
160SUMMARY_packagegroup-base-acpi = "ACPI support"
161RDEPENDS_packagegroup-base-acpi = "\
162 acpid \
163 libacpi "
164
165SUMMARY_packagegroup-base-apm = "APM support"
166RDEPENDS_packagegroup-base-apm = "\
167 ${VIRTUAL-RUNTIME_apm} \
168 apmd"
169
170SUMMARY_packagegroup-base-ext2 = "ext2 filesystem support"
171RDEPENDS_packagegroup-base-ext2 = "\
172 hdparm \
173 e2fsprogs \
174 e2fsprogs-e2fsck \
175 e2fsprogs-mke2fs"
176
177SUMMARY_packagegroup-base-vfat = "FAT filesystem support"
178RRECOMMENDS_packagegroup-base-vfat = "\
179 kernel-module-msdos \
180 kernel-module-vfat \
181 kernel-module-nls-iso8859-1 \
182 kernel-module-nls-cp437 \
183 dosfstools"
184
185SUMMARY_packagegroup-base-alsa = "ALSA sound support"
186RDEPENDS_packagegroup-base-alsa = "\
187 alsa-utils-alsactl \
188 alsa-utils-alsamixer \
189 ${VIRTUAL-RUNTIME_alsa-state}"
190
191RRECOMMENDS_packagegroup-base-alsa = "\
192 kernel-module-snd-mixer-oss \
193 kernel-module-snd-pcm-oss"
194
195SUMMARY_packagegroup-base-pcmcia = "PC card slot support"
196RDEPENDS_packagegroup-base-pcmcia = "\
197 pcmciautils \
198 "
199
200RRECOMMENDS_packagegroup-base-pcmcia = "\
201 kernel-module-pcmcia \
202 kernel-module-airo-cs \
203 kernel-module-pcnet-cs \
204 kernel-module-serial-cs \
205 kernel-module-ide-cs \
206 kernel-module-ide-disk \
207 ${@base_contains('DISTRO_FEATURES', 'wifi', 'kernel-module-hostap-cs', '',d)} \
208 ${@base_contains('DISTRO_FEATURES', 'wifi', 'kernel-module-orinoco-cs', '',d)} \
209 ${@base_contains('DISTRO_FEATURES', 'wifi', 'kernel-module-spectrum-cs', '',d)}"
210
211SUMMARY_packagegroup-base-bluetooth = "Bluetooth support"
212RDEPENDS_packagegroup-base-bluetooth = "\
213 bluez4 \
214 ${@base_contains('COMBINED_FEATURES', 'alsa', 'libasound-module-bluez', '',d)} \
215 "
216
217RRECOMMENDS_packagegroup-base-bluetooth = "\
218 kernel-module-bluetooth \
219 kernel-module-l2cap \
220 kernel-module-rfcomm \
221 kernel-module-hci-vhci \
222 kernel-module-bnep \
223 kernel-module-hidp \
224 kernel-module-hci-uart \
225 kernel-module-sco \
226 ${@base_contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-hci-usb', '',d)} \
227 ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetooth3c-cs', '',d)} \
228 ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluecard-cs', '',d)} \
229 ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetoothuart-cs', '',d)} \
230 ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-dtl1-cs', '',d)} \
231 "
232
233SUMMARY_packagegroup-base-irda = "IrDA support"
234RDEPENDS_packagegroup-base-irda = "\
235 irda-utils"
236
237RRECOMMENDS_packagegroup-base-irda = "\
238 kernel-module-pxaficp-ir \
239 kernel-module-irda \
240 kernel-module-ircomm \
241 kernel-module-ircomm-tty \
242 kernel-module-irlan \
243 ${@base_contains('DISTRO_FEATURES', 'ppp', 'kernel-module-irnet', '',d)} \
244 kernel-module-irport \
245 kernel-module-irtty \
246 kernel-module-irtty-sir \
247 kernel-module-sir-dev \
248 ${@base_contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-ir-usb', '',d)} "
249
250SUMMARY_packagegroup-base-usbgadget = "USB gadget support"
251RRECOMMENDS_packagegroup-base-usbgadget = "\
252 kernel-module-pxa27x_udc \
253 kernel-module-gadgetfs \
254 kernel-module-g-file-storage \
255 kernel-module-g-serial \
256 kernel-module-g-ether"
257
258SUMMARY_packagegroup-base-usbhost = "USB host support"
259RDEPENDS_packagegroup-base-usbhost = "\
260 usbutils "
261
262RRECOMMENDS_packagegroup-base-usbhost = "\
263 kernel-module-uhci-hcd \
264 kernel-module-ohci-hcd \
265 kernel-module-ehci-hcd \
266 kernel-module-usbcore \
267 kernel-module-usbhid \
268 kernel-module-usbnet \
269 kernel-module-sd-mod \
270 kernel-module-scsi-mod \
271 kernel-module-usbmouse \
272 kernel-module-mousedev \
273 kernel-module-usbserial \
274 kernel-module-usb-storage "
275
276SUMMARY_packagegroup-base-ppp = "PPP dial-up protocol support"
277RDEPENDS_packagegroup-base-ppp = "\
278 ppp \
279 ppp-dialin"
280
281RRECOMMENDS_packagegroup-base-ppp = "\
282 kernel-module-ppp-async \
283 kernel-module-ppp-deflate \
284 kernel-module-ppp-generic \
285 kernel-module-ppp-mppe \
286 kernel-module-slhc"
287
288SUMMARY_packagegroup-base-ipsec = "IPSEC support"
289RDEPENDS_packagegroup-base-ipsec = "\
290 "
291
292RRECOMMENDS_packagegroup-base-ipsec = "\
293 kernel-module-ipsec"
294
295#
296# packagegroup-base-wifi contain everything needed to get WiFi working
297# WEP/WPA connection needs to be supported out-of-box
298#
299SUMMARY_packagegroup-base-wifi = "WiFi support"
300RDEPENDS_packagegroup-base-wifi = "\
301 wireless-tools \
302 ${@base_contains('COMBINED_FEATURES', 'pcmcia', 'hostap-utils', '',d)} \
303 ${@base_contains('COMBINED_FEATURES', 'pci', 'hostap-utils', '',d)} \
304 wpa-supplicant"
305
306RRECOMMENDS_packagegroup-base-wifi = "\
307 ${@base_contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-zd1211rw', '',d)} \
308 kernel-module-ieee80211-crypt \
309 kernel-module-ieee80211-crypt-ccmp \
310 kernel-module-ieee80211-crypt-tkip \
311 kernel-module-ieee80211-crypt-wep \
312 kernel-module-ecb \
313 kernel-module-arc4 \
314 kernel-module-crypto_algapi \
315 kernel-module-cryptomgr \
316 kernel-module-michael-mic \
317 kernel-module-aes-generic \
318 kernel-module-aes"
319
320SUMMARY_packagegroup-base-nfc = "Near Field Communication support"
321RDEPENDS_packagegroup-base-nfc = "\
322 neard"
323
324RRECOMMENDS_packagegroup-base-nfc = "\
325 kernel-module-nfc"
326
327SUMMARY_packagegroup-base-3g = "Cellular data support"
328RDEPENDS_packagegroup-base-3g = "\
329 ofono"
330
331RRECOMMENDS_packagegroup-base-3g = "\
332 kernel-module-cdc-acm \
333 kernel-module-cdc-wdm"
334
335SUMMARY_packagegroup-base-smbfs = "SMB network filesystem support"
336RRECOMMENDS_packagegroup-base-smbfs = "\
337 kernel-module-cifs \
338 kernel-module-smbfs"
339
340SUMMARY_packagegroup-base-cramfs = "cramfs filesystem support"
341RRECOMMENDS_packagegroup-base-cramfs = "\
342 kernel-module-cramfs"
343
344#
345# packagegroup-base-nfs provides ONLY client support - server is in nfs-utils package
346#
347SUMMARY_packagegroup-base-nfs = "NFS network filesystem support"
348RDEPENDS_packagegroup-base-nfs = "\
349 rpcbind"
350
351RRECOMMENDS_packagegroup-base-nfs = "\
352 kernel-module-nfs "
353
354SUMMARY_packagegroup-base-zeroconf = "Zeroconf support"
355RDEPENDS_packagegroup-base-zeroconf = "\
356 libnss-mdns \
357 avahi-daemon"
358
359SUMMARY_packagegroup-base-ipv6 = "IPv6 support"
360RDEPENDS_packagegroup-base-ipv6 = "\
361 "
362
363RRECOMMENDS_packagegroup-base-ipv6 = "\
364 kernel-module-ipv6 "
365
366SUMMARY_packagegroup-base-serial = "Serial port support"
367RDEPENDS_packagegroup-base-serial = "\
368 setserial \
369 lrzsz "
370
371SUMMARY_packagegroup-base-phone = "Cellular telephony (voice) support"
372RDEPENDS_packagegroup-base-phone = "\
373 ofono"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-boot.bb b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
new file mode 100644
index 0000000000..1154bc05b5
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
@@ -0,0 +1,52 @@
1#
2# Copyright (C) 2007 OpenedHand Ltd.
3#
4
5SUMMARY = "Minimal boot requirements"
6DESCRIPTION = "The minimal set of packages required to boot the system"
7LICENSE = "MIT"
8PR = "r17"
9
10inherit packagegroup
11
12PACKAGE_ARCH = "${MACHINE_ARCH}"
13
14#
15# Set by the machine configuration with packages essential for device bootup
16#
17MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
18MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
19
20# For backwards compatibility after rename
21RPROVIDES_${PN} = "task-core-boot"
22RREPLACES_${PN} = "task-core-boot"
23RCONFLICTS_${PN} = "task-core-boot"
24
25# Distro can override the following VIRTUAL-RUNTIME providers:
26VIRTUAL-RUNTIME_dev_manager ?= "udev"
27VIRTUAL-RUNTIME_login_manager ?= "busybox"
28VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
29VIRTUAL-RUNTIME_initscripts ?= "initscripts"
30VIRTUAL-RUNTIME_keymaps ?= "keymaps"
31
32SYSVINIT_SCRIPTS = "${@base_contains('MACHINE_FEATURES', 'rtc', 'busybox-hwclock', '', d)} \
33 modutils-initscripts \
34 init-ifupdown \
35 "
36
37RDEPENDS_${PN} = "\
38 base-files \
39 base-passwd \
40 busybox \
41 ${@base_contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \
42 ${@base_contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
43 netbase \
44 ${VIRTUAL-RUNTIME_login_manager} \
45 ${VIRTUAL-RUNTIME_init_manager} \
46 ${VIRTUAL-RUNTIME_initscripts} \
47 ${VIRTUAL-RUNTIME_dev_manager} \
48 ${VIRTUAL-RUNTIME_update-alternatives} \
49 ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"
50
51RRECOMMENDS_${PN} = "\
52 ${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
new file mode 100644
index 0000000000..74ed247512
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
@@ -0,0 +1,29 @@
1#
2# Copyright (C) 2007 OpenedHand Ltd.
3# Copyright (C) 2012 Red Hat, Inc.
4#
5
6SUMMARY = "Essential build dependencies"
7LICENSE = "MIT"
8
9inherit packagegroup
10
11RDEPENDS_packagegroup-core-buildessential = "\
12 autoconf \
13 automake \
14 binutils \
15 binutils-symlinks \
16 cpp \
17 cpp-symlinks \
18 gcc \
19 gcc-symlinks \
20 g++ \
21 g++-symlinks \
22 gettext \
23 make \
24 libstdc++ \
25 libstdc++-dev \
26 libtool \
27 pkgconfig \
28 "
29
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb b/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
new file mode 100644
index 0000000000..e7b013d406
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
@@ -0,0 +1,10 @@
1SUMMARY = "Remote debugging tools for Eclipse integration"
2LICENSE = "MIT"
3
4inherit packagegroup
5
6RDEPENDS_${PN} = "\
7 gdbserver \
8 tcf-agent \
9 openssh-sftp-server \
10 "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb b/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
new file mode 100644
index 0000000000..24c98c4938
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
@@ -0,0 +1,22 @@
1#
2# Copyright (C) 2008 OpenedHand Ltd.
3#
4
5SUMMARY = "NFS package groups"
6LICENSE = "MIT"
7PR = "r2"
8
9inherit packagegroup
10
11PACKAGES = "${PN}-server"
12
13# For backwards compatibility after rename
14RPROVIDES_${PN}-server = "task-core-nfs-server"
15RREPLACES_${PN}-server = "task-core-nfs-server"
16RCONFLICTS_${PN}-server = "task-core-nfs-server"
17
18SUMMARY_${PN}-server = "NFS server"
19RDEPENDS_${PN}-server = "\
20 nfs-utils \
21 nfs-utils-client \
22 "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
new file mode 100644
index 0000000000..172398929c
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
@@ -0,0 +1,77 @@
1#
2# Copyright (C) 2007 OpenedHand Ltd.
3#
4
5SUMMARY = "Software development tools"
6LICENSE = "MIT"
7PR = "r9"
8
9inherit packagegroup
10
11#PACKAGEFUNCS =+ 'generate_sdk_pkgs'
12
13# For backwards compatibility after rename
14RPROVIDES_packagegroup-core-sdk = "task-core-sdk"
15RREPLACES_packagegroup-core-sdk = "task-core-sdk"
16RCONFLICTS_packagegroup-core-sdk = "task-core-sdk"
17
18RDEPENDS_packagegroup-core-sdk = "\
19 packagegroup-core-buildessential \
20 coreutils \
21 ccache \
22 diffutils \
23 intltool \
24 perl-module-re \
25 perl-module-text-wrap \
26 findutils \
27 quilt \
28 less \
29 distcc \
30 ldd \
31 file \
32 tcl"
33
34RRECOMMENDS_packagegroup-core-sdk = "\
35 libgomp \
36 libgomp-dev"
37
38#python generate_sdk_pkgs () {
39# poky_pkgs = read_pkgdata('packagegroup-core', d)['PACKAGES']
40# pkgs = d.getVar('PACKAGES', True).split()
41# for pkg in poky_pkgs.split():
42# newpkg = pkg.replace('packagegroup-core', 'packagegroup-core-sdk')
43#
44# # for each of the task packages, add a corresponding sdk task
45# pkgs.append(newpkg)
46#
47# # for each sdk task, take the rdepends of the non-sdk task, and turn
48# # that into rrecommends upon the -dev versions of those, not unlike
49# # the package depchain code
50# spkgdata = read_subpkgdata(pkg, d)
51#
52# rdepends = explode_deps(spkgdata.get('RDEPENDS_%s' % pkg) or '')
53# rreclist = []
54#
55# for depend in rdepends:
56# split_depend = depend.split(' (')
57# name = split_depend[0].strip()
58# if packaged('%s-dev' % name, d):
59# rreclist.append('%s-dev' % name)
60# else:
61# deppkgdata = read_subpkgdata(name, d)
62# rdepends2 = explode_deps(deppkgdata.get('RDEPENDS_%s' % name) or '')
63# for depend in rdepends2:
64# split_depend = depend.split(' (')
65# name = split_depend[0].strip()
66# if packaged('%s-dev' % name, d):
67# rreclist.append('%s-dev' % name)
68#
69# oldrrec = d.getVar('RRECOMMENDS_%s' % newpkg) or ''
70# d.setVar('RRECOMMENDS_%s' % newpkg, oldrrec + ' ' + ' '.join(rreclist))
71# # bb.note('RRECOMMENDS_%s = "%s"' % (newpkg, d.getVar('RRECOMMENDS_%s' % newpkg)))
72#
73# # bb.note('pkgs is %s' % pkgs)
74# d.setVar('PACKAGES', ' '.join(pkgs))
75#}
76#
77#PACKAGES_DYNAMIC += "^packagegroup-core-sdk-.*"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb b/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
new file mode 100644
index 0000000000..458d8fa036
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
@@ -0,0 +1,12 @@
1SUMMARY = "Dropbear SSH client/server"
2LICENSE = "MIT"
3PR = "r1"
4
5inherit packagegroup
6
7# For backwards compatibility after rename
8RPROVIDES_${PN} = "task-core-ssh-dropbear"
9RREPLACES_${PN} = "task-core-ssh-dropbear"
10RCONFLICTS_${PN} = "task-core-ssh-dropbear"
11
12RDEPENDS_${PN} = "dropbear"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb b/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
new file mode 100644
index 0000000000..df70962912
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
@@ -0,0 +1,12 @@
1SUMMARY = "OpenSSH SSH client/server"
2LICENSE = "MIT"
3PR = "r1"
4
5inherit packagegroup
6
7# For backwards compatibility after rename
8RPROVIDES_${PN} = "task-core-ssh-openssh"
9RREPLACES_${PN} = "task-core-ssh-openssh"
10RCONFLICTS_${PN} = "task-core-ssh-openssh"
11
12RDEPENDS_${PN} = "openssh"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb b/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
new file mode 100644
index 0000000000..3325ef672e
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
@@ -0,0 +1,22 @@
1SUMMARY = "Target packages for the standalone SDK"
2PR = "r8"
3LICENSE = "MIT"
4
5inherit packagegroup
6
7# For backwards compatibility after rename
8RPROVIDES_${PN} = "task-core-standalone-sdk-target"
9RREPLACES_${PN} = "task-core-standalone-sdk-target"
10RCONFLICTS_${PN} = "task-core-standalone-sdk-target"
11RPROVIDES_${PN}-dbg = "task-core-standalone-sdk-target-dbg"
12RREPLACES_${PN}-dbg = "task-core-standalone-sdk-target-dbg"
13RCONFLICTS_${PN}-dbg = "task-core-standalone-sdk-target-dbg"
14
15RDEPENDS_${PN} = "\
16 libgcc \
17 libgcc-dev \
18 libstdc++ \
19 libstdc++-dev \
20 ${LIBC_DEPENDENCIES} \
21 qemuwrapper-cross \
22 "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
new file mode 100644
index 0000000000..f72aae4c9d
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
@@ -0,0 +1,27 @@
1#
2# Copyright (C) 2008 OpenedHand Ltd.
3#
4
5SUMMARY = "Debugging tools"
6LICENSE = "MIT"
7
8inherit packagegroup
9
10PR = "r2"
11
12PACKAGE_ARCH = "${MACHINE_ARCH}"
13
14# For backwards compatibility after rename
15RPROVIDES_${PN} = "task-core-tools-debug"
16RREPLACES_${PN} = "task-core-tools-debug"
17RCONFLICTS_${PN} = "task-core-tools-debug"
18
19MTRACE = ""
20MTRACE_libc-glibc = "libc-mtrace"
21
22RDEPENDS_${PN} = "\
23 gdb \
24 gdbserver \
25 strace \
26 ${MTRACE} \
27 "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
new file mode 100644
index 0000000000..80f3031ff5
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
@@ -0,0 +1,86 @@
1#
2# Copyright (C) 2008 OpenedHand Ltd.
3#
4
5SUMMARY = "Profiling tools"
6LICENSE = "MIT"
7
8PR = "r3"
9
10inherit packagegroup
11
12PACKAGE_ARCH = "${MACHINE_ARCH}"
13
14# For backwards compatibility after rename
15RPROVIDES_${PN} = "task-core-tools-profile"
16RREPLACES_${PN} = "task-core-tools-profile"
17RCONFLICTS_${PN} = "task-core-tools-profile"
18
19PROFILE_TOOLS_X = "${@base_contains('DISTRO_FEATURES', 'x11', 'sysprof', '', d)}"
20PROFILE_TOOLS_SYSTEMD = "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd-analyze', '', d)}"
21
22RRECOMMENDS_${PN} = "\
23 perf \
24 trace-cmd \
25 kernel-module-oprofile \
26 blktrace \
27 ${PROFILE_TOOLS_X} \
28 ${PROFILE_TOOLS_SYSTEMD} \
29 "
30
31PROFILETOOLS = "\
32 oprofile \
33 oprofileui-server \
34 powertop \
35 latencytop \
36 "
37
38# systemtap needs elfutils which is not fully buildable on uclibc
39# hence we exclude it from uclibc based builds
40SYSTEMTAP = "systemtap"
41SYSTEMTAP_libc-uclibc = ""
42SYSTEMTAP_mips = ""
43SYSTEMTAP_mips64 = ""
44SYSTEMTAP_aarch64 = ""
45
46# lttng-ust uses sched_getcpu() which is not there on uclibc
47# for some of the architectures it can be patched to call the
48# syscall directly but for x86_64 __NR_getcpu is a vsyscall
49# which means we can not use syscall() to call it. So we ignore
50# it for x86_64/uclibc
51
52LTTNGUST = "lttng-ust"
53LTTNGUST_libc-uclibc = ""
54LTTNGUST_aarch64 = ""
55
56LTTNGTOOLS = "lttng-tools"
57LTTNGTOOLS_aarch64 = ""
58
59LTTNGMODULES = "lttng-modules"
60LTTNGMODULES_aarch64 = ""
61LTTNGMODULES_arm = ""
62
63BABELTRACE = "babeltrace"
64BABELTRACE_aarch64 = ""
65
66# valgrind does not work on mips
67
68VALGRIND = "valgrind"
69VALGRIND_libc-uclibc = ""
70VALGRIND_mips = ""
71VALGRIND_mips64 = ""
72VALGRIND_arm = ""
73VALGRIND_aarch64 = ""
74
75# exmap-console
76# exmap-server
77
78RDEPENDS_${PN} = "\
79 ${PROFILETOOLS} \
80 ${LTTNGUST} \
81 ${LTTNGTOOLS} \
82 ${LTTNGMODULES} \
83 ${BABELTRACE} \
84 ${SYSTEMTAP} \
85 ${VALGRIND} \
86 "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
new file mode 100644
index 0000000000..952fbd0d1a
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
@@ -0,0 +1,63 @@
1#
2# Copyright (C) 2008 OpenedHand Ltd.
3#
4
5SUMMARY = "Testing tools/applications"
6LICENSE = "MIT"
7
8PR = "r2"
9
10inherit packagegroup
11
12PACKAGE_ARCH = "${MACHINE_ARCH}"
13
14# For backwards compatibility after rename
15RPROVIDES_${PN} = "task-core-tools-testapps"
16RREPLACES_${PN} = "task-core-tools-testapps"
17RCONFLICTS_${PN} = "task-core-tools-testapps"
18
19# kexec-tools doesn't work on Mips
20KEXECTOOLS ?= "kexec"
21KEXECTOOLS_mips ?= ""
22KEXECTOOLS_mipsel ?= ""
23KEXECTOOLS_powerpc ?= ""
24KEXECTOOLS_e5500-64b ?= ""
25KEXECTOOLS_aarch64 ?= ""
26
27X11GLTOOLS = "\
28 mesa-demos \
29 piglit \
30 "
31
323GTOOLS = "\
33 ofono-tests \
34 "
35
36X11TOOLS = "\
37 fstests \
38 owl-video \
39 x11perf \
40 xrestop \
41 xwininfo \
42 xprop \
43 xvideo-tests \
44 "
45
46RDEPENDS_${PN} = "\
47 blktool \
48 tslib-calibrate \
49 tslib-tests \
50 lrzsz \
51 ${KEXECTOOLS} \
52 alsa-utils-amixer \
53 alsa-utils-aplay \
54 gst-meta-video \
55 gst-meta-audio \
56 ltp \
57 connman-tools \
58 connman-tests \
59 connman-client \
60 ${@base_contains('DISTRO_FEATURES', 'x11', "${X11TOOLS}", "", d)} \
61 ${@base_contains('DISTRO_FEATURES', 'x11 opengl', "${X11GLTOOLS}", "", d)} \
62 ${@base_contains('DISTRO_FEATURES', '3g', "${3GTOOLS}", "", d)} \
63 "
diff --git a/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
new file mode 100644
index 0000000000..e3b1c18fa9
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
@@ -0,0 +1,18 @@
1SUMMARY = "Host SDK package for cross canadian toolchain"
2PN = "packagegroup-cross-canadian-${MACHINE}"
3LICENSE = "MIT"
4
5# Save TRANSLATED_TARGET_ARCH before allarch tramples it
6TRANSLATED_TARGET_ARCH = "${@d.getVar('TUNE_ARCH', True).replace('_', '-')}"
7
8inherit cross-canadian packagegroup
9
10PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
11
12RDEPENDS_${PN} = "\
13 binutils-cross-canadian-${@' binutils-cross-canadian-'.join(all_multilib_tune_values(d,'TRANSLATED_TARGET_ARCH').split())} \
14 gdb-cross-canadian-${@' gdb-cross-canadian-'.join(all_multilib_tune_values(d, 'TRANSLATED_TARGET_ARCH').split())} \
15 gcc-cross-canadian-${@' gcc-cross-canadian-'.join(all_multilib_tune_values(d, 'TRANSLATED_TARGET_ARCH').split())} \
16 meta-environment-${MACHINE} \
17 "
18
diff --git a/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
new file mode 100644
index 0000000000..8e3b917c75
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
@@ -0,0 +1,229 @@
1#
2# Copyright (C) 2010 Intel Corporation
3#
4
5SUMMARY = "Self-hosting"
6DESCRIPTION = "Packages required to run the build system"
7PR = "r13"
8LICENSE = "MIT"
9
10inherit packagegroup
11
12PACKAGES = "\
13 packagegroup-self-hosted \
14 packagegroup-self-hosted-debug \
15 packagegroup-self-hosted-sdk \
16 packagegroup-self-hosted-extended \
17 packagegroup-self-hosted-graphics \
18 packagegroup-self-hosted-host-tools \
19 "
20
21RDEPENDS_packagegroup-self-hosted = "\
22 packagegroup-self-hosted-debug \
23 packagegroup-self-hosted-sdk \
24 packagegroup-self-hosted-extended \
25 packagegroup-self-hosted-graphics \
26 packagegroup-self-hosted-host-tools \
27 "
28
29# midori depends on webkit-gtk which could not build for mips64
30MIDORI = "midori"
31MIDORI_mips64 = ""
32
33RDEPENDS_packagegroup-self-hosted-host-tools = "\
34 connman \
35 connman-plugin-ethernet \
36 dhcp-client \
37 e2fsprogs \
38 e2fsprogs-e2fsck \
39 e2fsprogs-mke2fs \
40 e2fsprogs-tune2fs \
41 hdparm \
42 iptables \
43 lsb \
44 xdg-utils \
45 mc \
46 mc-fish \
47 mc-helpers \
48 mc-helpers-perl \
49 mc-helpers-python \
50 leafpad \
51 ${MIDORI} \
52 pcmanfm \
53 parted \
54 pseudo \
55 screen \
56 vte \
57 "
58
59RRECOMMENDS_packagegroup-self-hosted-host-tools = "\
60 kernel-module-tun \
61 kernel-module-iptable-raw \
62 kernel-module-iptable-nat \
63 kernel-module-iptable-mangle \
64 kernel-module-iptable-filter \
65 "
66
67# eglibc-utils: for rpcgen
68RDEPENDS_packagegroup-self-hosted-sdk = "\
69 autoconf \
70 automake \
71 binutils \
72 binutils-symlinks \
73 ccache \
74 coreutils \
75 cpp \
76 cpp-symlinks \
77 distcc \
78 eglibc-utils \
79 eglibc-gconv-ibm850 \
80 file \
81 findutils \
82 g++ \
83 g++-symlinks \
84 gcc \
85 gcc-symlinks \
86 intltool \
87 ldd \
88 less \
89 libssp \
90 libssp-dev \
91 libssp-staticdev \
92 libstdc++ \
93 libstdc++-dev \
94 libtool \
95 make \
96 mktemp \
97 perl-module-re \
98 perl-module-text-wrap \
99 pkgconfig \
100 quilt \
101 sed \
102 "
103
104RDEPENDS_packagegroup-self-hosted-debug = " \
105 gdb \
106 gdbserver \
107 rsync \
108 strace \
109 tcf-agent"
110
111
112RDEPENDS_packagegroup-self-hosted-extended = "\
113 bzip2 \
114 chkconfig \
115 chrpath \
116 cpio \
117 curl \
118 diffstat \
119 diffutils \
120 elfutils \
121 expat \
122 gamin \
123 gawk \
124 gdbm \
125 gettext \
126 gettext-runtime \
127 git \
128 grep \
129 groff \
130 gzip \
131 settings-daemon \
132 hicolor-icon-theme \
133 sato-icon-theme \
134 libaio \
135 libusb1 \
136 libxml2 \
137 lrzsz \
138 lsof \
139 lzo \
140 man \
141 man-pages \
142 mdadm \
143 minicom \
144 mtools \
145 ncurses \
146 ncurses-terminfo-base \
147 neon \
148 nfs-utils \
149 nfs-utils-client \
150 openssl \
151 openssh-sftp-server \
152 opkg \
153 opkg-utils \
154 patch \
155 perl \
156 perl-dev \
157 perl-modules \
158 perl-pod \
159 ${PTH} \
160 python \
161 python-compile \
162 python-compiler \
163 python-compression \
164 python-core \
165 python-curses \
166 python-datetime \
167 python-difflib \
168 python-distutils \
169 python-elementtree \
170 python-email \
171 python-fcntl \
172 python-git \
173 python-json \
174 python-logging \
175 python-misc \
176 python-mmap \
177 python-multiprocessing \
178 python-netclient \
179 python-netserver \
180 python-pickle \
181 python-pkgutil \
182 python-pprint \
183 python-re \
184 python-rpm \
185 python-shell \
186 python-sqlite3 \
187 python-subprocess \
188 python-textutils \
189 python-unittest \
190 python-unixadmin \
191 python-xmlrpc \
192 quota \
193 readline \
194 rpm \
195 setserial \
196 socat \
197 subversion \
198 sudo \
199 sysstat \
200 tar \
201 tcl \
202 texi2html \
203 texinfo \
204 unzip \
205 usbutils \
206 watchdog \
207 wget \
208 which \
209 xinetd \
210 zip \
211 zlib \
212 xz \
213 "
214
215
216RDEPENDS_packagegroup-self-hosted-graphics = "\
217 builder \
218 libgl \
219 libgl-dev \
220 libglu \
221 libglu-dev \
222 libsdl \
223 libsdl-dev \
224 libx11-dev \
225 python-pygtk \
226 gtk-theme-clearlooks \
227 "
228PTH = "pth"
229PTH_libc-uclibc = ""
diff --git a/meta/recipes-core/psplash/files/psplash-init b/meta/recipes-core/psplash/files/psplash-init
new file mode 100755
index 0000000000..66c85e9335
--- /dev/null
+++ b/meta/recipes-core/psplash/files/psplash-init
@@ -0,0 +1,29 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: psplash
4# Required-Start:
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8### END INIT INFO
9
10read CMDLINE < /proc/cmdline
11for x in $CMDLINE; do
12 case $x in
13 psplash=false)
14 echo "Boot splashscreen disabled"
15 exit 0;
16 ;;
17 esac
18done
19
20export TMPDIR=/mnt/.psplash
21mount tmpfs -t tmpfs $TMPDIR -o,size=40k
22
23rotation=0
24if [ -e /etc/rotation ]; then
25 read rotation < /etc/rotation
26fi
27
28/usr/bin/psplash --angle $rotation &
29
diff --git a/meta/recipes-core/psplash/files/psplash-poky-img.h b/meta/recipes-core/psplash/files/psplash-poky-img.h
new file mode 100644
index 0000000000..8d56aa0201
--- /dev/null
+++ b/meta/recipes-core/psplash/files/psplash-poky-img.h
@@ -0,0 +1,1259 @@
1/* GdkPixbuf RGB C-Source image dump 1-byte-run-length-encoded */
2
3#define POKY_IMG_ROWSTRIDE (1920)
4#define POKY_IMG_WIDTH (640)
5#define POKY_IMG_HEIGHT (480)
6#define POKY_IMG_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */
7#define POKY_IMG_RLE_PIXEL_DATA ((uint8*) \
8 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
9 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
10 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
11 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
12 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
13 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
14 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
15 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
16 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
17 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
18 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
19 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
20 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
21 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
22 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
23 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
24 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
25 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
26 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
27 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
28 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
29 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
30 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
31 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
32 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
33 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
34 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
35 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
36 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
37 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
38 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
39 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
40 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
41 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
42 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
43 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
44 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
45 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
46 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
47 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
48 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
49 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
50 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
51 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
52 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
53 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
54 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
55 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
56 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
57 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
58 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
59 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
60 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
61 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
62 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
63 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
64 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
65 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
66 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
67 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
68 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
69 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
70 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
71 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
72 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
73 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
74 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
75 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
76 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
77 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
78 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
79 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
80 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
81 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
82 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
83 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
84 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
85 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
86 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
87 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
88 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
89 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
90 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
91 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
92 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
93 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
94 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
95 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
96 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
97 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
98 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
99 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
100 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
101 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
102 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
103 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
104 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
105 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
106 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
107 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
108 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
109 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
110 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
111 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
112 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
113 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
114 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
115 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
116 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
117 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
118 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
119 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
120 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
121 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
122 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
123 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
124 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
125 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
126 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
127 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
128 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
129 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
130 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
131 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
132 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
133 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
134 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
135 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
136 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
137 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
138 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
139 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
140 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
141 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
142 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
143 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
144 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
145 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
146 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
147 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
148 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
149 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
150 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
151 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
152 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
153 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
154 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
155 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
156 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
157 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
158 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
159 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
160 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
161 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
162 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
163 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
164 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
165 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
166 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
167 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
168 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
169 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
170 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
171 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
172 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
173 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
174 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
175 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
176 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
177 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
178 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
179 "\237\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
180 "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \
181 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
182 "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
183 "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
184 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
185 "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
186 "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
187 "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \
188 "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
189 "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \
190 "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \
191 "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \
192 "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \
193 "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \
194 "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \
195 "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
196 "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \
197 "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \
198 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
199 "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \
200 "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \
201 "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \
202 "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
203 "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
204 "\377\377\377\377\377\377\377\223\377\377\377\363\376\377\374\3\373\375" \
205 "\372\360\366\370\353\360\363\202\347\355\357\5\346\354\356\347\355\357" \
206 "\351\356\360\360\366\370\371\373\370\363\376\377\374\377\377\377\377" \
207 "\377\377\377\377\377\377\377\377\223\377\377\377\353\376\377\374\10\356" \
208 "\363\366\324\331\333\277\304\306\252\262\272\227\237\247}\220\233p\203" \
209 "\216ew\202\212]oz\10dv\201n\201\214~\215\223\216\236\244\247\257\267" \
210 "\274\301\303\320\326\330\352\357\362\353\376\377\374\377\377\377\377" \
211 "\377\377\377\377\377\377\377\377\223\377\377\377\346\376\377\374\5\366" \
212 "\370\364\320\326\330\255\265\275\210\227\235j}\210\232]oz\5gy\204\204" \
213 "\223\231\250\260\270\314\321\324\355\362\365\346\376\377\374\377\377" \
214 "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\342\376\377" \
215 "\374\5\373\375\372\327\334\337\253\263\273x\213\227^p{\243]oz\4q\204" \
216 "\217\242\252\262\320\326\330\365\372\375\342\376\377\374\377\377\377" \
217 "\377\377\377\377\377\377\377\377\377\223\377\377\377\337\376\377\374" \
218 "\4\371\373\370\317\324\327\225\245\253ew\202\252]oz\4bt\177\211\230\236" \
219 "\306\314\316\367\371\366\337\376\377\374\377\377\377\377\377\377\377" \
220 "\377\377\377\377\377\223\377\377\377\335\376\377\374\3\333\340\343\236" \
221 "\246\256fx\203\260]oz\3bt\177\225\235\245\320\326\330\335\376\377\374" \
222 "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\332" \
223 "\376\377\374\3\367\371\366\276\303\305u\210\224\266]oz\3m\200\213\257" \
224 "\267\277\355\362\365\332\376\377\374\377\377\377\377\377\377\377\377" \
225 "\377\377\377\377\223\377\377\377\330\376\377\374\3\353\360\363\252\262" \
226 "\272fx\203\272]oz\3as~\230\250\256\342\347\352\330\376\377\374\377\377" \
227 "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\326\376\377" \
228 "\374\3\352\357\362\236\246\256as~\276]oz\3^p{\216\236\244\341\346\351" \
229 "\326\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
230 "\377\377\377\324\376\377\374\3\354\361\364\246\256\266as~\302]oz\3^p" \
231 "{\227\237\247\346\354\356\324\376\377\374\377\377\377\377\377\377\377" \
232 "\377\377\377\377\377\223\377\377\377\322\376\377\374\3\372\374\371\265" \
233 "\276\306fx\203\306]oz\3as~\250\260\270\362\367\371\322\376\377\374\377" \
234 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\321\376" \
235 "\377\374\2\320\326\330p\203\216\312]oz\2hz\205\302\307\312\321\376\377" \
236 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
237 "\317\376\377\374\2\356\363\366\231\241\251\316]oz\2\204\223\231\345\352" \
238 "\355\317\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
239 "\223\377\377\377\316\376\377\374\2\311\316\321i{\206\320]oz\2bt\177\264" \
240 "\274\305\316\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
241 "\377\223\377\377\377\314\376\377\374\2\362\367\371\226\246\254\324]o" \
242 "z\2\206\225\233\353\360\363\314\376\377\374\377\377\377\377\377\377\377" \
243 "\377\377\377\377\377\223\377\377\377\313\376\377\374\2\334\342\344o\202" \
244 "\215\326]oz\2gy\204\315\322\325\313\376\377\374\377\377\377\377\377\377" \
245 "\377\377\377\377\377\377\223\377\377\377\312\376\377\374\2\302\307\312" \
246 "as~\330]oz\3^p{\254\264\274\373\375\372\311\376\377\374\377\377\377\377" \
247 "\377\377\377\377\377\377\377\377\223\377\377\377\310\376\377\374\2\372" \
248 "\374\371\236\246\256\334]oz\2\210\227\235\360\366\370\310\376\377\374" \
249 "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\307" \
250 "\376\377\374\2\360\366\370\205\224\232\336]oz\2s\206\221\347\355\357" \
251 "\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
252 "\377\377\377\306\376\377\374\2\347\355\357t\207\222\340]oz\2i{\206\333" \
253 "\340\343\306\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
254 "\377\223\377\377\377\305\376\377\374\2\343\350\353j}\210\251]oz\7bt\177" \
255 "w\212\226\215\234\243\236\246\256\246\256\266\254\264\274\264\274\305" \
256 "\202\300\305\310\7\264\274\305\255\265\275\250\260\270\233\252\261\222" \
257 "\241\247~\215\223ew\202\251]oz\2cu\200\322\330\332\305\376\377\374\377" \
258 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\304\376" \
259 "\377\374\2\337\344\346i{\206\245]oz\5j}\210\230\240\250\270\300\311\322" \
260 "\330\332\351\356\360\220\376\377\374\5\354\361\364\326\333\335\300\305" \
261 "\310\236\246\256p\203\216\245]oz\2as~\316\323\326\304\376\377\374\377" \
262 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\303\376" \
263 "\377\374\2\335\343\345gy\204\242]oz\4ew\202\222\241\247\276\303\305\342" \
264 "\347\352\232\376\377\374\4\352\357\362\304\311\314\233\243\253j}\210" \
265 "\242]oz\2as~\313\320\322\303\376\377\374\377\377\377\377\377\377\377" \
266 "\377\377\377\377\377\223\377\377\377\302\376\377\374\2\341\346\351hz" \
267 "\205\240]oz\4_q|\211\230\236\307\315\317\370\372\367\240\376\377\374" \
268 "\4\373\375\372\320\326\330\231\241\251bt\177\240]oz\2as~\317\324\327" \
269 "\302\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
270 "\377\377\377\301\376\377\374\2\343\350\353i{\206\237]oz\3q\204\217\266" \
271 "\277\307\354\361\364\246\376\377\374\3\366\370\364\303\310\313\177\216" \
272 "\224\237]oz\2bt\177\325\332\334\301\376\377\374\377\377\377\377\377\377" \
273 "\377\377\377\377\377\377\223\377\377\377\300\376\377\374\2\355\362\365" \
274 "l\177\212\236]oz\3u\210\224\307\315\317\373\375\372\253\376\377\374\2" \
275 "\324\331\333\204\223\231\236]oz\2ew\202\341\346\351\300\376\377\374\377" \
276 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\277\376" \
277 "\377\374\2\365\372\375\177\216\224\235]oz\2~\215\223\315\322\325\260" \
278 "\376\377\374\2\331\336\341\211\230\236\235]oz\2l\177\212\353\360\363" \
279 "\277\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
280 "\377\377\377\277\376\377\374\1\214\233\242\234]oz\2i{\206\305\312\315" \
281 "\264\376\377\374\2\324\331\333q\204\217\234]oz\2u\210\224\367\371\366" \
282 "\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
283 "\377\377\377\276\376\377\374\1\257\267\277\233]oz\3^p{\242\252\262\362" \
284 "\367\371\266\376\377\374\3\372\374\371\261\271\302bt\177\233]oz\1\225" \
285 "\235\245\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
286 "\377\223\377\377\377\275\376\377\374\2\317\324\327^p{\232]oz\2w\212\226" \
287 "\335\343\345\272\376\377\374\2\351\356\360\211\230\236\233]oz\1\264\274" \
288 "\305\275\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
289 "\223\377\377\377\274\376\377\374\2\347\355\357ew\202\232]oz\2\242\252" \
290 "\262\371\373\370\225\376\377\374\10\336\367\374\262\355\370\220\343\361" \
291 "m\332\361G\317\353,\311\352(\307\350#\304\346\202\0\301\350\10\0\304" \
292 "\352(\307\350,\311\352B\314\347i\326\356\207\341\364\260\353\366\333" \
293 "\364\371\226\376\377\374\2\266\277\307as~\231]oz\2_q|\327\334\337\274" \
294 "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
295 "\377\377\273\376\377\374\2\373\375\372}\220\233\231]oz\2ew\202\313\320" \
296 "\322\223\376\377\374\4\334\365\372\233\345\364M\323\357\0\304\352\222" \
297 "\25\274\344\4\0\301\350J\321\355\211\342\365\314\361\372\223\376\377" \
298 "\374\2\332\337\342m\200\213\231]oz\2l\177\212\360\366\370\273\376\377" \
299 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
300 "\273\376\377\374\1\257\267\277\231]oz\2x\213\227\347\355\357\221\376" \
301 "\377\374\3\336\367\374\206\340\363*\310\351\232\25\274\344\3#\304\346" \
302 "w\333\356\316\363\374\221\376\377\374\2\360\366\370\214\233\242\231]" \
303 "oz\1\227\237\247\273\376\377\374\377\377\377\377\377\377\377\377\377" \
304 "\377\377\377\223\377\377\377\272\376\377\374\2\335\343\345_q|\230]oz" \
305 "\2\210\227\235\364\371\374\217\376\377\374\3\370\376\377\256\350\364" \
306 "B\314\347\240\25\274\344\3*\310\351\233\345\364\367\375\377\217\376\377" \
307 "\374\2\373\375\372\242\252\262\231]oz\1\305\312\315\272\376\377\374\377" \
308 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\271\376" \
309 "\377\374\2\372\374\371w\212\226\230]oz\2\231\241\251\372\374\371\216" \
310 "\376\377\374\3\367\375\377\233\345\364(\307\350\244\25\274\344\3\0\302" \
311 "\351\206\340\363\356\373\374\217\376\377\374\1\257\267\277\230]oz\2h" \
312 "z\205\356\363\366\271\376\377\374\377\377\377\377\377\377\377\377\377" \
313 "\377\377\377\223\377\377\377\271\376\377\374\1\257\267\277\230]oz\1\246" \
314 "\256\266\217\376\377\374\2\237\350\367\0\304\352\250\25\274\344\3\0\276" \
315 "\345\207\341\364\370\376\377\216\376\377\374\2\277\304\306_q|\227]oz" \
316 "\1\231\241\251\271\376\377\374\377\377\377\377\377\377\377\377\377\377" \
317 "\377\377\223\377\377\377\270\376\377\374\2\346\354\356bt\177\227]oz\1" \
318 "\251\261\271\216\376\377\374\2\315\362\3731\313\354\254\25\274\344\2" \
319 "(\307\350\262\355\370\216\376\377\374\2\305\312\315^p{\227]oz\1\322\330" \
320 "\332\270\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
321 "\223\377\377\377\270\376\377\374\1\215\234\243\227]oz\1\233\252\261\215" \
322 "\376\377\374\3\367\375\377m\332\361\0\276\345\257\25\274\344\2L\322\356" \
323 "\356\373\374\215\376\377\374\1\274\301\303\227]oz\2t\207\222\373\375" \
324 "\372\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
325 "\223\377\377\377\267\376\377\374\1\325\332\334\227]oz\2\214\233\242\373" \
326 "\375\372\214\376\377\374\2\333\364\371,\311\352\262\25\274\344\2\0\304" \
327 "\352\301\356\366\215\376\377\374\1\252\262\272\227]oz\1\274\301\303\267" \
328 "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
329 "\377\377\267\376\377\374\1v\211\225\226]oz\2\205\224\232\365\372\375" \
330 "\214\376\377\374\2\236\347\366\0\276\345\264\25\274\344\3\0\276\345\203" \
331 "\334\360\370\376\377\214\376\377\374\1\236\246\256\226]oz\2hz\205\362" \
332 "\367\371\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
333 "\377\223\377\377\377\266\376\377\374\1\307\315\317\226]oz\2n\201\214" \
334 "\360\366\370\214\376\377\374\1m\332\361\270\25\274\344\2I\320\354\366" \
335 "\373\376\213\376\377\374\2\373\375\372\203\222\230\226]oz\1\254\264\274" \
336 "\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
337 "\377\377\377\265\376\377\374\2\373\375\372s\206\221\225]oz\2as~\333\340" \
338 "\343\213\376\377\374\2\370\376\377M\323\357\272\25\274\344\2""1\313\354" \
339 "\356\373\374\213\376\377\374\2\353\360\363i{\206\225]oz\2ew\202\357\365" \
340 "\367\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
341 "\223\377\377\377\265\376\377\374\1\305\312\315\226]oz\1\265\276\306\213" \
342 "\376\377\374\2\366\373\376B\314\347\274\25\274\344\2(\307\350\336\367" \
343 "\374\213\376\377\374\2\322\330\332^p{\225]oz\1\252\262\272\265\376\377" \
344 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
345 "\265\376\377\374\1u\210\224\225]oz\1\214\233\242\213\376\377\374\2\366" \
346 "\373\376B\314\347\276\25\274\344\2#\304\346\337\370\375\213\376\377\374" \
347 "\1\253\263\273\225]oz\2fx\203\367\371\366\264\376\377\374\377\377\377" \
348 "\377\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374" \
349 "\1\322\330\332\225]oz\2i{\206\360\366\370\212\376\377\374\2\370\376\377" \
350 "I\320\354\300\25\274\344\2*\310\351\357\374\375\212\376\377\374\2\373" \
351 "\375\372~\215\223\225]oz\1\264\274\305\264\376\377\374\377\377\377\377" \
352 "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1\210" \
353 "\227\235\225]oz\1\303\310\313\213\376\377\374\1i\326\356\302\25\274\344" \
354 "\2B\314\347\370\376\377\212\376\377\374\2\335\343\345^p{\224]oz\2m\200" \
355 "\213\373\375\372\263\376\377\374\377\377\377\377\377\377\377\377\377" \
356 "\377\377\377\223\377\377\377\263\376\377\374\2\345\352\355^p{\224]oz" \
357 "\1~\221\235\213\376\377\374\1y\336\360\304\25\274\344\1M\323\357\213" \
358 "\376\377\374\1\242\252\262\225]oz\1\315\322\325\263\376\377\374\377\377" \
359 "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\263\376\377" \
360 "\374\1\252\262\272\224]oz\2_q|\341\346\351\212\376\377\374\2\274\355" \
361 "\373\0\276\345\305\25\274\344\1\220\343\361\212\376\377\374\2\360\366" \
362 "\370i{\206\224]oz\1\211\230\236\263\376\377\374\377\377\377\377\377\377" \
363 "\377\377\377\377\377\377\223\377\377\377\262\376\377\374\2\372\374\371" \
364 "i{\206\224]oz\1\250\260\270\212\376\377\374\2\350\371\377\0\304\352\306" \
365 "\25\274\344\2\0\276\345\316\363\374\212\376\377\374\1\303\310\313\224" \
366 "]oz\2^p{\352\357\362\262\376\377\374\377\377\377\377\377\377\377\377" \
367 "\377\377\377\377\223\377\377\377\262\376\377\374\1\315\322\325\224]o" \
368 "z\2dv\201\357\365\367\212\376\377\374\1G\317\353\240\25\274\344\3\0\302" \
369 "\351,\311\352J\321\355\203L\322\356\2B\314\347#\304\346\240\25\274\344" \
370 "\2*\310\351\367\375\377\212\376\377\374\1q\204\217\224]oz\1\257\267\277" \
371 "\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
372 "\377\377\377\262\376\377\374\1\230\240\250\224]oz\1\247\257\267\212\376" \
373 "\377\374\1\233\345\364\235\25\274\344\4*\310\351n\333\362\273\354\371" \
374 "\360\375\376\210\376\377\374\4\357\374\375\303\361\370\206\340\363/\312" \
375 "\353\235\25\274\344\1w\333\356\212\376\377\374\1\303\310\313\224]oz\1" \
376 "v\211\225\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
377 "\377\223\377\377\377\261\376\377\374\2\365\372\375dv\201\223]oz\2as~" \
378 "\353\360\363\211\376\377\374\2\356\373\374\0\302\351\232\25\274\344\3" \
379 "\0\276\345m\332\361\335\366\373\220\376\377\374\2\336\367\374(\307\350" \
380 "\232\25\274\344\2%\305\347\336\367\374\212\376\377\374\2\372\374\371" \
381 "n\201\214\224]oz\1\343\350\353\261\376\377\374\377\377\377\377\377\377" \
382 "\377\377\377\377\377\377\223\377\377\377\261\376\377\374\1\313\320\322" \
383 "\224]oz\1\233\252\261\212\376\377\374\1k\327\357\231\25\274\344\3\0\276" \
384 "\345\206\340\363\357\374\375\222\376\377\374\1k\327\357\232\25\274\344" \
385 "\2%\305\347\336\367\374\214\376\377\374\1\276\303\305\224]oz\1\257\267" \
386 "\277\261\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
387 "\223\377\377\377\261\376\377\374\1\226\246\254\223]oz\2^p{\347\355\357" \
388 "\211\376\377\374\2\316\363\374\0\276\345\230\25\274\344\2J\321\355\337" \
389 "\370\375\223\376\377\374\1k\327\357\232\25\274\344\2%\305\347\336\367" \
390 "\374\215\376\377\374\2\370\372\367i{\206\223]oz\1\177\216\224\261\376" \
391 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
392 "\377\261\376\377\374\1k~\211\223]oz\1\205\224\232\212\376\377\374\1J" \
393 "\321\355\227\25\274\344\2\0\276\345\257\351\365\224\376\377\374\1m\332" \
394 "\361\232\25\274\344\2%\305\347\336\367\374\217\376\377\374\1\246\256" \
395 "\266\223]oz\2^p{\356\363\366\260\376\377\374\377\377\377\377\377\377" \
396 "\377\377\377\377\377\377\223\377\377\377\260\376\377\374\1\335\343\345" \
397 "\224]oz\1\303\310\313\211\376\377\374\2\333\364\371\0\276\345\226\25" \
398 "\274\344\2#\304\346\316\363\374\224\376\377\374\1m\332\361\232\25\274" \
399 "\344\2%\305\347\336\367\374\220\376\377\374\1\335\343\345\224]oz\1\306" \
400 "\314\316\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
401 "\377\223\377\377\377\260\376\377\374\1\264\274\305\223]oz\2cu\200\367" \
402 "\371\366\211\376\377\374\1i\326\356\226\25\274\344\2,\311\352\347\370" \
403 "\376\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367\374" \
404 "\222\376\377\374\1t\207\222\223]oz\1\236\246\256\260\376\377\374\377" \
405 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\260\376" \
406 "\377\374\1\215\234\243\223]oz\1\231\241\251\211\376\377\374\2\347\370" \
407 "\376\0\276\345\225\25\274\344\2*\310\351\357\374\375\224\376\377\374" \
408 "\1m\332\361\232\25\274\344\2%\305\347\336\367\374\223\376\377\374\1\261" \
409 "\271\302\223]oz\1q\204\217\260\376\377\374\377\377\377\377\377\377\377" \
410 "\377\377\377\377\377\223\377\377\377\260\376\377\374\1i{\206\223]oz\1" \
411 "\317\324\327\211\376\377\374\1\207\341\364\225\25\274\344\2#\304\346" \
412 "\337\370\375\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336" \
413 "\367\374\224\376\377\374\1\351\356\360\224]oz\1\356\363\366\257\376\377" \
414 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
415 "\257\376\377\374\1\345\352\355\223]oz\2as~\370\372\367\211\376\377\374" \
416 "\1,\311\352\224\25\274\344\2\0\276\345\313\360\371\224\376\377\374\1" \
417 "m\332\361\232\25\274\344\2%\305\347\336\367\374\226\376\377\374\1q\204" \
418 "\217\223]oz\1\314\321\324\257\376\377\374\377\377\377\377\377\377\377" \
419 "\377\377\377\377\377\223\377\377\377\257\376\377\374\1\311\316\321\223" \
420 "]oz\1\202\221\227\211\376\377\374\1\320\365\376\225\25\274\344\1\207" \
421 "\341\364\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367" \
422 "\374\214\376\377\374\2\236\347\366\237\350\367\211\376\377\374\1\236" \
423 "\246\256\223]oz\1\255\265\275\257\376\377\374\377\377\377\377\377\377" \
424 "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\254\264\274" \
425 "\223]oz\1\255\265\275\211\376\377\374\1y\336\360\224\25\274\344\2/\312" \
426 "\353\370\376\377\223\376\377\374\1m\332\361\232\25\274\344\2%\305\347" \
427 "\336\367\374\214\376\377\374\3\236\347\366\0\276\345J\321\355\211\376" \
428 "\377\374\1\311\316\321\223]oz\1\215\234\243\257\376\377\374\377\377\377" \
429 "\377\377\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374" \
430 "\1\214\233\242\223]oz\1\326\333\335\211\376\377\374\1,\311\352\224\25" \
431 "\274\344\1\312\357\370\223\376\377\374\1n\333\362\232\25\274\344\2%\305" \
432 "\347\336\367\374\214\376\377\374\5\236\347\366\0\276\345\25\274\344\0" \
433 "\276\345\367\375\377\210\376\377\374\2\356\363\366^p{\222]oz\1o\202\215" \
434 "\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
435 "\377\377\377\257\376\377\374\1o\202\215\222]oz\2as~\366\373\376\210\376" \
436 "\377\374\2\357\374\375\0\276\345\223\25\274\344\1J\321\355\223\376\377" \
437 "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \
438 "\2\236\347\366\0\276\345\203\25\274\344\1\274\355\373\211\376\377\374" \
439 "\1u\210\224\222]oz\2^p{\370\372\367\256\376\377\374\377\377\377\377\377" \
440 "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\2\373\375" \
441 "\372_q|\222]oz\1u\210\224\211\376\377\374\1\261\354\367\224\25\274\344" \
442 "\1\312\357\370\222\376\377\374\1n\333\362\232\25\274\344\2%\305\347\336" \
443 "\367\374\214\376\377\374\2\236\347\366\0\276\345\204\25\274\344\1\204" \
444 "\335\361\211\376\377\374\1\230\240\250\223]oz\1\342\347\352\256\376\377" \
445 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
446 "\256\376\377\374\1\351\356\360\223]oz\1\225\235\245\211\376\377\374\1" \
447 "n\333\362\223\25\274\344\1,\311\352\222\376\377\374\1n\333\362\232\25" \
448 "\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345" \
449 "\205\25\274\344\1B\314\347\211\376\377\374\1\257\267\277\223]oz\1\317" \
450 "\324\327\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
451 "\377\223\377\377\377\256\376\377\374\1\326\333\335\223]oz\1\253\263\273" \
452 "\211\376\377\374\1B\314\347\223\25\274\344\1\211\342\365\221\376\377" \
453 "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \
454 "\2\236\347\366\0\276\345\206\25\274\344\1\0\302\351\211\376\377\374\1" \
455 "\307\315\317\223]oz\1\276\303\305\256\376\377\374\377\377\377\377\377" \
456 "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\306\314" \
457 "\316\223]oz\1\305\312\315\211\376\377\374\1#\304\346\223\25\274\344\1" \
458 "\337\370\375\220\376\377\374\1w\333\356\232\25\274\344\2%\305\347\336" \
459 "\367\374\214\376\377\374\2\236\347\366\0\276\345\210\25\274\344\1\356" \
460 "\373\374\210\376\377\374\1\337\344\346\223]oz\1\253\263\273\256\376\377" \
461 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
462 "\256\376\377\374\1\274\301\303\223]oz\1\333\340\343\210\376\377\374\2" \
463 "\367\375\377\0\276\345\222\25\274\344\1(\307\350\220\376\377\374\1\231" \
464 "\342\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236" \
465 "\347\366\0\276\345\211\25\274\344\1\302\357\367\210\376\377\374\2\364" \
466 "\371\374^p{\222]oz\1\236\246\256\256\376\377\374\377\377\377\377\377" \
467 "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\257\267" \
468 "\277\223]oz\1\353\360\363\210\376\377\374\1\316\363\374\223\25\274\344" \
469 "\1\\\326\355\217\376\377\374\2\320\365\376\31\275\345\231\25\274\344" \
470 "\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\212\25" \
471 "\274\344\1\237\350\367\211\376\377\374\1gy\204\222]oz\1\216\236\244\256" \
472 "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
473 "\377\377\256\376\377\374\1\242\252\262\223]oz\1\366\370\364\210\376\377" \
474 "\374\1\262\355\370\223\25\274\344\1\220\343\361\217\376\377\374\1J\321" \
475 "\355\231\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347" \
476 "\366\0\276\345\213\25\274\344\1\211\342\365\211\376\377\374\1m\200\213" \
477 "\222]oz\1\204\223\231\256\376\377\374\377\377\377\377\377\377\377\377" \
478 "\377\377\377\377\223\377\377\377\256\376\377\374\1\226\246\254\223]o" \
479 "z\211\376\377\374\1\237\350\367\223\25\274\344\1\262\355\370\216\376" \
480 "\377\374\2\350\371\377\0\276\345\230\25\274\344\2%\305\347\336\367\374" \
481 "\214\376\377\374\2\236\347\366\0\276\345\214\25\274\344\1n\333\362\211" \
482 "\376\377\374\1u\210\224\222]oz\1y\214\230\256\376\377\374\377\377\377" \
483 "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \
484 "\1\231\241\251\222]oz\1cu\200\211\376\377\374\1\233\345\364\223\25\274" \
485 "\344\1\316\363\374\216\376\377\374\1\235\346\365\230\25\274\344\2%\305" \
486 "\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\215\25\274\344" \
487 "\1k\327\357\211\376\377\374\1\200\217\225\222]oz\1u\210\224\256\376\377" \
488 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
489 "\256\376\377\374\1\222\241\247\222]oz\1j}\210\211\376\377\374\1\220\343" \
490 "\361\223\25\274\344\1\336\367\374\216\376\377\374\1w\333\356\227\25\274" \
491 "\344\2#\304\346\336\367\374\214\376\377\374\2\236\347\366\0\276\345\216" \
492 "\25\274\344\1M\323\357\211\376\377\374\1\210\227\235\222]oz\1s\206\221" \
493 "\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
494 "\377\377\377\256\376\377\374\1\211\230\236\222]oz\1n\201\214\211\376" \
495 "\377\374\1\206\340\363\223\25\274\344\1\350\371\377\216\376\377\374\1" \
496 "i\326\356\226\25\274\344\2#\304\346\336\367\374\214\376\377\374\2\236" \
497 "\347\366\0\276\345\217\25\274\344\1M\323\357\211\376\377\374\1\215\234" \
498 "\243\222]oz\1m\200\213\256\376\377\374\377\377\377\377\377\377\377\377" \
499 "\377\377\377\377\223\377\377\377\256\376\377\374\1\222\241\247\222]o" \
500 "z\1l\177\212\211\376\377\374\1\207\341\364\223\25\274\344\1\336\367\374" \
501 "\216\376\377\374\1n\333\362\225\25\274\344\2#\304\346\336\367\374\214" \
502 "\376\377\374\2\235\346\365\0\276\345\220\25\274\344\1M\323\357\211\376" \
503 "\377\374\1\211\230\236\222]oz\1s\206\221\256\376\377\374\377\377\377" \
504 "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \
505 "\1\231\241\251\222]oz\1ew\202\211\376\377\374\1\231\342\362\223\25\274" \
506 "\344\1\320\365\376\216\376\377\374\1\221\344\362\224\25\274\344\2#\304" \
507 "\346\336\367\374\214\376\377\374\2\235\346\365\0\276\345\221\25\274\344" \
508 "\1i\326\356\211\376\377\374\1\202\221\227\222]oz\1u\210\224\256\376\377" \
509 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
510 "\256\376\377\374\1\242\252\262\222]oz\1^p{\211\376\377\374\1\237\350" \
511 "\367\223\25\274\344\1\301\356\366\216\376\377\374\1\333\364\371\223\25" \
512 "\274\344\2#\304\346\336\367\374\214\376\377\374\2\356\373\374\0\276\345" \
513 "\222\25\274\344\1n\333\362\211\376\377\374\1w\212\226\222]oz\1\202\221" \
514 "\227\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
515 "\223\377\377\377\256\376\377\374\1\246\256\266\223]oz\1\370\372\367\210" \
516 "\376\377\374\1\260\353\366\223\25\274\344\1\233\345\364\217\376\377\374" \
517 "\1,\311\352\221\25\274\344\2#\304\346\336\367\374\215\376\377\374\1\312" \
518 "\357\370\223\25\274\344\1\204\335\361\211\376\377\374\1o\202\215\222" \
519 "]oz\1\205\224\232\256\376\377\374\377\377\377\377\377\377\377\377\377" \
520 "\377\377\377\223\377\377\377\256\376\377\374\1\252\262\272\223]oz\1\355" \
521 "\362\365\210\376\377\374\1\314\361\372\223\25\274\344\1m\332\361\217" \
522 "\376\377\374\1\273\354\371\220\25\274\344\2#\304\346\336\367\374\216" \
523 "\376\377\374\1\233\345\364\223\25\274\344\1\236\347\366\211\376\377\374" \
524 "\1i{\206\222]oz\1\211\230\236\256\376\377\374\377\377\377\377\377\377" \
525 "\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\266\277\307" \
526 "\223]oz\1\340\345\350\210\376\377\374\1\356\373\374\223\25\274\344\1" \
527 ",\311\352\220\376\377\374\1i\326\356\216\25\274\344\2#\304\346\336\367" \
528 "\374\217\376\377\374\1\\\326\355\223\25\274\344\1\274\355\373\210\376" \
529 "\377\374\2\372\374\371_q|\222]oz\1\226\246\254\256\376\377\374\377\377" \
530 "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377" \
531 "\374\1\307\315\317\223]oz\1\313\320\322\211\376\377\374\1\0\302\351\222" \
532 "\25\274\344\2\0\276\345\357\374\375\217\376\377\374\2\370\376\377G\317" \
533 "\353\214\25\274\344\2(\307\350\336\367\374\220\376\377\374\1%\305\347" \
534 "\223\25\274\344\1\336\367\374\210\376\377\374\1\343\350\353\223]oz\1" \
535 "\254\264\274\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \
536 "\377\377\223\377\377\377\256\376\377\374\1\327\334\337\223]oz\1\257\267" \
537 "\277\211\376\377\374\1B\314\347\223\25\274\344\1\237\350\367\220\376" \
538 "\377\374\3\370\376\377n\333\362\31\275\345\211\25\274\344\2J\321\355" \
539 "\356\373\374\220\376\377\374\1\315\362\373\223\25\274\344\1\0\301\350" \
540 "\211\376\377\374\1\316\323\326\223]oz\1\276\303\305\256\376\377\374\377" \
541 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376" \
542 "\377\374\1\346\354\356\223]oz\1\225\245\253\211\376\377\374\1k\327\357" \
543 "\223\25\274\344\1G\317\353\222\376\377\374\3\320\365\376Z\325\354\0\301" \
544 "\350\204\25\274\344\3\0\276\345G\317\353\274\355\373\222\376\377\374" \
545 "\1w\333\356\223\25\274\344\1""3\314\355\211\376\377\374\1\264\274\305" \
546 "\223]oz\1\315\322\325\256\376\377\374\377\377\377\377\377\377\377\377" \
547 "\377\377\377\377\223\377\377\377\256\376\377\374\1\366\373\376\223]o" \
548 "z\1z\215\231\211\376\377\374\1\237\350\367\223\25\274\344\2\31\275\345" \
549 "\335\366\373\223\376\377\374\2\370\376\377\316\363\374\202\261\354\367" \
550 "\2\313\360\371\366\373\376\223\376\377\374\2\370\376\377\0\302\351\223" \
551 "\25\274\344\1n\333\362\211\376\377\374\1\230\250\256\223]oz\1\334\342" \
552 "\344\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
553 "\223\377\377\377\257\376\377\374\1m\200\213\222]oz\1ew\202\211\376\377" \
554 "\374\1\347\370\376\224\25\274\344\1m\332\361\254\376\377\374\1\233\345" \
555 "\364\224\25\274\344\1\261\354\367\211\376\377\374\1}\220\233\223]oz\1" \
556 "\366\370\364\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \
557 "\377\377\223\377\377\377\257\376\377\374\1\211\230\236\223]oz\1\335\343" \
558 "\345\211\376\377\374\1%\305\347\223\25\274\344\2\0\276\345\336\367\374" \
559 "\252\376\377\374\2\367\375\377#\304\346\223\25\274\344\2\31\275\345\357" \
560 "\374\375\210\376\377\374\2\370\372\367as~\222]oz\1m\200\213\257\376\377" \
561 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
562 "\257\376\377\374\1\251\261\271\223]oz\1\264\274\305\211\376\377\374\1" \
563 "k\327\357\224\25\274\344\1L\322\356\252\376\377\374\1\206\340\363\224" \
564 "\25\274\344\1""3\314\355\211\376\377\374\1\322\330\332\223]oz\1\211\230" \
565 "\236\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
566 "\223\377\377\377\257\376\377\374\1\305\312\315\223]oz\1\211\230\236\211" \
567 "\376\377\374\1\301\356\366\225\25\274\344\1\262\355\370\250\376\377\374" \
568 "\2\334\365\372\0\276\345\224\25\274\344\1\220\343\361\211\376\377\374" \
569 "\1\252\262\272\223]oz\1\251\261\271\257\376\377\374\377\377\377\377\377" \
570 "\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\337\344" \
571 "\346\223]oz\2ew\202\373\375\372\210\376\377\374\2\370\376\377#\304\346" \
572 "\224\25\274\344\2\0\302\351\347\370\376\246\376\377\374\2\367\375\377" \
573 ",\311\352\224\25\274\344\2\0\276\345\337\370\375\211\376\377\374\1\177" \
574 "\216\224\223]oz\1\305\312\315\257\376\377\374\377\377\377\377\377\377" \
575 "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\2\373\375\372" \
576 "dv\201\223]oz\1\331\336\341\211\376\377\374\1n\333\362\225\25\274\344" \
577 "\2B\314\347\370\376\377\245\376\377\374\1i\326\356\225\25\274\344\1B" \
578 "\314\347\211\376\377\374\2\362\367\371_q|\223]oz\1\346\354\356\257\376" \
579 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
580 "\377\260\376\377\374\1\210\227\235\223]oz\1\246\256\266\211\376\377\374" \
581 "\1\316\363\374\226\25\274\344\2M\323\357\370\376\377\243\376\377\374" \
582 "\1\206\340\363\226\25\274\344\1\256\350\364\211\376\377\374\1\301\306" \
583 "\311\223]oz\1k~\211\260\376\377\374\377\377\377\377\377\377\377\377\377" \
584 "\377\377\377\223\377\377\377\260\376\377\374\1\257\267\277\223]oz\2i" \
585 "{\206\373\375\372\211\376\377\374\1G\317\353\226\25\274\344\2\\\326\355" \
586 "\370\376\377\241\376\377\374\1\220\343\361\226\25\274\344\2\0\304\352" \
587 "\370\376\377\211\376\377\374\1\204\223\231\223]oz\1\230\240\250\260\376" \
588 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
589 "\377\260\376\377\374\1\331\336\341\224]oz\1\317\324\327\211\376\377\374" \
590 "\1\301\356\366\227\25\274\344\2J\321\355\367\375\377\237\376\377\374" \
591 "\1w\333\356\227\25\274\344\1\206\340\363\211\376\377\374\2\351\356\360" \
592 "^p{\223]oz\1\277\304\306\260\376\377\374\377\377\377\377\377\377\377" \
593 "\377\377\377\377\377\223\377\377\377\260\376\377\374\2\372\374\371cu" \
594 "\200\223]oz\1\222\241\247\212\376\377\374\1/\312\353\227\25\274\344\2" \
595 ",\311\352\334\365\372\234\376\377\374\2\356\373\374I\320\354\227\25\274" \
596 "\344\2\0\301\350\366\373\376\211\376\377\374\1\261\271\302\224]oz\1\343" \
597 "\350\353\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
598 "\377\223\377\377\377\261\376\377\374\1\216\236\244\223]oz\2cu\200\362" \
599 "\367\371\211\376\377\374\1\261\354\367\230\25\274\344\3\0\276\345\233" \
600 "\345\364\370\376\377\231\376\377\374\2\262\355\370\0\304\352\230\25\274" \
601 "\344\1\206\340\363\212\376\377\374\1s\206\221\223]oz\1q\204\217\261\376" \
602 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
603 "\377\261\376\377\374\1\305\312\315\224]oz\1\257\267\277\212\376\377\374" \
604 "\1B\314\347\231\25\274\344\2""1\313\354\303\361\370\226\376\377\374\2" \
605 "\334\365\372J\321\355\231\25\274\344\2#\304\346\366\373\376\211\376\377" \
606 "\374\1\315\322\325\224]oz\1\251\261\271\261\376\377\374\377\377\377\377" \
607 "\377\377\377\377\377\377\377\377\223\377\377\377\261\376\377\374\2\362" \
608 "\367\371as~\223]oz\2hz\205\370\372\367\211\376\377\374\2\334\365\372" \
609 "\0\276\345\232\25\274\344\3B\314\347\262\355\370\370\376\377\221\376" \
610 "\377\374\3\313\360\371L\322\356\0\276\345\232\25\274\344\1\256\350\364" \
611 "\212\376\377\374\1z\215\231\224]oz\1\333\340\343\261\376\377\374\377" \
612 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376" \
613 "\377\374\1\207\226\234\224]oz\1\270\300\311\212\376\377\374\1w\333\356" \
614 "\234\25\274\344\4\0\304\352m\332\361\273\354\371\366\373\376\212\376" \
615 "\377\374\4\370\376\377\302\357\367y\336\360(\307\350\234\25\274\344\1" \
616 "B\314\347\212\376\377\374\1\324\331\333\224]oz\1k~\211\262\376\377\374" \
617 "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262" \
618 "\376\377\374\1\301\306\311\224]oz\2k~\211\372\374\371\211\376\377\374" \
619 "\2\366\373\376(\307\350\236\25\274\344\5\31\275\345,\311\352M\323\357" \
620 "y\336\360\211\342\365\202\233\345\364\5\220\343\361\204\335\361Z\325" \
621 "\3541\313\354\0\276\345\236\25\274\344\2\0\301\350\336\367\374\212\376" \
622 "\377\374\1\205\224\232\224]oz\1\246\256\266\262\376\377\374\377\377\377" \
623 "\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376\377\374" \
624 "\2\367\371\366dv\201\224]oz\1\274\301\303\212\376\377\374\2\315\362\373" \
625 "\0\276\345\307\25\274\344\1\236\347\366\212\376\377\374\1\325\332\334" \
626 "\225]oz\1\341\346\351\262\376\377\374\377\377\377\377\377\377\377\377" \
627 "\377\377\377\377\223\377\377\377\263\376\377\374\1\236\246\256\224]o" \
628 "z\2fx\203\356\363\366\212\376\377\374\1\221\344\362\306\25\274\344\1" \
629 "M\323\357\212\376\377\374\2\372\374\371t\207\222\224]oz\1\177\216\224" \
630 "\263\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
631 "\377\377\377\263\376\377\374\1\333\340\343\225]oz\1\226\246\254\213\376" \
632 "\377\374\1L\322\356\304\25\274\344\2,\311\352\366\373\376\212\376\377" \
633 "\374\1\265\276\306\225]oz\1\302\307\312\263\376\377\374\377\377\377\377" \
634 "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1u\210" \
635 "\224\224]oz\2^p{\331\336\341\212\376\377\374\2\366\373\376/\312\353\302" \
636 "\25\274\344\2\0\302\351\336\367\374\212\376\377\374\2\353\360\363dv\201" \
637 "\224]oz\2dv\201\364\371\374\263\376\377\374\377\377\377\377\377\377\377" \
638 "\377\377\377\377\377\223\377\377\377\264\376\377\374\1\302\307\312\225" \
639 "]oz\2w\212\226\372\374\371\212\376\377\374\2\350\371\377%\305\347\300" \
640 "\25\274\344\2\0\301\350\314\361\372\213\376\377\374\1\227\237\247\225" \
641 "]oz\1\246\256\266\264\376\377\374\377\377\377\377\377\377\377\377\377" \
642 "\377\377\377\223\377\377\377\264\376\377\374\2\372\374\371l\177\212\225" \
643 "]oz\1\252\262\272\213\376\377\374\2\337\370\375\0\304\352\276\25\274" \
644 "\344\2\0\276\345\274\355\373\213\376\377\374\1\305\312\315\225]oz\2a" \
645 "s~\353\360\363\264\376\377\374\377\377\377\377\377\377\377\377\377\377" \
646 "\377\377\223\377\377\377\265\376\377\374\1\270\300\311\225]oz\2^p{\322" \
647 "\330\332\213\376\377\374\2\332\363\370#\304\346\274\25\274\344\2\0\276" \
648 "\345\273\354\371\213\376\377\374\2\343\350\353dv\201\225]oz\1\236\246" \
649 "\256\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
650 "\223\377\377\377\265\376\377\374\2\365\372\375hz\205\225]oz\2i{\206\354" \
651 "\361\364\213\376\377\374\2\337\370\375*\310\351\272\25\274\344\2\0\302" \
652 "\351\314\361\372\213\376\377\374\2\371\373\370x\213\227\225]oz\2_q|\346" \
653 "\354\356\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
654 "\377\223\377\377\377\266\376\377\374\1\261\271\302\226]oz\2\205\224\232" \
655 "\373\375\372\213\376\377\374\2\356\373\374B\314\347\270\25\274\344\2" \
656 "%\305\347\335\366\373\214\376\377\374\1\242\252\262\226]oz\1\231\241" \
657 "\251\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
658 "\223\377\377\377\266\376\377\374\2\370\372\367m\200\213\226]oz\1\242" \
659 "\252\262\214\376\377\374\2\367\375\377i\326\356\266\25\274\344\2B\314" \
660 "\347\350\371\377\214\376\377\374\1\277\304\306\226]oz\2bt\177\351\356" \
661 "\360\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
662 "\223\377\377\377\267\376\377\374\1\305\312\315\227]oz\1\261\271\302\215" \
663 "\376\377\374\2\250\347\371\0\301\350\262\25\274\344\3\31\275\345\206" \
664 "\340\363\370\376\377\214\376\377\374\2\316\323\326_q|\226]oz\1\251\261" \
665 "\271\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
666 "\223\377\377\377\270\376\377\374\1y\214\230\226]oz\2^p{\301\306\311\215" \
667 "\376\377\374\2\335\366\373/\312\353\260\25\274\344\2#\304\346\312\357" \
668 "\370\215\376\377\374\2\330\335\340cu\200\226]oz\2hz\205\366\370\364\267" \
669 "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
670 "\377\377\270\376\377\374\1\332\337\342\230\222\241\247\1\353\360\363" \
671 "\215\376\377\374\3\370\376\377\231\342\362\0\301\350\254\25\274\344\3" \
672 "\0\276\345w\333\356\366\373\376\215\376\377\374\2\365\372\375\236\246" \
673 "\256\227\222\241\247\1\307\315\317\270\376\377\374\377\377\377\377\377" \
674 "\377\377\377\377\377\377\377\223\377\377\377\341\376\377\374\3\356\373" \
675 "\374i\326\356\0\276\345\251\25\274\344\2J\321\355\335\366\373\341\376" \
676 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
677 "\377\343\376\377\374\3\316\363\374Z\325\354\31\275\345\245\25\274\344" \
678 "\2G\317\353\302\357\367\343\376\377\374\377\377\377\377\377\377\377\377" \
679 "\377\377\377\377\223\377\377\377\345\376\377\374\3\336\367\374m\332\361" \
680 "\0\276\345\240\25\274\344\3\31\275\345M\323\357\316\363\374\345\376\377" \
681 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
682 "\347\376\377\374\4\366\373\376\237\350\367I\320\354\31\275\345\232\25" \
683 "\274\344\4\0\276\345B\314\347\231\342\362\356\373\374\347\376\377\374" \
684 "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\352" \
685 "\376\377\374\4\356\373\374\235\346\365Z\325\354#\304\346\224\25\274\344" \
686 "\4\0\302\351L\322\356\221\344\362\336\367\374\352\376\377\374\377\377" \
687 "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\356\376\377" \
688 "\374\6\336\367\374\237\350\367w\333\356M\323\357,\311\352\0\276\345\210" \
689 "\25\274\344\6\0\276\345*\310\351J\321\355n\333\362\233\345\364\320\365" \
690 "\376\356\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
691 "\223\377\377\377\364\376\377\374\10\367\375\377\356\373\374\335\366\373" \
692 "\316\363\374\315\362\373\335\366\373\350\371\377\366\373\376\364\376" \
693 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
694 "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
695 "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
696 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
697 "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
698 "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
699 "\377\377\377\377\377\377\377\377\223\377\377\377\375\376\377\374\202" \
700 "\370\376\377\250\376\377\374\1\367\375\377\217\376\377\374\1\367\375" \
701 "\377\237\376\377\374\1\367\375\377\230\376\377\374\377\377\377\377\377" \
702 "\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374\4\237\350" \
703 "\367\0\276\345\31\275\345\203\334\360\245\376\377\374\5\316\363\374#" \
704 "\304\346\25\274\344G\317\353\367\375\377\213\376\377\374\5\335\366\373" \
705 "(\307\350\25\274\344B\314\347\366\373\376\233\376\377\374\5\356\373\374" \
706 "/\312\353\25\274\344*\310\351\337\370\375\226\376\377\374\377\377\377" \
707 "\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374" \
708 "\1#\304\346\203\25\274\344\1\357\374\375\244\376\377\374\1i\326\356\203" \
709 "\25\274\344\1\260\353\366\213\376\377\374\1n\333\362\203\25\274\344\1" \
710 "\235\346\365\233\376\377\374\1\231\342\362\203\25\274\344\1y\336\360" \
711 "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
712 "\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \
713 "\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377" \
714 "\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340" \
715 "\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377" \
716 "\377\377\377\377\377\377\223\377\377\377\374\376\377\374\1\0\301\350" \
717 "\203\25\274\344\1\336\367\374\244\376\377\374\1I\320\354\203\25\274\344" \
718 "\1\231\342\362\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363" \
719 "\233\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \
720 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
721 "\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377" \
722 "\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357" \
723 "\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274" \
724 "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \
725 "\377\377\223\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1" \
726 "\336\367\374\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362" \
727 "\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377" \
728 "\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377" \
729 "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377" \
730 "\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377\374\1I\320" \
731 "\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357\203\25\274" \
732 "\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274\344\1k\327" \
733 "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
734 "\223\377\377\377\232\376\377\374\7\311\316\321\211\230\236j}\210cu\200" \
735 "n\201\214\233\243\253\333\340\343\206\376\377\374\2\236\246\256dv\201" \
736 "\205]oz\4_q|k~\211\222\241\247\337\344\346\210\376\377\374\7\322\330" \
737 "\332\222\241\247l\177\212cu\200k~\211\222\241\247\322\330\332\206\376" \
738 "\377\374\2\257\267\277gy\204\205]oz\4^p{i{\206\211\230\236\325\332\334" \
739 "\210\376\377\374\10\313\360\371\\\326\355%\305\347\0\276\345\0\302\351" \
740 "G\317\353\237\350\367\370\376\377\205\376\377\374\2\235\346\365\0\304" \
741 "\352\212\25\274\344\4\0\276\345\0\304\352M\323\357\315\362\373\205\376" \
742 "\377\374\1\0\301\350\207\25\274\344\4\0\301\350B\314\347\233\345\364" \
743 "\370\376\377\207\376\377\374\7\302\357\367M\323\357#\304\346\0\276\345" \
744 "\0\304\352J\321\355\260\353\366\210\376\377\374\4\315\362\373M\323\357" \
745 "#\304\346\31\275\345\207\25\274\344\1\231\342\362\204\376\377\374\4\323" \
746 "\364\367\\\326\355%\305\347\0\276\345\207\25\274\344\1\206\340\363\205" \
747 "\376\377\374\10\334\365\372m\332\361(\307\350\0\276\345\0\302\351B\314" \
748 "\347\233\345\364\370\376\377\207\376\377\374\4\336\367\374m\332\361(" \
749 "\307\350\0\276\345\207\25\274\344\1k\327\357\226\376\377\374\377\377" \
750 "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\230\376\377" \
751 "\374\2\356\363\366\202\221\227\206]oz\3^p{\247\257\267\373\375\372\203" \
752 "\376\377\374\1\327\334\337\212]oz\2_q|\303\310\313\205\376\377\374\2" \
753 "\364\371\374\222\241\247\207]oz\2\222\241\247\370\372\367\203\376\377" \
754 "\374\2\353\360\363^p{\212]oz\1\254\264\274\205\376\377\374\2\370\376" \
755 "\377m\332\361\207\25\274\344\2B\314\347\350\371\377\203\376\377\374\2" \
756 "\370\376\377\0\276\345\216\25\274\344\2\31\275\345\235\346\365\204\376" \
757 "\377\374\1\0\301\350\212\25\274\344\2B\314\347\357\374\375\204\376\377" \
758 "\374\2\367\375\377Z\325\354\207\25\274\344\2G\317\353\357\374\375\205" \
759 "\376\377\374\2\235\346\365\31\275\345\212\25\274\344\1\231\342\362\203" \
760 "\376\377\374\2\256\350\364\0\276\345\212\25\274\344\1\206\340\363\204" \
761 "\376\377\374\2\206\340\363\31\275\345\206\25\274\344\2*\310\351\335\366" \
762 "\373\205\376\377\374\2\302\357\367\0\301\350\212\25\274\344\1k\327\357" \
763 "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
764 "\377\377\377\227\376\377\374\2\364\371\374u\210\224\211]oz\1\242\252" \
765 "\262\203\376\377\374\1\306\314\316\213]oz\2_q|\325\332\334\203\376\377" \
766 "\374\2\373\375\372\210\227\235\211]oz\2\211\230\236\373\375\372\202\376" \
767 "\377\374\1\330\335\340\214]oz\1\304\311\314\204\376\377\374\1i\326\356" \
768 "\211\25\274\344\2*\310\351\366\373\376\202\376\377\374\1\357\374\375" \
769 "\220\25\274\344\2\0\276\345\274\355\373\203\376\377\374\1\0\301\350\213" \
770 "\25\274\344\1M\323\357\204\376\377\374\1L\322\356\211\25\274\344\2""3" \
771 "\314\355\370\376\377\203\376\377\374\2\313\360\371\0\276\345\213\25\274" \
772 "\344\1\231\342\362\202\376\377\374\2\333\364\371\0\276\345\213\25\274" \
773 "\344\1\206\340\363\203\376\377\374\1\206\340\363\211\25\274\344\2\0\304" \
774 "\352\347\370\376\203\376\377\374\2\356\373\374\0\304\352\213\25\274\344" \
775 "\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
776 "\377\223\377\377\377\227\376\377\374\1\251\261\271\213]oz\1\322\330\332" \
777 "\202\376\377\374\1\306\314\316\214]oz\1\200\217\225\203\376\377\374\1" \
778 "\277\304\306\213]oz\1\277\304\306\202\376\377\374\1\330\335\340\214]" \
779 "oz\2j}\210\373\375\372\202\376\377\374\1\273\354\371\213\25\274\344\1" \
780 "n\333\362\202\376\377\374\1\357\374\375\221\25\274\344\1""1\313\354\203" \
781 "\376\377\374\1\0\301\350\214\25\274\344\1\332\363\370\202\376\377\374" \
782 "\1\237\350\367\213\25\274\344\1\206\340\363\203\376\377\374\1I\320\354" \
783 "\214\25\274\344\1\231\342\362\202\376\377\374\1M\323\357\214\25\274\344" \
784 "\1\206\340\363\202\376\377\374\2\320\365\376\31\275\345\212\25\274\344" \
785 "\1L\322\356\203\376\377\374\1\203\334\360\214\25\274\344\1k\327\357\226" \
786 "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
787 "\377\377\226\376\377\374\2\370\372\367cu\200\203]oz\5s\206\221\317\324" \
788 "\327\343\350\353\276\303\305ew\202\203]oz\1\210\227\235\202\376\377\374" \
789 "\1\306\314\316\203]oz\1y\214\230\203\347\355\357\2\346\354\356\264\274" \
790 "\305\203]oz\2^p{\357\365\367\202\376\377\374\1p\203\216\203]oz\5k~\211" \
791 "\307\315\317\343\350\353\306\314\316k~\211\203]oz\1p\203\216\202\376" \
792 "\377\374\1\330\335\340\203]oz\1k~\211\204\347\355\357\2\304\311\314_" \
793 "q|\203]oz\1\334\342\344\202\376\377\374\1B\314\347\203\25\274\344\5\0" \
794 "\301\350\233\345\364\333\364\371\260\353\366(\307\350\203\25\274\344" \
795 "\4\0\276\345\367\375\377\376\377\374\357\374\375\204\25\274\344\203\335" \
796 "\366\373\204\25\274\344\3\302\357\367\335\366\373\206\340\363\204\25" \
797 "\274\344\1\356\373\374\202\376\377\374\1\0\301\350\203\25\274\344\1\302" \
798 "\357\367\203\335\366\373\2\302\357\367\0\304\352\203\25\274\344\1\207" \
799 "\341\364\202\376\377\374\1,\311\352\203\25\274\344\5\0\302\351\236\347" \
800 "\366\332\363\370\256\350\364#\304\346\203\25\274\344\5\0\302\351\370" \
801 "\376\377\376\377\374\370\376\377\0\276\345\203\25\274\344\1w\333\356" \
802 "\204\335\366\373\1B\314\347\203\25\274\344\1\231\342\362\202\376\377" \
803 "\374\1\0\276\345\203\25\274\344\2m\332\361\334\365\372\203\335\366\373" \
804 "\1I\320\354\203\25\274\344\1\206\340\363\202\376\377\374\1i\326\356\203" \
805 "\25\274\344\5\0\276\345\206\340\363\323\364\367\273\354\3711\313\354" \
806 "\204\25\274\344\1\335\366\373\202\376\377\374\1,\311\352\203\25\274\344" \
807 "\2L\322\356\332\363\370\203\335\366\373\1n\333\362\203\25\274\344\1k" \
808 "\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
809 "\377\223\377\377\377\226\376\377\374\1\324\331\333\203]oz\2cu\200\353" \
810 "\360\363\203\376\377\374\1\307\315\317\203]oz\4as~\372\374\371\376\377" \
811 "\374\306\314\316\203]oz\1\202\221\227\205\376\377\374\1hz\205\203]oz" \
812 "\3\341\346\351\376\377\374\347\355\357\203]oz\2^p{\335\343\345\203\376" \
813 "\377\374\1\333\340\343\204]oz\3\347\355\357\376\377\374\330\335\340\203" \
814 "]oz\1m\200\213\205\376\377\374\1~\215\223\203]oz\4\313\320\322\376\377" \
815 "\374\370\376\377\31\275\345\203\25\274\344\1\256\350\364\203\376\377" \
816 "\374\2\336\367\374\0\276\345\203\25\274\344\3\274\355\373\376\377\374" \
817 "\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367" \
818 "\374\202\376\377\374\1\0\301\350\203\25\274\344\1\323\364\367\202\376" \
819 "\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374\1n" \
820 "\333\362\203\25\274\344\3m\332\361\376\377\374\356\373\374\204\25\274" \
821 "\344\1\274\355\373\203\376\377\374\2\323\364\367\0\276\345\203\25\274" \
822 "\344\3\315\362\373\376\377\374\335\366\373\203\25\274\344\2\0\276\345" \
823 "\370\376\377\204\376\377\374\1I\320\354\203\25\274\344\3\231\342\362" \
824 "\376\377\374\366\373\376\204\25\274\344\1\366\373\376\204\376\377\374" \
825 "\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\1%\305\347\203" \
826 "\25\274\344\1\207\341\364\203\376\377\374\2\360\375\376\0\304\352\203" \
827 "\25\274\344\1\233\345\364\202\376\377\374\1\0\301\350\203\25\274\344" \
828 "\1\323\364\367\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357" \
829 "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
830 "\377\377\377\226\376\377\374\1\303\310\313\203]oz\1\204\223\231\204\376" \
831 "\377\374\2\370\372\367_q|\203]oz\3\354\361\364\376\377\374\306\314\316" \
832 "\203]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351" \
833 "\376\377\374\326\333\335\203]oz\1n\201\214\205\376\377\374\1l\177\212" \
834 "\203]oz\3\327\334\337\376\377\374\330\335\340\203]oz\1m\200\213\205\376" \
835 "\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\337\370\375\203" \
836 "\25\274\344\2\31\275\345\370\376\377\204\376\377\374\1""3\314\355\203" \
837 "\25\274\344\3\236\347\366\376\377\374\357\374\375\204\25\274\344\203" \
838 "\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346" \
839 "\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274" \
840 "\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357" \
841 "\376\377\374\315\362\373\203\25\274\344\1\0\301\350\205\376\377\374\1" \
842 "*\310\351\203\25\274\344\3\261\354\367\376\377\374\316\363\374\203\25" \
843 "\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \
844 "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \
845 "\357\203\25\274\344\1\206\340\363\202\376\377\374\1\31\275\345\203\25" \
846 "\274\344\1\335\366\373\204\376\377\374\1M\323\357\203\25\274\344\1\203" \
847 "\334\360\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204" \
848 "\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374" \
849 "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226" \
850 "\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202" \
851 "\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205" \
852 "\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327" \
853 "\203]oz\1as~\205o\202\215\1as~\203]oz\3\317\324\327\376\377\374\330\335" \
854 "\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306\314" \
855 "\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\205%\305\347" \
856 "\1\0\276\345\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204" \
857 "\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377" \
858 "\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301" \
859 "\350\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274" \
860 "\344\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\31\275\345\205" \
861 "%\305\347\1\0\276\345\203\25\274\344\3\237\350\367\376\377\374\316\363" \
862 "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \
863 "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \
864 "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274" \
865 "\344\1#\304\346\204%\305\347\1\0\301\350\203\25\274\344\1w\333\356\202" \
866 "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \
867 "\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377" \
868 "\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376\377\374" \
869 "\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203]oz\3" \
870 "\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376\377" \
871 "\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215]oz\3" \
872 "\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374" \
873 "\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25\274" \
874 "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376\377" \
875 "\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274" \
876 "\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \
877 "\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376\377\374" \
878 "\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363\374\203" \
879 "\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \
880 "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \
881 "\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274\344\1w\333" \
882 "\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376" \
883 "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \
884 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376" \
885 "\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203" \
886 "]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376" \
887 "\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215" \
888 "]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377" \
889 "\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25" \
890 "\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376" \
891 "\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203" \
892 "\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344" \
893 "\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376" \
894 "\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363" \
895 "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \
896 "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \
897 "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274" \
898 "\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \
899 "\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376" \
900 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
901 "\377\226\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374" \
902 "\1ew\202\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221" \
903 "\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317" \
904 "\324\327\215]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213" \
905 "\205\376\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367" \
906 "\374\215\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274" \
907 "\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#" \
908 "\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203" \
909 "\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3" \
910 "k\327\357\376\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377" \
911 "\374\316\363\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354" \
912 "\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344" \
913 "\205\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377" \
914 "\374\215\25\274\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274" \
915 "\344\1\336\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327" \
916 "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
917 "\223\377\377\377\226\376\377\374\1\300\305\310\203]oz\1\211\230\236\205" \
918 "\376\377\374\1bt\177\203]oz\3\352\357\362\376\377\374\306\314\316\203" \
919 "]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376" \
920 "\377\374\317\324\327\203]oz\1p\203\216\211\335\343\345\3\366\370\364" \
921 "\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \
922 "\227\203]oz\3\306\314\316\376\377\374\336\367\374\203\25\274\344\1\0" \
923 "\276\345\211\314\361\372\3\350\371\377\376\377\374\357\374\375\204\25" \
924 "\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374" \
925 "\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350" \
926 "\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344" \
927 "\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\0\302\351\211\314" \
928 "\361\372\3\356\373\374\376\377\374\316\363\374\203\25\274\344\1\0\301" \
929 "\350\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376\377" \
930 "\374\357\374\375\204\25\274\344\205\376\377\374\1M\323\357\203\25\274" \
931 "\344\1\206\340\363\202\376\377\374\204\25\274\344\1\301\356\366\210\314" \
932 "\361\372\1\337\370\375\202\376\377\374\1\0\301\350\203\25\274\344\1\336" \
933 "\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226" \
934 "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
935 "\377\377\226\376\377\374\1\314\321\324\203]oz\2l\177\212\372\374\371" \
936 "\203\376\377\374\1\333\340\343\203]oz\4^p{\366\373\376\376\377\374\306" \
937 "\314\316\203]oz\1\202\221\227\205\376\377\374\1k~\211\203]oz\3\341\346" \
938 "\351\376\377\374\320\326\330\203]oz\1t\207\222\213\376\377\374\1\330" \
939 "\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306" \
940 "\314\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\213\376\377" \
941 "\374\1\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336" \
942 "\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202" \
943 "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \
944 "\1n\333\362\203\25\274\344\3k\327\357\376\377\374\303\361\370\203\25" \
945 "\274\344\1\0\304\352\213\376\377\374\1\332\363\370\203\25\274\344\1\0" \
946 "\276\345\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376" \
947 "\377\374\357\374\375\204\25\274\344\1\370\376\377\204\376\377\374\1M" \
948 "\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274\344" \
949 "\1\356\373\374\213\376\377\374\1\0\301\350\203\25\274\344\1\335\366\373" \
950 "\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \
951 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
952 "\226\376\377\374\2\353\360\363^p{\203]oz\5\236\246\256\366\373\376\376" \
953 "\377\374\347\355\357w\212\226\203]oz\1~\215\223\202\376\377\374\1\306" \
954 "\314\316\203]oz\1\202\221\227\204\376\377\374\2\335\343\345^p{\203]o" \
955 "z\3\351\356\360\376\377\374\335\343\345\203]oz\2bt\177\343\350\353\212" \
956 "\376\377\374\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \
957 "\227\203]oz\3\306\314\316\376\377\374\356\373\374\204\25\274\344\1\274" \
958 "\355\373\212\376\377\374\1\357\374\375\204\25\274\344\203\376\377\374" \
959 "\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344" \
960 "\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \
961 "\203\376\377\374\2\367\375\377/\312\353\203\25\274\344\3\204\335\361" \
962 "\376\377\374\334\365\372\203\25\274\344\2\0\276\345\314\361\372\212\376" \
963 "\377\374\1\356\373\374\204\25\274\344\1\274\355\373\204\376\377\374\1" \
964 "I\320\354\203\25\274\344\4\231\342\362\376\377\374\370\376\377\0\276" \
965 "\345\203\25\274\344\1\257\351\365\204\376\377\374\1M\323\357\203\25\274" \
966 "\344\1\206\340\363\202\376\377\374\1\0\301\350\203\25\274\344\1\233\345" \
967 "\364\213\376\377\374\1#\304\346\203\25\274\344\1\207\341\364\204\376" \
968 "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \
969 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\227\376" \
970 "\377\374\1\211\230\236\204]oz\3cu\200p\203\216^p{\204]oz\1\277\304\306" \
971 "\202\376\377\374\1\306\314\316\203]oz\1dv\201\203~\215\223\2v\211\225" \
972 "as~\203]oz\1n\201\214\202\376\377\374\2\371\373\370dv\201\203]oz\2bt" \
973 "\177w\212\226\205~\215\223\2\203\222\230\304\311\314\202\376\377\374" \
974 "\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]o" \
975 "z\1\306\314\316\202\376\377\374\1(\307\350\203\25\274\344\2\0\276\345" \
976 "*\310\351\205,\311\352\2""1\313\354\207\341\364\202\376\377\374\1\357" \
977 "\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374" \
978 "\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377" \
979 "\374\1\0\301\350\203\25\274\344\1*\310\351\203,\311\352\1\0\302\351\204" \
980 "\25\274\344\4\274\355\373\376\377\374\370\376\377\0\302\351\203\25\274" \
981 "\344\2\31\275\345*\310\351\205,\311\352\2B\314\347\231\342\362\203\376" \
982 "\377\374\1%\305\347\203\25\274\344\2\0\276\345*\310\351\203,\311\352" \
983 "\1\0\301\350\203\25\274\344\1\231\342\362\202\376\377\374\1/\312\353" \
984 "\203\25\274\344\2\0\276\345*\310\351\203,\311\352\1\0\301\350\203\25" \
985 "\274\344\1\206\340\363\202\376\377\374\1G\317\353\204\25\274\344\1(\307" \
986 "\350\205,\311\352\3""1\313\354w\333\356\370\376\377\202\376\377\374\1" \
987 "M\323\357\204\25\274\344\1(\307\350\203,\311\352\1\0\304\352\203\25\274" \
988 "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \
989 "\377\377\223\377\377\377\227\376\377\374\2\343\350\353ew\202\211]oz\2" \
990 "\177\216\224\373\375\372\202\376\377\374\1\306\314\316\214]oz\1\270\300" \
991 "\311\203\376\377\374\1\253\263\273\213]oz\4_q|\352\357\362\376\377\374" \
992 "\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\1" \
993 "\306\314\316\202\376\377\374\1\233\345\364\214\25\274\344\3\301\356\366" \
994 "\376\377\374\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344" \
995 "\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374" \
996 "\202\376\377\374\1\0\301\350\213\25\274\344\2,\311\352\370\376\377\202" \
997 "\376\377\374\1\206\340\363\214\25\274\344\1\316\363\374\202\376\377\374" \
998 "\1\233\345\364\214\25\274\344\1\231\342\362\202\376\377\374\1\250\347" \
999 "\371\214\25\274\344\1\206\340\363\202\376\377\374\1\273\354\371\214\25" \
1000 "\274\344\1\236\347\366\202\376\377\374\2\313\360\371\0\276\345\213\25" \
1001 "\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377" \
1002 "\377\377\377\223\377\377\377\230\376\377\374\2\325\332\334gy\204\207" \
1003 "]oz\2x\213\227\354\361\364\203\376\377\374\1\306\314\316\213]oz\1\225" \
1004 "\235\245\204\376\377\374\2\372\374\371~\221\235\213]oz\3\333\340\343" \
1005 "\376\377\374\342\347\352\203]oz\1t\207\222\205\376\377\374\1\211\230" \
1006 "\236\203]oz\1\317\324\327\203\376\377\374\1M\323\357\213\25\274\344\4" \
1007 "\237\350\367\376\377\374\367\375\377\0\276\345\202\25\274\344\1\0\276" \
1008 "\345\203\376\377\374\1\0\301\350\203\25\274\344\1\357\374\375\202\376" \
1009 "\377\374\1(\307\350\203\25\274\344\1\335\366\373\202\376\377\374\1\0" \
1010 "\302\351\212\25\274\344\2\0\301\350\333\364\371\203\376\377\374\2\370" \
1011 "\376\377G\317\353\213\25\274\344\1\273\354\371\203\376\377\374\1M\323" \
1012 "\357\213\25\274\344\1\237\350\367\203\376\377\374\1k\327\357\213\25\274" \
1013 "\344\1\231\342\362\203\376\377\374\1w\333\356\213\25\274\344\1\206\340" \
1014 "\363\203\376\377\374\1\207\341\364\213\25\274\344\1n\333\362\226\376" \
1015 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
1016 "\377\231\376\377\374\3\351\356\360\231\241\251bt\177\203]oz\3k~\211\257" \
1017 "\267\277\370\372\367\204\376\377\374\1\306\314\316\211]oz\3gy\204\261" \
1018 "\271\302\373\375\372\205\376\377\374\3\371\373\370\252\262\272dv\201" \
1019 "\210]oz\2x\213\227\372\374\371\202\376\377\374\4}\220\233]oz^p{\266\277" \
1020 "\307\205\376\377\374\5\311\316\321_q|]ozq\204\217\370\372\367\203\376" \
1021 "\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344\2\0\304\352" \
1022 "\356\373\374\202\376\377\374\1M\323\357\202\25\274\344\1m\332\361\203" \
1023 "\376\377\374\1n\333\362\202\25\274\344\1L\322\356\203\376\377\374\1\206" \
1024 "\340\363\202\25\274\344\2B\314\347\370\376\377\202\376\377\374\1w\333" \
1025 "\356\210\25\274\344\3\0\276\345L\322\356\336\367\374\205\376\377\374" \
1026 "\3\370\376\377\204\335\361\0\301\350\210\25\274\344\2(\307\350\366\373" \
1027 "\376\203\376\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344" \
1028 "\2#\304\346\356\373\374\204\376\377\374\2\233\345\364\0\302\351\210\25" \
1029 "\274\344\2\0\302\351\337\370\375\204\376\377\374\2\237\350\367#\304\346" \
1030 "\210\25\274\344\2\0\301\350\333\364\371\204\376\377\374\2\257\351\365" \
1031 "%\305\347\210\25\274\344\2\0\276\345\314\361\372\226\376\377\374\377" \
1032 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\233\376" \
1033 "\377\374\4\365\372\375\335\343\345\325\332\334\343\350\353\207\376\377" \
1034 "\374\1\306\314\316\203]oz\1u\210\224\204\324\331\333\2\335\343\345\373" \
1035 "\375\372\211\376\377\374\2\372\374\371\334\342\344\206\324\331\333\2" \
1036 "\331\336\341\372\374\371\203\376\377\374\3\373\375\372\332\337\342\343" \
1037 "\350\353\207\376\377\374\3\351\356\360\330\335\340\366\373\376\206\376" \
1038 "\377\374\2\370\376\377\316\363\374\206\273\354\371\2\302\357\367\366" \
1039 "\373\376\204\376\377\374\2\314\361\372\315\362\373\205\376\377\374\2" \
1040 "\316\363\374\313\360\371\205\376\377\374\3\332\363\370\312\357\370\370" \
1041 "\376\377\204\376\377\374\1\316\363\374\206\273\354\371\2\302\357\367" \
1042 "\356\373\374\211\376\377\374\2\370\376\377\314\361\372\206\273\354\371" \
1043 "\2\302\357\367\367\375\377\206\376\377\374\2\370\376\377\316\363\374" \
1044 "\206\273\354\371\2\302\357\367\366\373\376\206\376\377\374\2\370\376" \
1045 "\377\316\363\374\206\273\354\371\2\301\356\366\357\374\375\207\376\377" \
1046 "\374\1\332\363\370\206\273\354\371\2\301\356\366\356\373\374\207\376" \
1047 "\377\374\2\333\364\371\274\355\373\205\273\354\371\2\274\355\373\350" \
1048 "\371\377\227\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
1049 "\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202\221\227" \
1050 "\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377\377\377" \
1051 "\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202" \
1052 "\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377" \
1053 "\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203" \
1054 "]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377" \
1055 "\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314" \
1056 "\316\203]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377" \
1057 "\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374" \
1058 "\1\315\322\325\203]oz\1\211\230\236\377\376\377\374\306\376\377\374\377" \
1059 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376" \
1060 "\377\374\2\360\366\370i{\206\202]oz\1\302\307\312\377\376\377\374\306" \
1061 "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
1062 "\377\377\247\376\377\374\3\357\365\367\313\320\322\335\343\345\377\376" \
1063 "\377\374\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
1064 "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
1065 "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \
1066 "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
1067 "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \
1068 "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \
1069 "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \
1070 "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \
1071 "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \
1072 "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \
1073 "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
1074 "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \
1075 "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \
1076 "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
1077 "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \
1078 "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \
1079 "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \
1080 "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
1081 "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
1082 "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \
1083 "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
1084 "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
1085 "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
1086 "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
1087 "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
1088 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1089 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1090 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1091 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1092 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1093 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1094 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1095 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1096 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1097 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1098 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1099 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1100 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1101 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1102 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1103 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1104 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1105 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1106 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1107 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1108 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1109 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1110 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1111 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1112 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1113 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1114 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1115 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1116 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1117 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1118 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1119 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1120 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1121 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1122 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1123 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1124 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1125 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1126 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1127 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1128 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1129 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1130 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1131 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1132 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1133 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1134 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1135 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1136 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1137 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1138 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1139 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1140 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1141 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1142 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1143 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1144 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1145 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1146 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1147 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1148 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1149 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1150 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1151 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1152 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1153 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1154 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1155 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1156 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1157 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1158 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1159 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1160 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1161 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1162 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1163 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1164 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1165 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1166 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1167 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1168 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1169 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1170 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1171 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1172 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1173 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1174 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1175 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1176 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1177 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1178 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1179 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1180 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1181 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1182 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1183 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1184 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1185 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1186 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1187 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1188 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1189 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1190 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1191 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1192 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1193 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1194 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1195 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1196 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1197 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1198 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1199 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1200 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1201 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1202 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1203 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1204 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1205 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1206 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1207 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1208 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1209 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1210 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1211 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1212 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1213 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1214 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1215 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1216 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1217 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1218 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1219 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1220 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1221 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1222 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1223 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1224 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1225 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1226 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1227 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1228 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1229 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1230 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1231 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1232 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1233 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1234 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1235 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1236 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1237 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1238 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1239 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1240 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1241 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1242 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1243 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1244 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1245 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1246 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1247 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1248 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1249 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1250 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1251 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1252 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1253 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1254 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1255 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1256 "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
1257 "\377\377\377\377\232\377\377\377")
1258
1259
diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb
new file mode 100644
index 0000000000..628ced4d49
--- /dev/null
+++ b/meta/recipes-core/psplash/psplash_git.bb
@@ -0,0 +1,111 @@
1SUMMARY = "Userspace framebuffer boot logo based on usplash"
2DESCRIPTION = "PSplash is a userspace graphical boot splash screen for mainly embedded Linux devices supporting a 16bpp or 32bpp framebuffer. It has few dependencies (just libc), supports basic images and text and handles rotation. Its visual look is configurable by basic source changes. Also included is a 'client' command utility for sending information to psplash such as boot progress information."
3HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash"
4SECTION = "base"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=16;md5=840fb2356b10a85bed78dd09dc7745c6"
7
8SRCREV = "afd4e228c606a9998feae44a3fed4474803240b7"
9PV = "0.1+git${SRCPV}"
10PR = "r15"
11
12SRC_URI = "git://git.yoctoproject.org/${BPN} \
13 file://psplash-init \
14 ${SPLASH_IMAGES}"
15
16SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"
17
18python __anonymous() {
19 oldpkgs = d.getVar("PACKAGES", True).split()
20 splashfiles = d.getVar('SPLASH_IMAGES', True).split()
21 pkgs = []
22 localpaths = []
23 haspng = False
24 for uri in splashfiles:
25 fetcher = bb.fetch2.Fetch([uri], d)
26 flocal = os.path.basename(fetcher.localpath(uri))
27 fbase = os.path.splitext(flocal)[0]
28 outsuffix = fetcher.ud[uri].parm.get("outsuffix")
29 if not outsuffix:
30 if fbase.startswith("psplash-"):
31 outsuffix = fbase[8:]
32 else:
33 outsuffix = fbase
34 if outsuffix.endswith('-img'):
35 outsuffix = outsuffix[:-4]
36 outname = "psplash-%s" % outsuffix
37 if outname == '' or outname in oldpkgs:
38 bb.fatal("The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter" % (outname, uri))
39 else:
40 pkgs.append(outname)
41 if flocal.endswith(".png"):
42 haspng = True
43 localpaths.append(flocal)
44
45 # Set these so that we have less work to do in do_compile and do_install_append
46 d.setVar("SPLASH_INSTALL", " ".join(pkgs))
47 d.setVar("SPLASH_LOCALPATHS", " ".join(localpaths))
48
49 if haspng:
50 d.appendVar("DEPENDS", " gdk-pixbuf-native")
51
52 d.prependVar("PACKAGES", "%s " % (" ".join(pkgs)))
53 mlprefix = d.getVar('MLPREFIX', True) or ''
54 pn = d.getVar('PN', True) or ''
55 for p in pkgs:
56 ep = '%s%s' % (mlprefix, p)
57 epsplash = '%s%s' % (mlprefix, 'psplash')
58 d.setVar("FILES_%s" % ep, "${bindir}/%s" % p)
59 d.setVar("ALTERNATIVE_%s" % ep, 'psplash')
60 d.setVarFlag("ALTERNATIVE_TARGET_%s" % ep, 'psplash', '${bindir}/%s' % p)
61 d.appendVar("RDEPENDS_%s" % ep, " %s" % pn)
62 if p == "psplash-default":
63 d.appendVar("RRECOMMENDS_%s" % pn, " %s" % ep)
64}
65
66S = "${WORKDIR}/git"
67
68inherit autotools pkgconfig update-rc.d update-alternatives
69
70ALTERNATIVE_PRIORITY = "100"
71ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash"
72
73python do_compile () {
74 import shutil
75
76 # Build a separate executable for each splash image
77 workdir = d.getVar('WORKDIR', True)
78 convertscript = "%s/make-image-header.sh" % d.getVar('S', True)
79 destfile = "%s/psplash-poky-img.h" % d.getVar('S', True)
80 localfiles = d.getVar('SPLASH_LOCALPATHS', True).split()
81 outputfiles = d.getVar('SPLASH_INSTALL', True).split()
82 for localfile, outputfile in zip(localfiles, outputfiles):
83 if localfile.endswith(".png"):
84 outp = oe.utils.getstatusoutput('%s %s POKY' % (convertscript, os.path.join(workdir, localfile)))
85 print(outp[1])
86 fbase = os.path.splitext(localfile)[0]
87 shutil.copyfile("%s-img.h" % fbase, destfile)
88 else:
89 shutil.copyfile(os.path.join(workdir, localfile), destfile)
90 # For some reason just updating the header is not enough, we have to touch the .c
91 # file in order to get it to rebuild
92 os.utime("%s/psplash.c" % d.getVar('S', True), None)
93 bb.build.exec_func("oe_runmake", d)
94 shutil.copyfile("psplash", outputfile)
95}
96
97do_install_append() {
98 install -d ${D}/mnt/.psplash/
99 install -d ${D}${sysconfdir}/init.d/
100 install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh
101 install -d ${D}${bindir}
102 for i in ${SPLASH_INSTALL} ; do
103 install -m 0755 $i ${D}${bindir}/$i
104 done
105 rm -f ${D}${bindir}/psplash
106}
107
108FILES_${PN} += "/mnt/.psplash"
109
110INITSCRIPT_NAME = "psplash.sh"
111INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."
diff --git a/meta/recipes-core/readline/files/acinclude.m4 b/meta/recipes-core/readline/files/acinclude.m4
new file mode 100644
index 0000000000..c30a7d3054
--- /dev/null
+++ b/meta/recipes-core/readline/files/acinclude.m4
@@ -0,0 +1,1871 @@
1dnl
2dnl Bash specific tests
3dnl
4dnl Some derived from PDKSH 5.1.3 autoconf tests
5dnl
6
7AC_DEFUN([BASH_C_LONG_LONG],
8[AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
9[if test "$GCC" = yes; then
10 ac_cv_c_long_long=yes
11else
12AC_TRY_RUN([
13int
14main()
15{
16long long foo = 0;
17exit(sizeof(long long) < sizeof(long));
18}
19], ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
20fi])
21if test $ac_cv_c_long_long = yes; then
22 AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.])
23fi
24])
25
26dnl
27dnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIX
28dnl (< changed to <=) added.
29dnl
30AC_DEFUN([BASH_C_LONG_DOUBLE],
31[AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
32[if test "$GCC" = yes; then
33 ac_cv_c_long_double=yes
34else
35AC_TRY_RUN([
36int
37main()
38{
39 /* The Stardent Vistra knows sizeof(long double), but does not
40 support it. */
41 long double foo = 0.0;
42 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
43 /* On IRIX 5.3, the compiler converts long double to double with a warning,
44 but compiles this successfully. */
45 exit(sizeof(long double) <= sizeof(double));
46}
47], ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
48fi])
49if test $ac_cv_c_long_double = yes; then
50 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.])
51fi
52])
53
54dnl
55dnl Check for <inttypes.h>. This is separated out so that it can be
56dnl AC_REQUIREd.
57dnl
58dnl BASH_HEADER_INTTYPES
59AC_DEFUN([BASH_HEADER_INTTYPES],
60[
61 AC_CHECK_HEADERS(inttypes.h)
62])
63
64dnl
65dnl check for typedef'd symbols in header files, but allow the caller to
66dnl specify the include files to be checked in addition to the default
67dnl
68dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND])
69AC_DEFUN([BASH_CHECK_TYPE],
70[
71AC_REQUIRE([AC_HEADER_STDC])dnl
72AC_REQUIRE([BASH_HEADER_INTTYPES])
73AC_MSG_CHECKING(for $1)
74AC_CACHE_VAL(bash_cv_type_$1,
75[AC_EGREP_CPP($1, [#include <sys/types.h>
76#if STDC_HEADERS
77#include <stdlib.h>
78#include <stddef.h>
79#endif
80#if HAVE_INTTYPES_H
81#include <inttypes.h>
82#endif
83$2
84], bash_cv_type_$1=yes, bash_cv_type_$1=no)])
85AC_MSG_RESULT($bash_cv_type_$1)
86ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then
87 AC_DEFINE($4)
88 fi])
89if test $bash_cv_type_$1 = no; then
90 AC_DEFINE_UNQUOTED($1, $3)
91fi
92])
93
94dnl
95dnl BASH_CHECK_DECL(FUNC)
96dnl
97dnl Check for a declaration of FUNC in stdlib.h and inttypes.h like
98dnl AC_CHECK_DECL
99dnl
100AC_DEFUN([BASH_CHECK_DECL],
101[
102AC_REQUIRE([AC_HEADER_STDC])
103AC_REQUIRE([BASH_HEADER_INTTYPES])
104AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1,
105[AC_TRY_LINK(
106[
107#if STDC_HEADERS
108# include <stdlib.h>
109#endif
110#if HAVE_INTTYPES_H
111# include <inttypes.h>
112#endif
113],
114[return !$1;],
115bash_cv_decl_$1=yes, bash_cv_decl_$1=no)])
116bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
117if test $bash_cv_decl_$1 = yes; then
118 AC_DEFINE_UNQUOTED($bash_tr_func, 1)
119else
120 AC_DEFINE_UNQUOTED($bash_tr_func, 0)
121fi
122])
123
124AC_DEFUN([BASH_DECL_PRINTF],
125[AC_MSG_CHECKING(for declaration of printf in <stdio.h>)
126AC_CACHE_VAL(bash_cv_printf_declared,
127[AC_TRY_RUN([
128#include <stdio.h>
129#ifdef __STDC__
130typedef int (*_bashfunc)(const char *, ...);
131#else
132typedef int (*_bashfunc)();
133#endif
134main()
135{
136_bashfunc pf;
137pf = (_bashfunc) printf;
138exit(pf == 0);
139}
140], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
141 [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)
142 bash_cv_printf_declared=yes]
143)])
144AC_MSG_RESULT($bash_cv_printf_declared)
145if test $bash_cv_printf_declared = yes; then
146AC_DEFINE(PRINTF_DECLARED)
147fi
148])
149
150AC_DEFUN([BASH_DECL_SBRK],
151[AC_MSG_CHECKING(for declaration of sbrk in <unistd.h>)
152AC_CACHE_VAL(bash_cv_sbrk_declared,
153[AC_EGREP_HEADER(sbrk, unistd.h,
154 bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)])
155AC_MSG_RESULT($bash_cv_sbrk_declared)
156if test $bash_cv_sbrk_declared = yes; then
157AC_DEFINE(SBRK_DECLARED)
158fi
159])
160
161dnl
162dnl Check for sys_siglist[] or _sys_siglist[]
163dnl
164AC_DEFUN([BASH_DECL_UNDER_SYS_SIGLIST],
165[AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h])
166AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,
167[AC_TRY_COMPILE([
168#include <sys/types.h>
169#include <signal.h>
170#ifdef HAVE_UNISTD_H
171#include <unistd.h>
172#endif], [ char *msg = _sys_siglist[2]; ],
173 bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
174 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
175AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
176if test $bash_cv_decl_under_sys_siglist = yes; then
177AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
178fi
179])
180
181AC_DEFUN([BASH_UNDER_SYS_SIGLIST],
182[AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
183AC_MSG_CHECKING([for _sys_siglist in system C library])
184AC_CACHE_VAL(bash_cv_under_sys_siglist,
185[AC_TRY_RUN([
186#include <sys/types.h>
187#include <signal.h>
188#ifdef HAVE_UNISTD_H
189#include <unistd.h>
190#endif
191#ifndef UNDER_SYS_SIGLIST_DECLARED
192extern char *_sys_siglist[];
193#endif
194main()
195{
196char *msg = (char *)_sys_siglist[2];
197exit(msg == 0);
198}],
199 bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
200 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
201 bash_cv_under_sys_siglist=no])])
202AC_MSG_RESULT($bash_cv_under_sys_siglist)
203if test $bash_cv_under_sys_siglist = yes; then
204AC_DEFINE(HAVE_UNDER_SYS_SIGLIST)
205fi
206])
207
208AC_DEFUN([BASH_SYS_SIGLIST],
209[
210AC_CHECK_DECLS([sys_siglist])
211AC_MSG_CHECKING([for sys_siglist in system C library])
212AC_CACHE_VAL(bash_cv_sys_siglist,
213[AC_TRY_RUN([
214#include <sys/types.h>
215#include <signal.h>
216#ifdef HAVE_UNISTD_H
217#include <unistd.h>
218#endif
219#ifndef HAVE_DECL_SYS_SIGLIST
220extern char *sys_siglist[];
221#endif
222main()
223{
224char *msg = sys_siglist[2];
225exit(msg == 0);
226}],
227 bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
228 [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)
229 bash_cv_sys_siglist=no])])
230AC_MSG_RESULT($bash_cv_sys_siglist)
231if test $bash_cv_sys_siglist = yes; then
232AC_DEFINE(HAVE_SYS_SIGLIST)
233fi
234])
235
236dnl Check for the various permutations of sys_siglist and make sure we
237dnl compile in siglist.o if they're not defined
238AC_DEFUN([BASH_CHECK_SYS_SIGLIST], [
239AC_REQUIRE([BASH_SYS_SIGLIST])
240AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
241AC_REQUIRE([BASH_FUNC_STRSIGNAL])
242if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then
243 SIGLIST_O=siglist.o
244else
245 SIGLIST_O=
246fi
247AC_SUBST([SIGLIST_O])
248])
249
250dnl Check for sys_errlist[] and sys_nerr, check for declaration
251AC_DEFUN([BASH_SYS_ERRLIST],
252[AC_MSG_CHECKING([for sys_errlist and sys_nerr])
253AC_CACHE_VAL(bash_cv_sys_errlist,
254[AC_TRY_LINK([#include <errno.h>],
255[extern char *sys_errlist[];
256 extern int sys_nerr;
257 char *msg = sys_errlist[sys_nerr - 1];],
258 bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnl
259AC_MSG_RESULT($bash_cv_sys_errlist)
260if test $bash_cv_sys_errlist = yes; then
261AC_DEFINE(HAVE_SYS_ERRLIST)
262fi
263])
264
265dnl
266dnl Check if dup2() does not clear the close on exec flag
267dnl
268AC_DEFUN([BASH_FUNC_DUP2_CLOEXEC_CHECK],
269[AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag)
270AC_CACHE_VAL(bash_cv_dup2_broken,
271[AC_TRY_RUN([
272#include <sys/types.h>
273#include <fcntl.h>
274main()
275{
276 int fd1, fd2, fl;
277 fd1 = open("/dev/null", 2);
278 if (fcntl(fd1, 2, 1) < 0)
279 exit(1);
280 fd2 = dup2(fd1, 1);
281 if (fd2 < 0)
282 exit(2);
283 fl = fcntl(fd2, 1, 0);
284 /* fl will be 1 if dup2 did not reset the close-on-exec flag. */
285 exit(fl != 1);
286}
287], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
288 [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)
289 bash_cv_dup2_broken=no])
290])
291AC_MSG_RESULT($bash_cv_dup2_broken)
292if test $bash_cv_dup2_broken = yes; then
293AC_DEFINE(DUP2_BROKEN)
294fi
295])
296
297AC_DEFUN([BASH_FUNC_STRSIGNAL],
298[AC_MSG_CHECKING([for the existence of strsignal])
299AC_CACHE_VAL(bash_cv_have_strsignal,
300[AC_TRY_LINK([#include <sys/types.h>
301#include <signal.h>],
302[char *s = (char *)strsignal(2);],
303 bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])
304AC_MSG_RESULT($bash_cv_have_strsignal)
305if test $bash_cv_have_strsignal = yes; then
306AC_DEFINE(HAVE_STRSIGNAL)
307fi
308])
309
310dnl Check to see if opendir will open non-directories (not a nice thing)
311AC_DEFUN([BASH_FUNC_OPENDIR_CHECK],
312[AC_REQUIRE([AC_HEADER_DIRENT])dnl
313AC_MSG_CHECKING(if opendir() opens non-directories)
314AC_CACHE_VAL(bash_cv_opendir_not_robust,
315[AC_TRY_RUN([
316#include <stdio.h>
317#include <sys/types.h>
318#include <fcntl.h>
319#ifdef HAVE_UNISTD_H
320# include <unistd.h>
321#endif /* HAVE_UNISTD_H */
322#if defined(HAVE_DIRENT_H)
323# include <dirent.h>
324#else
325# define dirent direct
326# ifdef HAVE_SYS_NDIR_H
327# include <sys/ndir.h>
328# endif /* SYSNDIR */
329# ifdef HAVE_SYS_DIR_H
330# include <sys/dir.h>
331# endif /* SYSDIR */
332# ifdef HAVE_NDIR_H
333# include <ndir.h>
334# endif
335#endif /* HAVE_DIRENT_H */
336main()
337{
338DIR *dir;
339int fd, err;
340err = mkdir("/tmp/bash-aclocal", 0700);
341if (err < 0) {
342 perror("mkdir");
343 exit(1);
344}
345unlink("/tmp/bash-aclocal/not_a_directory");
346fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
347write(fd, "\n", 1);
348close(fd);
349dir = opendir("/tmp/bash-aclocal/not_a_directory");
350unlink("/tmp/bash-aclocal/not_a_directory");
351rmdir("/tmp/bash-aclocal");
352exit (dir == 0);
353}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
354 [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
355 bash_cv_opendir_not_robust=no]
356)])
357AC_MSG_RESULT($bash_cv_opendir_not_robust)
358if test $bash_cv_opendir_not_robust = yes; then
359AC_DEFINE(OPENDIR_NOT_ROBUST)
360fi
361])
362
363dnl
364AH_TEMPLATE([VOID_SIGHANDLER], [Define if signal handlers return type void])
365AC_DEFUN([BASH_TYPE_SIGHANDLER],
366[AC_MSG_CHECKING([whether signal handlers are of type void])
367AC_CACHE_VAL(bash_cv_void_sighandler,
368[AC_TRY_COMPILE([#include <sys/types.h>
369#include <signal.h>
370#ifdef signal
371#undef signal
372#endif
373#ifdef __cplusplus
374extern "C"
375#endif
376void (*signal ()) ();],
377[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl
378AC_MSG_RESULT($bash_cv_void_sighandler)
379if test $bash_cv_void_sighandler = yes; then
380AC_DEFINE(VOID_SIGHANDLER)
381fi
382])
383
384dnl
385dnl A signed 16-bit integer quantity
386dnl
387AC_DEFUN([BASH_TYPE_BITS16_T],
388[
389if test "$ac_cv_sizeof_short" = 2; then
390 AC_CHECK_TYPE(bits16_t, short)
391elif test "$ac_cv_sizeof_char" = 2; then
392 AC_CHECK_TYPE(bits16_t, char)
393else
394 AC_CHECK_TYPE(bits16_t, short)
395fi
396])
397
398dnl
399dnl An unsigned 16-bit integer quantity
400dnl
401AC_DEFUN([BASH_TYPE_U_BITS16_T],
402[
403if test "$ac_cv_sizeof_short" = 2; then
404 AC_CHECK_TYPE(u_bits16_t, unsigned short)
405elif test "$ac_cv_sizeof_char" = 2; then
406 AC_CHECK_TYPE(u_bits16_t, unsigned char)
407else
408 AC_CHECK_TYPE(u_bits16_t, unsigned short)
409fi
410])
411
412dnl
413dnl A signed 32-bit integer quantity
414dnl
415AC_DEFUN([BASH_TYPE_BITS32_T],
416[
417if test "$ac_cv_sizeof_int" = 4; then
418 AC_CHECK_TYPE(bits32_t, int)
419elif test "$ac_cv_sizeof_long" = 4; then
420 AC_CHECK_TYPE(bits32_t, long)
421else
422 AC_CHECK_TYPE(bits32_t, int)
423fi
424])
425
426dnl
427dnl An unsigned 32-bit integer quantity
428dnl
429AC_DEFUN([BASH_TYPE_U_BITS32_T],
430[
431if test "$ac_cv_sizeof_int" = 4; then
432 AC_CHECK_TYPE(u_bits32_t, unsigned int)
433elif test "$ac_cv_sizeof_long" = 4; then
434 AC_CHECK_TYPE(u_bits32_t, unsigned long)
435else
436 AC_CHECK_TYPE(u_bits32_t, unsigned int)
437fi
438])
439
440AC_DEFUN([BASH_TYPE_PTRDIFF_T],
441[
442if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then
443 AC_CHECK_TYPE(ptrdiff_t, int)
444elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then
445 AC_CHECK_TYPE(ptrdiff_t, long)
446elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then
447 AC_CHECK_TYPE(ptrdiff_t, [long long])
448else
449 AC_CHECK_TYPE(ptrdiff_t, int)
450fi
451])
452
453dnl
454dnl A signed 64-bit quantity
455dnl
456AC_DEFUN([BASH_TYPE_BITS64_T],
457[
458if test "$ac_cv_sizeof_char_p" = 8; then
459 AC_CHECK_TYPE(bits64_t, char *)
460elif test "$ac_cv_sizeof_double" = 8; then
461 AC_CHECK_TYPE(bits64_t, double)
462elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then
463 AC_CHECK_TYPE(bits64_t, [long long])
464elif test "$ac_cv_sizeof_long" = 8; then
465 AC_CHECK_TYPE(bits64_t, long)
466else
467 AC_CHECK_TYPE(bits64_t, double)
468fi
469])
470
471AC_DEFUN([BASH_TYPE_LONG_LONG],
472[
473AC_CACHE_CHECK([for long long], bash_cv_type_long_long,
474[AC_TRY_LINK([
475long long ll = 1; int i = 63;],
476[
477long long llm = (long long) -1;
478return ll << i | ll >> i | llm / ll | llm % ll;
479], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')])
480if test "$bash_cv_type_long_long" = 'long long'; then
481 AC_DEFINE(HAVE_LONG_LONG, 1)
482fi
483])
484
485AC_DEFUN([BASH_TYPE_UNSIGNED_LONG_LONG],
486[
487AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long,
488[AC_TRY_LINK([
489unsigned long long ull = 1; int i = 63;],
490[
491unsigned long long ullmax = (unsigned long long) -1;
492return ull << i | ull >> i | ullmax / ull | ullmax % ull;
493], bash_cv_type_unsigned_long_long='unsigned long long',
494 bash_cv_type_unsigned_long_long='unsigned long')])
495if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then
496 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1)
497fi
498])
499
500dnl
501dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0)
502dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use
503dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify
504dnl matters, this just checks for rlim_t, quad_t, or long.
505dnl
506AC_DEFUN([BASH_TYPE_RLIMIT],
507[AC_MSG_CHECKING(for size and type of struct rlimit fields)
508AC_CACHE_VAL(bash_cv_type_rlimit,
509[AC_TRY_COMPILE([#include <sys/types.h>
510#include <sys/resource.h>],
511[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[
512AC_TRY_RUN([
513#include <sys/types.h>
514#include <sys/time.h>
515#include <sys/resource.h>
516main()
517{
518#ifdef HAVE_QUAD_T
519 struct rlimit rl;
520 if (sizeof(rl.rlim_cur) == sizeof(quad_t))
521 exit(0);
522#endif
523 exit(1);
524}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
525 [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long)
526 bash_cv_type_rlimit=long])])
527])
528AC_MSG_RESULT($bash_cv_type_rlimit)
529if test $bash_cv_type_rlimit = quad_t; then
530AC_DEFINE(RLIMTYPE, quad_t)
531elif test $bash_cv_type_rlimit = rlim_t; then
532AC_DEFINE(RLIMTYPE, rlim_t)
533fi
534])
535
536AC_DEFUN([BASH_FUNC_LSTAT],
537[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an
538dnl inline function in <sys/stat.h>.
539AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,
540[AC_TRY_LINK([
541#include <sys/types.h>
542#include <sys/stat.h>
543],[ lstat(".",(struct stat *)0); ],
544bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])
545if test $bash_cv_func_lstat = yes; then
546 AC_DEFINE(HAVE_LSTAT)
547fi
548])
549
550AC_DEFUN([BASH_FUNC_INET_ATON],
551[
552AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
553[AC_TRY_LINK([
554#include <sys/types.h>
555#include <netinet/in.h>
556#include <arpa/inet.h>
557struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
558bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
559if test $bash_cv_func_inet_aton = yes; then
560 AC_DEFINE(HAVE_INET_ATON)
561else
562 AC_LIBOBJ(inet_aton)
563fi
564])
565
566AC_DEFUN([BASH_FUNC_GETENV],
567[AC_MSG_CHECKING(to see if getenv can be redefined)
568AC_CACHE_VAL(bash_cv_getenv_redef,
569[AC_TRY_RUN([
570#ifdef HAVE_UNISTD_H
571# include <unistd.h>
572#endif
573#ifndef __STDC__
574# ifndef const
575# define const
576# endif
577#endif
578char *
579getenv (name)
580#if defined (__linux__) || defined (__bsdi__) || defined (convex)
581 const char *name;
582#else
583 char const *name;
584#endif /* !__linux__ && !__bsdi__ && !convex */
585{
586return "42";
587}
588main()
589{
590char *s;
591/* The next allows this program to run, but does not allow bash to link
592 when it redefines getenv. I'm not really interested in figuring out
593 why not. */
594#if defined (NeXT)
595exit(1);
596#endif
597s = getenv("ABCDE");
598exit(s == 0); /* force optimizer to leave getenv in */
599}
600], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
601 [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes)
602 bash_cv_getenv_redef=yes]
603)])
604AC_MSG_RESULT($bash_cv_getenv_redef)
605if test $bash_cv_getenv_redef = yes; then
606AC_DEFINE(CAN_REDEFINE_GETENV)
607fi
608])
609
610# We should check for putenv before calling this
611AC_DEFUN([BASH_FUNC_STD_PUTENV],
612[
613AC_REQUIRE([AC_HEADER_STDC])
614AC_REQUIRE([AC_C_PROTOTYPES])
615AC_CACHE_CHECK([for standard-conformant putenv declaration], bash_cv_std_putenv,
616[AC_TRY_LINK([
617#if STDC_HEADERS
618#include <stdlib.h>
619#include <stddef.h>
620#endif
621#ifndef __STDC__
622# ifndef const
623# define const
624# endif
625#endif
626#ifdef PROTOTYPES
627extern int putenv (char *);
628#else
629extern int putenv ();
630#endif
631],
632[return (putenv == 0);],
633bash_cv_std_putenv=yes, bash_cv_std_putenv=no
634)])
635if test $bash_cv_std_putenv = yes; then
636AC_DEFINE(HAVE_STD_PUTENV)
637fi
638])
639
640# We should check for unsetenv before calling this
641AC_DEFUN([BASH_FUNC_STD_UNSETENV],
642[
643AC_REQUIRE([AC_HEADER_STDC])
644AC_REQUIRE([AC_C_PROTOTYPES])
645AC_CACHE_CHECK([for standard-conformant unsetenv declaration], bash_cv_std_unsetenv,
646[AC_TRY_LINK([
647#if STDC_HEADERS
648#include <stdlib.h>
649#include <stddef.h>
650#endif
651#ifndef __STDC__
652# ifndef const
653# define const
654# endif
655#endif
656#ifdef PROTOTYPES
657extern int unsetenv (const char *);
658#else
659extern int unsetenv ();
660#endif
661],
662[return (unsetenv == 0);],
663bash_cv_std_unsetenv=yes, bash_cv_std_unsetenv=no
664)])
665if test $bash_cv_std_unsetenv = yes; then
666AC_DEFINE(HAVE_STD_UNSETENV)
667fi
668])
669
670AC_DEFUN([BASH_FUNC_ULIMIT_MAXFDS],
671[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize)
672AC_CACHE_VAL(bash_cv_ulimit_maxfds,
673[AC_TRY_RUN([
674main()
675{
676long maxfds = ulimit(4, 0L);
677exit (maxfds == -1L);
678}
679], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
680 [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no)
681 bash_cv_ulimit_maxfds=no]
682)])
683AC_MSG_RESULT($bash_cv_ulimit_maxfds)
684if test $bash_cv_ulimit_maxfds = yes; then
685AC_DEFINE(ULIMIT_MAXFDS)
686fi
687])
688
689AC_DEFUN([BASH_FUNC_GETCWD],
690[AC_MSG_CHECKING([if getcwd() calls popen()])
691AC_CACHE_VAL(bash_cv_getcwd_calls_popen,
692[AC_TRY_RUN([
693#include <stdio.h>
694#ifdef HAVE_UNISTD_H
695#include <unistd.h>
696#endif
697
698#ifndef __STDC__
699#ifndef const
700#define const
701#endif
702#endif
703
704int popen_called;
705
706FILE *
707popen(command, type)
708 const char *command;
709 const char *type;
710{
711 popen_called = 1;
712 return (FILE *)NULL;
713}
714
715FILE *_popen(command, type)
716 const char *command;
717 const char *type;
718{
719 return (popen (command, type));
720}
721
722int
723pclose(stream)
724FILE *stream;
725{
726 return 0;
727}
728
729int
730_pclose(stream)
731FILE *stream;
732{
733 return 0;
734}
735
736main()
737{
738 char lbuf[32];
739 popen_called = 0;
740 getcwd(lbuf, 32);
741 exit (popen_called);
742}
743], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
744 [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
745 bash_cv_getcwd_calls_popen=no]
746)])
747AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
748if test $bash_cv_getcwd_calls_popen = yes; then
749AC_DEFINE(GETCWD_BROKEN)
750AC_LIBOBJ(getcwd)
751fi
752])
753
754dnl
755dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
756dnl system, we can't use AC_PREREQ
757dnl
758AC_DEFUN([BASH_FUNC_GETHOSTBYNAME],
759[if test "X$bash_cv_have_gethostbyname" = "X"; then
760_bash_needmsg=yes
761else
762AC_MSG_CHECKING(for gethostbyname in socket library)
763_bash_needmsg=
764fi
765AC_CACHE_VAL(bash_cv_have_gethostbyname,
766[AC_TRY_LINK([#include <netdb.h>],
767[ struct hostent *hp;
768 hp = gethostbyname("localhost");
769], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
770)
771if test "X$_bash_needmsg" = Xyes; then
772 AC_MSG_CHECKING(for gethostbyname in socket library)
773fi
774AC_MSG_RESULT($bash_cv_have_gethostbyname)
775if test "$bash_cv_have_gethostbyname" = yes; then
776AC_DEFINE(HAVE_GETHOSTBYNAME)
777fi
778])
779
780AC_DEFUN([BASH_FUNC_FNMATCH_EXTMATCH],
781[AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH)
782AC_CACHE_VAL(bash_cv_fnm_extmatch,
783[AC_TRY_RUN([
784#include <fnmatch.h>
785
786main()
787{
788#ifdef FNM_EXTMATCH
789 exit (0);
790#else
791 exit (1);
792#endif
793}
794], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no,
795 [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no)
796 bash_cv_fnm_extmatch=no])
797])
798AC_MSG_RESULT($bash_cv_fnm_extmatch)
799if test $bash_cv_fnm_extmatch = yes; then
800AC_DEFINE(HAVE_LIBC_FNM_EXTMATCH)
801fi
802])
803
804AH_TEMPLATE([HAVE_POSIX_SIGSETJMP], [Define if we POSIX-style sigsetjmp/siglongjmp are available])
805AC_DEFUN([BASH_FUNC_POSIX_SETJMP],
806[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
807AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp)
808AC_CACHE_VAL(bash_cv_func_sigsetjmp,
809[AC_TRY_RUN([
810#ifdef HAVE_UNISTD_H
811#include <unistd.h>
812#endif
813#include <sys/types.h>
814#include <signal.h>
815#include <setjmp.h>
816
817main()
818{
819#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
820exit (1);
821#else
822
823int code;
824sigset_t set, oset;
825sigjmp_buf xx;
826
827/* get the mask */
828sigemptyset(&set);
829sigemptyset(&oset);
830sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);
831sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);
832
833/* save it */
834code = sigsetjmp(xx, 1);
835if (code)
836 exit(0); /* could get sigmask and compare to oset here. */
837
838/* change it */
839sigaddset(&set, SIGINT);
840sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
841
842/* and siglongjmp */
843siglongjmp(xx, 10);
844exit(1);
845#endif
846}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
847 [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
848 bash_cv_func_sigsetjmp=missing]
849)])
850AC_MSG_RESULT($bash_cv_func_sigsetjmp)
851if test $bash_cv_func_sigsetjmp = present; then
852AC_DEFINE(HAVE_POSIX_SIGSETJMP)
853fi
854])
855
856AH_TEMPLATE([STRCOLL_BROKEN], [Define if strcoll is broken with respect to strcmp in the default locale.])
857AC_DEFUN([BASH_FUNC_STRCOLL],
858[
859AC_MSG_CHECKING(whether or not strcoll and strcmp differ)
860AC_CACHE_VAL(bash_cv_func_strcoll_broken,
861[AC_TRY_RUN([
862#include <stdio.h>
863#if defined (HAVE_LOCALE_H)
864#include <locale.h>
865#endif
866
867main(c, v)
868int c;
869char *v[];
870{
871 int r1, r2;
872 char *deflocale, *defcoll;
873
874#ifdef HAVE_SETLOCALE
875 deflocale = setlocale(LC_ALL, "");
876 defcoll = setlocale(LC_COLLATE, "");
877#endif
878
879#ifdef HAVE_STRCOLL
880 /* These two values are taken from tests/glob-test. */
881 r1 = strcoll("abd", "aXd");
882#else
883 r1 = 0;
884#endif
885 r2 = strcmp("abd", "aXd");
886
887 /* These two should both be greater than 0. It is permissible for
888 a system to return different values, as long as the sign is the
889 same. */
890
891 /* Exit with 1 (failure) if these two values are both > 0, since
892 this tests whether strcoll(3) is broken with respect to strcmp(3)
893 in the default locale. */
894 exit (r1 > 0 && r2 > 0);
895}
896], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
897 [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
898 bash_cv_func_strcoll_broken=no]
899)])
900AC_MSG_RESULT($bash_cv_func_strcoll_broken)
901if test $bash_cv_func_strcoll_broken = yes; then
902AC_DEFINE(STRCOLL_BROKEN)
903fi
904])
905
906AC_DEFUN([BASH_FUNC_PRINTF_A_FORMAT],
907[AC_MSG_CHECKING([for printf floating point output in hex notation])
908AC_CACHE_VAL(bash_cv_printf_a_format,
909[AC_TRY_RUN([
910#include <stdio.h>
911#include <string.h>
912
913int
914main()
915{
916 double y = 0.0;
917 char abuf[1024];
918
919 sprintf(abuf, "%A", y);
920 exit(strchr(abuf, 'P') == (char *)0);
921}
922], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no,
923 [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no)
924 bash_cv_printf_a_format=no]
925)])
926AC_MSG_RESULT($bash_cv_printf_a_format)
927if test $bash_cv_printf_a_format = yes; then
928AC_DEFINE(HAVE_PRINTF_A_FORMAT)
929fi
930])
931
932AC_DEFUN([BASH_STRUCT_TERMIOS_LDISC],
933[
934AC_CHECK_MEMBER(struct termios.c_line, AC_DEFINE(TERMIOS_LDISC), ,[
935#include <sys/types.h>
936#include <termios.h>
937])
938])
939
940AC_DEFUN([BASH_STRUCT_TERMIO_LDISC],
941[
942AC_CHECK_MEMBER(struct termio.c_line, AC_DEFINE(TERMIO_LDISC), ,[
943#include <sys/types.h>
944#include <termio.h>
945])
946])
947
948dnl
949dnl Like AC_STRUCT_ST_BLOCKS, but doesn't muck with LIBOBJS
950dnl
951dnl sets bash_cv_struct_stat_st_blocks
952dnl
953dnl unused for now; we'll see how AC_CHECK_MEMBERS works
954dnl
955AC_DEFUN([BASH_STRUCT_ST_BLOCKS],
956[
957AC_MSG_CHECKING([for struct stat.st_blocks])
958AC_CACHE_VAL(bash_cv_struct_stat_st_blocks,
959[AC_TRY_COMPILE(
960[
961#include <sys/types.h>
962#include <sys/stat.h>
963],
964[
965main()
966{
967static struct stat a;
968if (a.st_blocks) return 0;
969return 0;
970}
971], bash_cv_struct_stat_st_blocks=yes, bash_cv_struct_stat_st_blocks=no)
972])
973AC_MSG_RESULT($bash_cv_struct_stat_st_blocks)
974if test "$bash_cv_struct_stat_st_blocks" = "yes"; then
975AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS)
976fi
977])
978
979AC_DEFUN([BASH_CHECK_LIB_TERMCAP],
980[
981if test "X$bash_cv_termcap_lib" = "X"; then
982_bash_needmsg=yes
983else
984AC_MSG_CHECKING(which library has the termcap functions)
985_bash_needmsg=
986fi
987AC_CACHE_VAL(bash_cv_termcap_lib,
988[AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
989 [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo,
990 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
991 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
992 bash_cv_termcap_lib=gnutermcap)])])])])
993if test "X$_bash_needmsg" = "Xyes"; then
994AC_MSG_CHECKING(which library has the termcap functions)
995fi
996AC_MSG_RESULT(using $bash_cv_termcap_lib)
997if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
998LDFLAGS="$LDFLAGS -L./lib/termcap"
999TERMCAP_LIB="./lib/termcap/libtermcap.a"
1000TERMCAP_DEP="./lib/termcap/libtermcap.a"
1001elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
1002TERMCAP_LIB=-ltermcap
1003TERMCAP_DEP=
1004elif test $bash_cv_termcap_lib = libtinfo; then
1005TERMCAP_LIB=-ltinfo
1006TERMCAP_DEP=
1007elif test $bash_cv_termcap_lib = libncurses; then
1008TERMCAP_LIB=-lncurses
1009TERMCAP_DEP=
1010else
1011TERMCAP_LIB=-lcurses
1012TERMCAP_DEP=
1013fi
1014])
1015
1016dnl
1017dnl Check for the presence of getpeername in libsocket.
1018dnl If libsocket is present, check for libnsl and add it to LIBS if
1019dnl it's there, since most systems with libsocket require linking
1020dnl with libnsl as well. This should only be called if getpeername
1021dnl was not found in libc.
1022dnl
1023dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
1024dnl AS WELL
1025dnl
1026AC_DEFUN([BASH_CHECK_LIB_SOCKET],
1027[
1028if test "X$bash_cv_have_socklib" = "X"; then
1029_bash_needmsg=
1030else
1031AC_MSG_CHECKING(for socket library)
1032_bash_needmsg=yes
1033fi
1034AC_CACHE_VAL(bash_cv_have_socklib,
1035[AC_CHECK_LIB(socket, getpeername,
1036 bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)])
1037if test "X$_bash_needmsg" = Xyes; then
1038 AC_MSG_RESULT($bash_cv_have_socklib)
1039 _bash_needmsg=
1040fi
1041if test $bash_cv_have_socklib = yes; then
1042 # check for libnsl, add it to LIBS if present
1043 if test "X$bash_cv_have_libnsl" = "X"; then
1044 _bash_needmsg=
1045 else
1046 AC_MSG_CHECKING(for libnsl)
1047 _bash_needmsg=yes
1048 fi
1049 AC_CACHE_VAL(bash_cv_have_libnsl,
1050 [AC_CHECK_LIB(nsl, t_open,
1051 bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)])
1052 if test "X$_bash_needmsg" = Xyes; then
1053 AC_MSG_RESULT($bash_cv_have_libnsl)
1054 _bash_needmsg=
1055 fi
1056 if test $bash_cv_have_libnsl = yes; then
1057 LIBS="-lsocket -lnsl $LIBS"
1058 else
1059 LIBS="-lsocket $LIBS"
1060 fi
1061 AC_DEFINE(HAVE_LIBSOCKET)
1062 AC_DEFINE(HAVE_GETPEERNAME)
1063fi
1064])
1065
1066AH_TEMPLATE([STRUCT_DIRENT_HAS_D_INO], [Define if struct dirent has a d_ino member])
1067AC_DEFUN([BASH_STRUCT_DIRENT_D_INO],
1068[AC_REQUIRE([AC_HEADER_DIRENT])
1069AC_MSG_CHECKING(if struct dirent has a d_ino member)
1070AC_CACHE_VAL(bash_cv_dirent_has_dino,
1071[AC_TRY_COMPILE([
1072#include <stdio.h>
1073#include <sys/types.h>
1074#ifdef HAVE_UNISTD_H
1075# include <unistd.h>
1076#endif /* HAVE_UNISTD_H */
1077#if defined(HAVE_DIRENT_H)
1078# include <dirent.h>
1079#else
1080# define dirent direct
1081# ifdef HAVE_SYS_NDIR_H
1082# include <sys/ndir.h>
1083# endif /* SYSNDIR */
1084# ifdef HAVE_SYS_DIR_H
1085# include <sys/dir.h>
1086# endif /* SYSDIR */
1087# ifdef HAVE_NDIR_H
1088# include <ndir.h>
1089# endif
1090#endif /* HAVE_DIRENT_H */
1091],[
1092struct dirent d; int z; z = d.d_ino;
1093], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)])
1094AC_MSG_RESULT($bash_cv_dirent_has_dino)
1095if test $bash_cv_dirent_has_dino = yes; then
1096AC_DEFINE(STRUCT_DIRENT_HAS_D_INO)
1097fi
1098])
1099
1100AH_TEMPLATE([STRUCT_DIRENT_HAS_D_FILENO], [Define if struct dirent has a d_fileno member])
1101AC_DEFUN([BASH_STRUCT_DIRENT_D_FILENO],
1102[AC_REQUIRE([AC_HEADER_DIRENT])
1103AC_MSG_CHECKING(if struct dirent has a d_fileno member)
1104AC_CACHE_VAL(bash_cv_dirent_has_d_fileno,
1105[AC_TRY_COMPILE([
1106#include <stdio.h>
1107#include <sys/types.h>
1108#ifdef HAVE_UNISTD_H
1109# include <unistd.h>
1110#endif /* HAVE_UNISTD_H */
1111#if defined(HAVE_DIRENT_H)
1112# include <dirent.h>
1113#else
1114# define dirent direct
1115# ifdef HAVE_SYS_NDIR_H
1116# include <sys/ndir.h>
1117# endif /* SYSNDIR */
1118# ifdef HAVE_SYS_DIR_H
1119# include <sys/dir.h>
1120# endif /* SYSDIR */
1121# ifdef HAVE_NDIR_H
1122# include <ndir.h>
1123# endif
1124#endif /* HAVE_DIRENT_H */
1125],[
1126struct dirent d; int z; z = d.d_fileno;
1127], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)])
1128AC_MSG_RESULT($bash_cv_dirent_has_d_fileno)
1129if test $bash_cv_dirent_has_d_fileno = yes; then
1130AC_DEFINE(STRUCT_DIRENT_HAS_D_FILENO)
1131fi
1132])
1133
1134AC_DEFUN([BASH_STRUCT_TIMEVAL],
1135[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
1136AC_CACHE_VAL(bash_cv_struct_timeval,
1137[
1138AC_EGREP_HEADER(struct timeval, sys/time.h,
1139 bash_cv_struct_timeval=yes,
1140 AC_EGREP_HEADER(struct timeval, time.h,
1141 bash_cv_struct_timeval=yes,
1142 bash_cv_struct_timeval=no))
1143])
1144AC_MSG_RESULT($bash_cv_struct_timeval)
1145if test $bash_cv_struct_timeval = yes; then
1146 AC_DEFINE(HAVE_TIMEVAL)
1147fi
1148])
1149
1150AH_TEMPLATE([STRUCT_WINSIZE_IN_SYS_IOCTL], [Define if struct winsize is in sys/ioctl.h])
1151AH_TEMPLATE([STRUCT_WINSIZE_IN_TERMIOS], [Define if struct winsize is in termios.h])
1152AC_DEFUN([BASH_STRUCT_WINSIZE],
1153[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h)
1154AC_CACHE_VAL(bash_cv_struct_winsize_header,
1155[AC_TRY_COMPILE([#include <sys/types.h>
1156#include <sys/ioctl.h>], [struct winsize x;],
1157 bash_cv_struct_winsize_header=ioctl_h,
1158 [AC_TRY_COMPILE([#include <sys/types.h>
1159#include <termios.h>], [struct winsize x;],
1160 bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other)
1161])])
1162if test $bash_cv_struct_winsize_header = ioctl_h; then
1163 AC_MSG_RESULT(sys/ioctl.h)
1164 AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL)
1165elif test $bash_cv_struct_winsize_header = termios_h; then
1166 AC_MSG_RESULT(termios.h)
1167 AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS)
1168else
1169 AC_MSG_RESULT(not found)
1170fi
1171])
1172
1173dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
1174AH_TEMPLATE([HAVE_POSIX_SIGNALS], [Define if we have the POSIX signal routines])
1175AH_TEMPLATE([HAVE_BSD_SIGNALS], [Define if we have the BSD signal routines])
1176AH_TEMPLATE([HAVE_USG_SIGHOLD], [Define if we have the USG signal routines])
1177AC_DEFUN([BASH_SYS_SIGNAL_VINTAGE],
1178[AC_REQUIRE([AC_TYPE_SIGNAL])
1179AC_MSG_CHECKING(for type of signal functions)
1180AC_CACHE_VAL(bash_cv_signal_vintage,
1181[
1182 AC_MSG_WARN([checking for posix...])
1183 AC_TRY_LINK([#include <signal.h>],[
1184 sigset_t ss;
1185 struct sigaction sa;
1186 sigemptyset(&ss); sigsuspend(&ss);
1187 sigaction(SIGINT, &sa, (struct sigaction *) 0);
1188 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
1189 ], bash_cv_signal_vintage="posix",
1190 [
1191 AC_MSG_WARN([checking for 4.2bsd...])
1192 AC_TRY_LINK([#include <signal.h>], [
1193 int mask = sigmask(SIGINT);
1194 sigsetmask(mask); sigblock(mask); sigpause(mask);
1195 ], bash_cv_signal_vintage="4.2bsd",
1196 [
1197 AC_MSG_WARN([checking for svr3...])
1198 AC_TRY_LINK([
1199 #include <signal.h>
1200 RETSIGTYPE foo() { }], [
1201 int mask = sigmask(SIGINT);
1202 sigset(SIGINT, foo); sigrelse(SIGINT);
1203 sighold(SIGINT); sigpause(SIGINT);
1204 ], bash_cv_signal_vintage="svr3", bash_cv_signal_vintage="v7"
1205 )]
1206 )]
1207)
1208])
1209AC_MSG_RESULT($bash_cv_signal_vintage)
1210if test "$bash_cv_signal_vintage" = "posix"; then
1211AC_DEFINE(HAVE_POSIX_SIGNALS)
1212elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
1213AC_DEFINE(HAVE_BSD_SIGNALS)
1214elif test "$bash_cv_signal_vintage" = "svr3"; then
1215AC_DEFINE(HAVE_USG_SIGHOLD)
1216fi
1217])
1218
1219dnl Check if the pgrp of setpgrp() can't be the pid of a zombie process.
1220AC_DEFUN([BASH_SYS_PGRP_SYNC],
1221[AC_REQUIRE([AC_FUNC_GETPGRP])
1222AC_MSG_CHECKING(whether pgrps need synchronization)
1223AC_CACHE_VAL(bash_cv_pgrp_pipe,
1224[AC_TRY_RUN([
1225#ifdef HAVE_UNISTD_H
1226# include <unistd.h>
1227#endif
1228main()
1229{
1230# ifdef GETPGRP_VOID
1231# define getpgID() getpgrp()
1232# else
1233# define getpgID() getpgrp(0)
1234# define setpgid(x,y) setpgrp(x,y)
1235# endif
1236 int pid1, pid2, fds[2];
1237 int status;
1238 char ok;
1239
1240 switch (pid1 = fork()) {
1241 case -1:
1242 exit(1);
1243 case 0:
1244 setpgid(0, getpid());
1245 exit(0);
1246 }
1247 setpgid(pid1, pid1);
1248
1249 sleep(2); /* let first child die */
1250
1251 if (pipe(fds) < 0)
1252 exit(2);
1253
1254 switch (pid2 = fork()) {
1255 case -1:
1256 exit(3);
1257 case 0:
1258 setpgid(0, pid1);
1259 ok = getpgID() == pid1;
1260 write(fds[1], &ok, 1);
1261 exit(0);
1262 }
1263 setpgid(pid2, pid1);
1264
1265 close(fds[1]);
1266 if (read(fds[0], &ok, 1) != 1)
1267 exit(4);
1268 wait(&status);
1269 wait(&status);
1270 exit(ok ? 0 : 5);
1271}
1272], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
1273 [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
1274 bash_cv_pgrp_pipe=no])
1275])
1276AC_MSG_RESULT($bash_cv_pgrp_pipe)
1277if test $bash_cv_pgrp_pipe = yes; then
1278AC_DEFINE(PGRP_PIPE)
1279fi
1280])
1281
1282AH_TEMPLATE([MUST_REINSTALL_SIGHANDLERS], [Define if signal handlers must be reinstalled when invoked.])
1283AC_DEFUN([BASH_SYS_REINSTALL_SIGHANDLERS],
1284[AC_REQUIRE([AC_TYPE_SIGNAL])
1285AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
1286AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked])
1287AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers,
1288[AC_TRY_RUN([
1289#include <signal.h>
1290#ifdef HAVE_UNISTD_H
1291#include <unistd.h>
1292#endif
1293
1294typedef RETSIGTYPE sigfunc();
1295
1296int nsigint;
1297
1298#ifdef HAVE_POSIX_SIGNALS
1299sigfunc *
1300set_signal_handler(sig, handler)
1301 int sig;
1302 sigfunc *handler;
1303{
1304 struct sigaction act, oact;
1305 act.sa_handler = handler;
1306 act.sa_flags = 0;
1307 sigemptyset (&act.sa_mask);
1308 sigemptyset (&oact.sa_mask);
1309 sigaction (sig, &act, &oact);
1310 return (oact.sa_handler);
1311}
1312#else
1313#define set_signal_handler(s, h) signal(s, h)
1314#endif
1315
1316RETSIGTYPE
1317sigint(s)
1318int s;
1319{
1320 nsigint++;
1321}
1322
1323main()
1324{
1325 nsigint = 0;
1326 set_signal_handler(SIGINT, sigint);
1327 kill((int)getpid(), SIGINT);
1328 kill((int)getpid(), SIGINT);
1329 exit(nsigint != 2);
1330}
1331], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
1332 [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no)
1333 bash_cv_must_reinstall_sighandlers=no]
1334)])
1335AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
1336if test $bash_cv_must_reinstall_sighandlers = yes; then
1337AC_DEFINE(MUST_REINSTALL_SIGHANDLERS)
1338fi
1339])
1340
1341dnl check that some necessary job control definitions are present
1342AC_DEFUN([BASH_SYS_JOB_CONTROL_MISSING],
1343[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
1344AC_MSG_CHECKING(for presence of necessary job control definitions)
1345AC_CACHE_VAL(bash_cv_job_control_missing,
1346[AC_TRY_RUN([
1347#include <sys/types.h>
1348#ifdef HAVE_SYS_WAIT_H
1349#include <sys/wait.h>
1350#endif
1351#ifdef HAVE_UNISTD_H
1352#include <unistd.h>
1353#endif
1354#include <signal.h>
1355
1356/* Add more tests in here as appropriate. */
1357main()
1358{
1359/* signal type */
1360#if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS)
1361exit(1);
1362#endif
1363
1364/* signals and tty control. */
1365#if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT)
1366exit (1);
1367#endif
1368
1369/* process control */
1370#if !defined (WNOHANG) || !defined (WUNTRACED)
1371exit(1);
1372#endif
1373
1374/* Posix systems have tcgetpgrp and waitpid. */
1375#if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP)
1376exit(1);
1377#endif
1378
1379#if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID)
1380exit(1);
1381#endif
1382
1383/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */
1384#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3)
1385exit(1);
1386#endif
1387
1388exit(0);
1389}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
1390 [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing)
1391 bash_cv_job_control_missing=missing]
1392)])
1393AC_MSG_RESULT($bash_cv_job_control_missing)
1394if test $bash_cv_job_control_missing = missing; then
1395AC_DEFINE(JOB_CONTROL_MISSING)
1396fi
1397])
1398
1399dnl check whether named pipes are present
1400dnl this requires a previous check for mkfifo, but that is awkward to specify
1401AC_DEFUN([BASH_SYS_NAMED_PIPES],
1402[AC_MSG_CHECKING(for presence of named pipes)
1403AC_CACHE_VAL(bash_cv_sys_named_pipes,
1404[AC_TRY_RUN([
1405#include <sys/types.h>
1406#include <sys/stat.h>
1407#ifdef HAVE_UNISTD_H
1408#include <unistd.h>
1409#endif
1410
1411/* Add more tests in here as appropriate. */
1412main()
1413{
1414int fd, err;
1415
1416#if defined (HAVE_MKFIFO)
1417exit (0);
1418#endif
1419
1420#if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO))
1421exit (1);
1422#endif
1423
1424#if defined (NeXT)
1425exit (1);
1426#endif
1427err = mkdir("/tmp/bash-aclocal", 0700);
1428if (err < 0) {
1429 perror ("mkdir");
1430 exit(1);
1431}
1432fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
1433if (fd == -1) {
1434 rmdir ("/tmp/bash-aclocal");
1435 exit (1);
1436}
1437close(fd);
1438unlink ("/tmp/bash-aclocal/sh-np-autoconf");
1439rmdir ("/tmp/bash-aclocal");
1440exit(0);
1441}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
1442 [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
1443 bash_cv_sys_named_pipes=missing]
1444)])
1445AC_MSG_RESULT($bash_cv_sys_named_pipes)
1446if test $bash_cv_sys_named_pipes = missing; then
1447AC_DEFINE(NAMED_PIPES_MISSING)
1448fi
1449])
1450
1451AC_DEFUN([BASH_SYS_DEFAULT_MAIL_DIR],
1452[AC_MSG_CHECKING(for default mail directory)
1453AC_CACHE_VAL(bash_cv_mail_dir,
1454[if test -d /var/mail; then
1455 bash_cv_mail_dir=/var/mail
1456 elif test -d /var/spool/mail; then
1457 bash_cv_mail_dir=/var/spool/mail
1458 elif test -d /usr/mail; then
1459 bash_cv_mail_dir=/usr/mail
1460 elif test -d /usr/spool/mail; then
1461 bash_cv_mail_dir=/usr/spool/mail
1462 else
1463 bash_cv_mail_dir=unknown
1464 fi
1465])
1466AC_MSG_RESULT($bash_cv_mail_dir)
1467AC_DEFINE_UNQUOTED(DEFAULT_MAIL_DIRECTORY, "$bash_cv_mail_dir")
1468])
1469
1470AC_DEFUN([BASH_HAVE_TIOCGWINSZ],
1471[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
1472AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl,
1473[AC_TRY_COMPILE([#include <sys/types.h>
1474#include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
1475 bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)])
1476AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl)
1477if test $bash_cv_tiocgwinsz_in_ioctl = yes; then
1478AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
1479fi
1480])
1481
1482AH_TEMPLATE([TIOCSTAT_IN_SYS_IOCTL], [Define if TIOCSTAT is in sys/ioctl.h])
1483AC_DEFUN([BASH_HAVE_TIOCSTAT],
1484[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
1485AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl,
1486[AC_TRY_COMPILE([#include <sys/types.h>
1487#include <sys/ioctl.h>], [int x = TIOCSTAT;],
1488 bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)])
1489AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl)
1490if test $bash_cv_tiocstat_in_ioctl = yes; then
1491AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL)
1492fi
1493])
1494
1495AH_TEMPLATE([FIONREAD_IN_SYS_IOCTL], [Define if FIONREAD is in sys/ioctl.h])
1496AC_DEFUN([BASH_HAVE_FIONREAD],
1497[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
1498AC_CACHE_VAL(bash_cv_fionread_in_ioctl,
1499[AC_TRY_COMPILE([#include <sys/types.h>
1500#include <sys/ioctl.h>], [int x = FIONREAD;],
1501 bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)])
1502AC_MSG_RESULT($bash_cv_fionread_in_ioctl)
1503if test $bash_cv_fionread_in_ioctl = yes; then
1504AC_DEFINE(FIONREAD_IN_SYS_IOCTL)
1505fi
1506])
1507
1508dnl
1509dnl See if speed_t is declared in <sys/types.h>. Some versions of linux
1510dnl require a definition of speed_t each time <termcap.h> is included,
1511dnl but you can only get speed_t if you include <termios.h> (on some
1512dnl versions) or <sys/types.h> (on others).
1513dnl
1514AH_TEMPLATE([SPEED_T_IN_SYS_TYPES], [Define if speed_t is in sys/types.h])
1515AC_DEFUN([BASH_CHECK_SPEED_T],
1516[AC_MSG_CHECKING(for speed_t in sys/types.h)
1517AC_CACHE_VAL(bash_cv_speed_t_in_sys_types,
1518[AC_TRY_COMPILE([#include <sys/types.h>], [speed_t x;],
1519 bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)])
1520AC_MSG_RESULT($bash_cv_speed_t_in_sys_types)
1521if test $bash_cv_speed_t_in_sys_types = yes; then
1522AC_DEFINE(SPEED_T_IN_SYS_TYPES)
1523fi
1524])
1525
1526AH_TEMPLATE([HAVE_GETPW_DECLS], [Define if getpw functions are declared in pwd.h])
1527AC_DEFUN([BASH_CHECK_GETPW_FUNCS],
1528[AC_MSG_CHECKING(whether getpw functions are declared in pwd.h)
1529AC_CACHE_VAL(bash_cv_getpw_declared,
1530[AC_EGREP_CPP(getpwuid,
1531[
1532#include <sys/types.h>
1533#ifdef HAVE_UNISTD_H
1534# include <unistd.h>
1535#endif
1536#include <pwd.h>
1537],
1538bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)])
1539AC_MSG_RESULT($bash_cv_getpw_declared)
1540if test $bash_cv_getpw_declared = yes; then
1541AC_DEFINE(HAVE_GETPW_DECLS)
1542fi
1543])
1544
1545AC_DEFUN([BASH_CHECK_DEV_FD],
1546[AC_MSG_CHECKING(whether /dev/fd is available)
1547AC_CACHE_VAL(bash_cv_dev_fd,
1548[if test -d /dev/fd && test -r /dev/fd/0; then
1549 bash_cv_dev_fd=standard
1550 elif test -d /proc/self/fd && test -r /proc/self/fd/0; then
1551 bash_cv_dev_fd=whacky
1552 else
1553 bash_cv_dev_fd=absent
1554 fi
1555])
1556AC_MSG_RESULT($bash_cv_dev_fd)
1557if test $bash_cv_dev_fd = "standard"; then
1558 AC_DEFINE(HAVE_DEV_FD)
1559 AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")
1560elif test $bash_cv_dev_fd = "whacky"; then
1561 AC_DEFINE(HAVE_DEV_FD)
1562 AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")
1563fi
1564])
1565
1566AC_DEFUN([BASH_CHECK_DEV_STDIN],
1567[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
1568AC_CACHE_VAL(bash_cv_dev_stdin,
1569[if test -d /dev/fd && test -r /dev/stdin; then
1570 bash_cv_dev_stdin=present
1571 elif test -d /proc/self/fd && test -r /dev/stdin; then
1572 bash_cv_dev_stdin=present
1573 else
1574 bash_cv_dev_stdin=absent
1575 fi
1576])
1577AC_MSG_RESULT($bash_cv_dev_stdin)
1578if test $bash_cv_dev_stdin = "present"; then
1579 AC_DEFINE(HAVE_DEV_STDIN)
1580fi
1581])
1582
1583dnl
1584dnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitions
1585dnl
1586AC_DEFUN([BASH_CHECK_KERNEL_RLIMIT],
1587[AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines])
1588AC_CACHE_VAL(bash_cv_kernel_rlimit,
1589[AC_TRY_COMPILE([
1590#include <sys/types.h>
1591#include <sys/resource.h>
1592],
1593[
1594 int f;
1595 f = RLIMIT_DATA;
1596], bash_cv_kernel_rlimit=no,
1597[AC_TRY_COMPILE([
1598#include <sys/types.h>
1599#define _KERNEL
1600#include <sys/resource.h>
1601#undef _KERNEL
1602],
1603[
1604 int f;
1605 f = RLIMIT_DATA;
1606], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)]
1607)])
1608AC_MSG_RESULT($bash_cv_kernel_rlimit)
1609if test $bash_cv_kernel_rlimit = yes; then
1610AC_DEFINE(RLIMIT_NEEDS_KERNEL)
1611fi
1612])
1613
1614dnl
1615dnl Check for 64-bit off_t -- used for malloc alignment
1616dnl
1617dnl C does not allow duplicate case labels, so the compile will fail if
1618dnl sizeof(off_t) is > 4.
1619dnl
1620AC_DEFUN([BASH_CHECK_OFF_T_64],
1621[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
1622AC_TRY_COMPILE([
1623#ifdef HAVE_UNISTD_H
1624#include <unistd.h>
1625#endif
1626#include <sys/types.h>
1627],[
1628switch (0) case 0: case (sizeof (off_t) <= 4):;
1629], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
1630if test $bash_cv_off_t_64 = yes; then
1631 AC_DEFINE(HAVE_OFF_T_64)
1632fi])
1633
1634AC_DEFUN([BASH_CHECK_RTSIGS],
1635[AC_MSG_CHECKING(for unusable real-time signals due to large values)
1636AC_CACHE_VAL(bash_cv_unusable_rtsigs,
1637[AC_TRY_RUN([
1638#include <sys/types.h>
1639#include <signal.h>
1640
1641#ifndef NSIG
1642# define NSIG 64
1643#endif
1644
1645main ()
1646{
1647 int n_sigs = 2 * NSIG;
1648#ifdef SIGRTMIN
1649 int rtmin = SIGRTMIN;
1650#else
1651 int rtmin = 0;
1652#endif
1653
1654 exit(rtmin < n_sigs);
1655}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no,
1656 [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes)
1657 bash_cv_unusable_rtsigs=yes]
1658)])
1659AC_MSG_RESULT($bash_cv_unusable_rtsigs)
1660if test $bash_cv_unusable_rtsigs = yes; then
1661AC_DEFINE(UNUSABLE_RT_SIGNALS)
1662fi
1663])
1664
1665dnl
1666dnl check for availability of multibyte characters and functions
1667dnl
1668AH_TEMPLATE([HAVE_MBSRTOWCS], [Define if we have the mbsrtowcs function])
1669AH_TEMPLATE([HAVE_WCWIDTH], [Define if we have the wcwidth function])
1670AH_TEMPLATE([HAVE_MBSTATE_T], [Define if we have mbstate_t])
1671AH_TEMPLATE([HAVE_LANGINFO_CODESET], [Define if we have nl_langinfo and CODESET])
1672AC_DEFUN([BASH_CHECK_MULTIBYTE],
1673[
1674AC_CHECK_HEADERS(wctype.h)
1675AC_CHECK_HEADERS(wchar.h)
1676AC_CHECK_HEADERS(langinfo.h)
1677
1678AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
1679AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
1680
1681AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
1682[AC_TRY_RUN([
1683#include <wchar.h>
1684int
1685main ()
1686{
1687 mbstate_t ps;
1688 return 0;
1689}], bash_cv_have_mbstate_t=yes, bash_cv_have_mbstate_t=no)])
1690if test $bash_cv_have_mbstate_t = yes; then
1691 AC_DEFINE(HAVE_MBSTATE_T)
1692fi
1693
1694AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset,
1695[AC_TRY_LINK(
1696[#include <langinfo.h>],
1697[char* cs = nl_langinfo(CODESET);],
1698bash_cv_langinfo_codeset=yes, bash_cv_langinfo_codeset=no)])
1699if test $bash_cv_langinfo_codeset = yes; then
1700 AC_DEFINE(HAVE_LANGINFO_CODESET)
1701fi
1702
1703])
1704
1705dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIB
1706dnl require:
1707dnl AC_PROG_CC
1708dnl BASH_CHECK_LIB_TERMCAP
1709
1710AC_DEFUN([RL_LIB_READLINE_VERSION],
1711[
1712AC_REQUIRE([BASH_CHECK_LIB_TERMCAP])
1713
1714AC_MSG_CHECKING([version of installed readline library])
1715
1716# What a pain in the ass this is.
1717
1718# save cpp and ld options
1719_save_CFLAGS="$CFLAGS"
1720_save_LDFLAGS="$LDFLAGS"
1721_save_LIBS="$LIBS"
1722
1723# Don't set ac_cv_rl_prefix if the caller has already assigned a value. This
1724# allows the caller to do something like $_rl_prefix=$withval if the user
1725# specifies --with-installed-readline=PREFIX as an argument to configure
1726
1727if test -z "$ac_cv_rl_prefix"; then
1728test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix}
1729fi
1730
1731eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include
1732eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib
1733
1734LIBS="$LIBS -lreadline ${TERMCAP_LIB}"
1735CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}"
1736LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}"
1737
1738AC_TRY_RUN([
1739#include <stdio.h>
1740#include <readline/readline.h>
1741
1742main()
1743{
1744 FILE *fp;
1745 fp = fopen("conftest.rlv", "w");
1746 if (fp == 0) exit(1);
1747 fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0");
1748 fclose(fp);
1749 exit(0);
1750}
1751],
1752ac_cv_rl_version=`cat conftest.rlv`,
1753ac_cv_rl_version='0.0',
1754ac_cv_rl_version='4.2')
1755
1756CFLAGS="$_save_CFLAGS"
1757LDFLAGS="$_save_LDFLAGS"
1758LIBS="$_save_LIBS"
1759
1760RL_MAJOR=0
1761RL_MINOR=0
1762
1763# (
1764case "$ac_cv_rl_version" in
17652*|3*|4*|5*|6*|7*|8*|9*)
1766 RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'`
1767 RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'`
1768 ;;
1769esac
1770
1771# (((
1772case $RL_MAJOR in
1773[[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;;
1774[[0-9]]) _RL_MAJOR=0$RL_MAJOR ;;
1775*) _RL_MAJOR=00 ;;
1776esac
1777
1778# (((
1779case $RL_MINOR in
1780[[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;;
1781[[0-9]]) _RL_MINOR=0$RL_MINOR ;;
1782*) _RL_MINOR=00 ;;
1783esac
1784
1785RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}"
1786
1787# Readline versions greater than 4.2 have these defines in readline.h
1788
1789if test $ac_cv_rl_version = '0.0' ; then
1790 AC_MSG_WARN([Could not test version of installed readline library.])
1791elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then
1792 # set these for use by the caller
1793 RL_PREFIX=$ac_cv_rl_prefix
1794 RL_LIBDIR=$ac_cv_rl_libdir
1795 RL_INCLUDEDIR=$ac_cv_rl_includedir
1796 AC_MSG_RESULT($ac_cv_rl_version)
1797else
1798
1799AC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library])
1800AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library])
1801AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library])
1802
1803AC_SUBST(RL_VERSION)
1804AC_SUBST(RL_MAJOR)
1805AC_SUBST(RL_MINOR)
1806
1807# set these for use by the caller
1808RL_PREFIX=$ac_cv_rl_prefix
1809RL_LIBDIR=$ac_cv_rl_libdir
1810RL_INCLUDEDIR=$ac_cv_rl_includedir
1811
1812AC_MSG_RESULT($ac_cv_rl_version)
1813
1814fi
1815])
1816
1817AC_DEFUN(BASH_FUNC_CTYPE_NONASCII,
1818[
1819AC_MSG_CHECKING(whether the ctype macros accept non-ascii characters)
1820AC_CACHE_VAL(bash_cv_func_ctype_nonascii,
1821[AC_TRY_RUN([
1822#ifdef HAVE_LOCALE_H
1823#include <locale.h>
1824#endif
1825#include <stdio.h>
1826#include <ctype.h>
1827
1828main(c, v)
1829int c;
1830char *v[];
1831{
1832 char *deflocale;
1833 unsigned char x;
1834 int r1, r2;
1835
1836#ifdef HAVE_SETLOCALE
1837 /* We take a shot here. If that locale is not known, try the
1838 system default. We try this one because '\342' (226) is
1839 known to be a printable character in that locale. */
1840 deflocale = setlocale(LC_ALL, "en_US.ISO8859-1");
1841 if (deflocale == 0)
1842 deflocale = setlocale(LC_ALL, "");
1843#endif
1844
1845 x = '\342';
1846 r1 = isprint(x);
1847 x -= 128;
1848 r2 = isprint(x);
1849 exit (r1 == 0 || r2 == 0);
1850}
1851], bash_cv_func_ctype_nonascii=yes, bash_cv_func_ctype_nonascii=no,
1852 [AC_MSG_WARN(cannot check ctype macros if cross compiling -- defaulting to no)
1853 bash_cv_func_ctype_nonascii=no]
1854)])
1855AC_MSG_RESULT($bash_cv_func_ctype_nonascii)
1856if test $bash_cv_func_ctype_nonascii = yes; then
1857AC_DEFINE(CTYPE_NON_ASCII)
1858fi
1859])
1860
1861AC_DEFUN(BASH_TYPE_SIG_ATOMIC_T,
1862[AC_CACHE_CHECK([for sig_atomic_t in signal.h], ac_cv_have_sig_atomic_t,
1863[AC_TRY_LINK([
1864#include <signal.h>
1865],[ sig_atomic_t x; ],
1866ac_cv_have_sig_atomic_t=yes, ac_cv_have_sig_atomic_t=no)])
1867if test "$ac_cv_have_sig_atomic_t" = "no"
1868then
1869 AC_CHECK_TYPE(sig_atomic_t,int)
1870fi
1871])
diff --git a/meta/recipes-core/readline/files/norpath.patch b/meta/recipes-core/readline/files/norpath.patch
new file mode 100644
index 0000000000..5d71582b70
--- /dev/null
+++ b/meta/recipes-core/readline/files/norpath.patch
@@ -0,0 +1,21 @@
1This support script ends up hardcoding unnecessary rpaths into the libraries. We
2will search $libdir automatically so this is just wastes space. There may be some
3cases this is necessary but our use cases aren't one of them.
4
5Upstream-Status: Inappropriate
6
7RP 2012/2/23
8
9Index: readline-6.2/support/shobj-conf
10===================================================================
11--- readline-6.2.orig/support/shobj-conf 2012-02-23 11:06:37.193179379 +0000
12+++ readline-6.2/support/shobj-conf 2012-02-23 11:06:50.049178918 +0000
13@@ -114,7 +114,7 @@
14 SHOBJ_LD='${CC}'
15 SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
16
17- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
18+ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
19 SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
20 ;;
21
diff --git a/meta/recipes-core/readline/readline-5.2/acinclude.m4 b/meta/recipes-core/readline/readline-5.2/acinclude.m4
new file mode 100644
index 0000000000..8a45f99084
--- /dev/null
+++ b/meta/recipes-core/readline/readline-5.2/acinclude.m4
@@ -0,0 +1,1815 @@
1dnl
2dnl Bash specific tests
3dnl
4dnl Some derived from PDKSH 5.1.3 autoconf tests
5dnl
6
7AC_DEFUN([BASH_C_LONG_LONG],
8[AC_CACHE_CHECK(for long long, ac_cv_c_long_long,
9[if test "$GCC" = yes; then
10 ac_cv_c_long_long=yes
11else
12AC_TRY_RUN([
13int
14main()
15{
16long long foo = 0;
17exit(sizeof(long long) < sizeof(long));
18}
19], ac_cv_c_long_long=yes, ac_cv_c_long_long=no)
20fi])
21if test $ac_cv_c_long_long = yes; then
22 AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.])
23fi
24])
25
26dnl
27dnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIX
28dnl (< changed to <=) added.
29dnl
30AC_DEFUN([BASH_C_LONG_DOUBLE],
31[AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
32[if test "$GCC" = yes; then
33 ac_cv_c_long_double=yes
34else
35AC_TRY_RUN([
36int
37main()
38{
39 /* The Stardent Vistra knows sizeof(long double), but does not
40 support it. */
41 long double foo = 0.0;
42 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
43 /* On IRIX 5.3, the compiler converts long double to double with a warning,
44 but compiles this successfully. */
45 exit(sizeof(long double) <= sizeof(double));
46}
47], ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
48fi])
49if test $ac_cv_c_long_double = yes; then
50 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.])
51fi
52])
53
54dnl
55dnl Check for <inttypes.h>. This is separated out so that it can be
56dnl AC_REQUIREd.
57dnl
58dnl BASH_HEADER_INTTYPES
59AC_DEFUN([BASH_HEADER_INTTYPES],
60[
61 AC_CHECK_HEADERS(inttypes.h)
62])
63
64dnl
65dnl check for typedef'd symbols in header files, but allow the caller to
66dnl specify the include files to be checked in addition to the default
67dnl
68dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND])
69AC_DEFUN([BASH_CHECK_TYPE],
70[
71AC_REQUIRE([AC_HEADER_STDC])dnl
72AC_REQUIRE([BASH_HEADER_INTTYPES])
73AC_MSG_CHECKING(for $1)
74AC_CACHE_VAL(bash_cv_type_$1,
75[AC_EGREP_CPP($1, [#include <sys/types.h>
76#if STDC_HEADERS
77#include <stdlib.h>
78#include <stddef.h>
79#endif
80#if HAVE_INTTYPES_H
81#include <inttypes.h>
82#endif
83$2
84], bash_cv_type_$1=yes, bash_cv_type_$1=no)])
85AC_MSG_RESULT($bash_cv_type_$1)
86ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then
87 AC_DEFINE($4)
88 fi])
89if test $bash_cv_type_$1 = no; then
90 AC_DEFINE_UNQUOTED($1, $3)
91fi
92])
93
94dnl
95dnl BASH_CHECK_DECL(FUNC)
96dnl
97dnl Check for a declaration of FUNC in stdlib.h and inttypes.h like
98dnl AC_CHECK_DECL
99dnl
100AC_DEFUN([BASH_CHECK_DECL],
101[
102AC_REQUIRE([AC_HEADER_STDC])
103AC_REQUIRE([BASH_HEADER_INTTYPES])
104AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1,
105[AC_TRY_LINK(
106[
107#if STDC_HEADERS
108# include <stdlib.h>
109#endif
110#if HAVE_INTTYPES_H
111# include <inttypes.h>
112#endif
113],
114[return !$1;],
115bash_cv_decl_$1=yes, bash_cv_decl_$1=no)])
116bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
117if test $bash_cv_decl_$1 = yes; then
118 AC_DEFINE_UNQUOTED($bash_tr_func, 1)
119else
120 AC_DEFINE_UNQUOTED($bash_tr_func, 0)
121fi
122])
123
124AC_DEFUN([BASH_DECL_PRINTF],
125[AC_MSG_CHECKING(for declaration of printf in <stdio.h>)
126AC_CACHE_VAL(bash_cv_printf_declared,
127[AC_TRY_RUN([
128#include <stdio.h>
129#ifdef __STDC__
130typedef int (*_bashfunc)(const char *, ...);
131#else
132typedef int (*_bashfunc)();
133#endif
134main()
135{
136_bashfunc pf;
137pf = (_bashfunc) printf;
138exit(pf == 0);
139}
140], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
141 [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)
142 bash_cv_printf_declared=yes]
143)])
144AC_MSG_RESULT($bash_cv_printf_declared)
145if test $bash_cv_printf_declared = yes; then
146AC_DEFINE(PRINTF_DECLARED)
147fi
148])
149
150AC_DEFUN([BASH_DECL_SBRK],
151[AC_MSG_CHECKING(for declaration of sbrk in <unistd.h>)
152AC_CACHE_VAL(bash_cv_sbrk_declared,
153[AC_EGREP_HEADER(sbrk, unistd.h,
154 bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)])
155AC_MSG_RESULT($bash_cv_sbrk_declared)
156if test $bash_cv_sbrk_declared = yes; then
157AC_DEFINE(SBRK_DECLARED)
158fi
159])
160
161dnl
162dnl Check for sys_siglist[] or _sys_siglist[]
163dnl
164AC_DEFUN([BASH_DECL_UNDER_SYS_SIGLIST],
165[AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h])
166AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,
167[AC_TRY_COMPILE([
168#include <sys/types.h>
169#include <signal.h>
170#ifdef HAVE_UNISTD_H
171#include <unistd.h>
172#endif], [ char *msg = _sys_siglist[2]; ],
173 bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
174 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
175AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
176if test $bash_cv_decl_under_sys_siglist = yes; then
177AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
178fi
179])
180
181AC_DEFUN([BASH_UNDER_SYS_SIGLIST],
182[AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
183AC_MSG_CHECKING([for _sys_siglist in system C library])
184AC_CACHE_VAL(bash_cv_under_sys_siglist,
185[AC_TRY_RUN([
186#include <sys/types.h>
187#include <signal.h>
188#ifdef HAVE_UNISTD_H
189#include <unistd.h>
190#endif
191#ifndef UNDER_SYS_SIGLIST_DECLARED
192extern char *_sys_siglist[];
193#endif
194main()
195{
196char *msg = (char *)_sys_siglist[2];
197exit(msg == 0);
198}],
199 bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
200 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
201 bash_cv_under_sys_siglist=no])])
202AC_MSG_RESULT($bash_cv_under_sys_siglist)
203if test $bash_cv_under_sys_siglist = yes; then
204AC_DEFINE(HAVE_UNDER_SYS_SIGLIST)
205fi
206])
207
208AC_DEFUN([BASH_SYS_SIGLIST],
209[
210AC_CHECK_DECLS([sys_siglist])
211AC_MSG_CHECKING([for sys_siglist in system C library])
212AC_CACHE_VAL(bash_cv_sys_siglist,
213[AC_TRY_RUN([
214#include <sys/types.h>
215#include <signal.h>
216#ifdef HAVE_UNISTD_H
217#include <unistd.h>
218#endif
219#ifndef HAVE_DECL_SYS_SIGLIST
220extern char *sys_siglist[];
221#endif
222main()
223{
224char *msg = sys_siglist[2];
225exit(msg == 0);
226}],
227 bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
228 [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)
229 bash_cv_sys_siglist=no])])
230AC_MSG_RESULT($bash_cv_sys_siglist)
231if test $bash_cv_sys_siglist = yes; then
232AC_DEFINE(HAVE_SYS_SIGLIST)
233fi
234])
235
236dnl Check for the various permutations of sys_siglist and make sure we
237dnl compile in siglist.o if they're not defined
238AC_DEFUN([BASH_CHECK_SYS_SIGLIST], [
239AC_REQUIRE([BASH_SYS_SIGLIST])
240AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
241AC_REQUIRE([BASH_FUNC_STRSIGNAL])
242if test "$bash_cv_sys_siglist" = no && test "$bash_cv_under_sys_siglist" = no && test "$bash_cv_have_strsignal" = no; then
243 SIGLIST_O=siglist.o
244else
245 SIGLIST_O=
246fi
247AC_SUBST([SIGLIST_O])
248])
249
250dnl Check for sys_errlist[] and sys_nerr, check for declaration
251AC_DEFUN([BASH_SYS_ERRLIST],
252[AC_MSG_CHECKING([for sys_errlist and sys_nerr])
253AC_CACHE_VAL(bash_cv_sys_errlist,
254[AC_TRY_LINK([#include <errno.h>],
255[extern char *sys_errlist[];
256 extern int sys_nerr;
257 char *msg = sys_errlist[sys_nerr - 1];],
258 bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnl
259AC_MSG_RESULT($bash_cv_sys_errlist)
260if test $bash_cv_sys_errlist = yes; then
261AC_DEFINE(HAVE_SYS_ERRLIST)
262fi
263])
264
265dnl
266dnl Check if dup2() does not clear the close on exec flag
267dnl
268AC_DEFUN([BASH_FUNC_DUP2_CLOEXEC_CHECK],
269[AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag)
270AC_CACHE_VAL(bash_cv_dup2_broken,
271[AC_TRY_RUN([
272#include <sys/types.h>
273#include <fcntl.h>
274main()
275{
276 int fd1, fd2, fl;
277 fd1 = open("/dev/null", 2);
278 if (fcntl(fd1, 2, 1) < 0)
279 exit(1);
280 fd2 = dup2(fd1, 1);
281 if (fd2 < 0)
282 exit(2);
283 fl = fcntl(fd2, 1, 0);
284 /* fl will be 1 if dup2 did not reset the close-on-exec flag. */
285 exit(fl != 1);
286}
287], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
288 [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)
289 bash_cv_dup2_broken=no])
290])
291AC_MSG_RESULT($bash_cv_dup2_broken)
292if test $bash_cv_dup2_broken = yes; then
293AC_DEFINE(DUP2_BROKEN)
294fi
295])
296
297AC_DEFUN([BASH_FUNC_STRSIGNAL],
298[AC_MSG_CHECKING([for the existence of strsignal])
299AC_CACHE_VAL(bash_cv_have_strsignal,
300[AC_TRY_LINK([#include <sys/types.h>
301#include <signal.h>],
302[char *s = (char *)strsignal(2);],
303 bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])
304AC_MSG_RESULT($bash_cv_have_strsignal)
305if test $bash_cv_have_strsignal = yes; then
306AC_DEFINE(HAVE_STRSIGNAL)
307fi
308])
309
310dnl Check to see if opendir will open non-directories (not a nice thing)
311AC_DEFUN([BASH_FUNC_OPENDIR_CHECK],
312[AC_REQUIRE([AC_HEADER_DIRENT])dnl
313AC_MSG_CHECKING(if opendir() opens non-directories)
314AC_CACHE_VAL(bash_cv_opendir_not_robust,
315[AC_TRY_RUN([
316#include <stdio.h>
317#include <sys/types.h>
318#include <fcntl.h>
319#ifdef HAVE_UNISTD_H
320# include <unistd.h>
321#endif /* HAVE_UNISTD_H */
322#if defined(HAVE_DIRENT_H)
323# include <dirent.h>
324#else
325# define dirent direct
326# ifdef HAVE_SYS_NDIR_H
327# include <sys/ndir.h>
328# endif /* SYSNDIR */
329# ifdef HAVE_SYS_DIR_H
330# include <sys/dir.h>
331# endif /* SYSDIR */
332# ifdef HAVE_NDIR_H
333# include <ndir.h>
334# endif
335#endif /* HAVE_DIRENT_H */
336main()
337{
338DIR *dir;
339int fd, err;
340err = mkdir("/tmp/bash-aclocal", 0700);
341if (err < 0) {
342 perror("mkdir");
343 exit(1);
344}
345unlink("/tmp/bash-aclocal/not_a_directory");
346fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
347write(fd, "\n", 1);
348close(fd);
349dir = opendir("/tmp/bash-aclocal/not_a_directory");
350unlink("/tmp/bash-aclocal/not_a_directory");
351rmdir("/tmp/bash-aclocal");
352exit (dir == 0);
353}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
354 [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
355 bash_cv_opendir_not_robust=no]
356)])
357AC_MSG_RESULT($bash_cv_opendir_not_robust)
358if test $bash_cv_opendir_not_robust = yes; then
359AC_DEFINE(OPENDIR_NOT_ROBUST)
360fi
361])
362
363dnl
364AH_TEMPLATE([VOID_SIGHANDLER], [Define if signal handlers return type void])
365AC_DEFUN([BASH_TYPE_SIGHANDLER],
366[AC_MSG_CHECKING([whether signal handlers are of type void])
367AC_CACHE_VAL(bash_cv_void_sighandler,
368[AC_TRY_COMPILE([#include <sys/types.h>
369#include <signal.h>
370#ifdef signal
371#undef signal
372#endif
373#ifdef __cplusplus
374extern "C"
375#endif
376void (*signal ()) ();],
377[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl
378AC_MSG_RESULT($bash_cv_void_sighandler)
379if test $bash_cv_void_sighandler = yes; then
380AC_DEFINE(VOID_SIGHANDLER)
381fi
382])
383
384dnl
385dnl A signed 16-bit integer quantity
386dnl
387AC_DEFUN([BASH_TYPE_BITS16_T],
388[
389if test "$ac_cv_sizeof_short" = 2; then
390 AC_CHECK_TYPE(bits16_t, short)
391elif test "$ac_cv_sizeof_char" = 2; then
392 AC_CHECK_TYPE(bits16_t, char)
393else
394 AC_CHECK_TYPE(bits16_t, short)
395fi
396])
397
398dnl
399dnl An unsigned 16-bit integer quantity
400dnl
401AC_DEFUN([BASH_TYPE_U_BITS16_T],
402[
403if test "$ac_cv_sizeof_short" = 2; then
404 AC_CHECK_TYPE(u_bits16_t, unsigned short)
405elif test "$ac_cv_sizeof_char" = 2; then
406 AC_CHECK_TYPE(u_bits16_t, unsigned char)
407else
408 AC_CHECK_TYPE(u_bits16_t, unsigned short)
409fi
410])
411
412dnl
413dnl A signed 32-bit integer quantity
414dnl
415AC_DEFUN([BASH_TYPE_BITS32_T],
416[
417if test "$ac_cv_sizeof_int" = 4; then
418 AC_CHECK_TYPE(bits32_t, int)
419elif test "$ac_cv_sizeof_long" = 4; then
420 AC_CHECK_TYPE(bits32_t, long)
421else
422 AC_CHECK_TYPE(bits32_t, int)
423fi
424])
425
426dnl
427dnl An unsigned 32-bit integer quantity
428dnl
429AC_DEFUN([BASH_TYPE_U_BITS32_T],
430[
431if test "$ac_cv_sizeof_int" = 4; then
432 AC_CHECK_TYPE(u_bits32_t, unsigned int)
433elif test "$ac_cv_sizeof_long" = 4; then
434 AC_CHECK_TYPE(u_bits32_t, unsigned long)
435else
436 AC_CHECK_TYPE(u_bits32_t, unsigned int)
437fi
438])
439
440AC_DEFUN([BASH_TYPE_PTRDIFF_T],
441[
442if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then
443 AC_CHECK_TYPE(ptrdiff_t, int)
444elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then
445 AC_CHECK_TYPE(ptrdiff_t, long)
446elif test "$ac_cv_type_long_long" = yes && test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_char_p"; then
447 AC_CHECK_TYPE(ptrdiff_t, [long long])
448else
449 AC_CHECK_TYPE(ptrdiff_t, int)
450fi
451])
452
453dnl
454dnl A signed 64-bit quantity
455dnl
456AC_DEFUN([BASH_TYPE_BITS64_T],
457[
458if test "$ac_cv_sizeof_char_p" = 8; then
459 AC_CHECK_TYPE(bits64_t, char *)
460elif test "$ac_cv_sizeof_double" = 8; then
461 AC_CHECK_TYPE(bits64_t, double)
462elif test -n "$ac_cv_type_long_long" && test "$ac_cv_sizeof_long_long" = 8; then
463 AC_CHECK_TYPE(bits64_t, [long long])
464elif test "$ac_cv_sizeof_long" = 8; then
465 AC_CHECK_TYPE(bits64_t, long)
466else
467 AC_CHECK_TYPE(bits64_t, double)
468fi
469])
470
471AC_DEFUN([BASH_TYPE_LONG_LONG],
472[
473AC_CACHE_CHECK([for long long], bash_cv_type_long_long,
474[AC_TRY_LINK([
475long long ll = 1; int i = 63;],
476[
477long long llm = (long long) -1;
478return ll << i | ll >> i | llm / ll | llm % ll;
479], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')])
480if test "$bash_cv_type_long_long" = 'long long'; then
481 AC_DEFINE(HAVE_LONG_LONG, 1)
482fi
483])
484
485AC_DEFUN([BASH_TYPE_UNSIGNED_LONG_LONG],
486[
487AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long,
488[AC_TRY_LINK([
489unsigned long long ull = 1; int i = 63;],
490[
491unsigned long long ullmax = (unsigned long long) -1;
492return ull << i | ull >> i | ullmax / ull | ullmax % ull;
493], bash_cv_type_unsigned_long_long='unsigned long long',
494 bash_cv_type_unsigned_long_long='unsigned long')])
495if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then
496 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1)
497fi
498])
499
500dnl
501dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0)
502dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use
503dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify
504dnl matters, this just checks for rlim_t, quad_t, or long.
505dnl
506AC_DEFUN([BASH_TYPE_RLIMIT],
507[AC_MSG_CHECKING(for size and type of struct rlimit fields)
508AC_CACHE_VAL(bash_cv_type_rlimit,
509[AC_TRY_COMPILE([#include <sys/types.h>
510#include <sys/resource.h>],
511[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[
512AC_TRY_RUN([
513#include <sys/types.h>
514#include <sys/time.h>
515#include <sys/resource.h>
516main()
517{
518#ifdef HAVE_QUAD_T
519 struct rlimit rl;
520 if (sizeof(rl.rlim_cur) == sizeof(quad_t))
521 exit(0);
522#endif
523 exit(1);
524}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
525 [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long)
526 bash_cv_type_rlimit=long])])
527])
528AC_MSG_RESULT($bash_cv_type_rlimit)
529if test $bash_cv_type_rlimit = quad_t; then
530AC_DEFINE(RLIMTYPE, quad_t)
531elif test $bash_cv_type_rlimit = rlim_t; then
532AC_DEFINE(RLIMTYPE, rlim_t)
533fi
534])
535
536AC_DEFUN([BASH_FUNC_LSTAT],
537[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an
538dnl inline function in <sys/stat.h>.
539AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,
540[AC_TRY_LINK([
541#include <sys/types.h>
542#include <sys/stat.h>
543],[ lstat(".",(struct stat *)0); ],
544bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])
545if test $bash_cv_func_lstat = yes; then
546 AC_DEFINE(HAVE_LSTAT)
547fi
548])
549
550AC_DEFUN([BASH_FUNC_INET_ATON],
551[
552AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
553[AC_TRY_LINK([
554#include <sys/types.h>
555#include <netinet/in.h>
556#include <arpa/inet.h>
557struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
558bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
559if test $bash_cv_func_inet_aton = yes; then
560 AC_DEFINE(HAVE_INET_ATON)
561else
562 AC_LIBOBJ(inet_aton)
563fi
564])
565
566AC_DEFUN([BASH_FUNC_GETENV],
567[AC_MSG_CHECKING(to see if getenv can be redefined)
568AC_CACHE_VAL(bash_cv_getenv_redef,
569[AC_TRY_RUN([
570#ifdef HAVE_UNISTD_H
571# include <unistd.h>
572#endif
573#ifndef __STDC__
574# ifndef const
575# define const
576# endif
577#endif
578char *
579getenv (name)
580#if defined (__linux__) || defined (__bsdi__) || defined (convex)
581 const char *name;
582#else
583 char const *name;
584#endif /* !__linux__ && !__bsdi__ && !convex */
585{
586return "42";
587}
588main()
589{
590char *s;
591/* The next allows this program to run, but does not allow bash to link
592 when it redefines getenv. I'm not really interested in figuring out
593 why not. */
594#if defined (NeXT)
595exit(1);
596#endif
597s = getenv("ABCDE");
598exit(s == 0); /* force optimizer to leave getenv in */
599}
600], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
601 [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes)
602 bash_cv_getenv_redef=yes]
603)])
604AC_MSG_RESULT($bash_cv_getenv_redef)
605if test $bash_cv_getenv_redef = yes; then
606AC_DEFINE(CAN_REDEFINE_GETENV)
607fi
608])
609
610# We should check for putenv before calling this
611AC_DEFUN([BASH_FUNC_STD_PUTENV],
612[
613AC_REQUIRE([AC_HEADER_STDC])
614AC_REQUIRE([AC_C_PROTOTYPES])
615AC_CACHE_CHECK([for standard-conformant putenv declaration], bash_cv_std_putenv,
616[AC_TRY_LINK([
617#if STDC_HEADERS
618#include <stdlib.h>
619#include <stddef.h>
620#endif
621#ifndef __STDC__
622# ifndef const
623# define const
624# endif
625#endif
626#ifdef PROTOTYPES
627extern int putenv (char *);
628#else
629extern int putenv ();
630#endif
631],
632[return (putenv == 0);],
633bash_cv_std_putenv=yes, bash_cv_std_putenv=no
634)])
635if test $bash_cv_std_putenv = yes; then
636AC_DEFINE(HAVE_STD_PUTENV)
637fi
638])
639
640# We should check for unsetenv before calling this
641AC_DEFUN([BASH_FUNC_STD_UNSETENV],
642[
643AC_REQUIRE([AC_HEADER_STDC])
644AC_REQUIRE([AC_C_PROTOTYPES])
645AC_CACHE_CHECK([for standard-conformant unsetenv declaration], bash_cv_std_unsetenv,
646[AC_TRY_LINK([
647#if STDC_HEADERS
648#include <stdlib.h>
649#include <stddef.h>
650#endif
651#ifndef __STDC__
652# ifndef const
653# define const
654# endif
655#endif
656#ifdef PROTOTYPES
657extern int unsetenv (const char *);
658#else
659extern int unsetenv ();
660#endif
661],
662[return (unsetenv == 0);],
663bash_cv_std_unsetenv=yes, bash_cv_std_unsetenv=no
664)])
665if test $bash_cv_std_unsetenv = yes; then
666AC_DEFINE(HAVE_STD_UNSETENV)
667fi
668])
669
670AC_DEFUN([BASH_FUNC_ULIMIT_MAXFDS],
671[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize)
672AC_CACHE_VAL(bash_cv_ulimit_maxfds,
673[AC_TRY_RUN([
674main()
675{
676long maxfds = ulimit(4, 0L);
677exit (maxfds == -1L);
678}
679], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
680 [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no)
681 bash_cv_ulimit_maxfds=no]
682)])
683AC_MSG_RESULT($bash_cv_ulimit_maxfds)
684if test $bash_cv_ulimit_maxfds = yes; then
685AC_DEFINE(ULIMIT_MAXFDS)
686fi
687])
688
689AC_DEFUN([BASH_FUNC_GETCWD],
690[AC_MSG_CHECKING([if getcwd() calls popen()])
691AC_CACHE_VAL(bash_cv_getcwd_calls_popen,
692[AC_TRY_RUN([
693#include <stdio.h>
694#ifdef HAVE_UNISTD_H
695#include <unistd.h>
696#endif
697
698#ifndef __STDC__
699#ifndef const
700#define const
701#endif
702#endif
703
704int popen_called;
705
706FILE *
707popen(command, type)
708 const char *command;
709 const char *type;
710{
711 popen_called = 1;
712 return (FILE *)NULL;
713}
714
715FILE *_popen(command, type)
716 const char *command;
717 const char *type;
718{
719 return (popen (command, type));
720}
721
722int
723pclose(stream)
724FILE *stream;
725{
726 return 0;
727}
728
729int
730_pclose(stream)
731FILE *stream;
732{
733 return 0;
734}
735
736main()
737{
738 char lbuf[32];
739 popen_called = 0;
740 getcwd(lbuf, 32);
741 exit (popen_called);
742}
743], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
744 [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
745 bash_cv_getcwd_calls_popen=no]
746)])
747AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
748if test $bash_cv_getcwd_calls_popen = yes; then
749AC_DEFINE(GETCWD_BROKEN)
750AC_LIBOBJ(getcwd)
751fi
752])
753
754dnl
755dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
756dnl system, we can't use AC_PREREQ
757dnl
758AC_DEFUN([BASH_FUNC_GETHOSTBYNAME],
759[if test "X$bash_cv_have_gethostbyname" = "X"; then
760_bash_needmsg=yes
761else
762AC_MSG_CHECKING(for gethostbyname in socket library)
763_bash_needmsg=
764fi
765AC_CACHE_VAL(bash_cv_have_gethostbyname,
766[AC_TRY_LINK([#include <netdb.h>],
767[ struct hostent *hp;
768 hp = gethostbyname("localhost");
769], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
770)
771if test "X$_bash_needmsg" = Xyes; then
772 AC_MSG_CHECKING(for gethostbyname in socket library)
773fi
774AC_MSG_RESULT($bash_cv_have_gethostbyname)
775if test "$bash_cv_have_gethostbyname" = yes; then
776AC_DEFINE(HAVE_GETHOSTBYNAME)
777fi
778])
779
780AC_DEFUN([BASH_FUNC_FNMATCH_EXTMATCH],
781[AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH)
782AC_CACHE_VAL(bash_cv_fnm_extmatch,
783[AC_TRY_RUN([
784#include <fnmatch.h>
785
786main()
787{
788#ifdef FNM_EXTMATCH
789 exit (0);
790#else
791 exit (1);
792#endif
793}
794], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no,
795 [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no)
796 bash_cv_fnm_extmatch=no])
797])
798AC_MSG_RESULT($bash_cv_fnm_extmatch)
799if test $bash_cv_fnm_extmatch = yes; then
800AC_DEFINE(HAVE_LIBC_FNM_EXTMATCH)
801fi
802])
803
804AH_TEMPLATE([HAVE_POSIX_SIGSETJMP], [Define if we POSIX-style sigsetjmp/siglongjmp are available])
805AC_DEFUN([BASH_FUNC_POSIX_SETJMP],
806[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
807AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp)
808AC_CACHE_VAL(bash_cv_func_sigsetjmp,
809[AC_TRY_RUN([
810#ifdef HAVE_UNISTD_H
811#include <unistd.h>
812#endif
813#include <sys/types.h>
814#include <signal.h>
815#include <setjmp.h>
816
817main()
818{
819#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
820exit (1);
821#else
822
823int code;
824sigset_t set, oset;
825sigjmp_buf xx;
826
827/* get the mask */
828sigemptyset(&set);
829sigemptyset(&oset);
830sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);
831sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);
832
833/* save it */
834code = sigsetjmp(xx, 1);
835if (code)
836 exit(0); /* could get sigmask and compare to oset here. */
837
838/* change it */
839sigaddset(&set, SIGINT);
840sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
841
842/* and siglongjmp */
843siglongjmp(xx, 10);
844exit(1);
845#endif
846}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
847 [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
848 bash_cv_func_sigsetjmp=missing]
849)])
850AC_MSG_RESULT($bash_cv_func_sigsetjmp)
851if test $bash_cv_func_sigsetjmp = present; then
852AC_DEFINE(HAVE_POSIX_SIGSETJMP)
853fi
854])
855
856AH_TEMPLATE([STRCOLL_BROKEN], [Define if strcoll is broken with respect to strcmp in the default locale.])
857AC_DEFUN([BASH_FUNC_STRCOLL],
858[
859AC_MSG_CHECKING(whether or not strcoll and strcmp differ)
860AC_CACHE_VAL(bash_cv_func_strcoll_broken,
861[AC_TRY_RUN([
862#include <stdio.h>
863#if defined (HAVE_LOCALE_H)
864#include <locale.h>
865#endif
866
867main(c, v)
868int c;
869char *v[];
870{
871 int r1, r2;
872 char *deflocale, *defcoll;
873
874#ifdef HAVE_SETLOCALE
875 deflocale = setlocale(LC_ALL, "");
876 defcoll = setlocale(LC_COLLATE, "");
877#endif
878
879#ifdef HAVE_STRCOLL
880 /* These two values are taken from tests/glob-test. */
881 r1 = strcoll("abd", "aXd");
882#else
883 r1 = 0;
884#endif
885 r2 = strcmp("abd", "aXd");
886
887 /* These two should both be greater than 0. It is permissible for
888 a system to return different values, as long as the sign is the
889 same. */
890
891 /* Exit with 1 (failure) if these two values are both > 0, since
892 this tests whether strcoll(3) is broken with respect to strcmp(3)
893 in the default locale. */
894 exit (r1 > 0 && r2 > 0);
895}
896], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
897 [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
898 bash_cv_func_strcoll_broken=no]
899)])
900AC_MSG_RESULT($bash_cv_func_strcoll_broken)
901if test $bash_cv_func_strcoll_broken = yes; then
902AC_DEFINE(STRCOLL_BROKEN)
903fi
904])
905
906AC_DEFUN([BASH_FUNC_PRINTF_A_FORMAT],
907[AC_MSG_CHECKING([for printf floating point output in hex notation])
908AC_CACHE_VAL(bash_cv_printf_a_format,
909[AC_TRY_RUN([
910#include <stdio.h>
911#include <string.h>
912
913int
914main()
915{
916 double y = 0.0;
917 char abuf[1024];
918
919 sprintf(abuf, "%A", y);
920 exit(strchr(abuf, 'P') == (char *)0);
921}
922], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no,
923 [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no)
924 bash_cv_printf_a_format=no]
925)])
926AC_MSG_RESULT($bash_cv_printf_a_format)
927if test $bash_cv_printf_a_format = yes; then
928AC_DEFINE(HAVE_PRINTF_A_FORMAT)
929fi
930])
931
932AC_DEFUN([BASH_STRUCT_TERMIOS_LDISC],
933[
934AC_CHECK_MEMBER(struct termios.c_line, AC_DEFINE(TERMIOS_LDISC), ,[
935#include <sys/types.h>
936#include <termios.h>
937])
938])
939
940AC_DEFUN([BASH_STRUCT_TERMIO_LDISC],
941[
942AC_CHECK_MEMBER(struct termio.c_line, AC_DEFINE(TERMIO_LDISC), ,[
943#include <sys/types.h>
944#include <termio.h>
945])
946])
947
948dnl
949dnl Like AC_STRUCT_ST_BLOCKS, but doesn't muck with LIBOBJS
950dnl
951dnl sets bash_cv_struct_stat_st_blocks
952dnl
953dnl unused for now; we'll see how AC_CHECK_MEMBERS works
954dnl
955AC_DEFUN([BASH_STRUCT_ST_BLOCKS],
956[
957AC_MSG_CHECKING([for struct stat.st_blocks])
958AC_CACHE_VAL(bash_cv_struct_stat_st_blocks,
959[AC_TRY_COMPILE(
960[
961#include <sys/types.h>
962#include <sys/stat.h>
963],
964[
965main()
966{
967static struct stat a;
968if (a.st_blocks) return 0;
969return 0;
970}
971], bash_cv_struct_stat_st_blocks=yes, bash_cv_struct_stat_st_blocks=no)
972])
973AC_MSG_RESULT($bash_cv_struct_stat_st_blocks)
974if test "$bash_cv_struct_stat_st_blocks" = "yes"; then
975AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS)
976fi
977])
978
979AC_DEFUN([BASH_CHECK_LIB_TERMCAP],
980[
981if test "X$bash_cv_termcap_lib" = "X"; then
982_bash_needmsg=yes
983else
984AC_MSG_CHECKING(which library has the termcap functions)
985_bash_needmsg=
986fi
987AC_CACHE_VAL(bash_cv_termcap_lib,
988[AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
989 [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo,
990 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
991 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
992 bash_cv_termcap_lib=gnutermcap)])])])])
993if test "X$_bash_needmsg" = "Xyes"; then
994AC_MSG_CHECKING(which library has the termcap functions)
995fi
996AC_MSG_RESULT(using $bash_cv_termcap_lib)
997if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
998LDFLAGS="$LDFLAGS -L./lib/termcap"
999TERMCAP_LIB="./lib/termcap/libtermcap.a"
1000TERMCAP_DEP="./lib/termcap/libtermcap.a"
1001elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
1002TERMCAP_LIB=-ltermcap
1003TERMCAP_DEP=
1004elif test $bash_cv_termcap_lib = libtinfo; then
1005TERMCAP_LIB=-ltinfo
1006TERMCAP_DEP=
1007elif test $bash_cv_termcap_lib = libncurses; then
1008TERMCAP_LIB=-lncurses
1009TERMCAP_DEP=
1010else
1011TERMCAP_LIB=-lcurses
1012TERMCAP_DEP=
1013fi
1014])
1015
1016dnl
1017dnl Check for the presence of getpeername in libsocket.
1018dnl If libsocket is present, check for libnsl and add it to LIBS if
1019dnl it's there, since most systems with libsocket require linking
1020dnl with libnsl as well. This should only be called if getpeername
1021dnl was not found in libc.
1022dnl
1023dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
1024dnl AS WELL
1025dnl
1026AC_DEFUN([BASH_CHECK_LIB_SOCKET],
1027[
1028if test "X$bash_cv_have_socklib" = "X"; then
1029_bash_needmsg=
1030else
1031AC_MSG_CHECKING(for socket library)
1032_bash_needmsg=yes
1033fi
1034AC_CACHE_VAL(bash_cv_have_socklib,
1035[AC_CHECK_LIB(socket, getpeername,
1036 bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)])
1037if test "X$_bash_needmsg" = Xyes; then
1038 AC_MSG_RESULT($bash_cv_have_socklib)
1039 _bash_needmsg=
1040fi
1041if test $bash_cv_have_socklib = yes; then
1042 # check for libnsl, add it to LIBS if present
1043 if test "X$bash_cv_have_libnsl" = "X"; then
1044 _bash_needmsg=
1045 else
1046 AC_MSG_CHECKING(for libnsl)
1047 _bash_needmsg=yes
1048 fi
1049 AC_CACHE_VAL(bash_cv_have_libnsl,
1050 [AC_CHECK_LIB(nsl, t_open,
1051 bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)])
1052 if test "X$_bash_needmsg" = Xyes; then
1053 AC_MSG_RESULT($bash_cv_have_libnsl)
1054 _bash_needmsg=
1055 fi
1056 if test $bash_cv_have_libnsl = yes; then
1057 LIBS="-lsocket -lnsl $LIBS"
1058 else
1059 LIBS="-lsocket $LIBS"
1060 fi
1061 AC_DEFINE(HAVE_LIBSOCKET)
1062 AC_DEFINE(HAVE_GETPEERNAME)
1063fi
1064])
1065
1066AH_TEMPLATE([STRUCT_DIRENT_HAS_D_INO], [Define if struct dirent has a d_ino member])
1067AC_DEFUN([BASH_STRUCT_DIRENT_D_INO],
1068[AC_REQUIRE([AC_HEADER_DIRENT])
1069AC_MSG_CHECKING(if struct dirent has a d_ino member)
1070AC_CACHE_VAL(bash_cv_dirent_has_dino,
1071[AC_TRY_COMPILE([
1072#include <stdio.h>
1073#include <sys/types.h>
1074#ifdef HAVE_UNISTD_H
1075# include <unistd.h>
1076#endif /* HAVE_UNISTD_H */
1077#if defined(HAVE_DIRENT_H)
1078# include <dirent.h>
1079#else
1080# define dirent direct
1081# ifdef HAVE_SYS_NDIR_H
1082# include <sys/ndir.h>
1083# endif /* SYSNDIR */
1084# ifdef HAVE_SYS_DIR_H
1085# include <sys/dir.h>
1086# endif /* SYSDIR */
1087# ifdef HAVE_NDIR_H
1088# include <ndir.h>
1089# endif
1090#endif /* HAVE_DIRENT_H */
1091],[
1092struct dirent d; int z; z = d.d_ino;
1093], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)])
1094AC_MSG_RESULT($bash_cv_dirent_has_dino)
1095if test $bash_cv_dirent_has_dino = yes; then
1096AC_DEFINE(STRUCT_DIRENT_HAS_D_INO)
1097fi
1098])
1099
1100AH_TEMPLATE([STRUCT_DIRENT_HAS_D_FILENO], [Define if struct dirent has a d_fileno member])
1101AC_DEFUN([BASH_STRUCT_DIRENT_D_FILENO],
1102[AC_REQUIRE([AC_HEADER_DIRENT])
1103AC_MSG_CHECKING(if struct dirent has a d_fileno member)
1104AC_CACHE_VAL(bash_cv_dirent_has_d_fileno,
1105[AC_TRY_COMPILE([
1106#include <stdio.h>
1107#include <sys/types.h>
1108#ifdef HAVE_UNISTD_H
1109# include <unistd.h>
1110#endif /* HAVE_UNISTD_H */
1111#if defined(HAVE_DIRENT_H)
1112# include <dirent.h>
1113#else
1114# define dirent direct
1115# ifdef HAVE_SYS_NDIR_H
1116# include <sys/ndir.h>
1117# endif /* SYSNDIR */
1118# ifdef HAVE_SYS_DIR_H
1119# include <sys/dir.h>
1120# endif /* SYSDIR */
1121# ifdef HAVE_NDIR_H
1122# include <ndir.h>
1123# endif
1124#endif /* HAVE_DIRENT_H */
1125],[
1126struct dirent d; int z; z = d.d_fileno;
1127], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)])
1128AC_MSG_RESULT($bash_cv_dirent_has_d_fileno)
1129if test $bash_cv_dirent_has_d_fileno = yes; then
1130AC_DEFINE(STRUCT_DIRENT_HAS_D_FILENO)
1131fi
1132])
1133
1134AC_DEFUN([BASH_STRUCT_TIMEVAL],
1135[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
1136AC_CACHE_VAL(bash_cv_struct_timeval,
1137[
1138AC_EGREP_HEADER(struct timeval, sys/time.h,
1139 bash_cv_struct_timeval=yes,
1140 AC_EGREP_HEADER(struct timeval, time.h,
1141 bash_cv_struct_timeval=yes,
1142 bash_cv_struct_timeval=no))
1143])
1144AC_MSG_RESULT($bash_cv_struct_timeval)
1145if test $bash_cv_struct_timeval = yes; then
1146 AC_DEFINE(HAVE_TIMEVAL)
1147fi
1148])
1149
1150AH_TEMPLATE([STRUCT_WINSIZE_IN_SYS_IOCTL], [Define if struct winsize is in sys/ioctl.h])
1151AH_TEMPLATE([STRUCT_WINSIZE_IN_TERMIOS], [Define if struct winsize is in termios.h])
1152AC_DEFUN([BASH_STRUCT_WINSIZE],
1153[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h)
1154AC_CACHE_VAL(bash_cv_struct_winsize_header,
1155[AC_TRY_COMPILE([#include <sys/types.h>
1156#include <sys/ioctl.h>], [struct winsize x;],
1157 bash_cv_struct_winsize_header=ioctl_h,
1158 [AC_TRY_COMPILE([#include <sys/types.h>
1159#include <termios.h>], [struct winsize x;],
1160 bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other)
1161])])
1162if test $bash_cv_struct_winsize_header = ioctl_h; then
1163 AC_MSG_RESULT(sys/ioctl.h)
1164 AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL)
1165elif test $bash_cv_struct_winsize_header = termios_h; then
1166 AC_MSG_RESULT(termios.h)
1167 AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS)
1168else
1169 AC_MSG_RESULT(not found)
1170fi
1171])
1172
1173dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
1174AH_TEMPLATE([HAVE_POSIX_SIGNALS], [Define if we have the POSIX signal routines])
1175AH_TEMPLATE([HAVE_BSD_SIGNALS], [Define if we have the BSD signal routines])
1176AH_TEMPLATE([HAVE_USG_SIGHOLD], [Define if we have the USG signal routines])
1177AC_DEFUN([BASH_SYS_SIGNAL_VINTAGE],
1178[AC_REQUIRE([AC_TYPE_SIGNAL])
1179AC_MSG_CHECKING(for type of signal functions)
1180AC_CACHE_VAL(bash_cv_signal_vintage,
1181[
1182 AC_MSG_WARN([checking for posix...])
1183 AC_TRY_LINK([#include <signal.h>],[
1184 sigset_t ss;
1185 struct sigaction sa;
1186 sigemptyset(&ss); sigsuspend(&ss);
1187 sigaction(SIGINT, &sa, (struct sigaction *) 0);
1188 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
1189 ], bash_cv_signal_vintage="posix",
1190 [
1191 AC_MSG_WARN([checking for 4.2bsd...])
1192 AC_TRY_LINK([#include <signal.h>], [
1193 int mask = sigmask(SIGINT);
1194 sigsetmask(mask); sigblock(mask); sigpause(mask);
1195 ], bash_cv_signal_vintage="4.2bsd",
1196 [
1197 AC_MSG_WARN([checking for svr3...])
1198 AC_TRY_LINK([
1199 #include <signal.h>
1200 RETSIGTYPE foo() { }], [
1201 int mask = sigmask(SIGINT);
1202 sigset(SIGINT, foo); sigrelse(SIGINT);
1203 sighold(SIGINT); sigpause(SIGINT);
1204 ], bash_cv_signal_vintage="svr3", bash_cv_signal_vintage="v7"
1205 )]
1206 )]
1207)
1208])
1209AC_MSG_RESULT($bash_cv_signal_vintage)
1210if test "$bash_cv_signal_vintage" = "posix"; then
1211AC_DEFINE(HAVE_POSIX_SIGNALS)
1212elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
1213AC_DEFINE(HAVE_BSD_SIGNALS)
1214elif test "$bash_cv_signal_vintage" = "svr3"; then
1215AC_DEFINE(HAVE_USG_SIGHOLD)
1216fi
1217])
1218
1219dnl Check if the pgrp of setpgrp() can't be the pid of a zombie process.
1220AC_DEFUN([BASH_SYS_PGRP_SYNC],
1221[AC_REQUIRE([AC_FUNC_GETPGRP])
1222AC_MSG_CHECKING(whether pgrps need synchronization)
1223AC_CACHE_VAL(bash_cv_pgrp_pipe,
1224[AC_TRY_RUN([
1225#ifdef HAVE_UNISTD_H
1226# include <unistd.h>
1227#endif
1228main()
1229{
1230# ifdef GETPGRP_VOID
1231# define getpgID() getpgrp()
1232# else
1233# define getpgID() getpgrp(0)
1234# define setpgid(x,y) setpgrp(x,y)
1235# endif
1236 int pid1, pid2, fds[2];
1237 int status;
1238 char ok;
1239
1240 switch (pid1 = fork()) {
1241 case -1:
1242 exit(1);
1243 case 0:
1244 setpgid(0, getpid());
1245 exit(0);
1246 }
1247 setpgid(pid1, pid1);
1248
1249 sleep(2); /* let first child die */
1250
1251 if (pipe(fds) < 0)
1252 exit(2);
1253
1254 switch (pid2 = fork()) {
1255 case -1:
1256 exit(3);
1257 case 0:
1258 setpgid(0, pid1);
1259 ok = getpgID() == pid1;
1260 write(fds[1], &ok, 1);
1261 exit(0);
1262 }
1263 setpgid(pid2, pid1);
1264
1265 close(fds[1]);
1266 if (read(fds[0], &ok, 1) != 1)
1267 exit(4);
1268 wait(&status);
1269 wait(&status);
1270 exit(ok ? 0 : 5);
1271}
1272], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
1273 [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
1274 bash_cv_pgrp_pipe=no])
1275])
1276AC_MSG_RESULT($bash_cv_pgrp_pipe)
1277if test $bash_cv_pgrp_pipe = yes; then
1278AC_DEFINE(PGRP_PIPE)
1279fi
1280])
1281
1282AH_TEMPLATE([MUST_REINSTALL_SIGHANDLERS], [Define if signal handlers must be reinstalled when invoked.])
1283AC_DEFUN([BASH_SYS_REINSTALL_SIGHANDLERS],
1284[AC_REQUIRE([AC_TYPE_SIGNAL])
1285AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
1286AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked])
1287AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers,
1288[AC_TRY_RUN([
1289#include <signal.h>
1290#ifdef HAVE_UNISTD_H
1291#include <unistd.h>
1292#endif
1293
1294typedef RETSIGTYPE sigfunc();
1295
1296int nsigint;
1297
1298#ifdef HAVE_POSIX_SIGNALS
1299sigfunc *
1300set_signal_handler(sig, handler)
1301 int sig;
1302 sigfunc *handler;
1303{
1304 struct sigaction act, oact;
1305 act.sa_handler = handler;
1306 act.sa_flags = 0;
1307 sigemptyset (&act.sa_mask);
1308 sigemptyset (&oact.sa_mask);
1309 sigaction (sig, &act, &oact);
1310 return (oact.sa_handler);
1311}
1312#else
1313#define set_signal_handler(s, h) signal(s, h)
1314#endif
1315
1316RETSIGTYPE
1317sigint(s)
1318int s;
1319{
1320 nsigint++;
1321}
1322
1323main()
1324{
1325 nsigint = 0;
1326 set_signal_handler(SIGINT, sigint);
1327 kill((int)getpid(), SIGINT);
1328 kill((int)getpid(), SIGINT);
1329 exit(nsigint != 2);
1330}
1331], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
1332 [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no)
1333 bash_cv_must_reinstall_sighandlers=no]
1334)])
1335AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
1336if test $bash_cv_must_reinstall_sighandlers = yes; then
1337AC_DEFINE(MUST_REINSTALL_SIGHANDLERS)
1338fi
1339])
1340
1341dnl check that some necessary job control definitions are present
1342AC_DEFUN([BASH_SYS_JOB_CONTROL_MISSING],
1343[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE])
1344AC_MSG_CHECKING(for presence of necessary job control definitions)
1345AC_CACHE_VAL(bash_cv_job_control_missing,
1346[AC_TRY_RUN([
1347#include <sys/types.h>
1348#ifdef HAVE_SYS_WAIT_H
1349#include <sys/wait.h>
1350#endif
1351#ifdef HAVE_UNISTD_H
1352#include <unistd.h>
1353#endif
1354#include <signal.h>
1355
1356/* Add more tests in here as appropriate. */
1357main()
1358{
1359/* signal type */
1360#if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS)
1361exit(1);
1362#endif
1363
1364/* signals and tty control. */
1365#if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT)
1366exit (1);
1367#endif
1368
1369/* process control */
1370#if !defined (WNOHANG) || !defined (WUNTRACED)
1371exit(1);
1372#endif
1373
1374/* Posix systems have tcgetpgrp and waitpid. */
1375#if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP)
1376exit(1);
1377#endif
1378
1379#if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID)
1380exit(1);
1381#endif
1382
1383/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */
1384#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3)
1385exit(1);
1386#endif
1387
1388exit(0);
1389}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
1390 [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing)
1391 bash_cv_job_control_missing=missing]
1392)])
1393AC_MSG_RESULT($bash_cv_job_control_missing)
1394if test $bash_cv_job_control_missing = missing; then
1395AC_DEFINE(JOB_CONTROL_MISSING)
1396fi
1397])
1398
1399dnl check whether named pipes are present
1400dnl this requires a previous check for mkfifo, but that is awkward to specify
1401AC_DEFUN([BASH_SYS_NAMED_PIPES],
1402[AC_MSG_CHECKING(for presence of named pipes)
1403AC_CACHE_VAL(bash_cv_sys_named_pipes,
1404[AC_TRY_RUN([
1405#include <sys/types.h>
1406#include <sys/stat.h>
1407#ifdef HAVE_UNISTD_H
1408#include <unistd.h>
1409#endif
1410
1411/* Add more tests in here as appropriate. */
1412main()
1413{
1414int fd, err;
1415
1416#if defined (HAVE_MKFIFO)
1417exit (0);
1418#endif
1419
1420#if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO))
1421exit (1);
1422#endif
1423
1424#if defined (NeXT)
1425exit (1);
1426#endif
1427err = mkdir("/tmp/bash-aclocal", 0700);
1428if (err < 0) {
1429 perror ("mkdir");
1430 exit(1);
1431}
1432fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
1433if (fd == -1) {
1434 rmdir ("/tmp/bash-aclocal");
1435 exit (1);
1436}
1437close(fd);
1438unlink ("/tmp/bash-aclocal/sh-np-autoconf");
1439rmdir ("/tmp/bash-aclocal");
1440exit(0);
1441}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
1442 [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
1443 bash_cv_sys_named_pipes=missing]
1444)])
1445AC_MSG_RESULT($bash_cv_sys_named_pipes)
1446if test $bash_cv_sys_named_pipes = missing; then
1447AC_DEFINE(NAMED_PIPES_MISSING)
1448fi
1449])
1450
1451AC_DEFUN([BASH_SYS_DEFAULT_MAIL_DIR],
1452[AC_MSG_CHECKING(for default mail directory)
1453AC_CACHE_VAL(bash_cv_mail_dir,
1454[if test -d /var/mail; then
1455 bash_cv_mail_dir=/var/mail
1456 elif test -d /var/spool/mail; then
1457 bash_cv_mail_dir=/var/spool/mail
1458 elif test -d /usr/mail; then
1459 bash_cv_mail_dir=/usr/mail
1460 elif test -d /usr/spool/mail; then
1461 bash_cv_mail_dir=/usr/spool/mail
1462 else
1463 bash_cv_mail_dir=unknown
1464 fi
1465])
1466AC_MSG_RESULT($bash_cv_mail_dir)
1467AC_DEFINE_UNQUOTED(DEFAULT_MAIL_DIRECTORY, "$bash_cv_mail_dir")
1468])
1469
1470AC_DEFUN([BASH_HAVE_TIOCGWINSZ],
1471[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
1472AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl,
1473[AC_TRY_COMPILE([#include <sys/types.h>
1474#include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
1475 bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)])
1476AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl)
1477if test $bash_cv_tiocgwinsz_in_ioctl = yes; then
1478AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
1479fi
1480])
1481
1482AH_TEMPLATE([TIOCSTAT_IN_SYS_IOCTL], [Define if TIOCSTAT is in sys/ioctl.h])
1483AC_DEFUN([BASH_HAVE_TIOCSTAT],
1484[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
1485AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl,
1486[AC_TRY_COMPILE([#include <sys/types.h>
1487#include <sys/ioctl.h>], [int x = TIOCSTAT;],
1488 bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)])
1489AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl)
1490if test $bash_cv_tiocstat_in_ioctl = yes; then
1491AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL)
1492fi
1493])
1494
1495AH_TEMPLATE([FIONREAD_IN_SYS_IOCTL], [Define if FIONREAD is in sys/ioctl.h])
1496AC_DEFUN([BASH_HAVE_FIONREAD],
1497[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
1498AC_CACHE_VAL(bash_cv_fionread_in_ioctl,
1499[AC_TRY_COMPILE([#include <sys/types.h>
1500#include <sys/ioctl.h>], [int x = FIONREAD;],
1501 bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)])
1502AC_MSG_RESULT($bash_cv_fionread_in_ioctl)
1503if test $bash_cv_fionread_in_ioctl = yes; then
1504AC_DEFINE(FIONREAD_IN_SYS_IOCTL)
1505fi
1506])
1507
1508dnl
1509dnl See if speed_t is declared in <sys/types.h>. Some versions of linux
1510dnl require a definition of speed_t each time <termcap.h> is included,
1511dnl but you can only get speed_t if you include <termios.h> (on some
1512dnl versions) or <sys/types.h> (on others).
1513dnl
1514AH_TEMPLATE([SPEED_T_IN_SYS_TYPES], [Define if speed_t is in sys/types.h])
1515AC_DEFUN([BASH_CHECK_SPEED_T],
1516[AC_MSG_CHECKING(for speed_t in sys/types.h)
1517AC_CACHE_VAL(bash_cv_speed_t_in_sys_types,
1518[AC_TRY_COMPILE([#include <sys/types.h>], [speed_t x;],
1519 bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)])
1520AC_MSG_RESULT($bash_cv_speed_t_in_sys_types)
1521if test $bash_cv_speed_t_in_sys_types = yes; then
1522AC_DEFINE(SPEED_T_IN_SYS_TYPES)
1523fi
1524])
1525
1526AH_TEMPLATE([HAVE_GETPW_DECLS], [Define if getpw functions are declared in pwd.h])
1527AC_DEFUN([BASH_CHECK_GETPW_FUNCS],
1528[AC_MSG_CHECKING(whether getpw functions are declared in pwd.h)
1529AC_CACHE_VAL(bash_cv_getpw_declared,
1530[AC_EGREP_CPP(getpwuid,
1531[
1532#include <sys/types.h>
1533#ifdef HAVE_UNISTD_H
1534# include <unistd.h>
1535#endif
1536#include <pwd.h>
1537],
1538bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)])
1539AC_MSG_RESULT($bash_cv_getpw_declared)
1540if test $bash_cv_getpw_declared = yes; then
1541AC_DEFINE(HAVE_GETPW_DECLS)
1542fi
1543])
1544
1545AC_DEFUN([BASH_CHECK_DEV_FD],
1546[AC_MSG_CHECKING(whether /dev/fd is available)
1547AC_CACHE_VAL(bash_cv_dev_fd,
1548[if test -d /dev/fd && test -r /dev/fd/0; then
1549 bash_cv_dev_fd=standard
1550 elif test -d /proc/self/fd && test -r /proc/self/fd/0; then
1551 bash_cv_dev_fd=whacky
1552 else
1553 bash_cv_dev_fd=absent
1554 fi
1555])
1556AC_MSG_RESULT($bash_cv_dev_fd)
1557if test $bash_cv_dev_fd = "standard"; then
1558 AC_DEFINE(HAVE_DEV_FD)
1559 AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")
1560elif test $bash_cv_dev_fd = "whacky"; then
1561 AC_DEFINE(HAVE_DEV_FD)
1562 AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")
1563fi
1564])
1565
1566AC_DEFUN([BASH_CHECK_DEV_STDIN],
1567[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
1568AC_CACHE_VAL(bash_cv_dev_stdin,
1569[if test -d /dev/fd && test -r /dev/stdin; then
1570 bash_cv_dev_stdin=present
1571 elif test -d /proc/self/fd && test -r /dev/stdin; then
1572 bash_cv_dev_stdin=present
1573 else
1574 bash_cv_dev_stdin=absent
1575 fi
1576])
1577AC_MSG_RESULT($bash_cv_dev_stdin)
1578if test $bash_cv_dev_stdin = "present"; then
1579 AC_DEFINE(HAVE_DEV_STDIN)
1580fi
1581])
1582
1583dnl
1584dnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitions
1585dnl
1586AC_DEFUN([BASH_CHECK_KERNEL_RLIMIT],
1587[AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines])
1588AC_CACHE_VAL(bash_cv_kernel_rlimit,
1589[AC_TRY_COMPILE([
1590#include <sys/types.h>
1591#include <sys/resource.h>
1592],
1593[
1594 int f;
1595 f = RLIMIT_DATA;
1596], bash_cv_kernel_rlimit=no,
1597[AC_TRY_COMPILE([
1598#include <sys/types.h>
1599#define _KERNEL
1600#include <sys/resource.h>
1601#undef _KERNEL
1602],
1603[
1604 int f;
1605 f = RLIMIT_DATA;
1606], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)]
1607)])
1608AC_MSG_RESULT($bash_cv_kernel_rlimit)
1609if test $bash_cv_kernel_rlimit = yes; then
1610AC_DEFINE(RLIMIT_NEEDS_KERNEL)
1611fi
1612])
1613
1614dnl
1615dnl Check for 64-bit off_t -- used for malloc alignment
1616dnl
1617dnl C does not allow duplicate case labels, so the compile will fail if
1618dnl sizeof(off_t) is > 4.
1619dnl
1620AC_DEFUN([BASH_CHECK_OFF_T_64],
1621[AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
1622AC_TRY_COMPILE([
1623#ifdef HAVE_UNISTD_H
1624#include <unistd.h>
1625#endif
1626#include <sys/types.h>
1627],[
1628switch (0) case 0: case (sizeof (off_t) <= 4):;
1629], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
1630if test $bash_cv_off_t_64 = yes; then
1631 AC_DEFINE(HAVE_OFF_T_64)
1632fi])
1633
1634AC_DEFUN([BASH_CHECK_RTSIGS],
1635[AC_MSG_CHECKING(for unusable real-time signals due to large values)
1636AC_CACHE_VAL(bash_cv_unusable_rtsigs,
1637[AC_TRY_RUN([
1638#include <sys/types.h>
1639#include <signal.h>
1640
1641#ifndef NSIG
1642# define NSIG 64
1643#endif
1644
1645main ()
1646{
1647 int n_sigs = 2 * NSIG;
1648#ifdef SIGRTMIN
1649 int rtmin = SIGRTMIN;
1650#else
1651 int rtmin = 0;
1652#endif
1653
1654 exit(rtmin < n_sigs);
1655}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no,
1656 [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes)
1657 bash_cv_unusable_rtsigs=yes]
1658)])
1659AC_MSG_RESULT($bash_cv_unusable_rtsigs)
1660if test $bash_cv_unusable_rtsigs = yes; then
1661AC_DEFINE(UNUSABLE_RT_SIGNALS)
1662fi
1663])
1664
1665dnl
1666dnl check for availability of multibyte characters and functions
1667dnl
1668AH_TEMPLATE([HAVE_MBSRTOWCS], [Define if we have the mbsrtowcs function])
1669AH_TEMPLATE([HAVE_WCWIDTH], [Define if we have the wcwidth function])
1670AH_TEMPLATE([HAVE_MBSTATE_T], [Define if we have mbstate_t])
1671AH_TEMPLATE([HAVE_LANGINFO_CODESET], [Define if we have nl_langinfo and CODESET])
1672AC_DEFUN([BASH_CHECK_MULTIBYTE],
1673[
1674AC_CHECK_HEADERS(wctype.h)
1675AC_CHECK_HEADERS(wchar.h)
1676AC_CHECK_HEADERS(langinfo.h)
1677
1678AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS))
1679AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH))
1680
1681AC_CACHE_CHECK([for mbstate_t], bash_cv_have_mbstate_t,
1682[AC_TRY_RUN([
1683#include <wchar.h>
1684int
1685main ()
1686{
1687 mbstate_t ps;
1688 return 0;
1689}], bash_cv_have_mbstate_t=yes, bash_cv_have_mbstate_t=no)])
1690if test $bash_cv_have_mbstate_t = yes; then
1691 AC_DEFINE(HAVE_MBSTATE_T)
1692fi
1693
1694AC_CACHE_CHECK([for nl_langinfo and CODESET], bash_cv_langinfo_codeset,
1695[AC_TRY_LINK(
1696[#include <langinfo.h>],
1697[char* cs = nl_langinfo(CODESET);],
1698bash_cv_langinfo_codeset=yes, bash_cv_langinfo_codeset=no)])
1699if test $bash_cv_langinfo_codeset = yes; then
1700 AC_DEFINE(HAVE_LANGINFO_CODESET)
1701fi
1702
1703])
1704
1705dnl need: prefix exec_prefix libdir includedir CC TERMCAP_LIB
1706dnl require:
1707dnl AC_PROG_CC
1708dnl BASH_CHECK_LIB_TERMCAP
1709
1710AC_DEFUN([RL_LIB_READLINE_VERSION],
1711[
1712AC_REQUIRE([BASH_CHECK_LIB_TERMCAP])
1713
1714AC_MSG_CHECKING([version of installed readline library])
1715
1716# What a pain in the ass this is.
1717
1718# save cpp and ld options
1719_save_CFLAGS="$CFLAGS"
1720_save_LDFLAGS="$LDFLAGS"
1721_save_LIBS="$LIBS"
1722
1723# Don't set ac_cv_rl_prefix if the caller has already assigned a value. This
1724# allows the caller to do something like $_rl_prefix=$withval if the user
1725# specifies --with-installed-readline=PREFIX as an argument to configure
1726
1727if test -z "$ac_cv_rl_prefix"; then
1728test "x$prefix" = xNONE && ac_cv_rl_prefix=$ac_default_prefix || ac_cv_rl_prefix=${prefix}
1729fi
1730
1731eval ac_cv_rl_includedir=${ac_cv_rl_prefix}/include
1732eval ac_cv_rl_libdir=${ac_cv_rl_prefix}/lib
1733
1734LIBS="$LIBS -lreadline ${TERMCAP_LIB}"
1735CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}"
1736LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}"
1737
1738AC_TRY_RUN([
1739#include <stdio.h>
1740#include <readline/readline.h>
1741
1742main()
1743{
1744 FILE *fp;
1745 fp = fopen("conftest.rlv", "w");
1746 if (fp == 0) exit(1);
1747 fprintf(fp, "%s\n", rl_library_version ? rl_library_version : "0.0");
1748 fclose(fp);
1749 exit(0);
1750}
1751],
1752ac_cv_rl_version=`cat conftest.rlv`,
1753ac_cv_rl_version='0.0',
1754ac_cv_rl_version='4.2')
1755
1756CFLAGS="$_save_CFLAGS"
1757LDFLAGS="$_save_LDFLAGS"
1758LIBS="$_save_LIBS"
1759
1760RL_MAJOR=0
1761RL_MINOR=0
1762
1763# (
1764case "$ac_cv_rl_version" in
17652*|3*|4*|5*|6*|7*|8*|9*)
1766 RL_MAJOR=`echo $ac_cv_rl_version | sed 's:\..*$::'`
1767 RL_MINOR=`echo $ac_cv_rl_version | sed -e 's:^.*\.::' -e 's:[[a-zA-Z]]*$::'`
1768 ;;
1769esac
1770
1771# (((
1772case $RL_MAJOR in
1773[[0-9][0-9]]) _RL_MAJOR=$RL_MAJOR ;;
1774[[0-9]]) _RL_MAJOR=0$RL_MAJOR ;;
1775*) _RL_MAJOR=00 ;;
1776esac
1777
1778# (((
1779case $RL_MINOR in
1780[[0-9][0-9]]) _RL_MINOR=$RL_MINOR ;;
1781[[0-9]]) _RL_MINOR=0$RL_MINOR ;;
1782*) _RL_MINOR=00 ;;
1783esac
1784
1785RL_VERSION="0x${_RL_MAJOR}${_RL_MINOR}"
1786
1787# Readline versions greater than 4.2 have these defines in readline.h
1788
1789if test $ac_cv_rl_version = '0.0' ; then
1790 AC_MSG_WARN([Could not test version of installed readline library.])
1791elif test $RL_MAJOR -gt 4 || { test $RL_MAJOR = 4 && test $RL_MINOR -gt 2 ; } ; then
1792 # set these for use by the caller
1793 RL_PREFIX=$ac_cv_rl_prefix
1794 RL_LIBDIR=$ac_cv_rl_libdir
1795 RL_INCLUDEDIR=$ac_cv_rl_includedir
1796 AC_MSG_RESULT($ac_cv_rl_version)
1797else
1798
1799AC_DEFINE_UNQUOTED(RL_READLINE_VERSION, $RL_VERSION, [encoded version of the installed readline library])
1800AC_DEFINE_UNQUOTED(RL_VERSION_MAJOR, $RL_MAJOR, [major version of installed readline library])
1801AC_DEFINE_UNQUOTED(RL_VERSION_MINOR, $RL_MINOR, [minor version of installed readline library])
1802
1803AC_SUBST(RL_VERSION)
1804AC_SUBST(RL_MAJOR)
1805AC_SUBST(RL_MINOR)
1806
1807# set these for use by the caller
1808RL_PREFIX=$ac_cv_rl_prefix
1809RL_LIBDIR=$ac_cv_rl_libdir
1810RL_INCLUDEDIR=$ac_cv_rl_includedir
1811
1812AC_MSG_RESULT($ac_cv_rl_version)
1813
1814fi
1815])
diff --git a/meta/recipes-core/readline/readline-5.2/configure-fix.patch b/meta/recipes-core/readline/readline-5.2/configure-fix.patch
new file mode 100644
index 0000000000..be60a9861e
--- /dev/null
+++ b/meta/recipes-core/readline/readline-5.2/configure-fix.patch
@@ -0,0 +1,26 @@
1Upstream-Status: Pending
2
3Without this it fails to link against libtermcap causing various missing symbols
4issues.
5
6RP - 8/10/08
7
8Index: readline-5.2/configure.in
9===================================================================
10--- readline-5.2.orig/configure.in 2008-10-08 09:58:52.000000000 +0100
11+++ readline-5.2/configure.in 2008-10-08 09:59:03.000000000 +0100
12@@ -211,10 +211,10 @@
13 AC_MSG_CHECKING(configuration for building shared libraries)
14 eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
15
16-# case "$SHLIB_LIBS" in
17-# *curses*|*termcap*|*termlib*) ;;
18-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
19-# esac
20+ case "$SHLIB_LIBS" in
21+ *curses*|*termcap*|*termlib*) ;;
22+ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
23+ esac
24
25 AC_SUBST(SHOBJ_CC)
26 AC_SUBST(SHOBJ_CFLAGS)
diff --git a/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch b/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch
new file mode 100644
index 0000000000..3166b470f2
--- /dev/null
+++ b/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch
@@ -0,0 +1,21 @@
1This support script ends up hardcoding unnecessary rpaths into the libraries. We
2will search $libdir automatically so this is just wastes space. There may be some
3cases this is necessary but our use cases aren't one of them.
4
5Upstream-Status: Inappropriate
6
7Signed-off-by: Saul Wold <sgw@linux.intel.com>
8
9Index: readline-5.2/support/shobj-conf
10===================================================================
11--- readline-5.2.orig/support/shobj-conf
12+++ readline-5.2/support/shobj-conf
13@@ -110,7 +110,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*)
14 SHOBJ_LD='${CC}'
15 SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
16
17- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
18+ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
19 SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
20 ;;
21
diff --git a/meta/recipes-core/readline/readline-6.3/configure-fix.patch b/meta/recipes-core/readline/readline-6.3/configure-fix.patch
new file mode 100644
index 0000000000..ef3104f8a6
--- /dev/null
+++ b/meta/recipes-core/readline/readline-6.3/configure-fix.patch
@@ -0,0 +1,35 @@
1Upstream-Status: Pending
2
3Without this it fails to link against libtermcap causing various missing
4symbols issues.
5
6RP - 8/10/08
7
8Support 6.3 which uses configure.ac rather than configure.in.
9Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
10---
11 configure.ac | 8 ++++----
12 1 file changed, 4 insertions(+), 4 deletions(-)
13
14diff --git a/configure.ac b/configure.ac
15index cea8f91..9075b8f 100644
16--- a/configure.ac
17+++ b/configure.ac
18@@ -218,10 +218,10 @@ if test -f ${srcdir}/support/shobj-conf; then
19 AC_MSG_CHECKING(configuration for building shared libraries)
20 eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
21
22-# case "$SHLIB_LIBS" in
23-# *curses*|*termcap*|*termlib*) ;;
24-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
25-# esac
26+ case "$SHLIB_LIBS" in
27+ *curses*|*termcap*|*termlib*) ;;
28+ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
29+ esac
30
31 AC_SUBST(SHOBJ_CC)
32 AC_SUBST(SHOBJ_CFLAGS)
33--
341.8.1.2
35
diff --git a/meta/recipes-core/readline/readline.inc b/meta/recipes-core/readline/readline.inc
new file mode 100644
index 0000000000..6c43e2df11
--- /dev/null
+++ b/meta/recipes-core/readline/readline.inc
@@ -0,0 +1,37 @@
1SUMMARY = "Library for editing typed command lines"
2DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
3command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
4additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
5lines, and perform csh-like history expansion on previous commands."
6SECTION = "libs"
7
8# GPLv2+ (< 6.0), GPLv3+ (>= 6.0)
9LICENSE = "GPLv3+"
10LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
11
12DEPENDS += "ncurses"
13
14SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive \
15 file://configure-fix.patch \
16 file://norpath.patch \
17 file://acinclude.m4"
18
19S = "${WORKDIR}/${BPN}-${PV}"
20
21inherit autotools
22
23LEAD_SONAME = "libreadline.so"
24
25do_configure_prepend () {
26 install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
27}
28
29do_install_append () {
30 # Make install doesn't properly install these
31 oe_libinstall -so -C shlib libhistory ${D}${libdir}
32 oe_libinstall -so -C shlib libreadline ${D}${libdir}
33
34 rmdir ${D}${bindir}
35}
36
37BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/readline/readline_5.2.bb b/meta/recipes-core/readline/readline_5.2.bb
new file mode 100644
index 0000000000..05ab26f053
--- /dev/null
+++ b/meta/recipes-core/readline/readline_5.2.bb
@@ -0,0 +1,82 @@
1SUMMARY = "Library for editing typed command lines"
2DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
3command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
4additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
5lines, and perform csh-like history expansion on previous commands."
6SECTION = "libs"
7
8LICENSE = "GPLv2+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=03b36fdd84f74b8d8189a202b980b67f"
10
11DEPENDS += "ncurses"
12
13PR = "r9"
14
15SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive \
16 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-001;name=patch1;apply=yes;striplevel=0 \
17 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-002;name=patch2;apply=yes;striplevel=0 \
18 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-003;name=patch3;apply=yes;striplevel=0 \
19 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-004;name=patch4;apply=yes;striplevel=0 \
20 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-005;name=patch5;apply=yes;striplevel=0 \
21 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-006;name=patch6;apply=yes;striplevel=0 \
22 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-007;name=patch7;apply=yes;striplevel=0 \
23 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-008;name=patch8;apply=yes;striplevel=0 \
24 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-009;name=patch9;apply=yes;striplevel=0 \
25 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-010;name=patch10;apply=yes;striplevel=0 \
26 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-011;name=patch11;apply=yes;striplevel=0 \
27 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-012;name=patch12;apply=yes;striplevel=0 \
28 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-013;name=patch13;apply=yes;striplevel=0 \
29 ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-014;name=patch14;apply=yes;striplevel=0 \
30 file://configure-fix.patch \
31 file://acinclude.m4 \
32 file://fix-redundant-rpath.patch"
33
34SRC_URI[archive.md5sum] = "e39331f32ad14009b9ff49cc10c5e751"
35SRC_URI[archive.sha256sum] = "12e88d96aee2cd1192500356f0535540db499282ca7f76339fb4228c31249f45"
36
37SRC_URI[patch1.md5sum] = "9d4d41622aa9b230c57f68548ce87d8f"
38SRC_URI[patch1.sha256sum] = "eac304c369154059f93049ada328739faaf40338d3cb1fb4b544c93d5ce3f8d5"
39SRC_URI[patch2.md5sum] = "f03e512d14206e37f7d6a748b56b9476"
40SRC_URI[patch2.sha256sum] = "9deacaef25507a0c2ae0b661bf9342559b59a2954d66ea3c5f5bcd900fdfcf78"
41SRC_URI[patch3.md5sum] = "252b42d8750f1a94b6bdf086612dceb2"
42SRC_URI[patch3.sha256sum] = "2a55d2ecb1c9b0147aeb193a6323616ab31c1c525a83b2db3a994b15594ba934"
43SRC_URI[patch4.md5sum] = "a32333c2e603a3ed250514e91050e552"
44SRC_URI[patch4.sha256sum] = "a03b65633781efa7c3aae5d57162985e7b7a3c10acf0f2621be610e16f27e5f2"
45SRC_URI[patch5.md5sum] = "8106796c09b789523a3a78ab69c04b6d"
46SRC_URI[patch5.sha256sum] = "06001896514148a757ea6edbbd40c4fc4331dc653847244386c37b138b150f64"
47SRC_URI[patch6.md5sum] = "512188e2bf0837f7eca19dbf71f182ae"
48SRC_URI[patch6.sha256sum] = "dfef3e982c0adf8bb5a9b7d0468ec8f5f18138b325e28759437464de5be71013"
49SRC_URI[patch7.md5sum] = "ac17aca62eb6fb398c9f2fe9de540aff"
50SRC_URI[patch7.sha256sum] = "775b028c7b761397ac6ae1bdfbac7e896dc3b9b3adc2f91312499180ca13bdd1"
51SRC_URI[patch8.md5sum] = "2484c392db021905f112cf97a94dfd4c"
52SRC_URI[patch8.sha256sum] = "a21b4e0bf0530b878bad24d5be23d18a9e03a75a31ae30844dc0933bb3d77ecd"
53SRC_URI[patch9.md5sum] = "fc6eb35d07914fae5c57d49c12483ff7"
54SRC_URI[patch9.sha256sum] = "138d5e0f0709a47a2d1621295a3dd5e3cc73b63b5cc28dab03abc4e94fe95ecf"
55SRC_URI[patch10.md5sum] = "7a2bf3dc7ac7680b1461a5701100e91b"
56SRC_URI[patch10.sha256sum] = "83f8c1aadb86b1a2fad8821a9c6be72a8de5afd7fd9fde58a30b3b57d939693e"
57SRC_URI[patch11.md5sum] = "ef6cef6822663470f6ac8c517c5a7ec6"
58SRC_URI[patch11.sha256sum] = "08ad3384ab0906e6fa4cc417eb8c43ff59375bcead15fd5c8e31730f0413b3d6"
59SRC_URI[patch12.md5sum] = "e3e9f441c8111589855bc363e5640f6c"
60SRC_URI[patch12.sha256sum] = "20f0243be2299c23213492cc2c19cfd15cc528d2b566a76a2de58306bb9e4c9e"
61SRC_URI[patch13.md5sum] = "3e2e5f543ed268a68fd1fa839faade1a"
62SRC_URI[patch13.sha256sum] = "0cc649516a5bdfa61c5e56937407570288b6972d75aa1bd060ad30ebe98144d5"
63SRC_URI[patch14.md5sum] = "a1be30e1c6f1099bb5fcef00a2631fb8"
64SRC_URI[patch14.sha256sum] = "6f1a68320d01522ca1ea5a737124ecc8739f3dcbfea2dee21e3ccf839a21a817"
65
66S = "${WORKDIR}/${BPN}-${PV}"
67
68inherit autotools
69
70LEAD_SONAME = "libreadline.so"
71
72do_configure_prepend () {
73 install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
74}
75
76do_install_append () {
77 # Make install doesn't properly install these
78 oe_libinstall -so -C shlib libhistory ${D}${libdir}
79 oe_libinstall -so -C shlib libreadline ${D}${libdir}
80}
81
82BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/readline/readline_6.3.bb b/meta/recipes-core/readline/readline_6.3.bb
new file mode 100644
index 0000000000..aa30f668b4
--- /dev/null
+++ b/meta/recipes-core/readline/readline_6.3.bb
@@ -0,0 +1,5 @@
1require readline.inc
2
3SRC_URI[archive.md5sum] = "33c8fb279e981274f485fd91da77e94a"
4SRC_URI[archive.sha256sum] = "56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43"
5
diff --git a/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch
new file mode 100644
index 0000000000..9d828d7026
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
1Upstream-Status: Submitted [http://sourceforge.net/tracker/?func=detail&aid=3600345&group_id=44427&atid=439544]
2
3Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
4diff -Nurd sysfsutils-2.1.0/configure.ac sysfsutils-2.1.0/configure.ac
5--- sysfsutils-2.1.0/configure.ac 2006-08-07 08:08:00.000000000 +0300
6+++ sysfsutils-2.1.0/configure.ac 2013-01-11 08:13:08.651550634 +0200
7@@ -2,7 +2,7 @@
8 AC_INIT(sysfsutils, 2.1.0, linux-diag-devel@lists.sourceforge.net)
9 AM_INIT_AUTOMAKE
10 AC_CONFIG_SRCDIR([config.h.in])
11-AM_CONFIG_HEADER([config.h])
12+AC_CONFIG_HEADERS([config.h])
13
14 # Checks for KLIBC support (should be before AC_PROG_LIBTOOL and AC_PROG_CC)
15 AC_CHECK_KLIBC
diff --git a/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch
new file mode 100644
index 0000000000..82e725e2ac
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch
@@ -0,0 +1,65 @@
1Upstream-Status: Pending
2
3Fix out of tree build issues so ${B} != ${S} works.
4
5RP 2013/03/18
6
7Index: sysfsutils-2.1.0/cmd/Makefile.am
8===================================================================
9--- sysfsutils-2.1.0.orig/cmd/Makefile.am 2013-03-08 08:57:27.224556508 +0000
10+++ sysfsutils-2.1.0/cmd/Makefile.am 2013-03-08 08:57:27.480556502 +0000
11@@ -1,6 +1,6 @@
12 bin_PROGRAMS = systool
13 systool_SOURCES = systool.c names.c names.h
14-INCLUDES = -I../include
15+INCLUDES = -I$(srcdir)/../include
16 LDADD = ../lib/libsysfs.la
17 EXTRA_CFLAGS = @EXTRA_CFLAGS@
18 AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS)
19Index: sysfsutils-2.1.0/lib/Makefile.am
20===================================================================
21--- sysfsutils-2.1.0.orig/lib/Makefile.am 2013-03-08 08:57:27.224556508 +0000
22+++ sysfsutils-2.1.0/lib/Makefile.am 2013-03-08 08:57:27.480556502 +0000
23@@ -1,7 +1,7 @@
24 lib_LTLIBRARIES = libsysfs.la
25 libsysfs_la_SOURCES = sysfs_utils.c sysfs_attr.c sysfs_class.c dlist.c \
26 sysfs_device.c sysfs_driver.c sysfs_bus.c sysfs_module.c sysfs.h
27-INCLUDES = -I../include
28+INCLUDES = -I$(srcdir)/../include
29 libsysfs_la_LDFLAGS = -version-info 2:1:0
30 EXTRA_CFLAGS = @EXTRA_CLFAGS@
31 libsysfs_la_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS)
32Index: sysfsutils-2.1.0/test/Makefile.am
33===================================================================
34--- sysfsutils-2.1.0.orig/test/Makefile.am 2013-03-08 08:57:27.224556508 +0000
35+++ sysfsutils-2.1.0/test/Makefile.am 2013-03-08 09:06:48.196543326 +0000
36@@ -2,14 +2,14 @@
37 BUILT_SOURCES = test.h
38 CLEANFILES = test.h
39 test.h:
40- ./create-test
41+ $(srcdir)/create-test $(srcdir)/libsysfs.conf
42 get_device_SOURCES = get_device.c
43 get_driver_SOURCES = get_driver.c
44 get_module_SOURCES = get_module.c
45 testlibsysfs_SOURCES = test.c test_attr.c test_bus.c test_class.c \
46 test_device.c test_driver.c test_module.c test_utils.c \
47 testout.c test-defs.h libsysfs.conf create-test
48-INCLUDES = -I../include
49+INCLUDES = -I$(srcdir)/../include
50 LDADD = ../lib/libsysfs.la
51 EXTRA_CFLAGS = @EXTRA_CLFAGS@
52 AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS)
53Index: sysfsutils-2.1.0/test/create-test
54===================================================================
55--- sysfsutils-2.1.0.orig/test/create-test 2005-11-28 10:22:10.000000000 +0000
56+++ sysfsutils-2.1.0/test/create-test 2013-03-08 09:07:03.372542838 +0000
57@@ -2,7 +2,7 @@
58
59 rm -f test.h
60
61-conf_file=./libsysfs.conf
62+conf_file=$1
63
64 . $conf_file
65
diff --git a/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch
new file mode 100644
index 0000000000..1a35b7897a
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch
@@ -0,0 +1,23 @@
1Upstream-Status: Backport [from fedora core 9]
2
3This patch is from the Fedora Core 9 sysfsutils-2.1.0-3.fc9 package.
4
5It fixes a problem in the upstream package where not all devices
6will be returned by the function.
7
8The package License indicates this is GPLv2 licensed.
9
10Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
11
12diff -puN lib/sysfs_class.c~sysfsutils_class_dup lib/sysfs_class.c
13--- sysfsutils-2.1.0/lib/sysfs_class.c~sysfsutils_class_dup 2006-09-07 17:01:26.000000000 -0500
14+++ sysfsutils-2.1.0-bjking1/lib/sysfs_class.c 2006-09-07 17:01:26.000000000 -0500
15@@ -66,7 +66,7 @@ static int cdev_name_equal(void *a, void
16 return 0;
17
18 if (strncmp((char *)a, ((struct sysfs_class_device *)b)->name,
19- strlen((char *)a)) == 0)
20+ SYSFS_NAME_LEN) == 0)
21 return 1;
22
23 return 0;
diff --git a/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb b/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
new file mode 100644
index 0000000000..1d9c476431
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
@@ -0,0 +1,29 @@
1SUMMARY = "Tools for working with sysfs"
2DESCRIPTION = "Tools for working with the sysfs virtual filesystem. The tool 'systool' can query devices by bus, class and topology."
3HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html"
4
5LICENSE = "GPLv2 & LGPLv2.1"
6LICENSE_${PN} = "GPLv2"
7LICENSE_libsysfs = "LGPLv2.1"
8LIC_FILES_CHKSUM = "file://COPYING;md5=3d06403ea54c7574a9e581c6478cc393 \
9 file://cmd/GPL;md5=d41d4e2e1e108554e0388ea4aecd8d27 \
10 file://lib/LGPL;md5=b75d069791103ffe1c0d6435deeff72e"
11PR = "r5"
12
13SRC_URI = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz \
14 file://sysfsutils-2.0.0-class-dup.patch \
15 file://obsolete_automake_macros.patch \
16 file://separatebuild.patch"
17
18SRC_URI[md5sum] = "14e7dcd0436d2f49aa403f67e1ef7ddc"
19SRC_URI[sha256sum] = "e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a"
20S = "${WORKDIR}/sysfsutils-${PV}"
21
22inherit autotools
23
24PACKAGES =+ "libsysfs libsysfs-dev libsysfs-staticdev"
25FILES_libsysfs = "${libdir}/lib*${SOLIBS}"
26FILES_libsysfs-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
27FILES_libsysfs-staticdev = "${libdir}/lib*.a"
28
29export libdir = "${base_libdir}"
diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb
new file mode 100644
index 0000000000..6419bc2c65
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -0,0 +1,41 @@
1SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts"
2
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
5
6PR = "r29"
7
8DEPENDS = "systemd-systemctl-native"
9
10inherit allarch
11
12ALLOW_EMPTY_${PN} = "1"
13
14SYSTEMD_DISABLED_SYSV_SERVICES = " \
15 busybox-udhcpc \
16 hwclock \
17 networking \
18 nfsserver \
19 nfscommon \
20 syslog.busybox \
21"
22
23pkg_postinst_${PN} () {
24 cd $D${sysconfdir}/init.d
25
26 echo "Disabling the following sysv scripts: "
27
28 OPTS=""
29
30 if [ -n "$D" ]; then
31 OPTS="--root=$D"
32 fi
33
34 for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
35 if [ \( -e $i -o $i.sh \) -a ! \( -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service \) ] ; then
36 echo -n "$i: " ; systemctl ${OPTS} mask $i.service
37 fi
38 done ; echo
39}
40
41RDPEPENDS_${PN} = "systemd"
diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb
new file mode 100644
index 0000000000..13b2dbacec
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -0,0 +1,49 @@
1SUMMARY = "Serial terminal support for systemd"
2LICENSE = "GPLv2+"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
4
5PR = "r5"
6
7SERIAL_CONSOLE ?= "115200 ttyS0"
8
9SRC_URI = "file://serial-getty@.service"
10
11do_install() {
12 if [ ! -z "${SERIAL_CONSOLES}" ] ; then
13 default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'`
14 install -d ${D}${systemd_unitdir}/system/
15 install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
16 install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
17 sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service
18
19 tmp="${SERIAL_CONSOLES}"
20 for entry in $tmp ; do
21 baudrate=`echo $entry | sed 's/\;.*//'`
22 ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
23 if [ "$baudrate" = "$default_baudrate" ] ; then
24 # enable the service
25 ln -sf ${systemd_unitdir}/system/serial-getty@.service \
26 ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service
27 else
28 # install custom service file for the non-default baudrate
29 install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
30 sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
31 # enable the service
32 ln -sf ${systemd_unitdir}/system/serial-getty$baudrate@.service \
33 ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service
34 fi
35 done
36 fi
37}
38
39RDEPENDS_${PN} = "systemd"
40
41# This is a machine specific file
42FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}"
43PACKAGE_ARCH = "${MACHINE_ARCH}"
44
45# As this package is tied to systemd, only build it when we're also building systemd.
46python () {
47 if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
48 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
49}
diff --git a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
new file mode 100644
index 0000000000..865de3402d
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
@@ -0,0 +1,36 @@
1# This file is part of systemd.
2#
3# systemd is free software; you can redistribute it and/or modify it
4# under the terms of the GNU Lesser General Public License as published by
5# the Free Software Foundation; either version 2.1 of the License, or
6# (at your option) any later version.
7
8[Unit]
9Description=Serial Getty on %I
10Documentation=man:agetty(8) man:systemd-getty-generator(8)
11Documentation=http://0pointer.de/blog/projects/serial-console.html
12BindsTo=dev-%i.device
13After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
14After=rc-local.service
15
16# If additional gettys are spawned during boot then we should make
17# sure that this is synchronized before getty.target, even though
18# getty.target didn't actually pull it in.
19Before=getty.target
20IgnoreOnIsolate=yes
21
22[Service]
23ExecStart=-/sbin/agetty --keep-baud %I @BAUDRATE@ $TERM
24Type=idle
25Restart=always
26RestartSec=0
27UtmpIdentifier=%I
28TTYPath=/dev/%I
29TTYReset=yes
30TTYVHangup=yes
31KillMode=process
32IgnoreSIGPIPE=no
33SendSIGHUP=yes
34
35[Install]
36WantedBy=getty.target
diff --git a/meta/recipes-core/systemd/systemd-systemctl-native.bb b/meta/recipes-core/systemd/systemd-systemctl-native.bb
new file mode 100644
index 0000000000..72bc77df4f
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-systemctl-native.bb
@@ -0,0 +1,15 @@
1SUMMARY = "Wrapper for enabling systemd services"
2
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
5
6PR = "r6"
7
8inherit native
9
10SRC_URI = "file://systemctl"
11
12do_install() {
13 install -d ${D}${bindir}
14 install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
15}
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
new file mode 100755
index 0000000000..b37f27abfb
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,153 @@
1#!/bin/sh
2echo "Started $0 $*"
3
4ROOT=
5
6# parse command line params
7action=
8while [ $# != 0 ]; do
9 opt="$1"
10
11 case "$opt" in
12 enable)
13 shift
14
15 action="$opt"
16 services="$1"
17 cmd_args="1"
18 shift
19 ;;
20 disable)
21 shift
22
23 action="$opt"
24 services="$1"
25 cmd_args="1"
26 shift
27 ;;
28 mask)
29 shift
30
31 action="$opt"
32 services="$1"
33 cmd_args="1"
34 shift
35 ;;
36 preset)
37 shift
38
39 action="$opt"
40 services="$1"
41 cmd_args="1"
42 shift
43 ;;
44 --root=*)
45 ROOT=${opt##--root=}
46 cmd_args="0"
47 shift
48 ;;
49 *)
50 if [ "$cmd_args" = "1" ]; then
51 services="$services $opt"
52 shift
53 else
54 echo "'$opt' is an unkown option; exiting with error"
55 exit 1
56 fi
57 ;;
58 esac
59done
60if [ "$action" = "preset" -a "$service_file" = "" ]; then
61 services=$(for f in `find $ROOT/etc/systemd/system $ROOT/lib/systemd/system $ROOT/usr/lib/systemd/system -type f 2>1`; do basename $f; done)
62 services="$services $opt"
63 presetall=1
64fi
65
66for service in $services; do
67 if [ "$presetall" = "1" ]; then
68 action="preset"
69 fi
70 if [ "$action" = "mask" ]; then
71 if [ ! -d $ROOT/etc/systemd/system/ ]; then
72 mkdir -p $ROOT/etc/systemd/system/
73 fi
74 cmd="ln -s /dev/null $ROOT/etc/systemd/system/$service"
75 echo "$cmd"
76 $cmd
77 exit 0
78 fi
79
80 echo "Try to find location of $service..."
81 # find service file
82 for p in $ROOT/etc/systemd/system \
83 $ROOT/lib/systemd/system \
84 $ROOT/usr/lib/systemd/system; do
85 if [ -e $p/$service ]; then
86 service_file=$p/$service
87 service_file=${service_file##$ROOT}
88 fi
89 done
90 if [ -z "$service_file" ]; then
91 echo "'$service' couldn't be found; exiting with error"
92 exit 1
93 fi
94 echo "Found $service in $service_file"
95
96 # If any new unit types are added to systemd they should be added
97 # to this regular expression.
98 unit_types_re='\.\(service\|socket\|device\|mount\|automount\|swap\|target\|path\|timer\|snapshot\)$'
99 if [ "$action" = "preset" ]; then
100 action=`egrep -sh $service $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '`
101 if [ -z "$action" ]; then
102 globalpreset=`egrep -sh '\*' $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '`
103 if [ -n "$globalpreset" ]; then
104 action="$globalpreset"
105 else
106 action="enable"
107 fi
108 fi
109 fi
110 # create the required symbolic links
111 wanted_by=$(sed '/^WantedBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
112 | tr ',' '\n' \
113 | grep "$unit_types_re")
114
115 for r in $wanted_by; do
116 echo "WantedBy=$r found in $service"
117 if [ "$action" = "enable" ]; then
118 mkdir -p $ROOT/etc/systemd/system/$r.wants
119 ln -s $service_file $ROOT/etc/systemd/system/$r.wants
120 echo "Enabled $service for $wanted_by."
121 else
122 rm -f $ROOT/etc/systemd/system/$r.wants/$service
123 rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants
124 echo "Disabled $service for $wanted_by."
125 fi
126 done
127
128 # create the required symbolic 'Alias' links
129 alias=$(sed '/^Alias[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
130 | tr ',' '\n' \
131 | grep "$unit_types_re")
132
133 for r in $alias; do
134 if [ "$action" = "enable" ]; then
135 mkdir -p $ROOT/etc/systemd/system
136 ln -s $service_file $ROOT/etc/systemd/system/$r
137 echo "Enabled $service for $alias."
138 else
139 rm -f $ROOT/etc/systemd/system/$r
140 echo "Disabled $service for $alias."
141 fi
142 done
143
144 # call us for the other required scripts
145 also=$(sed '/^Also[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
146 | tr ',' '\n')
147 for a in $also; do
148 echo "Also=$a found in $service"
149 if [ "$action" = "enable" ]; then
150 $0 --root=$ROOT enable $a
151 fi
152 done
153done
diff --git a/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/meta/recipes-core/systemd/systemd/00-create-volatile.conf
new file mode 100644
index 0000000000..9ffa88e464
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/00-create-volatile.conf
@@ -0,0 +1,7 @@
1#This goes hand-in-hand with the base-files of OE-Core. The file must
2# be sorted before 'systemd.conf' becuase this attempts to create a file
3# inside /var/log.
4
5
6d /var/volatile/log - - - -
7d /var/volatile/tmp - - - -
diff --git a/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch b/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
new file mode 100644
index 0000000000..9fdb3c9ab3
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
@@ -0,0 +1,34 @@
1Upstream-Status: Inappropriate [uclibc specific]
2
3From 7be9273548bcb1f57d011fc252965e45dd2a058c Mon Sep 17 00:00:00 2001
4From: Khem Raj <raj.khem@gmail.com>
5Date: Wed, 21 Aug 2013 19:09:27 -0700
6Subject: [PATCH] uClibc doesn't implement pwritev/preadv
7
8Lets stub out the testcase for building.
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/libsystemd-bus/test-bus-memfd.c | 2 ++
13 1 file changed, 2 insertions(+)
14
15Index: systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c
16===================================================================
17--- systemd-209.orig/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 15:03:09.983254602 -0800
18+++ systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 23:42:10.636652864 -0800
19@@ -151,6 +151,7 @@
20 /* check content */
21 assert_se(memcmp(buf, "ll", 2) == 0);
22
23+#ifndef __UCLIBC__
24 /* writev it out*/
25 iov[0].iov_base = (char *)"ABC";
26 iov[0].iov_len = 3;
27@@ -173,6 +174,7 @@
28 assert_se(memcmp(bufv[0], "ABC", 3) == 0);
29 assert_se(memcmp(bufv[1], "DEF", 3) == 0);
30 assert_se(memcmp(bufv[2], "GHI", 3) == 0);
31+#endif /* __UCLIBC__ */
32
33 sd_memfd_free(m);
34
diff --git a/meta/recipes-core/systemd/systemd/binfmt-install.patch b/meta/recipes-core/systemd/systemd/binfmt-install.patch
new file mode 100644
index 0000000000..c2d5099f24
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/binfmt-install.patch
@@ -0,0 +1,56 @@
1Don't install dependency links at install time for the binfmt services, use
2[Install] blocks so that they get created when the service is enabled like a
3traditional service.
4
5The [Install] blocks were rejected upstream as they don't have a way to "enable"
6it on install without static symlinks which can't be disabled, only masked. We
7however can do that in a postinst.
8
9Upstream-Status: Denied
10Signed-off-by: Ross Burton <ross.burton@intel.com>
11
12diff --git a/Makefile.am b/Makefile.am
13index 7933de6..78acb6f 100644
14--- a/Makefile.am
15+++ b/Makefile.am
16@@ -3133,10 +3133,6 @@ INSTALL_DIRS += \
17 $(prefix)/lib/binfmt.d \
18 $(sysconfdir)/binfmt.d
19
20-SYSINIT_TARGET_WANTS += \
21- systemd-binfmt.service \
22- proc-sys-fs-binfmt_misc.automount
23-
24 endif
25
26 EXTRA_DIST += \
27diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
28index 6be3893..709adef 100644
29--- a/units/proc-sys-fs-binfmt_misc.automount
30+++ b/units/proc-sys-fs-binfmt_misc.automount
31@@ -16,3 +16,6 @@ ConditionPathIsReadWrite=/proc/sys/
32
33 [Automount]
34 Where=/proc/sys/fs/binfmt_misc
35+
36+[Install]
37+WantedBy=sysinit.target
38diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
39index 02dfe77..86d3481 100644
40--- a/units/systemd-binfmt.service.in
41+++ b/units/systemd-binfmt.service.in
42@@ -11,6 +11,7 @@ Documentation=man:systemd-binfmt.service(8) man:binfmt.d(5)
43 Documentation=https://www.kernel.org/doc/Documentation/binfmt_misc.txt
44 DefaultDependencies=no
45 Conflicts=shutdown.target
46+Wants=proc-sys-fs-binfmt_misc.automount
47 After=systemd-readahead-collect.service systemd-readahead-replay.service proc-sys-fs-binfmt_misc.automount
48 Before=sysinit.target shutdown.target
49 ConditionPathIsReadWrite=/proc/sys/
50@@ -24,3 +25,6 @@ ConditionDirectoryNotEmpty=|/run/binfmt.d
51 Type=oneshot
52 RemainAfterExit=yes
53 ExecStart=@rootlibexecdir@/systemd-binfmt
54+
55+[Install]
56+WantedBy=sysinit.target
diff --git a/meta/recipes-core/systemd/systemd/init b/meta/recipes-core/systemd/systemd/init
new file mode 100644
index 0000000000..ea52be4820
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/init
@@ -0,0 +1,104 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: udev
5# Required-Start: mountvirtfs
6# Required-Stop:
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Start udevd, populate /dev and load drivers.
10### END INIT INFO
11
12. /etc/init.d/functions
13
14export TZ=/etc/localtime
15
16[ -d /sys/class ] || exit 1
17[ -r /proc/mounts ] || exit 1
18[ -x @UDEVD@ ] || exit 1
19[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
20[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
21
22readfile () {
23 filename=$1
24 READDATA=""
25 if [ -r $filename ]; then
26 while read line; do
27 READDATA="$READDATA$line"
28 done < $filename
29 fi
30}
31
32case "$1" in
33 start)
34 export ACTION=add
35 # propagate /dev from /sys
36 echo "Starting udev"
37
38 # mount the devtmpfs on /dev, if not already done
39 LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
40 mount -n -o mode=0755 -t devtmpfs none "/dev"
41 }
42 [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
43 [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
44 mount -a -t tmpfs 2>/dev/null
45
46 # cache handling
47 if [ "$DEVCACHE" != "" ]; then
48 readfile /proc/version
49 VERSION="$READDATA"
50 readfile /proc/cmdline
51 CMDLINE="$READDATA"
52 readfile /proc/devices
53 DEVICES="$READDATA"
54 readfile /proc/atags
55 ATAGS="$READDATA"
56
57 if [ -e $DEVCACHE ]; then
58 readfile /etc/udev/cache.data
59 if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then
60 (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
61 not_first_boot=1
62 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
63 [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
64 else
65 echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
66 fi
67 else
68 echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
69 fi
70 fi
71
72 # make_extra_nodes
73 killproc systemd-udevd > "/dev/null" 2>&1
74
75 # trigger the sorted events
76 echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
77 @UDEVD@ -d
78
79 udevadm control --env=STARTUP=1
80 if [ "$not_first_boot" != "" ];then
81 udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform
82 (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
83 else
84 udevadm trigger --action=add
85 udevadm settle
86 fi
87 ;;
88 stop)
89 echo "Stopping udevd"
90 start-stop-daemon --stop --name systemd-udevd --quiet
91 ;;
92 restart)
93 $0 stop
94 sleep 1
95 $0 start
96 ;;
97 status)
98 status systemd-udevd
99 ;;
100 *)
101 echo "Usage: $0 {start|stop|status|restart}"
102 exit 1
103esac
104exit 0
diff --git a/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch b/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch
new file mode 100644
index 0000000000..2063268246
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch
@@ -0,0 +1,19 @@
1on uclibc secure_getenv is not available
2therefore default to using getenv instead
3
4Upstream-Status: Denied [no desire for uclibc support]
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: git/src/shared/missing.h
8===================================================================
9--- git.orig/src/shared/missing.h 2012-09-22 18:46:44.141282145 -0700
10+++ git/src/shared/missing.h 2012-09-22 18:48:44.081276570 -0700
11@@ -233,6 +233,8 @@
12 #ifndef HAVE_SECURE_GETENV
13 # ifdef HAVE___SECURE_GETENV
14 # define secure_getenv __secure_getenv
15+# elif defined __UCLIBC__
16+# define secure_getenv getenv
17 # else
18 # error neither secure_getenv nor __secure_getenv are available
19 # endif
diff --git a/meta/recipes-core/systemd/systemd/run-ptest b/meta/recipes-core/systemd/systemd/run-ptest
new file mode 100644
index 0000000000..2f6bd93a5b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/run-ptest
@@ -0,0 +1,3 @@
1tar -C test -xJf test/sys.tar.xz
2make test/rules-test.sh.log
3make test/udev-test.pl.log
diff --git a/meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch b/meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch
new file mode 100644
index 0000000000..c5bee97238
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch
@@ -0,0 +1,513 @@
1From a3d59cd1b0a2738d06893948492113f2c35be0af Mon Sep 17 00:00:00 2001
2From: Lennart Poettering <lennart@poettering.net>
3Date: Wed, 19 Mar 2014 21:41:21 +0100
4Subject: [PATCH] sd-bus: don't use assert_return() to check for disconnected
5 bus connections
6
7A terminated connection is a runtime error and not a developer mistake,
8hence don't use assert_return() to check for it.
9
10Upstream-Status: Backport
11
12Signed-off-by: Jonathan Liu <net147@gmail.com>
13---
14 src/libsystemd/sd-bus/bus-control.c | 20 +++++++++---
15 src/libsystemd/sd-bus/bus-convenience.c | 58 +++++++++++++++++++++++++--------
16 src/libsystemd/sd-bus/bus-objects.c | 23 +++++++++----
17 src/libsystemd/sd-bus/sd-bus.c | 49 ++++++++++++++++++++--------
18 4 files changed, 113 insertions(+), 37 deletions(-)
19
20diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
21index bb6683e..bd392a2 100644
22--- a/src/libsystemd/sd-bus/bus-control.c
23+++ b/src/libsystemd/sd-bus/bus-control.c
24@@ -128,12 +128,14 @@ _public_ int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags)
25 assert_return(bus, -EINVAL);
26 assert_return(name, -EINVAL);
27 assert_return(bus->bus_client, -EINVAL);
28- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
29 assert_return(!bus_pid_changed(bus), -ECHILD);
30 assert_return(!(flags & ~(SD_BUS_NAME_ALLOW_REPLACEMENT|SD_BUS_NAME_REPLACE_EXISTING|SD_BUS_NAME_QUEUE)), -EINVAL);
31 assert_return(service_name_is_valid(name), -EINVAL);
32 assert_return(name[0] != ':', -EINVAL);
33
34+ if (!BUS_IS_OPEN(bus->state))
35+ return -ENOTCONN;
36+
37 if (bus->is_kernel)
38 return bus_request_name_kernel(bus, name, flags);
39 else
40@@ -201,11 +203,13 @@ _public_ int sd_bus_release_name(sd_bus *bus, const char *name) {
41 assert_return(bus, -EINVAL);
42 assert_return(name, -EINVAL);
43 assert_return(bus->bus_client, -EINVAL);
44- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
45 assert_return(!bus_pid_changed(bus), -ECHILD);
46 assert_return(service_name_is_valid(name), -EINVAL);
47 assert_return(name[0] != ':', -EINVAL);
48
49+ if (!BUS_IS_OPEN(bus->state))
50+ return -ENOTCONN;
51+
52 if (bus->is_kernel)
53 return bus_release_name_kernel(bus, name);
54 else
55@@ -342,9 +346,11 @@ static int bus_list_names_dbus1(sd_bus *bus, char ***acquired, char ***activatab
56 _public_ int sd_bus_list_names(sd_bus *bus, char ***acquired, char ***activatable) {
57 assert_return(bus, -EINVAL);
58 assert_return(acquired || activatable, -EINVAL);
59- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
60 assert_return(!bus_pid_changed(bus), -ECHILD);
61
62+ if (!BUS_IS_OPEN(bus->state))
63+ return -ENOTCONN;
64+
65 if (bus->is_kernel)
66 return bus_list_names_kernel(bus, acquired, activatable);
67 else
68@@ -735,11 +741,13 @@ _public_ int sd_bus_get_owner(
69 assert_return(name, -EINVAL);
70 assert_return(mask <= _SD_BUS_CREDS_ALL, -ENOTSUP);
71 assert_return(mask == 0 || creds, -EINVAL);
72- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
73 assert_return(!bus_pid_changed(bus), -ECHILD);
74 assert_return(service_name_is_valid(name), -EINVAL);
75 assert_return(bus->bus_client, -ENODATA);
76
77+ if (!BUS_IS_OPEN(bus->state))
78+ return -ENOTCONN;
79+
80 if (bus->is_kernel)
81 return bus_get_owner_kdbus(bus, name, mask, creds);
82 else
83@@ -1196,10 +1204,12 @@ _public_ int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128
84 assert_return(bus, -EINVAL);
85 assert_return(name, -EINVAL);
86 assert_return(machine, -EINVAL);
87- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
88 assert_return(!bus_pid_changed(bus), -ECHILD);
89 assert_return(service_name_is_valid(name), -EINVAL);
90
91+ if (!BUS_IS_OPEN(bus->state))
92+ return -ENOTCONN;
93+
94 if (streq_ptr(name, bus->unique_name))
95 return sd_id128_get_machine(machine);
96
97diff --git a/src/libsystemd/sd-bus/bus-convenience.c b/src/libsystemd/sd-bus/bus-convenience.c
98index 6e02ad3..c5b9cd4 100644
99--- a/src/libsystemd/sd-bus/bus-convenience.c
100+++ b/src/libsystemd/sd-bus/bus-convenience.c
101@@ -36,9 +36,11 @@ _public_ int sd_bus_emit_signal(
102 int r;
103
104 assert_return(bus, -EINVAL);
105- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
106 assert_return(!bus_pid_changed(bus), -ECHILD);
107
108+ if (!BUS_IS_OPEN(bus->state))
109+ return -ENOTCONN;
110+
111 r = sd_bus_message_new_signal(bus, &m, path, interface, member);
112 if (r < 0)
113 return r;
114@@ -70,9 +72,11 @@ _public_ int sd_bus_call_method(
115 int r;
116
117 assert_return(bus, -EINVAL);
118- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
119 assert_return(!bus_pid_changed(bus), -ECHILD);
120
121+ if (!BUS_IS_OPEN(bus->state))
122+ return -ENOTCONN;
123+
124 r = sd_bus_message_new_method_call(bus, &m, destination, path, interface, member);
125 if (r < 0)
126 return r;
127@@ -100,9 +104,12 @@ _public_ int sd_bus_reply_method_return(
128 assert_return(call, -EINVAL);
129 assert_return(call->sealed, -EPERM);
130 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
131- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
132+ assert_return(call->bus, -EINVAL);
133 assert_return(!bus_pid_changed(call->bus), -ECHILD);
134
135+ if (!BUS_IS_OPEN(call->bus->state))
136+ return -ENOTCONN;
137+
138 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
139 return 0;
140
141@@ -134,9 +141,12 @@ _public_ int sd_bus_reply_method_error(
142 assert_return(call->sealed, -EPERM);
143 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
144 assert_return(sd_bus_error_is_set(e), -EINVAL);
145- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
146+ assert_return(call->bus, -EINVAL);
147 assert_return(!bus_pid_changed(call->bus), -ECHILD);
148
149+ if (!BUS_IS_OPEN(call->bus->state))
150+ return -ENOTCONN;
151+
152 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
153 return 0;
154
155@@ -159,9 +169,12 @@ _public_ int sd_bus_reply_method_errorf(
156 assert_return(call, -EINVAL);
157 assert_return(call->sealed, -EPERM);
158 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
159- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
160+ assert_return(call->bus, -EINVAL);
161 assert_return(!bus_pid_changed(call->bus), -ECHILD);
162
163+ if (!BUS_IS_OPEN(call->bus->state))
164+ return -ENOTCONN;
165+
166 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
167 return 0;
168
169@@ -182,9 +195,12 @@ _public_ int sd_bus_reply_method_errno(
170 assert_return(call, -EINVAL);
171 assert_return(call->sealed, -EPERM);
172 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
173- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
174+ assert_return(call->bus, -EINVAL);
175 assert_return(!bus_pid_changed(call->bus), -ECHILD);
176
177+ if (!BUS_IS_OPEN(call->bus->state))
178+ return -ENOTCONN;
179+
180 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
181 return 0;
182
183@@ -208,9 +224,12 @@ _public_ int sd_bus_reply_method_errnof(
184 assert_return(call, -EINVAL);
185 assert_return(call->sealed, -EPERM);
186 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
187- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
188+ assert_return(call->bus, -EINVAL);
189 assert_return(!bus_pid_changed(call->bus), -ECHILD);
190
191+ if (!BUS_IS_OPEN(call->bus->state))
192+ return -ENOTCONN;
193+
194 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
195 return 0;
196
197@@ -239,9 +258,11 @@ _public_ int sd_bus_get_property(
198 assert_return(member_name_is_valid(member), -EINVAL);
199 assert_return(reply, -EINVAL);
200 assert_return(signature_is_single(type, false), -EINVAL);
201- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
202 assert_return(!bus_pid_changed(bus), -ECHILD);
203
204+ if (!BUS_IS_OPEN(bus->state))
205+ return -ENOTCONN;
206+
207 r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &rep, "ss", strempty(interface), member);
208 if (r < 0)
209 return r;
210@@ -273,9 +294,11 @@ _public_ int sd_bus_get_property_trivial(
211 assert_return(member_name_is_valid(member), -EINVAL);
212 assert_return(bus_type_is_trivial(type), -EINVAL);
213 assert_return(ptr, -EINVAL);
214- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
215 assert_return(!bus_pid_changed(bus), -ECHILD);
216
217+ if (!BUS_IS_OPEN(bus->state))
218+ return -ENOTCONN;
219+
220 r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member);
221 if (r < 0)
222 return r;
223@@ -309,9 +332,11 @@ _public_ int sd_bus_get_property_string(
224 assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL);
225 assert_return(member_name_is_valid(member), -EINVAL);
226 assert_return(ret, -EINVAL);
227- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
228 assert_return(!bus_pid_changed(bus), -ECHILD);
229
230+ if (!BUS_IS_OPEN(bus->state))
231+ return -ENOTCONN;
232+
233 r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member);
234 if (r < 0)
235 return r;
236@@ -348,9 +373,11 @@ _public_ int sd_bus_get_property_strv(
237 assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL);
238 assert_return(member_name_is_valid(member), -EINVAL);
239 assert_return(ret, -EINVAL);
240- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
241 assert_return(!bus_pid_changed(bus), -ECHILD);
242
243+ if (!BUS_IS_OPEN(bus->state))
244+ return -ENOTCONN;
245+
246 r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member);
247 if (r < 0)
248 return r;
249@@ -383,9 +410,11 @@ _public_ int sd_bus_set_property(
250 assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL);
251 assert_return(member_name_is_valid(member), -EINVAL);
252 assert_return(signature_is_single(type, false), -EINVAL);
253- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
254 assert_return(!bus_pid_changed(bus), -ECHILD);
255
256+ if (!BUS_IS_OPEN(bus->state))
257+ return -ENOTCONN;
258+
259 r = sd_bus_message_new_method_call(bus, &m, destination, path, "org.freedesktop.DBus.Properties", "Set");
260 if (r < 0)
261 return r;
262@@ -416,9 +445,12 @@ _public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_b
263
264 assert_return(call, -EINVAL);
265 assert_return(call->sealed, -EPERM);
266- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
267+ assert_return(call->bus, -EINVAL);
268 assert_return(!bus_pid_changed(call->bus), -ECHILD);
269
270+ if (!BUS_IS_OPEN(call->bus->state))
271+ return -ENOTCONN;
272+
273 c = sd_bus_message_get_creds(call);
274
275 /* All data we need? */
276diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
277index 08792fe..539cf2a 100644
278--- a/src/libsystemd/sd-bus/bus-objects.c
279+++ b/src/libsystemd/sd-bus/bus-objects.c
280@@ -2196,9 +2196,10 @@ _public_ int sd_bus_emit_properties_changed_strv(
281 assert_return(bus, -EINVAL);
282 assert_return(object_path_is_valid(path), -EINVAL);
283 assert_return(interface_name_is_valid(interface), -EINVAL);
284- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
285 assert_return(!bus_pid_changed(bus), -ECHILD);
286
287+ if (!BUS_IS_OPEN(bus->state))
288+ return -ENOTCONN;
289
290 /* A non-NULL but empty names list means nothing needs to be
291 generated. A NULL list OTOH indicates that all properties
292@@ -2241,9 +2242,11 @@ _public_ int sd_bus_emit_properties_changed(
293 assert_return(bus, -EINVAL);
294 assert_return(object_path_is_valid(path), -EINVAL);
295 assert_return(interface_name_is_valid(interface), -EINVAL);
296- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
297 assert_return(!bus_pid_changed(bus), -ECHILD);
298
299+ if (!BUS_IS_OPEN(bus->state))
300+ return -ENOTCONN;
301+
302 if (!name)
303 return 0;
304
305@@ -2361,9 +2364,11 @@ _public_ int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, ch
306
307 assert_return(bus, -EINVAL);
308 assert_return(object_path_is_valid(path), -EINVAL);
309- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
310 assert_return(!bus_pid_changed(bus), -ECHILD);
311
312+ if (!BUS_IS_OPEN(bus->state))
313+ return -ENOTCONN;
314+
315 if (strv_isempty(interfaces))
316 return 0;
317
318@@ -2421,9 +2426,11 @@ _public_ int sd_bus_emit_interfaces_added(sd_bus *bus, const char *path, const c
319
320 assert_return(bus, -EINVAL);
321 assert_return(object_path_is_valid(path), -EINVAL);
322- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
323 assert_return(!bus_pid_changed(bus), -ECHILD);
324
325+ if (!BUS_IS_OPEN(bus->state))
326+ return -ENOTCONN;
327+
328 interfaces = strv_from_stdarg_alloca(interface);
329
330 return sd_bus_emit_interfaces_added_strv(bus, path, interfaces);
331@@ -2435,9 +2442,11 @@ _public_ int sd_bus_emit_interfaces_removed_strv(sd_bus *bus, const char *path,
332
333 assert_return(bus, -EINVAL);
334 assert_return(object_path_is_valid(path), -EINVAL);
335- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
336 assert_return(!bus_pid_changed(bus), -ECHILD);
337
338+ if (!BUS_IS_OPEN(bus->state))
339+ return -ENOTCONN;
340+
341 if (strv_isempty(interfaces))
342 return 0;
343
344@@ -2461,9 +2470,11 @@ _public_ int sd_bus_emit_interfaces_removed(sd_bus *bus, const char *path, const
345
346 assert_return(bus, -EINVAL);
347 assert_return(object_path_is_valid(path), -EINVAL);
348- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
349 assert_return(!bus_pid_changed(bus), -ECHILD);
350
351+ if (!BUS_IS_OPEN(bus->state))
352+ return -ENOTCONN;
353+
354 interfaces = strv_from_stdarg_alloca(interface);
355
356 return sd_bus_emit_interfaces_removed_strv(bus, path, interfaces);
357diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
358index fa6d43a..15c7677 100644
359--- a/src/libsystemd/sd-bus/sd-bus.c
360+++ b/src/libsystemd/sd-bus/sd-bus.c
361@@ -1594,10 +1594,12 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
362 int r;
363
364 assert_return(bus, -EINVAL);
365- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
366 assert_return(m, -EINVAL);
367 assert_return(!bus_pid_changed(bus), -ECHILD);
368
369+ if (!BUS_IS_OPEN(bus->state))
370+ return -ENOTCONN;
371+
372 if (m->n_fds > 0) {
373 r = sd_bus_can_send(bus, SD_BUS_TYPE_UNIX_FD);
374 if (r < 0)
375@@ -1673,10 +1675,12 @@ _public_ int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destinat
376 int r;
377
378 assert_return(bus, -EINVAL);
379- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
380 assert_return(m, -EINVAL);
381 assert_return(!bus_pid_changed(bus), -ECHILD);
382
383+ if (!BUS_IS_OPEN(bus->state))
384+ return -ENOTCONN;
385+
386 if (!streq_ptr(m->destination, destination)) {
387
388 if (!destination)
389@@ -1728,13 +1732,15 @@ _public_ int sd_bus_call_async(
390 int r;
391
392 assert_return(bus, -EINVAL);
393- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
394 assert_return(m, -EINVAL);
395 assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
396 assert_return(!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED), -EINVAL);
397 assert_return(callback, -EINVAL);
398 assert_return(!bus_pid_changed(bus), -ECHILD);
399
400+ if (!BUS_IS_OPEN(bus->state))
401+ return -ENOTCONN;
402+
403 r = hashmap_ensure_allocated(&bus->reply_callbacks, uint64_hash_func, uint64_compare_func);
404 if (r < 0)
405 return r;
406@@ -1841,13 +1847,15 @@ _public_ int sd_bus_call(
407 int r;
408
409 assert_return(bus, -EINVAL);
410- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
411 assert_return(m, -EINVAL);
412 assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
413 assert_return(!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED), -EINVAL);
414 assert_return(!bus_error_is_dirty(error), -EINVAL);
415 assert_return(!bus_pid_changed(bus), -ECHILD);
416
417+ if (!BUS_IS_OPEN(bus->state))
418+ return -ENOTCONN;
419+
420 r = bus_ensure_running(bus);
421 if (r < 0)
422 return r;
423@@ -1973,9 +1981,11 @@ _public_ int sd_bus_get_events(sd_bus *bus) {
424 int flags = 0;
425
426 assert_return(bus, -EINVAL);
427- assert_return(BUS_IS_OPEN(bus->state) || bus->state == BUS_CLOSING, -ENOTCONN);
428 assert_return(!bus_pid_changed(bus), -ECHILD);
429
430+ if (!BUS_IS_OPEN(bus->state) && bus->state != BUS_CLOSING)
431+ return -ENOTCONN;
432+
433 if (bus->state == BUS_OPENING)
434 flags |= POLLOUT;
435 else if (bus->state == BUS_AUTHENTICATING) {
436@@ -2000,9 +2010,11 @@ _public_ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) {
437
438 assert_return(bus, -EINVAL);
439 assert_return(timeout_usec, -EINVAL);
440- assert_return(BUS_IS_OPEN(bus->state) || bus->state == BUS_CLOSING, -ENOTCONN);
441 assert_return(!bus_pid_changed(bus), -ECHILD);
442
443+ if (!BUS_IS_OPEN(bus->state) && bus->state != BUS_CLOSING)
444+ return -ENOTCONN;
445+
446 if (bus->track_queue) {
447 *timeout_usec = 0;
448 return 1;
449@@ -2531,7 +2543,8 @@ static int bus_poll(sd_bus *bus, bool need_more, uint64_t timeout_usec) {
450 if (bus->state == BUS_CLOSING)
451 return 1;
452
453- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
454+ if (!BUS_IS_OPEN(bus->state))
455+ return -ENOTCONN;
456
457 e = sd_bus_get_events(bus);
458 if (e < 0)
459@@ -2586,7 +2599,8 @@ _public_ int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec) {
460 if (bus->state == BUS_CLOSING)
461 return 0;
462
463- assert_return(BUS_IS_OPEN(bus->state) , -ENOTCONN);
464+ if (!BUS_IS_OPEN(bus->state))
465+ return -ENOTCONN;
466
467 if (bus->rqueue_size > 0)
468 return 0;
469@@ -2603,7 +2617,8 @@ _public_ int sd_bus_flush(sd_bus *bus) {
470 if (bus->state == BUS_CLOSING)
471 return 0;
472
473- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
474+ if (!BUS_IS_OPEN(bus->state))
475+ return -ENOTCONN;
476
477 r = bus_ensure_running(bus);
478 if (r < 0)
479@@ -3113,9 +3128,13 @@ _public_ int sd_bus_get_peer_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **re
480 assert_return(bus, -EINVAL);
481 assert_return(mask <= _SD_BUS_CREDS_ALL, -ENOTSUP);
482 assert_return(ret, -EINVAL);
483- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
484 assert_return(!bus_pid_changed(bus), -ECHILD);
485- assert_return(!bus->is_kernel, -ENOTSUP);
486+
487+ if (!bus->is_kernel)
488+ return -ENOTSUP;
489+
490+ if (!BUS_IS_OPEN(bus->state))
491+ return -ENOTCONN;
492
493 if (!bus->ucred_valid && !isempty(bus->label))
494 return -ENODATA;
495@@ -3154,9 +3173,13 @@ _public_ int sd_bus_try_close(sd_bus *bus) {
496 int r;
497
498 assert_return(bus, -EINVAL);
499- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
500 assert_return(!bus_pid_changed(bus), -ECHILD);
501- assert_return(bus->is_kernel, -ENOTSUP);
502+
503+ if (!bus->is_kernel)
504+ return -ENOTSUP;
505+
506+ if (!BUS_IS_OPEN(bus->state))
507+ return -ENOTCONN;
508
509 if (bus->rqueue_size > 0)
510 return -EBUSY;
511--
5121.9.1
513
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
new file mode 100644
index 0000000000..4639532236
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
@@ -0,0 +1,32 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: git/configure.ac
5===================================================================
6--- git.orig/configure.ac 2014-03-15 17:53:51.756340454 -0700
7+++ git/configure.ac 2014-03-15 18:07:34.888355897 -0700
8@@ -78,6 +78,24 @@
9
10 M4_DEFINES=
11
12+# check for few functions not implemented in uClibc
13+
14+AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
15+
16+# check for %ms format support - assume always no if cross compiling
17+
18+AC_MSG_CHECKING([whether %ms format is supported by *scanf])
19+
20+AC_LINK_IFELSE(
21+ [AC_LANG_PROGRAM([
22+ #include <stdio.h>
23+ ],[
24+ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ;
25+ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ;
26+ return (rc==3)?0:1;])],
27+ [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])],
28+ [AC_MSG_RESULT([no])])
29+
30 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
31 m4_ifdef([GTK_DOC_CHECK], [
32 GTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch
new file mode 100644
index 0000000000..7170a38af3
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch
@@ -0,0 +1,29 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: systemd-209/src/nspawn/nspawn.c
5===================================================================
6--- systemd-209.orig/src/nspawn/nspawn.c 2014-02-19 15:03:09.000000000 -0800
7+++ systemd-209/src/nspawn/nspawn.c 2014-02-19 23:20:38.720628627 -0800
8@@ -91,6 +91,8 @@
9 LINK_GUEST
10 } LinkJournal;
11
12+#include "config.h"
13+
14 static char *arg_directory = NULL;
15 static char *arg_user = NULL;
16 static sd_id128_t arg_uuid = {};
17@@ -2045,7 +2047,12 @@
18 a[0] = (char*) "/sbin/init";
19 execve(a[0], a, env_use);
20 } else if (argc > optind)
21+#ifdef HAVE_EXECVPE
22 execvpe(argv[optind], argv + optind, env_use);
23+#else
24+ environ = env_use;
25+ execvp(argv[optind], argv + optind);
26+#endif /* HAVE_EXECVPE */
27 else {
28 chdir(home ? home : "/root");
29 execle("/bin/bash", "-bash", NULL, env_use);
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch
new file mode 100644
index 0000000000..de73be96a7
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch
@@ -0,0 +1,84 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: systemd-209/src/journal/journal-file.c
5===================================================================
6--- systemd-209.orig/src/journal/journal-file.c 2014-02-12 18:42:33.000000000 -0800
7+++ systemd-209/src/journal/journal-file.c 2014-02-19 23:23:19.464631643 -0800
8@@ -38,6 +38,8 @@
9 #include "compress.h"
10 #include "fsprg.h"
11
12+#include "config.h"
13+
14 #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem))
15 #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem))
16
17@@ -316,7 +318,7 @@
18
19 static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) {
20 uint64_t old_size, new_size;
21- int r;
22+ int r = 0;
23
24 assert(f);
25
26@@ -364,9 +366,24 @@
27 /* Note that the glibc fallocate() fallback is very
28 inefficient, hence we try to minimize the allocation area
29 as we can. */
30+#ifdef HAVE_POSIX_ALLOCATE
31 r = posix_fallocate(f->fd, old_size, new_size - old_size);
32 if (r != 0)
33 return -r;
34+#else
35+ /* Use good old method to write zeros into the journal file
36+ perhaps very inefficient yet working. */
37+ if(new_size > old_size) {
38+ char *buf = alloca(new_size - old_size);
39+ off_t oldpos = lseek(f->fd, 0, SEEK_CUR);
40+ bzero(buf, new_size - old_size);
41+ lseek(f->fd, old_size, SEEK_SET);
42+ r = write(f->fd, buf, new_size - old_size);
43+ lseek(f->fd, oldpos, SEEK_SET);
44+ }
45+ if (r < 0)
46+ return -errno;
47+#endif /* HAVE_POSIX_FALLOCATE */
48
49 if (fstat(f->fd, &f->last_stat) < 0)
50 return -errno;
51Index: systemd-209/src/journal/journald-kmsg.c
52===================================================================
53--- systemd-209.orig/src/journal/journald-kmsg.c 2014-02-19 15:03:09.000000000 -0800
54+++ systemd-209/src/journal/journald-kmsg.c 2014-02-19 23:22:14.396630422 -0800
55@@ -441,6 +441,7 @@
56
57 int server_open_kernel_seqnum(Server *s) {
58 int fd;
59+ int r = 0;
60 uint64_t *p;
61
62 assert(s);
63@@ -454,8 +455,19 @@
64 log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m");
65 return 0;
66 }
67-
68- if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) {
69+#ifdef HAVE_POSIX_ALLOCATE
70+ r = posix_fallocate(fd, 0, sizeof(uint64_t));
71+#else
72+ /* Use good old method to write zeros into the journal file
73+ perhaps very inefficient yet working. */
74+ char *buf = alloca(sizeof(uint64_t));
75+ off_t oldpos = lseek(fd, 0, SEEK_CUR);
76+ bzero(buf, sizeof(uint64_t));
77+ lseek(fd, 0, SEEK_SET);
78+ r = write(fd, buf, sizeof(uint64_t));
79+ lseek(fd, oldpos, SEEK_SET);
80+#endif /* HAVE_POSIX_FALLOCATE */
81+ if (r < 0) {
82 log_error("Failed to allocate sequential number file, ignoring: %m");
83 close_nointr_nofail(fd);
84 return 0;
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch
new file mode 100644
index 0000000000..9b4c940984
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch
@@ -0,0 +1,35 @@
1Prefer getty to agetty in console setup systemd units
2
3Upstream-Status: Inappropriate [configuration specific]
4Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
5---
6 units/getty@.service.m4 | 2 +-
7 units/serial-getty@.service.m4 | 2 +-
8 2 files changed, 2 insertions(+), 2 deletions(-)
9
10Index: git/units/getty@.service.m4
11===================================================================
12--- git.orig/units/getty@.service.m4 2014-03-15 08:16:17.000000000 -0700
13+++ git/units/getty@.service.m4 2014-03-15 08:21:11.007695825 -0700
14@@ -27,7 +27,7 @@
15
16 [Service]
17 # the VT is cleared by TTYVTDisallocate
18-ExecStart=-/sbin/agetty --noclear %I $TERM
19+ExecStart=-/sbin/getty -L %I $TERM
20 Type=idle
21 Restart=always
22 RestartSec=0
23Index: git/units/serial-getty@.service.m4
24===================================================================
25--- git.orig/units/serial-getty@.service.m4 2014-03-15 08:16:17.000000000 -0700
26+++ git/units/serial-getty@.service.m4 2014-03-15 08:22:31.291697331 -0700
27@@ -22,7 +22,7 @@
28 IgnoreOnIsolate=yes
29
30 [Service]
31-ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
32+ExecStart=-/sbin/getty -L 115200 %I $TERM
33 Type=idle
34 Restart=always
35 RestartSec=0
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
new file mode 100644
index 0000000000..8c7aa072da
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
@@ -0,0 +1,30 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: git/src/shared/util.c
5===================================================================
6--- git.orig/src/shared/util.c 2014-03-15 15:14:21.368160908 -0700
7+++ git/src/shared/util.c 2014-03-15 15:44:21.988194688 -0700
8@@ -85,6 +85,8 @@
9 #include "def.h"
10 #include "missing.h"
11
12+#include "config.h"
13+
14 int saved_argc = 0;
15 char **saved_argv = NULL;
16
17@@ -6222,7 +6224,13 @@
18
19 u = umask(077);
20
21+#ifdef HAVE_MKOSTEMP
22 fd = mkostemp(pattern, flags);
23+#else
24+ fd = mkstemp(pattern);
25+ if (fd >= 0) fcntl(fd, F_SETFD, flags);
26+#endif /* HAVE_MKOSTEMP */
27+
28 if (fd < 0)
29 return -errno;
30
diff --git a/meta/recipes-core/systemd/systemd/touchscreen.rules b/meta/recipes-core/systemd/systemd/touchscreen.rules
new file mode 100644
index 0000000000..d83fd1673d
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/touchscreen.rules
@@ -0,0 +1,18 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Create a symlink to any touchscreen input device
17SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
18SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"
diff --git a/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
new file mode 100644
index 0000000000..39dfc9e2ea
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
@@ -0,0 +1,37 @@
1bypass unimplemented _SC_PHYS_PAGES system configuration API in uclibc
2
3Upstream-Status: Inappropriate [uclibc-specific]
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: git/src/shared/util.c
8===================================================================
9--- git.orig/src/shared/util.c 2014-03-15 18:09:34.796358146 -0700
10+++ git/src/shared/util.c 2014-03-15 20:16:33.836501084 -0700
11@@ -6332,11 +6332,24 @@
12
13 /* We return this as uint64_t in case we are running as 32bit
14 * process on a 64bit kernel with huge amounts of memory */
15-
16+#ifdef __UCLIBC__
17+ char line[128];
18+ FILE *f = fopen("/proc/meminfo", "r");
19+ if (f == NULL)
20+ return 0;
21+ while (!feof(f) && fgets(line, sizeof(line)-1, f)) {
22+ if (sscanf(line, "MemTotal: %l kB", &mem) == 1) {
23+ mem *= 1024;
24+ break;
25+ }
26+ }
27+ fclose(f);
28+ return (uint64_t) mem;
29+#else
30 mem = sysconf(_SC_PHYS_PAGES);
31 assert(mem > 0);
32-
33 return (uint64_t) mem * (uint64_t) page_size();
34+#endif
35 }
36
37 char* mount_test_option(const char *haystack, const char *needle) {
diff --git a/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch
new file mode 100644
index 0000000000..15645dee11
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch
@@ -0,0 +1,19 @@
1Dont include sys/sysinfo.h on uclibc it conflicts with linux/sysinfo.h
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Inappropriate [uclibc specific]
5
6Index: systemd-209/src/readahead/readahead-common.c
7===================================================================
8--- systemd-209.orig/src/readahead/readahead-common.c 2014-02-12 18:42:33.810685053 -0800
9+++ systemd-209/src/readahead/readahead-common.c 2014-02-19 23:49:31.856661142 -0800
10@@ -22,7 +22,9 @@
11 #include <errno.h>
12 #include <stdlib.h>
13 #include <string.h>
14+#ifndef __UCLIBC__
15 #include <sys/sysinfo.h>
16+#endif
17 #include <sys/inotify.h>
18 #include <fcntl.h>
19 #include <sys/mman.h>
diff --git a/meta/recipes-core/systemd/systemd_211.bb b/meta/recipes-core/systemd/systemd_211.bb
new file mode 100644
index 0000000000..44b196538a
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_211.bb
@@ -0,0 +1,353 @@
1SUMMARY = "System and service manager for Linux, replacing SysVinit"
2HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
3
4LICENSE = "GPLv2 & LGPLv2.1 & MIT"
5LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
6 file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \
7 file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed"
8
9PROVIDES = "udev"
10
11PE = "1"
12
13DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native util-linux"
14DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
15
16SECTION = "base/shell"
17
18inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest
19
20SRCREV = "3a450ec5c6adf3057bcedd6cc19c10617abc35a5"
21
22PV = "211+git${SRCPV}"
23
24SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git \
25 file://binfmt-install.patch \
26 file://systemd-pam-configure-check-uclibc.patch \
27 file://systemd-pam-fix-execvpe.patch \
28 file://systemd-pam-fix-fallocate.patch \
29 file://systemd-pam-fix-mkostemp.patch \
30 file://optional_secure_getenv.patch \
31 file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \
32 file://uclibc-sysinfo_h.patch \
33 file://uclibc-get-physmem.patch \
34 file://sd-bus-don-t-use-assert_return-to-check-for-disconne.patch \
35 \
36 file://touchscreen.rules \
37 file://00-create-volatile.conf \
38 file://init \
39 file://run-ptest \
40 "
41
42S = "${WORKDIR}/git"
43
44SRC_URI_append_libc-uclibc = "\
45 file://systemd-pam-fix-getty-unit.patch \
46 "
47LDFLAGS_append_libc-uclibc = " -lrt"
48
49GTKDOC_DOCDIR = "${S}/docs/"
50
51PACKAGECONFIG ??= "xz tcp-wrappers"
52# Sign the journal for anti-tampering
53PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
54# regardless of PACKAGECONFIG, libgcrypt is always required to expand
55# the AM_PATH_LIBGCRYPT autoconf macro
56DEPENDS += "libgcrypt"
57# Compress the journal
58PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
59PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers"
60PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
61PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
62
63CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
64
65# Helper variables to clarify locations. This mirrors the logic in systemd's
66# build system.
67rootprefix ?= "${base_prefix}"
68rootlibdir ?= "${base_libdir}"
69rootlibexecdir = "${rootprefix}/lib"
70
71# The gtk+ tools should get built as a separate recipe e.g. systemd-tools
72EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
73 --with-rootlibdir=${rootlibdir} \
74 ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
75 --enable-xz \
76 --disable-manpages \
77 --disable-coredump \
78 --disable-introspection \
79 --disable-kdbus \
80 --enable-split-usr \
81 --without-python \
82 --with-sysvrcnd-path=${sysconfdir} \
83 --with-firmware-path=/lib/firmware \
84 ac_cv_path_KILL=${base_bindir}/kill \
85 "
86# uclibc does not have NSS
87EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
88
89do_configure_prepend() {
90 export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
91 export KMOD="${base_bindir}/kmod"
92 if [ -d ${S}/units.pre_sed ] ; then
93 cp -r ${S}/units.pre_sed ${S}/units
94 else
95 cp -r ${S}/units ${S}/units.pre_sed
96 fi
97 sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
98 sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am
99 sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am
100}
101
102do_install() {
103 autotools_do_install
104 install -d ${D}/${base_sbindir}
105 # Provided by a separate recipe
106 rm ${D}${systemd_unitdir}/system/serial-getty* -f
107
108 # Provide support for initramfs
109 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
110 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
111
112 # Create machine-id
113 # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable
114 touch ${D}${sysconfdir}/machine-id
115
116 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
117
118 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
119
120 if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
121 install -d ${D}${sysconfdir}/init.d
122 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
123 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
124 fi
125
126 # Delete journal README, as log can be symlinked inside volatile.
127 rm -f ${D}/${localstatedir}/log/README
128}
129
130do_install_ptest () {
131 install -d ${D}${PTEST_PATH}/test
132 cp -rf ${S}/test/* ${D}${PTEST_PATH}/test
133 install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/
134 install -d ${D}${PTEST_PATH}/build-aux
135 cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
136 cp -rf ${B}/rules ${D}${PTEST_PATH}/
137 # This directory needs to be there for udev-test.pl to work.
138 install -d ${D}${libdir}/udev/rules.d
139 cp ${B}/Makefile ${D}${PTEST_PATH}/
140 cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test
141 sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl
142 sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
143 sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
144}
145
146python populate_packages_prepend (){
147 systemdlibdir = d.getVar("rootlibdir", True)
148 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
149}
150PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*"
151
152PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \
153 ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh"
154
155SYSTEMD_PACKAGES = "${PN}-binfmt"
156SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
157
158USERADD_PACKAGES = "${PN}"
159USERADD_PARAM_${PN} += "--system systemd-journal-gateway"
160GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
161
162FILES_${PN}-analyze = "${bindir}/systemd-analyze"
163
164FILES_${PN}-initramfs = "/init"
165RDEPENDS_${PN}-initramfs = "${PN}"
166
167# The test cases need perl and bash to run correctly.
168RDEPENDS_${PN}-ptest += "perl bash"
169FILES_${PN}-ptest += "${libdir}/udev/rules.d"
170
171FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug"
172
173FILES_${PN}-gui = "${bindir}/systemadm"
174
175FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
176 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
177 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
178
179FILES_${PN}-kernel-install = "${bindir}/kernel-install \
180 ${sysconfdir}/kernel/ \
181 ${exec_prefix}/lib/kernel \
182 "
183FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
184 "
185
186FILES_${PN}-zsh = "${datadir}/zsh/site-functions"
187
188FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
189 ${exec_prefix}/lib/binfmt.d \
190 ${rootlibexecdir}/systemd/systemd-binfmt \
191 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
192 ${systemd_unitdir}/system/systemd-binfmt.service"
193RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
194
195RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts"
196
197CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
198 ${sysconfdir}/systemd/logind.conf \
199 ${sysconfdir}/systemd/system.conf \
200 ${sysconfdir}/systemd/user.conf"
201
202FILES_${PN} = " ${base_bindir}/* \
203 ${datadir}/bash-completion \
204 ${datadir}/dbus-1/services \
205 ${datadir}/dbus-1/system-services \
206 ${datadir}/polkit-1 \
207 ${datadir}/${BPN} \
208 ${sysconfdir}/bash_completion.d/ \
209 ${sysconfdir}/dbus-1/ \
210 ${sysconfdir}/machine-id \
211 ${sysconfdir}/modules-load.d/ \
212 ${sysconfdir}/sysctl.d/ \
213 ${sysconfdir}/systemd/ \
214 ${sysconfdir}/tmpfiles.d/ \
215 ${sysconfdir}/xdg/ \
216 ${sysconfdir}/init.d/README \
217 ${rootlibexecdir}/systemd/* \
218 ${systemd_unitdir}/* \
219 ${base_libdir}/security/*.so \
220 ${libdir}/libnss_myhostname.so.2 \
221 /cgroup \
222 ${bindir}/systemd* \
223 ${bindir}/busctl \
224 ${bindir}/localectl \
225 ${bindir}/hostnamectl \
226 ${bindir}/timedatectl \
227 ${bindir}/bootctl \
228 ${bindir}/kernel-install \
229 ${exec_prefix}/lib/tmpfiles.d/*.conf \
230 ${exec_prefix}/lib/systemd \
231 ${exec_prefix}/lib/modules-load.d \
232 ${exec_prefix}/lib/sysctl.d \
233 ${localstatedir} \
234 /lib/udev/rules.d/70-uaccess.rules \
235 /lib/udev/rules.d/71-seat.rules \
236 /lib/udev/rules.d/73-seat-late.rules \
237 /lib/udev/rules.d/99-systemd.rules \
238 ${@base_contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \
239 "
240
241FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
242FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
243
244RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
245
246RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
247 util-linux-agetty \
248 util-linux-fsck e2fsprogs-e2fsck \
249 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
250"
251
252PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"
253
254FILES_udev-dbg += "/lib/udev/.debug"
255
256RDEPENDS_udev += "udev-utils"
257RPROVIDES_udev = "hotplug"
258RRECOMMENDS_udev += "udev-hwdb"
259
260RDEPENDS_udev-hwdb += "udev-utils"
261
262FILES_udev += "${base_sbindir}/udevd \
263 ${rootlibexecdir}/systemd/systemd-udevd \
264 ${rootlibexecdir}/udev/accelerometer \
265 ${rootlibexecdir}/udev/ata_id \
266 ${rootlibexecdir}/udev/cdrom_id \
267 ${rootlibexecdir}/udev/collect \
268 ${rootlibexecdir}/udev/findkeyboards \
269 ${rootlibexecdir}/udev/keyboard-force-release.sh \
270 ${rootlibexecdir}/udev/keymap \
271 ${rootlibexecdir}/udev/mtd_probe \
272 ${rootlibexecdir}/udev/scsi_id \
273 ${rootlibexecdir}/udev/v4l_id \
274 ${rootlibexecdir}/udev/keymaps \
275 ${rootlibexecdir}/udev/rules.d/4*.rules \
276 ${rootlibexecdir}/udev/rules.d/5*.rules \
277 ${rootlibexecdir}/udev/rules.d/6*.rules \
278 ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \
279 ${rootlibexecdir}/udev/rules.d/75*.rules \
280 ${rootlibexecdir}/udev/rules.d/78*.rules \
281 ${rootlibexecdir}/udev/rules.d/8*.rules \
282 ${rootlibexecdir}/udev/rules.d/95*.rules \
283 ${sysconfdir}/udev \
284 ${sysconfdir}/init.d/systemd-udevd \
285 ${systemd_unitdir}/system/*udev* \
286 ${systemd_unitdir}/system/*.wants/*udev* \
287 "
288
289FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm"
290
291FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
292
293INITSCRIPT_PACKAGES = "udev"
294INITSCRIPT_NAME_udev = "systemd-udevd"
295INITSCRIPT_PARAMS_udev = "start 03 S ."
296
297python __anonymous() {
298 if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
299 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
300}
301
302# TODO:
303# u-a for runlevel and telinit
304
305ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel"
306
307ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
308ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
309ALTERNATIVE_PRIORITY[init] ?= "300"
310
311ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
312ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
313ALTERNATIVE_PRIORITY[halt] ?= "300"
314
315ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
316ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
317ALTERNATIVE_PRIORITY[reboot] ?= "300"
318
319ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
320ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
321ALTERNATIVE_PRIORITY[shutdown] ?= "300"
322
323ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
324ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
325ALTERNATIVE_PRIORITY[poweroff] ?= "300"
326
327ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
328ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
329ALTERNATIVE_PRIORITY[runlevel] ?= "300"
330
331pkg_postinst_udev-hwdb () {
332 if test -n "$D"; then
333 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
334 --root $D
335 else
336 udevadm hwdb --update
337 fi
338}
339
340pkg_prerm_udev-hwdb () {
341 if test -n "$D"; then
342 exit 1
343 fi
344
345 rm -f ${sysconfdir}/udev/hwdb.bin
346}
347
348# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
349# that we don't build both udev and systemd in world builds.
350python () {
351 if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
352 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
353}
diff --git a/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch
new file mode 100644
index 0000000000..7b342901e1
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch
@@ -0,0 +1,25 @@
1Upstream-Status: Inappropriate [configuration]
2
3# The src Makefile was checking for libcrypt.a on the host, not in the
4# build environment. This patch checks for $LCRYPT in the environment
5# and uses it if it's there.
6# - jdike@linux.intel.com
7
8Index: sysvinit-2.88dsf/src/Makefile
9===================================================================
10--- sysvinit-2.88dsf.orig/src/Makefile
11+++ sysvinit-2.88dsf/src/Makefile
12@@ -85,9 +85,13 @@ else
13 endif
14
15 # Additional libs for GNU libc.
16+ifneq ($(LCRYPT),)
17+ SULOGINLIBS += $(LCRYPT)
18+else
19 ifneq ($(wildcard /usr/lib*/libcrypt.a),)
20 SULOGINLIBS += -lcrypt
21 endif
22+endif
23
24 all: $(BIN) $(SBIN) $(USRBIN)
25
diff --git a/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
new file mode 100644
index 0000000000..6c4225a678
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
@@ -0,0 +1,83 @@
1Upstream-Status: Pending
2
3diff --git a/src/Makefile b/src/Makefile
4index e2b8028..3e11e92 100644
5--- a/src/Makefile
6+++ b/src/Makefile
7@@ -65,7 +65,14 @@ else
8 INSTALL_DATA = install -m 644
9 endif
10 INSTALL_DIR = install -m 755 -d
11-MANDIR = /usr/share/man
12+
13+ROOT ?=
14+base_bindir ?= /bin
15+base_sbindir ?= /sbin
16+bindir ?= /usr/bin
17+sysconfdir ?= /etc
18+includedir ?= /usr/include
19+mandir ?= /usr/share/man
20
21 ifeq ($(WITH_SELINUX),yes)
22 SELINUX_DEF = -DWITH_SELINUX
23@@ -138,39 +145,39 @@ clobber: cleanobjs
24 distclean: clobber
25
26 install:
27- $(INSTALL_DIR) $(ROOT)/bin/ $(ROOT)/sbin/
28- $(INSTALL_DIR) $(ROOT)/usr/bin/
29+ $(INSTALL_DIR) $(ROOT)$(base_bindir)/ $(ROOT)$(base_sbindir)/
30+ $(INSTALL_DIR) $(ROOT)$(bindir)/
31 for i in $(BIN); do \
32- $(INSTALL_EXEC) $$i $(ROOT)/bin/ ; \
33+ $(INSTALL_EXEC) $$i $(ROOT)$(base_bindir)/ ; \
34 done
35 for i in $(SBIN); do \
36- $(INSTALL_EXEC) $$i $(ROOT)/sbin/ ; \
37+ $(INSTALL_EXEC) $$i $(ROOT)$(base_sbindir)/ ; \
38 done
39 for i in $(USRBIN); do \
40- $(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \
41+ $(INSTALL_EXEC) $$i $(ROOT)$(bindir)/ ; \
42 done
43- # $(INSTALL_DIR) $(ROOT)/etc/
44- # $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/
45- ln -sf halt $(ROOT)/sbin/reboot
46- ln -sf halt $(ROOT)/sbin/poweroff
47- ln -sf init $(ROOT)/sbin/telinit
48- ln -sf /sbin/killall5 $(ROOT)/bin/pidof
49- if [ ! -f $(ROOT)/usr/bin/lastb ]; then \
50- ln -sf last $(ROOT)/usr/bin/lastb; \
51+ # $(INSTALL_DIR) $(ROOT)$(sysconfdir)/
52+ # $(INSTALL_EXEC) initscript.sample $(ROOT)$(sysconfdir)/
53+ ln -sf halt $(ROOT)$(base_sbindir)/reboot
54+ ln -sf halt $(ROOT)$(base_sbindir)/poweroff
55+ ln -sf init $(ROOT)$(base_sbindir)/telinit
56+ ln -sf $(base_sbindir)/killall5 $(ROOT)$(base_bindir)/pidof
57+ if [ ! -f $(ROOT)$(bindir)/lastb ]; then \
58+ ln -sf last $(ROOT)$(bindir)/lastb; \
59 fi
60- $(INSTALL_DIR) $(ROOT)/usr/include/
61- $(INSTALL_DATA) initreq.h $(ROOT)/usr/include/
62- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man1/
63- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man5/
64- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man8/
65+ $(INSTALL_DIR) $(ROOT)$(includedir)/
66+ $(INSTALL_DATA) initreq.h $(ROOT)$(includedir)/
67+ $(INSTALL_DIR) $(ROOT)$(mandir)/man1/
68+ $(INSTALL_DIR) $(ROOT)$(mandir)/man5/
69+ $(INSTALL_DIR) $(ROOT)$(mandir)/man8/
70 for i in $(MAN1); do \
71- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man1/; \
72+ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man1/; \
73 done
74 for i in $(MAN5); do \
75- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man5/; \
76+ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man5/; \
77 done
78 for i in $(MAN8); do \
79- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man8/; \
80+ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man8/; \
81 done
82 ifeq ($(ROOT),)
83 #
diff --git a/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch
new file mode 100644
index 0000000000..5b5dfdc001
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch
@@ -0,0 +1,189 @@
1pidof: add -m option
2
3When used with -o, will also omit any processes that have the same
4argv[0] and argv[1] as any explicitly omitted process ids. This can be
5used to avoid multiple shell scripts concurrently calling pidof returning
6each other's pids.
7
8https://bugzilla.redhat.com/show_bug.cgi?id=883856
9
10Upstream-Status: backport
11Imported patch from: https://bugzilla.redhat.com/attachment.cgi?id=658166
12
13Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
14---
15 man/pidof.8 | 6 ++++++
16 src/killall5.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
17 2 files changed, 65 insertions(+), 3 deletions(-)
18
19diff --git a/man/pidof.8 b/man/pidof.8
20--- a/man/pidof.8
21+++ b/man/pidof.8
22@@ -24,6 +24,7 @@ pidof -- find the process ID of a running program.
23 .RB [ \-c ]
24 .RB [ \-n ]
25 .RB [ \-x ]
26+.RB [ \-m ]
27 .RB [ \-o
28 .IR omitpid[,omitpid..] ]
29 .RB [ \-o
30@@ -63,6 +64,11 @@ shells running the named scripts.
31 Tells \fIpidof\fP to omit processes with that process id. The special
32 pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
33 program, in other words the calling shell or shell script.
34+.IP -m
35+When used with -o, will also omit any processes that have the same
36+argv[0] and argv[1] as any explicitly omitted process ids. This can be
37+used to avoid multiple shell scripts concurrently calling pidof returning
38+each other's pids.
39 .SH "EXIT STATUS"
40 .TP
41 .B 0
42diff --git a/src/killall5.c b/src/killall5.c
43index 5937d98..e73885e 100644
44--- a/src/killall5.c
45+++ b/src/killall5.c
46@@ -118,6 +118,7 @@ typedef struct _s_nfs
47
48 /* List of processes. */
49 PROC *plist;
50+PROC *olist;
51
52 /* List of processes to omit. */
53 OMIT *omit;
54@@ -345,6 +346,20 @@ static void clear_mnt(void)
55 }
56 }
57
58+static void clear_omit(void)
59+{
60+ OMIT *o;
61+ PROC *p;
62+ for (o = omit; o; o = omit) {
63+ omit = omit->next;
64+ free(o);
65+ }
66+ for (p = olist; p; p = olist) {
67+ olist = olist->next;
68+ free(p);
69+ }
70+}
71+
72 /*
73 * Check if path is ia shadow off a NFS partition.
74 */
75@@ -452,6 +467,7 @@ int readproc(int do_stat)
76 DIR *dir;
77 FILE *fp;
78 PROC *p, *n;
79+ OMIT *o, *m;
80 struct dirent *d;
81 struct stat st;
82 char path[PATH_MAX+1];
83@@ -624,6 +640,17 @@ int readproc(int do_stat)
84 p->next = plist;
85 plist = p;
86 p->pid = pid;
87+ /* Could be smarter, but it's a small list. */
88+ m = omit;
89+ for (o = omit; m; o = m) {
90+ m = o->next;
91+ if (o->pid == p->pid) {
92+ n = (PROC*)xmalloc(sizeof(PROC));
93+ *n = *p;
94+ n->next = olist;
95+ olist = n;
96+ }
97+ }
98 }
99 closedir(dir);
100
101@@ -813,6 +840,26 @@ PIDQ_HEAD *pidof(char *prog)
102 return q;
103 }
104
105+int matches(PROC *o, PROC *p)
106+{
107+ int ret = 0;
108+ char *oargv1, *pargv1;
109+ if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) {
110+ if (o->argv1 && p->argv1) {
111+ if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL)
112+ oargv1 = strdup(o->argv1);
113+ if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL)
114+ pargv1 = strdup(p->argv1);
115+ if (! strcmp(oargv1, pargv1)) {
116+ ret = 1;
117+ }
118+ free(oargv1);
119+ free(pargv1);
120+ }
121+ }
122+ return ret;
123+}
124+
125 /* Give usage message and exit. */
126 void usage(void)
127 {
128@@ -845,6 +892,7 @@ void nsyslog(int pri, char *fmt, ...)
129 #define PIDOF_SINGLE 0x01
130 #define PIDOF_OMIT 0x02
131 #define PIDOF_NETFS 0x04
132+#define PIDOF_OMIT_OMIT_MATCHES 0x08
133
134 /*
135 * Pidof functionality.
136@@ -861,6 +909,7 @@ int main_pidof(int argc, char **argv)
137 struct stat st;
138 char tmp[512];
139
140+ olist = (PROC*)0;
141 omit = (OMIT*)0;
142 nlist = (NFS*)0;
143 opterr = 0;
144@@ -868,7 +917,7 @@ int main_pidof(int argc, char **argv)
145 if ((token = getenv("PIDOF_NETFS")) && (strcmp(token,"no") != 0))
146 flags |= PIDOF_NETFS;
147
148- while ((opt = getopt(argc,argv,"hco:sxn")) != EOF) switch (opt) {
149+ while ((opt = getopt(argc,argv,"hcmo:sxn")) != EOF) switch (opt) {
150 case '?':
151 nsyslog(LOG_ERR,"invalid options on command line!\n");
152 closelog();
153@@ -907,6 +956,9 @@ int main_pidof(int argc, char **argv)
154 case 'x':
155 scripts_too++;
156 break;
157+ case 'm':
158+ flags |= PIDOF_OMIT_OMIT_MATCHES;
159+ break;
160 case 'n':
161 flags |= PIDOF_NETFS;
162 break;
163@@ -938,10 +990,13 @@ int main_pidof(int argc, char **argv)
164 pid_t spid = 0;
165 while ((p = get_next_from_pid_q(q))) {
166 if ((flags & PIDOF_OMIT) && omit) {
167- OMIT * optr;
168- for (optr = omit; optr; optr = optr->next) {
169+ PROC * optr;
170+ for (optr = olist; optr; optr = optr->next) {
171 if (optr->pid == p->pid)
172 break;
173+ if (flags & PIDOF_OMIT_OMIT_MATCHES)
174+ if (matches(optr, p))
175+ break;
176 }
177
178 /*
179@@ -977,6 +1032,7 @@ int main_pidof(int argc, char **argv)
180 if (!first)
181 printf("\n");
182
183+ clear_omit();
184 clear_mnt();
185
186 closelog();
187--
1881.8.1.2
189
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/inittab b/meta/recipes-core/sysvinit/sysvinit-inittab/inittab
new file mode 100644
index 0000000000..6abbdf4558
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab/inittab
@@ -0,0 +1,30 @@
1# /etc/inittab: init(8) configuration.
2# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
3
4# The default runlevel.
5id:5:initdefault:
6
7# Boot-time system configuration/initialization script.
8# This is run first except when booting in emergency (-b) mode.
9si::sysinit:/etc/init.d/rcS
10
11# What to do in single-user mode.
12~~:S:wait:/sbin/sulogin
13
14# /etc/init.d executes the S and K scripts upon change
15# of runlevel.
16#
17# Runlevel 0 is halt.
18# Runlevel 1 is single-user.
19# Runlevels 2-5 are multi-user.
20# Runlevel 6 is reboot.
21
22l0:0:wait:/etc/init.d/rc 0
23l1:1:wait:/etc/init.d/rc 1
24l2:2:wait:/etc/init.d/rc 2
25l3:3:wait:/etc/init.d/rc 3
26l4:4:wait:/etc/init.d/rc 4
27l5:5:wait:/etc/init.d/rc 5
28l6:6:wait:/etc/init.d/rc 6
29# Normally not reached, but fallthrough in case of emergency.
30z6:6:respawn:/sbin/sulogin
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
new file mode 100644
index 0000000000..30641dac88
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -0,0 +1,82 @@
1SUMMARY = "Inittab configuration for SysVinit"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
4
5PR = "r10"
6
7SRC_URI = "file://inittab"
8
9S = "${WORKDIR}/sysvinit-${PV}"
10
11INHIBIT_DEFAULT_DEPS = "1"
12
13do_compile() {
14 :
15}
16
17do_install() {
18 install -d ${D}${sysconfdir}
19 install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
20
21 tmp="${SERIAL_CONSOLES}"
22 for i in $tmp
23 do
24 j=`echo ${i} | sed s/\;/\ /g`
25 label=`echo ${i} | sed -e 's/^.*;tty//' -e 's/;.*//'`
26 echo "$label:12345:respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
27 done
28
29 if [ "${USE_VT}" = "1" ]; then
30 cat <<EOF >>${D}${sysconfdir}/inittab
31# ${base_sbindir}/getty invocations for the runlevels.
32#
33# The "id" field MUST be the same as the last
34# characters of the device (after "tty").
35#
36# Format:
37# <id>:<runlevels>:<action>:<process>
38#
39
40EOF
41
42 for n in ${SYSVINIT_ENABLED_GETTYS}
43 do
44 echo "$n:2345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
45 done
46 echo "" >> ${D}${sysconfdir}/inittab
47 fi
48}
49
50pkg_postinst_${PN} () {
51# run this on the target
52if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
53 tmp="${SERIAL_CONSOLES_CHECK}"
54 for i in $tmp
55 do
56 j=`echo ${i} | sed s/^.*\;//g`
57 if [ -z "`cat /proc/consoles | grep ${j}`" ]; then
58 sed -i /^.*${j}$/d /etc/inittab
59 fi
60 done
61 kill -HUP 1
62else
63 if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
64 exit 0
65 else
66 exit 1
67 fi
68fi
69}
70
71# USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf.
72# Set PACKAGE_ARCH appropriately.
73PACKAGE_ARCH = "${MACHINE_ARCH}"
74
75FILES_${PN} = "${sysconfdir}/inittab"
76CONFFILES_${PN} = "${sysconfdir}/inittab"
77
78USE_VT ?= "1"
79SYSVINIT_ENABLED_GETTYS ?= "1"
80
81
82
diff --git a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
new file mode 100755
index 0000000000..7d6518d981
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
@@ -0,0 +1,96 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides: bootlogd
4# Required-Start:
5# Required-Stop:
6# Default-Start: S
7# Default-Stop: 2 3 4 5
8# Short-Description: One of the first scripts to be executed. Starts or stops
9# the bootlogd log program. If this script is called as
10# "stop-bootlogd", it will stop the daemon instead of
11# starting it even when called with the "start" argument.
12#
13### END INIT INFO
14
15PATH=/sbin:/bin:/usr/sbin:/usr/bin
16DAEMON=/sbin/bootlogd
17NAME=bootlogd
18DESC="Bootlog daemon"
19
20# source function library
21. /etc/init.d/functions
22
23test -f $DAEMON || exit 0
24
25[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
26
27## set -e # not needed
28
29case "$BOOTLOGD_ENABLE" in
30 [Nn]*)
31 exit 0
32 ;;
33esac
34
35STOPPER=
36ACTION="$1"
37case "$0" in
38 *stop-bootlog*)
39 STOPPER=Y
40 if [ "$ACTION" = start ]
41 then
42 ACTION=stop
43 fi
44 ;;
45esac
46
47case "$ACTION" in
48 start)
49 echo -n "Starting $DESC: "
50 if [ -d /proc/1/. ]
51 then
52 umask 027
53 start-stop-daemon --start --quiet \
54 --exec $DAEMON -- -r -c
55 else
56 $DAEMON -r -c
57 fi
58 echo "$NAME."
59 ;;
60 stop)
61 echo -n "Stopping $DESC: "
62 start-stop-daemon --stop --quiet --exec $DAEMON
63
64 if [ "$STOPPER" ] && [ -f /var/log/boot ] && \
65 [ -f /var/log/boot~ ]
66 then
67 cd /var/log
68 chgrp adm boot
69 savelog -p -c 5 boot > /dev/null 2>&1
70 mv boot.0 boot
71 mv boot~ boot.0
72 fi
73
74 echo "$NAME."
75 ;;
76 restart|force-reload)
77 echo -n "Restarting $DESC: "
78 start-stop-daemon --stop --quiet --exec $DAEMON
79 sleep 1
80 start-stop-daemon --start --quiet --exec $DAEMON
81 echo "$NAME."
82 ;;
83 status)
84 status $DAEMON
85 exit $?
86 ;;
87 *)
88 N=${0##*/}
89 N=${N#[SK]??}
90 echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
91 exit 1
92 ;;
93esac
94
95exit 0
96
diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
new file mode 100755
index 0000000000..1f400d9e55
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -0,0 +1,179 @@
1#!/bin/sh
2#
3# rc This file is responsible for starting/stopping
4# services when the runlevel changes.
5#
6# Optimization feature:
7# A startup script is _not_ run when the service was
8# running in the previous runlevel and it wasn't stopped
9# in the runlevel transition (most Debian services don't
10# have K?? links in rc{1,2,3,4,5} )
11#
12# Author: Miquel van Smoorenburg <miquels@cistron.nl>
13# Bruce Perens <Bruce@Pixar.com>
14#
15# Version: @(#)rc 2.78 07-Nov-1999 miquels@cistron.nl
16#
17
18. /etc/default/rcS
19export VERBOSE
20
21startup_progress() {
22 step=$(($step + $step_change))
23 if [ "$num_steps" != "0" ]; then
24 progress=$((($step * $progress_size / $num_steps) + $first_step))
25 else
26 progress=$progress_size
27 fi
28 #echo "PROGRESS is $progress $runlevel $first_step + ($step of $num_steps) $step_change $progress_size"
29 #if type psplash-write >/dev/null 2>&1; then
30 # TMPDIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true
31 #fi
32 if [ -e /mnt/.psplash/psplash_fifo ]; then
33 echo "PROGRESS $progress" > /mnt/.psplash/psplash_fifo
34 fi
35}
36
37
38#
39# Start script or program.
40#
41startup() {
42 # Handle verbosity
43 [ "$VERBOSE" = very ] && echo "INIT: Running $@..."
44
45 case "$1" in
46 *.sh)
47 # Source shell script for speed.
48 (
49 trap - INT QUIT TSTP
50 scriptname=$1
51 shift
52 . $scriptname
53 )
54 ;;
55 *)
56 "$@"
57 ;;
58 esac
59 startup_progress
60}
61
62 # Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
63 trap ":" INT QUIT TSTP
64
65 # Set onlcr to avoid staircase effect.
66 stty onlcr 0>&1
67
68 # Now find out what the current and what the previous runlevel are.
69
70 runlevel=$RUNLEVEL
71 # Get first argument. Set new runlevel to this argument.
72 [ "$1" != "" ] && runlevel=$1
73 if [ "$runlevel" = "" ]
74 then
75 echo "Usage: $0 <runlevel>" >&2
76 exit 1
77 fi
78 previous=$PREVLEVEL
79 [ "$previous" = "" ] && previous=N
80
81 export runlevel previous
82
83 # Is there an rc directory for this new runlevel?
84 if [ -d /etc/rc$runlevel.d ]
85 then
86 # Find out where in the progress bar the initramfs got to.
87 PROGRESS_STATE=0
88 #if [ -f /dev/.initramfs/progress_state ]; then
89 # . /dev/.initramfs/progress_state
90 #fi
91
92 # Split the remaining portion of the progress bar into thirds
93 progress_size=$(((100 - $PROGRESS_STATE) / 3))
94
95 case "$runlevel" in
96 0|6)
97 # Count down from -100 to 0 and use the entire bar
98 first_step=-100
99 progress_size=100
100 step_change=1
101 ;;
102 S)
103 # Begin where the initramfs left off and use 2/3
104 # of the remaining space
105 first_step=$PROGRESS_STATE
106 progress_size=$(($progress_size * 2))
107 step_change=1
108 ;;
109 *)
110 # Begin where rcS left off and use the final 1/3 of
111 # the space (by leaving progress_size unchanged)
112 first_step=$(($progress_size * 2 + $PROGRESS_STATE))
113 step_change=1
114 ;;
115 esac
116
117 num_steps=0
118 for s in /etc/rc$runlevel.d/[SK]*; do
119 case "${s##/etc/rc$runlevel.d/S??}" in
120 gdm|xdm|kdm|reboot|halt)
121 break
122 ;;
123 esac
124 num_steps=$(($num_steps + 1))
125 done
126 step=0
127
128 # First, run the KILL scripts.
129 if [ $previous != N ]
130 then
131 for i in /etc/rc$runlevel.d/K[0-9][0-9]*
132 do
133 # Check if the script is there.
134 [ ! -f $i ] && continue
135
136 # Stop the service.
137 startup $i stop
138 done
139 fi
140
141 # Now run the START scripts for this runlevel.
142 for i in /etc/rc$runlevel.d/S*
143 do
144 [ ! -f $i ] && continue
145
146 if [ $previous != N ] && [ $previous != S ]
147 then
148 #
149 # Find start script in previous runlevel and
150 # stop script in this runlevel.
151 #
152 suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
153 stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
154 previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
155 #
156 # If there is a start script in the previous level
157 # and _no_ stop script in this level, we don't
158 # have to re-start the service.
159 #
160 [ -f $previous_start ] && [ ! -f $stop ] && continue
161 fi
162 case "$runlevel" in
163 0|6)
164 startup $i stop
165 ;;
166 *)
167 startup $i start
168 ;;
169 esac
170 done
171 fi
172
173#Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch
174if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; then
175 if type psplash-write >/dev/null 2>&1; then
176 TMPDIR=/mnt/.psplash psplash-write "QUIT" || true
177 umount -l /mnt/.psplash
178 fi
179fi
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS b/meta/recipes-core/sysvinit/sysvinit/rcS
new file mode 100755
index 0000000000..080b04f32f
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS
@@ -0,0 +1,34 @@
1#!/bin/sh
2#
3# rcS Call all S??* scripts in /etc/rcS.d in
4# numerical/alphabetical order.
5#
6# Version: @(#)/etc/init.d/rcS 2.76 19-Apr-1999 miquels@cistron.nl
7#
8
9PATH=/sbin:/bin:/usr/sbin:/usr/bin
10runlevel=S
11prevlevel=N
12umask 022
13export PATH runlevel prevlevel
14
15# Make sure proc is mounted
16#
17[ -d "/proc/1" ] || mount /proc
18
19#
20# Source defaults.
21#
22. /etc/default/rcS
23
24#
25# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
26#
27trap ":" INT QUIT TSTP
28
29#
30# Call all parts in order.
31#
32exec /etc/init.d/rc S
33
34
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS-default b/meta/recipes-core/sysvinit/sysvinit/rcS-default
new file mode 100644
index 0000000000..709cdf6ec5
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -0,0 +1,29 @@
1#
2# Defaults for the boot scripts in /etc/rcS.d
3#
4
5# Time files in /tmp are kept in days.
6TMPTIME=0
7# Set to yes if you want sulogin to be spawned on bootup
8SULOGIN=no
9# Set to no if you want to be able to login over telnet/rlogin
10# before system startup is complete (as soon as inetd is started)
11DELAYLOGIN=no
12# Assume that the BIOS clock is set to UTC time (recommended)
13UTC=yes
14# Set VERBOSE to "no" if you would like a more quiet bootup.
15VERBOSE=no
16# Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically
17EDITMOTD=no
18# Whether to fsck root on boot
19ENABLE_ROOTFS_FSCK=no
20# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
21FSCKFIX=yes
22# Set TICKADJ to the correct tick value for this specific machine
23#TICKADJ=10000
24# Enable caching in populate-volatile.sh
25VOLATILE_ENABLE_CACHE=yes
26# Indicate whether the rootfs is intended to be read-only or not.
27# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs.
28# Normally you should not change this value.
29ROOTFS_READ_ONLY=no
diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
new file mode 100644
index 0000000000..c06eac44cf
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
@@ -0,0 +1,97 @@
1SUMMARY = "System-V like init"
2DESCRIPTION = "This package is required to boot in most configurations. It provides the /sbin/init program. This is the first process started on boot, and the last process terminated before the system halts."
3HOMEPAGE = "http://savannah.nongnu.org/projects/sysvinit/"
4SECTION = "base"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
7 file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
8PR = "r11"
9
10RDEPENDS_${PN} = "${PN}-inittab"
11
12SRC_URI = "http://download.savannah.gnu.org/releases-noredirect/sysvinit/sysvinit-${PV}.tar.bz2 \
13 file://install.patch \
14 file://crypt-lib.patch \
15 file://pidof-add-m-option.patch \
16 file://rcS-default \
17 file://rc \
18 file://rcS \
19 file://bootlogd.init"
20
21SRC_URI[md5sum] = "6eda8a97b86e0a6f59dabbf25202aa6f"
22SRC_URI[sha256sum] = "60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5df1519"
23
24S = "${WORKDIR}/sysvinit-${PV}"
25B = "${S}/src"
26
27inherit update-alternatives
28DEPENDS_append = " update-rc.d-native base-passwd"
29
30ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last mesg utmpdump wall"
31
32ALTERNATIVE_PRIORITY = "200"
33
34ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
35ALTERNATIVE_PRIORITY[init] = "50"
36
37ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
38ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
39ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
40ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
41ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
42ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
43
44ALTERNATIVE_${PN}-pidof = "pidof"
45ALTERNATIVE_LINK_NAME[pidof] = "${base_bindir}/pidof"
46
47ALTERNATIVE_${PN}-sulogin = "sulogin"
48ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
49
50ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 utmpdump.1"
51
52ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
53ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
54ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
55ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
56ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
57ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
58
59PACKAGES =+ "sysvinit-pidof sysvinit-sulogin"
60FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*"
61FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5"
62FILES_sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit"
63
64RDEPENDS_${PN} += "sysvinit-pidof initscripts-functions"
65
66CFLAGS_prepend = "-D_GNU_SOURCE "
67export LCRYPT = "-lcrypt"
68EXTRA_OEMAKE += "'base_bindir=${base_bindir}' \
69 'base_sbindir=${base_sbindir}' \
70 'bindir=${bindir}' \
71 'sbindir=${sbindir}' \
72 'sysconfdir=${sysconfdir}' \
73 'includedir=${includedir}' \
74 'mandir=${mandir}'"
75
76do_install () {
77 oe_runmake 'ROOT=${D}' install
78
79 install -d ${D}${sysconfdir} \
80 ${D}${sysconfdir}/default \
81 ${D}${sysconfdir}/init.d
82 for level in S 0 1 2 3 4 5 6; do
83 install -d ${D}${sysconfdir}/rc$level.d
84 done
85
86 install -m 0644 ${WORKDIR}/rcS-default ${D}${sysconfdir}/default/rcS
87 install -m 0755 ${WORKDIR}/rc ${D}${sysconfdir}/init.d
88 install -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d
89 install -m 0755 ${WORKDIR}/bootlogd.init ${D}${sysconfdir}/init.d/bootlogd
90 ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd
91
92 update-rc.d -r ${D} bootlogd start 07 S .
93 update-rc.d -r ${D} stop-bootlogd start 99 2 3 4 5 .
94
95 chown root.shutdown ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
96 chmod o-x,u+s ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
97}
diff --git a/meta/recipes-core/uclibc/site_config/funcs b/meta/recipes-core/uclibc/site_config/funcs
new file mode 100644
index 0000000000..ccc85392d7
--- /dev/null
+++ b/meta/recipes-core/uclibc/site_config/funcs
@@ -0,0 +1,474 @@
1a64l
2abs
3access
4__adjtimex
5alarm
6alphasort
7argz_append
8__argz_count
9argz_create_sep
10argz_insert
11__argz_next
12argz_next
13__argz_stringify
14argz_stringify
15asprintf
16atexit
17atof
18atoi
19bcmp
20bcopy
21bindresvport
22bind_textdomain_codeset
23btowc
24bzero
25calloc
26canonicalize_file_name
27catgets
28cfgetospeed
29cfsetispeed
30cfsetspeed
31chmod
32chown
33chroot
34clock
35close
36closedir
37closelog
38confstr
39connect
40daemon
41dcgettext
42difftime
43dirfd
44dirname
45dngettext
46dup2
47ecvt
48endgrent
49endmntent
50endpwent
51endutent
52endutxent
53epoll_ctl
54err
55ether_hostton
56ether_ntohost
57euidaccess
58execv
59fchdir
60fchmod
61fchmodat
62fchown
63fchownat
64fcntl
65fcvt
66fdatasync
67fdopendir
68feof_unlocked
69fgets_unlocked
70fgetxattr
71finite
72flistxattr
73flock
74flockfile
75fnmatch
76fork
77fpathconf
78__fpending
79fprintf
80free
81freeaddrinfo
82freeifaddrs
83fseeko
84__fsetlocking
85fsetxattr
86fstat64
87fstat
88fstatfs
89fsync
90ftello
91ftime
92ftruncate
93funlockfile
94futimes
95futimesat
96gai_strerror
97gcvt
98getaddrinfo
99getc_unlocked
100getcwd
101getdelim
102getdomainname
103getdtablesize
104getegid
105getenv
106geteuid
107getgid
108getgrent
109getgrent_r
110getgrgid_r
111getgrnam
112getgrnam_r
113getgrouplist
114getgroups
115gethostbyaddr_r
116gethostbyname2
117gethostbyname
118gethostbyname_r
119gethostent
120gethostid
121gethostname
122getifaddrs
123getline
124getloadavg
125getmntent
126getmsg
127getnameinfo
128getnetbyaddr_r
129getnetgrent_r
130getopt
131getopt_long
132getopt_long_only
133getpagesize
134getpass
135getpeername
136getpgrp
137getpid
138getppid
139getprotoent_r
140getpwent
141getpwent_r
142getpwnam
143getpwnam_r
144getpwuid
145getpwuid_r
146getresuid
147getrlimit
148getrusage
149getservbyname
150getservbyname_r
151getservbyport_r
152getservent
153getservent_r
154getspnam
155getspnam_r
156gettimeofday
157getttyent
158getttynam
159getuid
160getusershell
161getutent
162getutid
163getutline
164getutmp
165getutmpx
166getutxent
167getutxid
168getutxline
169getwd
170getxattr
171glob
172gmtime
173gmtime_r
174grantpt
175group_member
176herror
177hstrerror
178iconv
179iconv_open
180if_freenameindex
181if_indextoname
182if_nameindex
183if_nametoindex
184index
185inet_addr
186inet_aton
187inet_ntoa
188inet_ntop
189inet_pton
190initgroups
191innetgr
192iruserok
193isascii
194isatty
195isblank
196isgraph
197isinf
198isnan
199isprint
200isspace
201iswalnum
202iswcntrl
203iswctype
204iswprint
205iswspace
206iswupper
207isxdigit
208kill
209killpg
210lchown
211lckpwdf
212lgetxattr
213link
214listxattr
215llistxattr
216localtime
217localtime_r
218lockf
219lrand48
220lsearch
221lseek64
222lsetxattr
223lstat
224mallinfo
225malloc
226mblen
227mbrlen
228mbrtowc
229mbsinit
230mbsrtowcs
231mbtowc
232memalign
233memchr
234memcmp
235memcpy
236memmove
237mempcpy
238memrchr
239memset
240mkdir
241mkdirat
242mkdtemp
243mkfifo
244mknod
245mkstemp64
246mkstemp
247mktime
248mlock
249mmap
250mtrace
251munlock
252munmap
253nanosleep
254nice
255nl_langinfo
256ntp_adjtime
257ntp_gettime
258_obstack_free
259on_exit
260open64
261open
262openat
263opendir
264openlog
265pathconf
266pipe
267poll
268popen
269posix_memalign
270prctl
271pread
272printf
273__progname
274pselect
275pthread_mutex_lock
276ptsname
277putenv
278putgrent
279putpwent
280putspent
281pututline
282pututxline
283putwc
284pwrite
285qsort
286raise
287rand
288random
289rand_r
290read
291readdir
292readdir_r
293readlink
294realloc
295realpath
296re_comp
297recvmsg
298re_exec
299regcomp
300regexec
301remove
302rename
303re_search
304rmdir
305rpmatch
306rresvport_af
307ruserok
308ruserok_af
309sbrk
310scandir
311sched_setscheduler
312sched_yield
313__secure_getenv
314select
315semctl
316semget
317sendmsg
318setbuf
319setbuffer
320setegid
321setenv
322seteuid
323setgid
324setgroups
325sethostname
326setitimer
327_setjmp
328setjmp
329setlinebuf
330setlocale
331setmntent
332setpgid
333setpgrp
334setpriority
335setregid
336setresgid
337setresuid
338setreuid
339setrlimit
340setsid
341setsockopt
342settimeofday
343setuid
344setutent
345setutxent
346setvbuf
347setxattr
348sgetspent
349shmat
350shmctl
351shmdt
352shmget
353shutdown
354sigaction
355sigaddset
356sigaltstack
357sigblock
358sigemptyset
359sighold
360siginterrupt
361signal
362sigprocmask
363sigset
364sigsetmask
365sigstack
366sigsuspend
367sigvec
368snprintf
369socket
370socketpair
371sprintf
372srand48
373srand
374srandom
375sscanf
376stat
377statfs
378statvfs
379stime
380stpcpy
381strcasecmp
382strcasestr
383strchr
384strchrnul
385strcmp
386strcspn
387strdup
388strerror
389strerror_r
390strftime
391strlen
392strncasecmp
393strncmp
394strndup
395strnlen
396strpbrk
397strptime
398strrchr
399strsep
400strsignal
401strspn
402strstr
403strtod
404strtoimax
405strtok_r
406strtol
407strtoll
408strtoul
409strtoull
410strtoumax
411strverscmp
412strxfrm
413symlink
414sync
415sysconf
416sysctl
417sysinfo
418syslog
419_sys_siglist
420sys_siglist
421system
422tcgetattr
423tcgetpgrp
424tcsetattr
425tcsetpgrp
426time
427timegm
428times
429timezone
430tmpnam
431towlower
432towupper
433truncate
434tsearch
435ttyname
436tzset
437ulimit
438umask
439uname
440unlink
441unsetenv
442unshare
443updwtmp
444updwtmpx
445usleep
446ustat
447utime
448utimes
449utmpname
450utmpxname
451valloc
452vasprintf
453verrx
454vfork
455vfprintf
456vfscanf
457vhangup
458vprintf
459vsnprintf
460vsprintf
461wait3
462wait4
463waitpid
464wcrtomb
465wcscoll
466wcsdup
467wcslen
468wctob
469wctomb
470wctype
471wcwidth
472wmemchr
473wmemcpy
474wmempcpy
diff --git a/meta/recipes-core/uclibc/site_config/headers b/meta/recipes-core/uclibc/site_config/headers
new file mode 100644
index 0000000000..609ab53797
--- /dev/null
+++ b/meta/recipes-core/uclibc/site_config/headers
@@ -0,0 +1,156 @@
1aio.h
2alloca.h
3argz.h
4arpa/inet.h
5arpa/nameser.h
6asm/byteorder.h
7asm/ioctls.h
8asm/page.h
9asm/types.h
10assert.h
11byteswap.h
12crypt.h
13ctype.h
14dirent.h
15dlfcn.h
16elf.h
17endian.h
18err.h
19errno.h
20execinfo.h
21fcntl.h
22features.h
23float.h
24fstab.h
25ftw.h
26getopt.h
27glob.h
28grp.h
29iconv.h
30ifaddrs.h
31inttypes.h
32langinfo.h
33lastlog.h
34libgen.h
35libintl.h
36limits.h
37linux/capability.h
38linux/fd.h
39linux/fs.h
40linux/hayesesp.h
41linux/hdreg.h
42linux/icmp.h
43linux/in6.h
44linux/joystick.h
45linux/ptrace.h
46linux/serial.h
47linux/sonypi.h
48linux/unistd.h
49linux/utsname.h
50linux/version.h
51locale.h
52malloc.h
53math.h
54mcheck.h
55memory.h
56mntent.h
57mqueue.h
58netdb.h
59net/if.h
60netinet/ether.h
61netinet/in.h
62netinet/ip6.h
63netinet/ip.h
64netinet/tcp.h
65netinet/udp.h
66netipx/ipx.h
67net/route.h
68paths.h
69poll.h
70pthread.h
71pty.h
72pwd.h
73regex.h
74resolv.h
75rpc/rpc.h
76rpc/types.h
77sched.h
78scsi/scsi.h
79search.h
80semaphore.h
81setjmp.h
82sgtty.h
83shadow.h
84signal.h
85stdarg.h
86stdbool.h
87stdc
88stddef.h
89stdint.h
90stdio.h
91stdlib.h
92string.h
93strings.h
94stropts.h
95sys/bitypes.h
96sys/cdefs.h
97sys/dir.h
98sys/epoll.h
99sysexits.h
100sys/fcntl.h
101sys/file.h
102sys/fsuid.h
103sys/ioctl.h
104sys/ipc.h
105syslog.h
106sys/mman.h
107sys/mount.h
108sys/mtio.h
109sys/param.h
110sys/poll.h
111sys/prctl.h
112sys/ptrace.h
113sys/queue.h
114sys/reg.h
115sys/resource.h
116sys/select.h
117sys/sem.h
118sys/shm.h
119sys/signal.h
120sys/socket.h
121sys/socketvar.h
122sys/soundcard.h
123sys/statfs.h
124sys/stat.h
125sys/statvfs.h
126sys/stropts.h
127sys/swap.h
128sys/sysctl.h
129sys/sysinfo.h
130sys/sysmacros.h
131sys/termios.h
132sys/timeb.h
133sys/time.h
134sys/times.h
135sys/timex.h
136sys/types.h
137sys/uio.h
138sys/un.h
139sys/unistd.h
140sys/user.h
141sys/utsname.h
142sys/vfs.h
143sys/wait.h
144termio.h
145termios.h
146time.h
147ttyent.h
148ulimit.h
149unistd.h
150ustat.h
151utime.h
152utmp.h
153utmpx.h
154values.h
155wchar.h
156wctype.h
diff --git a/meta/recipes-core/uclibc/site_config/types b/meta/recipes-core/uclibc/site_config/types
new file mode 100644
index 0000000000..178bd85a00
--- /dev/null
+++ b/meta/recipes-core/uclibc/site_config/types
@@ -0,0 +1,21 @@
1char
2char *
3double
4float
5int
6long
7long double
8long int
9long long
10long long int
11short
12short int
13signed char
14unsigned char
15unsigned int
16unsigned long
17unsigned long int
18unsigned long long int
19unsigned short
20unsigned short int
21void *
diff --git a/meta/recipes-core/uclibc/uclibc-config.inc b/meta/recipes-core/uclibc/uclibc-config.inc
new file mode 100644
index 0000000000..8b9e41c64d
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-config.inc
@@ -0,0 +1,142 @@
1DEPENDS += "kern-tools-native"
2inherit cml1
3#
4# Set the ARCH environment variable for uClibc compilation.
5# Return value must match one of the architectures known to uClibc:
6# libc/sysdeps/*/*
7#
8
9valid_archs = "\
10alpha \
11arm \
12avr32 \
13bfin \
14c6x \
15cris \
16e1 \
17frv \
18h8300 \
19hppa \
20i386 \
21i960 \
22ia64 \
23m68k \
24microblaze \
25mips \
26nios \
27nios2 \
28powerpc \
29sh \
30sh64 \
31sparc \
32v850 \
33vax \
34x86_64 \
35xtensa \
36"
37def map_uclibc_arch(a, d):
38 """Return the uClibc architecture for the given TARGET_ARCH."""
39 import re
40
41 valid_archs = d.getVar('valid_archs', True).split()
42
43 if re.match('^(arm|sa110).*', a):
44 return 'arm'
45 elif re.match('^(i.86|athlon)$', a):
46 return 'i386'
47 elif re.match('^mips.*', a):
48 return 'mips'
49 elif re.match('^parisc.*', a):
50 return 'hppa'
51 elif re.match('^ppc.*', a):
52 return 'powerpc'
53 elif re.match('^s390.*', a):
54 return 's390'
55 elif re.match('^sh.*', a):
56 return 'sh'
57 elif re.match('^(sun|sparc).*', a):
58 return 'sparc'
59 elif re.match('^xtensa.*', a):
60 return 'xtensa'
61 elif a in valid_archs:
62 return a
63 else:
64 bb.error("cannot map '%s' to a uClibc architecture" % a)
65
66export UCLIBC_ARCH = "${@map_uclibc_arch(d.getVar('TARGET_ARCH', True), d)}"
67
68def map_uclibc_abi(o, d):
69 """Return the uClibc ABI for the given TARGET_OS."""
70 import re
71
72 arch = d.getVar('TARGET_ARCH', True)
73 if map_uclibc_arch(d.getVar('TARGET_ARCH', True), d) == "arm":
74 if re.match('.*eabi$', o):
75 return 'ARM_EABI'
76 else:
77 return 'ARM_OABI'
78 # FIXME: This is inaccurate! Handle o32, n32, n64
79 elif re.match('^mips.*64$', arch):
80 return 'MIPS_N64_ABI'
81 elif re.match('^mips.*', arch):
82 return 'MIPS_O32_ABI'
83 return ""
84
85export UCLIBC_ABI = "${@map_uclibc_abi(d.getVar('TARGET_OS', True), d)}"
86
87def map_uclibc_endian(a, d):
88 """Return the uClibc endianess for the given TARGET_ARCH."""
89 import re
90
91 # Always BE
92 if re.match('^(avr32|e1|frv|(parisc|hppa)|m68k|microblaze|powerpc.*|(sparc|sun).*)$', a):
93 return 'BIG'
94 # Possibly BE
95 elif re.match('^(((arm|sa110).*eb)|h8300.*eb|(parisc|hppa).*eb|mips|mips64|sh.*eb|xtensa.*eb)$', a):
96 return 'BIG'
97 return 'LITTLE'
98
99export UCLIBC_ENDIAN = "${@map_uclibc_endian(d.getVar('TARGET_ARCH', True), d)}"
100
101# internal helper
102def uclibc_cfg(feature, features, tokens, cnf, rem):
103 if type(tokens) == type(""):
104 tokens = [tokens]
105 rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
106 if type(features) == type([]) and feature in features:
107 cnf.extend([token + '=y' for token in tokens])
108 else:
109 cnf.extend(['# ' + token + ' is not set' for token in tokens])
110
111# Map distro features to config settings
112def features_to_uclibc_settings(d):
113 cnf, rem = ([], [])
114 distro_features = d.getVar('DISTRO_FEATURES', True).split()
115 uclibc_cfg('ipv4', distro_features, 'UCLIBC_HAS_IPV4', cnf, rem)
116 uclibc_cfg('ipv6', distro_features, 'UCLIBC_HAS_IPV6', cnf, rem)
117 uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem)
118 uclibc_cfg('nls', distro_features, 'UCLIBC_HAS_LOCALE', cnf, rem)
119 uclibc_cfg('thumb-interwork', distro_features,'USE_BX', cnf, rem)
120 uclibc_cfg('xattr', distro_features, 'UCLIBC_HAS_XATTR', cnf, rem)
121 uclibc_cfg('ssp', distro_features, 'UCLIBC_HAS_SSP', cnf, rem)
122 uclibc_cfg('argp', distro_features, 'UCLIBC_HAS_ARGP', cnf, rem)
123 uclibc_cfg('libc-posix-clang-wchar', distro_features,'UCLIBC_HAS_WCHAR', cnf, rem)
124 return "\n".join(cnf), "\n".join(rem)
125# X, Y = ${@features_to_uclibc_settings(d)}
126# unfortunately doesn't seem to work with bitbake, workaround:
127def features_to_uclibc_conf(d):
128 cnf, rem = features_to_uclibc_settings(d)
129 return cnf
130def features_to_uclibc_del(d):
131 cnf, rem = features_to_uclibc_settings(d)
132 return rem
133
134# returns all the elements from the src uri that are .cfg files
135def find_cfgs(d):
136 sources=src_patches(d, True)
137 sources_list=[]
138 for s in sources:
139 if s.endswith('.cfg'):
140 sources_list.append(s)
141
142 return sources_list
diff --git a/meta/recipes-core/uclibc/uclibc-git.inc b/meta/recipes-core/uclibc/uclibc-git.inc
new file mode 100644
index 0000000000..0649acaab5
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git.inc
@@ -0,0 +1,29 @@
1SRCREV="5eddde8f094ef52dca06695cc598e3b2556dcccb"
2
3PV = "0.9.33+git${SRCPV}"
4
5FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/uclibc-git' ], d)}"
6
7SRC_URI = "git://uclibc.org/uClibc.git;branch=master \
8 file://uClibc.machine \
9 file://uClibc.distro \
10 file://obstack.cfg \
11 file://locale.cfg \
12 file://uclibc_enable_log2_test.patch \
13 file://powerpc_copysignl.patch \
14 file://argp-support.patch \
15 file://argp-headers.patch \
16 file://remove_attribute_optimize_Os.patch \
17 file://compile-arm-fork-with-O2.patch \
18 file://orign_path.patch \
19 file://0001-atexit_old-Do-not-add-it-to-shared-libc.patch \
20 file://0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch \
21 file://0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \
22 file://0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch \
23 file://0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch \
24 file://0001-Add-eventfd_read-and-eventfd_write.patch \
25 file://0002-wire-setns-syscall.patch \
26 file://0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch \
27 file://0004-Add-clock_adjtime-syscall.patch \
28 "
29S = "${WORKDIR}/git"
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch
new file mode 100644
index 0000000000..dd0efc0f36
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-Add-eventfd_read-and-eventfd_write.patch
@@ -0,0 +1,120 @@
1From e3aae24ede969e2dede1aa19c2ee520cab71ce11 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 20 Feb 2014 00:30:18 -0800
4Subject: [PATCH 1/3] Add eventfd_read() and eventfd_write()
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Upstream-Status: Pending
8---
9 libc/sysdeps/linux/common/Makefile.in | 2 ++
10 libc/sysdeps/linux/common/eventfd_read.c | 27 +++++++++++++++++++++++++++
11 libc/sysdeps/linux/common/eventfd_write.c | 28 ++++++++++++++++++++++++++++
12 libc/sysdeps/linux/common/sys/eventfd.h | 4 ----
13 4 files changed, 57 insertions(+), 4 deletions(-)
14 create mode 100644 libc/sysdeps/linux/common/eventfd_read.c
15 create mode 100644 libc/sysdeps/linux/common/eventfd_write.c
16
17diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
18index dbf0b0f..45d2e21 100644
19--- a/libc/sysdeps/linux/common/Makefile.in
20+++ b/libc/sysdeps/linux/common/Makefile.in
21@@ -25,6 +25,8 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
22 capset.c \
23 dup3.c \
24 eventfd.c \
25+ eventfd_read.c \
26+ eventfd_write.c \
27 inotify.c \
28 ioperm.c \
29 iopl.c \
30diff --git a/libc/sysdeps/linux/common/eventfd_read.c b/libc/sysdeps/linux/common/eventfd_read.c
31new file mode 100644
32index 0000000..75f2aaa
33--- /dev/null
34+++ b/libc/sysdeps/linux/common/eventfd_read.c
35@@ -0,0 +1,27 @@
36+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
37+ This file is part of the GNU C Library.
38+
39+ The GNU C Library is free software; you can redistribute it and/or
40+ modify it under the terms of the GNU Lesser General Public
41+ License as published by the Free Software Foundation; either
42+ version 2.1 of the License, or (at your option) any later version.
43+
44+ The GNU C Library is distributed in the hope that it will be useful,
45+ but WITHOUT ANY WARRANTY; without even the implied warranty of
46+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
47+ Lesser General Public License for more details.
48+
49+ You should have received a copy of the GNU Lesser General Public
50+ License along with the GNU C Library; if not, see
51+ <http://www.gnu.org/licenses/>. */
52+
53+#include <errno.h>
54+#include <unistd.h>
55+#include <sys/eventfd.h>
56+
57+
58+int
59+eventfd_read (int fd, eventfd_t *value)
60+{
61+ return read (fd, value, sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0;
62+}
63diff --git a/libc/sysdeps/linux/common/eventfd_write.c b/libc/sysdeps/linux/common/eventfd_write.c
64new file mode 100644
65index 0000000..e1509cf
66--- /dev/null
67+++ b/libc/sysdeps/linux/common/eventfd_write.c
68@@ -0,0 +1,28 @@
69+/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
70+ This file is part of the GNU C Library.
71+
72+ The GNU C Library is free software; you can redistribute it and/or
73+ modify it under the terms of the GNU Lesser General Public
74+ License as published by the Free Software Foundation; either
75+ version 2.1 of the License, or (at your option) any later version.
76+
77+ The GNU C Library is distributed in the hope that it will be useful,
78+ but WITHOUT ANY WARRANTY; without even the implied warranty of
79+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
80+ Lesser General Public License for more details.
81+
82+ You should have received a copy of the GNU Lesser General Public
83+ License along with the GNU C Library; if not, see
84+ <http://www.gnu.org/licenses/>. */
85+
86+#include <errno.h>
87+#include <unistd.h>
88+#include <sys/eventfd.h>
89+
90+
91+int
92+eventfd_write (int fd, eventfd_t value)
93+{
94+ return write (fd, &value,
95+ sizeof (eventfd_t)) != sizeof (eventfd_t) ? -1 : 0;
96+}
97diff --git a/libc/sysdeps/linux/common/sys/eventfd.h b/libc/sysdeps/linux/common/sys/eventfd.h
98index 1bf785f..91b265b 100644
99--- a/libc/sysdeps/linux/common/sys/eventfd.h
100+++ b/libc/sysdeps/linux/common/sys/eventfd.h
101@@ -33,16 +33,12 @@ __BEGIN_DECLS
102 value to COUNT. */
103 extern int eventfd (int __count, int __flags) __THROW;
104
105-#if 0 /* not (yet) implemented in uClibc */
106-
107 /* Read event counter and possibly wait for events. */
108 extern int eventfd_read (int __fd, eventfd_t *__value);
109
110 /* Increment event counter. */
111 extern int eventfd_write (int __fd, eventfd_t __value);
112
113-#endif
114-
115 __END_DECLS
116
117 #endif /* sys/eventfd.h */
118--
1191.9.0
120
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch
new file mode 100644
index 0000000000..4ac765c334
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-Revert-utent.c-wtent.c-move-functions-from-utxent.c.patch
@@ -0,0 +1,319 @@
1Upstream-Status: Pending
2
3From 096abf14d2dc978607ccd8a0d7f42da65d8991f3 Mon Sep 17 00:00:00 2001
4From: Khem Raj <raj.khem@gmail.com>
5Date: Sun, 9 Sep 2012 22:00:04 -0700
6Subject: [PATCH] Revert "utent.c, wtent.c: move functions from utxent.c"
7
8This reverts commit 84135275cfeebc0b233c1c96eeada4d4178a0b18.
9---
10 include/utmp.h | 8 +++++
11 libc/misc/utmp/utent.c | 80 +++++++++++------------------------------------
12 libc/misc/utmp/utxent.c | 4 +--
13 libc/misc/utmp/wtent.c | 14 ++-------
14 4 files changed, 30 insertions(+), 76 deletions(-)
15
16Index: git/include/utmp.h
17===================================================================
18--- git.orig/include/utmp.h 2013-01-21 16:37:18.000000000 -0800
19+++ git/include/utmp.h 2013-01-21 16:40:56.987583099 -0800
20@@ -56,30 +56,37 @@
21 /* Append entry UTMP to the wtmp-like file WTMP_FILE. */
22 extern void updwtmp (const char *__wtmp_file, const struct utmp *__utmp)
23 __THROW;
24+libc_hidden_proto(updwtmp)
25
26 /* Change name of the utmp file to be examined. */
27 extern int utmpname (const char *__file) __THROW;
28+libc_hidden_proto(utmpname)
29
30 /* Read next entry from a utmp-like file. */
31 extern struct utmp *getutent (void) __THROW;
32+libc_hidden_proto(getutent)
33
34 /* Reset the input stream to the beginning of the file. */
35 extern void setutent (void) __THROW;
36+libc_hidden_proto(setutent)
37
38 /* Close the current open file. */
39 extern void endutent (void) __THROW;
40+libc_hidden_proto(endutent)
41
42 /* Search forward from the current point in the utmp file until the
43 next entry with a ut_type matching ID->ut_type. */
44 extern struct utmp *getutid (const struct utmp *__id) __THROW;
45+libc_hidden_proto(getutid)
46
47 /* Search forward from the current point in the utmp file until the
48 next entry with a ut_line matching LINE->ut_line. */
49 extern struct utmp *getutline (const struct utmp *__line) __THROW;
50+libc_hidden_proto(getutline)
51
52 /* Write out entry pointed to by UTMP_PTR into the utmp file. */
53 extern struct utmp *pututline (const struct utmp *__utmp_ptr) __THROW;
54-
55+libc_hidden_proto(pututline)
56
57 #if 0 /* def __USE_MISC */
58 /* Reentrant versions of the file for handling utmp files. */
59Index: git/libc/misc/utmp/utent.c
60===================================================================
61--- git.orig/libc/misc/utmp/utent.c 2013-01-21 16:37:18.000000000 -0800
62+++ git/libc/misc/utmp/utent.c 2013-01-21 16:38:14.035578638 -0800
63@@ -19,9 +19,6 @@
64 #include <errno.h>
65 #include <string.h>
66 #include <utmp.h>
67-#ifdef __UCLIBC_HAS_UTMPX__
68-# include <utmpx.h>
69-#endif
70 #include <not-cancel.h>
71
72 #include <bits/uClibc_mutex.h>
73@@ -34,7 +31,7 @@
74 static const char *static_ut_name = default_file_name;
75
76 /* This function must be called with the LOCK held */
77-static void __setutent_unlocked(void)
78+static void __setutent(void)
79 {
80 if (static_fd < 0) {
81 static_fd = open_not_cancel_2(static_ut_name, O_RDWR | O_CLOEXEC);
82@@ -53,24 +50,19 @@
83 lseek(static_fd, 0, SEEK_SET);
84 }
85 #if defined __UCLIBC_HAS_THREADS__
86-static void __setutent(void)
87+void setutent(void)
88 {
89 __UCLIBC_MUTEX_LOCK(utmplock);
90- __setutent_unlocked();
91+ __setutent();
92 __UCLIBC_MUTEX_UNLOCK(utmplock);
93 }
94 #else
95-static void __setutent(void);
96-strong_alias(__setutent_unlocked,__setutent)
97-#endif
98 strong_alias(__setutent,setutent)
99-
100-#ifdef __UCLIBC_HAS_UTMPX__
101-strong_alias(__setutent,setutxent)
102 #endif
103+libc_hidden_def(setutent)
104
105 /* This function must be called with the LOCK held */
106-static struct utmp *__getutent_unlocked(void)
107+static struct utmp *__getutent(void)
108 {
109 if (static_fd < 0) {
110 __setutent();
111@@ -86,27 +78,19 @@
112 return NULL;
113 }
114 #if defined __UCLIBC_HAS_THREADS__
115-static struct utmp *__getutent(void)
116+struct utmp *getutent(void)
117 {
118 struct utmp *ret;
119
120 __UCLIBC_MUTEX_LOCK(utmplock);
121- ret = __getutent_unlocked();
122+ ret = __getutent();
123 __UCLIBC_MUTEX_UNLOCK(utmplock);
124 return ret;
125 }
126 #else
127-static struct utmp *__getutent(void);
128-strong_alias(__getutent_unlocked,__getutent)
129-#endif
130 strong_alias(__getutent,getutent)
131-
132-#ifdef __UCLIBC_HAS_UTMPX__
133-struct utmpx *getutxent(void)
134-{
135- return (struct utmpx *) __getutent ();
136-}
137 #endif
138+libc_hidden_def(getutent)
139
140 static void __endutent(void)
141 {
142@@ -117,13 +101,10 @@
143 __UCLIBC_MUTEX_UNLOCK(utmplock);
144 }
145 strong_alias(__endutent,endutent)
146-
147-#ifdef __UCLIBC_HAS_UTMPX__
148-strong_alias(__endutent,endutxent)
149-#endif
150+libc_hidden_def(endutent)
151
152 /* This function must be called with the LOCK held */
153-static struct utmp *__getutid_unlocked(const struct utmp *utmp_entry)
154+static struct utmp *__getutid(const struct utmp *utmp_entry)
155 {
156 struct utmp *lutmp;
157 unsigned type;
158@@ -133,7 +114,7 @@
159 type = utmp_entry->ut_type - 1;
160 type /= 4;
161
162- while ((lutmp = __getutent_unlocked()) != NULL) {
163+ while ((lutmp = __getutent()) != NULL) {
164 if (type == 0 && lutmp->ut_type == utmp_entry->ut_type) {
165 /* one of RUN_LVL, BOOT_TIME, NEW_TIME, OLD_TIME */
166 return lutmp;
167@@ -147,34 +128,26 @@
168 return NULL;
169 }
170 #if defined __UCLIBC_HAS_THREADS__
171-static struct utmp *__getutid(const struct utmp *utmp_entry)
172+struct utmp *getutid(const struct utmp *utmp_entry)
173 {
174 struct utmp *ret;
175
176 __UCLIBC_MUTEX_LOCK(utmplock);
177- ret = __getutid_unlocked(utmp_entry);
178+ ret = __getutid(utmp_entry);
179 __UCLIBC_MUTEX_UNLOCK(utmplock);
180 return ret;
181 }
182 #else
183-static struct utmp *__getutid(const struct utmp *utmp_entry);
184-strong_alias(__getutid_unlocked,__getutid)
185-#endif
186 strong_alias(__getutid,getutid)
187-
188-#ifdef __UCLIBC_HAS_UTMPX__
189-struct utmpx *getutxid(const struct utmpx *utmp_entry)
190-{
191- return (struct utmpx *) __getutid ((const struct utmp *) utmp_entry);
192-}
193 #endif
194+libc_hidden_def(getutid)
195
196 static struct utmp *__getutline(const struct utmp *utmp_entry)
197 {
198 struct utmp *lutmp;
199
200 __UCLIBC_MUTEX_LOCK(utmplock);
201- while ((lutmp = __getutent_unlocked()) != NULL) {
202+ while ((lutmp = __getutent()) != NULL) {
203 if (lutmp->ut_type == USER_PROCESS || lutmp->ut_type == LOGIN_PROCESS) {
204 if (strncmp(lutmp->ut_line, utmp_entry->ut_line, sizeof(lutmp->ut_line)) == 0) {
205 break;
206@@ -185,13 +158,7 @@
207 return lutmp;
208 }
209 strong_alias(__getutline,getutline)
210-
211-#ifdef __UCLIBC_HAS_UTMPX__
212-struct utmpx *getutxline(const struct utmpx *utmp_entry)
213-{
214- return (struct utmpx *) __getutline ((const struct utmp *) utmp_entry);
215-}
216-#endif
217+libc_hidden_def(getutline)
218
219 static struct utmp *__pututline(const struct utmp *utmp_entry)
220 {
221@@ -200,7 +167,7 @@
222 the file pointer where they want it, everything will work out. */
223 lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
224
225- if (__getutid_unlocked(utmp_entry) != NULL)
226+ if (__getutid(utmp_entry) != NULL)
227 lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
228 else
229 lseek(static_fd, (off_t) 0, SEEK_END);
230@@ -211,13 +178,7 @@
231 return (struct utmp *)utmp_entry;
232 }
233 strong_alias(__pututline,pututline)
234-
235-#ifdef __UCLIBC_HAS_UTMPX__
236-struct utmpx *pututxline (const struct utmpx *utmp_entry)
237-{
238- return (struct utmpx *) __pututline ((const struct utmp *) utmp_entry);
239-}
240-#endif
241+libc_hidden_def(pututline)
242
243 static int __utmpname(const char *new_ut_name)
244 {
245@@ -241,7 +202,4 @@
246 return 0; /* or maybe return -(static_ut_name != new_ut_name)? */
247 }
248 strong_alias(__utmpname,utmpname)
249-
250-#ifdef __UCLIBC_HAS_UTMPX__
251-strong_alias(__utmpname,utmpxname)
252-#endif
253+libc_hidden_def(utmpname)
254Index: git/libc/misc/utmp/utxent.c
255===================================================================
256--- git.orig/libc/misc/utmp/utxent.c 2013-01-21 16:37:18.000000000 -0800
257+++ git/libc/misc/utmp/utxent.c 2013-01-21 16:38:14.035578638 -0800
258@@ -13,7 +13,6 @@
259 #include <utmpx.h>
260 #include <utmp.h>
261
262-#if 0 /* moved to utent.c */
263 void setutxent(void)
264 {
265 setutent ();
266@@ -49,12 +48,10 @@
267 return utmpname (new_ut_name);
268 }
269
270-/* moved to wtent.c */
271 void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
272 {
273 updwtmp (wtmpx_file, (const struct utmp *) utmpx);
274 }
275-#endif
276
277 /* Copy the information in UTMPX to UTMP. */
278 void getutmp (const struct utmpx *utmpx, struct utmp *utmp)
279@@ -107,3 +104,4 @@
280 utmpx->ut_time = utmp->ut_time;
281 #endif
282 }
283+
284Index: git/libc/misc/utmp/wtent.c
285===================================================================
286--- git.orig/libc/misc/utmp/wtent.c 2013-01-21 16:37:18.000000000 -0800
287+++ git/libc/misc/utmp/wtent.c 2013-01-21 16:38:14.035578638 -0800
288@@ -11,9 +11,6 @@
289 #include <time.h>
290 #include <unistd.h>
291 #include <utmp.h>
292-#ifdef __UCLIBC_HAS_UTMPX__
293-# include <utmpx.h>
294-#endif
295 #include <fcntl.h>
296 #include <sys/file.h>
297 #include <not-cancel.h>
298@@ -36,7 +33,7 @@
299 }
300 #endif
301
302-static void __updwtmp(const char *wtmp_file, const struct utmp *lutmp)
303+void updwtmp(const char *wtmp_file, const struct utmp *lutmp)
304 {
305 int fd;
306
307@@ -49,11 +46,4 @@
308 }
309 }
310 }
311-strong_alias(__updwtmp,updwtmp)
312-
313-#ifdef __UCLIBC_HAS_UTMPX__
314-void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
315-{
316- __updwtmp (wtmpx_file, (const struct utmp *) utmpx);
317-}
318-#endif
319+libc_hidden_def(updwtmp)
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch b/meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch
new file mode 100644
index 0000000000..b6dfce483e
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-atexit_old-Do-not-add-it-to-shared-libc.patch
@@ -0,0 +1,44 @@
1From 74667582526b39a1906228574d73a6528f4587eb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 23 Jun 2012 13:26:30 -0700
4Subject: [PATCH] atexit_old: Do not add it to shared libc
5
6atexit should only be in either uclibc_nonshared.a
7shared libc case or libc.a in static build case
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Upstream-Status: Pending
12---
13 libc/stdlib/Makefile.in | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
17index 3166b8e..3d686d9 100644
18--- a/libc/stdlib/Makefile.in
19+++ b/libc/stdlib/Makefile.in
20@@ -60,7 +60,6 @@ CSRC-$(if $(findstring yyy,$(UCLIBC_HAS_FLOATS)$(UCLIBC_HAS_WCHAR)$(UCLIBC_HAS_X
21
22 # multi source _atexit.c
23 CSRC-y += __cxa_atexit.c __cxa_finalize.c __exit_handler.c exit.c on_exit.c
24-CSRC-$(COMPAT_ATEXIT) += old_atexit.c
25
26 STDLIB_DIR := $(top_srcdir)libc/stdlib
27 STDLIB_OUT := $(top_builddir)libc/stdlib
28@@ -70,11 +69,12 @@ STDLIB_OBJ := $(patsubst %.c,$(STDLIB_OUT)/%.o,$(CSRC-y))
29
30 libc-y += $(STDLIB_OBJ)
31 libc-static-y += $(STDLIB_OUT)/atexit.o $(STDLIB_OUT)/system.o
32+libc-static-$(COMPAT_ATEXIT) += $(STDLIB_OUT)/old_atexit.o
33 libc-shared-y += $(STDLIB_OUT)/system.oS
34
35 # this should always be the PIC version, because it could be used in shared libs
36 libc-nonshared-y += $(STDLIB_OUT)/atexit.os
37-
38+libc-nonshared-$(COMPAT_ATEXIT) += $(STDLIB_OUT)/old_atexit.os
39 libc-nomulti-y += $(STDLIB_OUT)/labs.o $(STDLIB_OUT)/atol.o $(STDLIB_OUT)/_stdlib_strto_l.o $(STDLIB_OUT)/_stdlib_strto_ll.o
40 libc-nomulti-$(UCLIBC_HAS_XLOCALE) += $(STDLIB_OUT)/_stdlib_strto_l_l.o $(STDLIB_OUT)/_stdlib_strto_ll_l.o
41
42--
431.7.9.5
44
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch b/meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch
new file mode 100644
index 0000000000..ecb9d31645
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-librt-Use-nodefaultlibs-instead-of-nostdlib.patch
@@ -0,0 +1,33 @@
1From 95f9b6f37152b8316735d3c86c0db963ff59e22d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 23 Jun 2012 16:51:52 -0700
4Subject: [PATCH] librt: Use -nodefaultlibs instead of -nostdlib
5
6nostdlib disables linking in startup files too which is not
7what we want here since it needs to resolve __dso_handle
8which comes from crtbeginS.o, otherwise librt has this
9undefined reference to a weak undefined __dso_handle that
10shows up as error (with gold linker)
11when shared libraries are being built which are
12linking in librt
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15Upstream-Status: Pending
16---
17 librt/Makefile.in | 1 +
18 1 file changed, 1 insertion(+)
19
20Index: git/librt/Makefile.in
21===================================================================
22--- git.orig/librt/Makefile.in 2012-06-24 10:32:59.512653237 -0700
23+++ git/librt/Makefile.in 2012-06-24 11:31:00.660821666 -0700
24@@ -15,6 +15,9 @@
25 ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
26 LIBS-librt.so += $(top_builddir)lib/libdl.so $(top_builddir)lib/libpthread.so
27 endif
28+START_FILE-librt.so := $(SHARED_START_FILES)
29+END_FILE-librt.so := $(SHARED_END_FILES)
30+
31
32 librt_FULL_NAME := librt-$(VERSION).so
33
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch
new file mode 100644
index 0000000000..7e7c5793f1
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-arm-Move-aeabi_read_tp-to-uclibc_nonshared.a.patch
@@ -0,0 +1,28 @@
1From 714f543f4fa8fb3911449b6ce1517481359e0cff Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 23 Jun 2012 14:21:17 -0700
4Subject: [PATCH] nptl/arm: Move aeabi_read_tp to uclibc_nonshared.a
5
6Otherwise it creates wrong references from shared libs
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Upstream-Status: Pending
10---
11 libc/sysdeps/linux/arm/Makefile.arch | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
13
14Index: git/libc/sysdeps/linux/arm/Makefile.arch
15===================================================================
16--- git.orig/libc/sysdeps/linux/arm/Makefile.arch 2013-05-23 11:13:32.000000000 -0700
17+++ git/libc/sysdeps/linux/arm/Makefile.arch 2013-05-23 11:16:18.304333131 -0700
18@@ -13,7 +13,9 @@
19 vfork.S clone.S
20
21 SSRC-$(UCLIBC_HAS_LFS) += mmap64.S
22-SSRC-$(UCLIBC_HAS_THREADS_NATIVE) += libc-aeabi_read_tp.S libc-thumb_atomics.S
23+SSRC-$(UCLIBC_HAS_THREADS_NATIVE) += libc-thumb_atomics.S
24+libc-nonshared-$(UCLIBC_HAS_THREADS_NATIVE) += $(ARCH_OUT)/libc-aeabi_read_tp.os
25+libc-static-$(UCLIBC_HAS_THREADS_NATIVE) += $(ARCH_OUT)/libc-aeabi_read_tp.o
26 CSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += makecontext.c
27 SSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += getcontext.S setcontext.S swapcontext.S
28
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch
new file mode 100644
index 0000000000..297a40bd04
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch
@@ -0,0 +1,74 @@
1From d021e6252b33e779857846714fb1899a25c9965d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 23 Jun 2012 15:59:01 -0700
4Subject: [PATCH] nptl/atfork: Hide pthread_atfork in shared versions
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Upstream-Status: Pending
8---
9 libpthread/nptl/Makefile.in | 4 +++-
10 libpthread/nptl/pthread_atfork.c | 12 ++++++++++--
11 2 files changed, 13 insertions(+), 3 deletions(-)
12
13diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
14index 158bcae..3ef7175 100644
15--- a/libpthread/nptl/Makefile.in
16+++ b/libpthread/nptl/Makefile.in
17@@ -16,6 +16,7 @@ libc-shared-routines-y = forward.c libc-cancellation.c
18 libc-static-routines-y = alloca_cutoff.c libc-cancellation.c
19 libpthread-shared-only-routines-y = version.c
20 libpthread-static-only-routines-y = pthread_atfork.c
21+
22 libpthread-routines- += $(notdir $(wildcard $(libpthread_DIR)/gen_*.c)) # dummy generated files
23 libpthread-routines- += allocatestack.c # dummy included by pthread_create.c
24 libpthread-routines- += pthread_mutex_getprioceiling.c pthread_mutex_setprioceiling.c # XXX: delete those or use them!
25@@ -208,7 +209,7 @@ CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables
26 CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables
27
28 CFLAGS-pt-system.c = -fexceptions -I$(top_srcdir)libc/stdlib
29-
30+CFLAGS-pthread_atfork.c = -DNOT_IN_libc
31 #
32 # The rest of this file is uClibc specific.
33 #
34@@ -224,3 +225,4 @@ CFLAGS-OMIT-alloca_cutoff.c = $(CFLAGS-nptl)
35 CFLAGS-OMIT-forward.c = $(CFLAGS-nptl)
36 CFLAGS-OMIT-libc-lowlevelock.c = $(CFLAGS-nptl)
37 CFLAGS-OMIT-libc-cancellation.c = $(CFLAGS-nptl)
38+
39diff --git a/libpthread/nptl/pthread_atfork.c b/libpthread/nptl/pthread_atfork.c
40index e607d49..6224c17 100644
41--- a/libpthread/nptl/pthread_atfork.c
42+++ b/libpthread/nptl/pthread_atfork.c
43@@ -38,13 +38,17 @@
44 #include <fork.h>
45
46 /* This is defined by newer gcc version unique for each module. */
47-extern void *__dso_handle __attribute__ ((__weak__));
48- //,__visibility__ ("hidden")));
49+extern void *__dso_handle __attribute__ ((__weak__,
50+ __visibility__ ("hidden")));
51
52
53 /* Hide the symbol so that no definition but the one locally in the
54 executable or DSO is used. */
55 int
56+#ifndef __pthread_atfork
57+/* Don't mark the compatibility function as hidden. */
58+attribute_hidden
59+#endif
60 __pthread_atfork (
61 void (*prepare) (void),
62 void (*parent) (void),
63@@ -53,4 +57,8 @@ __pthread_atfork (
64 return __register_atfork (prepare, parent, child,
65 &__dso_handle == NULL ? NULL : __dso_handle);
66 }
67+#ifndef __pthread_atfork
68+extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
69+ void (*child) (void)) attribute_hidden;
70 strong_alias (__pthread_atfork, pthread_atfork)
71+#endif
72--
731.7.9.5
74
diff --git a/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch b/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch
new file mode 100644
index 0000000000..94c6f68571
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0002-wire-setns-syscall.patch
@@ -0,0 +1,68 @@
1From db575359d4b8164ad6c2ac5f36c7a50c065a2864 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 20 Feb 2014 00:44:34 -0800
4Subject: [PATCH 2/3] wire setns syscall
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Upstream-Status: Pending
8---
9 libc/sysdeps/linux/common/Makefile.in | 1 +
10 libc/sysdeps/linux/common/bits/sched.h | 4 ++++
11 libc/sysdeps/linux/common/setns.c | 18 ++++++++++++++++++
12 3 files changed, 23 insertions(+)
13 create mode 100644 libc/sysdeps/linux/common/setns.c
14
15diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
16index 45d2e21..10d9884 100644
17--- a/libc/sysdeps/linux/common/Makefile.in
18+++ b/libc/sysdeps/linux/common/Makefile.in
19@@ -45,6 +45,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
20 sendfile.c \
21 setfsgid.c \
22 setfsuid.c \
23+ setns.c \
24 setresgid.c \
25 setresuid.c \
26 signalfd.c \
27diff --git a/libc/sysdeps/linux/common/bits/sched.h b/libc/sysdeps/linux/common/bits/sched.h
28index a5eb6ee..9436f66 100644
29--- a/libc/sysdeps/linux/common/bits/sched.h
30+++ b/libc/sysdeps/linux/common/bits/sched.h
31@@ -85,6 +85,10 @@ extern int unshare (int __flags) __THROW;
32
33 /* Get index of currently used CPU. */
34 extern int sched_getcpu (void) __THROW;
35+
36+/* Switch process to namespace of type NSTYPE indicated by FD. */
37+extern int setns (int __fd, int __nstype) __THROW;
38+
39 #endif
40
41 __END_DECLS
42diff --git a/libc/sysdeps/linux/common/setns.c b/libc/sysdeps/linux/common/setns.c
43new file mode 100644
44index 0000000..376bf26
45--- /dev/null
46+++ b/libc/sysdeps/linux/common/setns.c
47@@ -0,0 +1,18 @@
48+/* vi: set sw=4 ts=4: */
49+/*
50+ * setns() for uClibc
51+ *
52+ * Copyright (C) 2014 Khem Raj <raj.khem@gmail.com>
53+ *
54+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
55+ */
56+
57+#include <sys/syscall.h>
58+#include <sched.h>
59+
60+/*
61+ * setns()
62+ */
63+#ifdef __NR_setns
64+_syscall2(int, setns, int, fd, int, nstype)
65+#endif
66--
671.9.0
68
diff --git a/meta/recipes-core/uclibc/uclibc-git/0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch b/meta/recipes-core/uclibc/uclibc-git/0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch
new file mode 100644
index 0000000000..f4387db9c7
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0003-fcntl.h-Define-F_SETPIPE_SZ-and-F_GETPIPE_SZ.patch
@@ -0,0 +1,377 @@
1From 7791d129d777e481a1e429815edcd05978438840 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 20 Feb 2014 01:12:14 -0800
4Subject: [PATCH 3/3] fcntl.h: Define F_SETPIPE_SZ and F_GETPIPE_SZ
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Upstream-Status: Pending
8---
9 libc/sysdeps/linux/alpha/bits/fcntl.h | 2 ++
10 libc/sysdeps/linux/arc/bits/fcntl.h | 2 ++
11 libc/sysdeps/linux/arm/bits/fcntl.h | 2 ++
12 libc/sysdeps/linux/bfin/bits/fcntl.h | 2 ++
13 libc/sysdeps/linux/cris/bits/fcntl.h | 2 ++
14 libc/sysdeps/linux/e1/bits/fcntl.h | 2 ++
15 libc/sysdeps/linux/frv/bits/fcntl.h | 2 ++
16 libc/sysdeps/linux/h8300/bits/fcntl.h | 2 ++
17 libc/sysdeps/linux/hppa/bits/fcntl.h | 2 ++
18 libc/sysdeps/linux/i386/bits/fcntl.h | 2 ++
19 libc/sysdeps/linux/i960/bits/fcntl.h | 2 ++
20 libc/sysdeps/linux/ia64/bits/fcntl.h | 2 ++
21 libc/sysdeps/linux/m68k/bits/fcntl.h | 2 ++
22 libc/sysdeps/linux/metag/bits/fcntl.h | 2 ++
23 libc/sysdeps/linux/microblaze/bits/fcntl.h | 2 ++
24 libc/sysdeps/linux/mips/bits/fcntl.h | 2 ++
25 libc/sysdeps/linux/nios/bits/fcntl.h | 2 ++
26 libc/sysdeps/linux/nios2/bits/fcntl.h | 2 ++
27 libc/sysdeps/linux/powerpc/bits/fcntl.h | 2 ++
28 libc/sysdeps/linux/sh/bits/fcntl.h | 2 ++
29 libc/sysdeps/linux/sh64/bits/fcntl.h | 2 ++
30 libc/sysdeps/linux/sparc/bits/fcntl.h | 2 ++
31 libc/sysdeps/linux/v850/bits/fcntl.h | 2 ++
32 libc/sysdeps/linux/vax/bits/fcntl.h | 2 ++
33 libc/sysdeps/linux/x86_64/bits/fcntl.h | 2 ++
34 libc/sysdeps/linux/xtensa/bits/fcntl.h | 2 ++
35 26 files changed, 52 insertions(+)
36
37diff --git a/libc/sysdeps/linux/alpha/bits/fcntl.h b/libc/sysdeps/linux/alpha/bits/fcntl.h
38index dd32529..a44be9e 100644
39--- a/libc/sysdeps/linux/alpha/bits/fcntl.h
40+++ b/libc/sysdeps/linux/alpha/bits/fcntl.h
41@@ -94,6 +94,8 @@
42 # define F_NOTIFY 1026 /* Request notfications on a directory. */
43 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
44 close-on-exit set on new fd. */
45+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
46+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
47 #endif
48
49 /* for F_[GET|SET]FD */
50diff --git a/libc/sysdeps/linux/arc/bits/fcntl.h b/libc/sysdeps/linux/arc/bits/fcntl.h
51index 71136da..1cb9600 100755
52--- a/libc/sysdeps/linux/arc/bits/fcntl.h
53+++ b/libc/sysdeps/linux/arc/bits/fcntl.h
54@@ -87,6 +87,8 @@
55 # define F_NOTIFY 1026 /* Request notfications on a directory. */
56 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
57 close-on-exit set on new fd. */
58+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
59+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
60 #endif
61
62 /* For F_[GET|SET]FL. */
63diff --git a/libc/sysdeps/linux/arm/bits/fcntl.h b/libc/sysdeps/linux/arm/bits/fcntl.h
64index f1a54f0..aedc154 100644
65--- a/libc/sysdeps/linux/arm/bits/fcntl.h
66+++ b/libc/sysdeps/linux/arm/bits/fcntl.h
67@@ -99,6 +99,8 @@
68 # define F_NOTIFY 1026 /* Request notfications on a directory. */
69 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
70 close-on-exit set on new fd. */
71+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
72+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
73 #endif
74
75 /* For F_[GET|SET]FD. */
76diff --git a/libc/sysdeps/linux/bfin/bits/fcntl.h b/libc/sysdeps/linux/bfin/bits/fcntl.h
77index c6cba56..e987824 100644
78--- a/libc/sysdeps/linux/bfin/bits/fcntl.h
79+++ b/libc/sysdeps/linux/bfin/bits/fcntl.h
80@@ -98,6 +98,8 @@
81 # define F_NOTIFY 1026 /* Request notfications on a directory. */
82 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
83 close-on-exit set on new fd. */
84+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
85+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
86 #endif
87
88 /* For F_[GET|SET]FL. */
89diff --git a/libc/sysdeps/linux/cris/bits/fcntl.h b/libc/sysdeps/linux/cris/bits/fcntl.h
90index acc5e25..029bb80 100644
91--- a/libc/sysdeps/linux/cris/bits/fcntl.h
92+++ b/libc/sysdeps/linux/cris/bits/fcntl.h
93@@ -99,6 +99,8 @@
94 # define F_NOTIFY 1026 /* Request notfications on a directory. */
95 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
96 close-on-exit set on new fd. */
97+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
98+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
99 #endif
100
101 /* For F_[GET|SET]FL. */
102diff --git a/libc/sysdeps/linux/e1/bits/fcntl.h b/libc/sysdeps/linux/e1/bits/fcntl.h
103index da699c8..2e0e6ba 100644
104--- a/libc/sysdeps/linux/e1/bits/fcntl.h
105+++ b/libc/sysdeps/linux/e1/bits/fcntl.h
106@@ -93,6 +93,8 @@
107 # define F_NOTIFY 1026 /* Request notfications on a directory. */
108 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
109 close-on-exit set on new fd. */
110+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
111+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
112 #endif
113
114 /* For F_[GET|SET]FL. */
115diff --git a/libc/sysdeps/linux/frv/bits/fcntl.h b/libc/sysdeps/linux/frv/bits/fcntl.h
116index 3aacc9d..5a7d9ef 100644
117--- a/libc/sysdeps/linux/frv/bits/fcntl.h
118+++ b/libc/sysdeps/linux/frv/bits/fcntl.h
119@@ -95,6 +95,8 @@
120 # define F_NOTIFY 1026 /* Request notfications on a directory. */
121 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
122 close-on-exit set on new fd. */
123+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
124+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
125 #endif
126
127 /* For F_[GET|SET]FL. */
128diff --git a/libc/sysdeps/linux/h8300/bits/fcntl.h b/libc/sysdeps/linux/h8300/bits/fcntl.h
129index d0b8310..45deec4 100644
130--- a/libc/sysdeps/linux/h8300/bits/fcntl.h
131+++ b/libc/sysdeps/linux/h8300/bits/fcntl.h
132@@ -93,6 +93,8 @@
133 # define F_NOTIFY 1026 /* Request notfications on a directory. */
134 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
135 close-on-exit set on new fd. */
136+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
137+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
138 #endif
139
140 /* For F_[GET|SET]FL. */
141diff --git a/libc/sysdeps/linux/hppa/bits/fcntl.h b/libc/sysdeps/linux/hppa/bits/fcntl.h
142index 1bb41ce..abb3372 100644
143--- a/libc/sysdeps/linux/hppa/bits/fcntl.h
144+++ b/libc/sysdeps/linux/hppa/bits/fcntl.h
145@@ -96,6 +96,8 @@
146 # define F_NOTIFY 1026 /* Request notfications on a directory. */
147 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
148 close-on-exit set on new fd. */
149+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
150+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
151 #endif
152
153 /* for F_[GET|SET]FL */
154diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h
155index d48e62a..79b69d4 100644
156--- a/libc/sysdeps/linux/i386/bits/fcntl.h
157+++ b/libc/sysdeps/linux/i386/bits/fcntl.h
158@@ -99,6 +99,8 @@
159 # define F_NOTIFY 1026 /* Request notfications on a directory. */
160 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
161 close-on-exit set on new fd. */
162+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
163+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
164 #endif
165
166 /* For F_[GET|SET]FD. */
167diff --git a/libc/sysdeps/linux/i960/bits/fcntl.h b/libc/sysdeps/linux/i960/bits/fcntl.h
168index e2fcbe6..f6e145d 100644
169--- a/libc/sysdeps/linux/i960/bits/fcntl.h
170+++ b/libc/sysdeps/linux/i960/bits/fcntl.h
171@@ -93,6 +93,8 @@
172 # define F_NOTIFY 1026 /* Request notfications on a directory. */
173 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
174 close-on-exit set on new fd. */
175+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
176+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
177 #endif
178
179 /* For F_[GET|SET]FL. */
180diff --git a/libc/sysdeps/linux/ia64/bits/fcntl.h b/libc/sysdeps/linux/ia64/bits/fcntl.h
181index 1ff0ed5..fedefb6 100644
182--- a/libc/sysdeps/linux/ia64/bits/fcntl.h
183+++ b/libc/sysdeps/linux/ia64/bits/fcntl.h
184@@ -95,6 +95,8 @@
185 # define F_NOTIFY 1026 /* Request notfications on a directory. */
186 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
187 close-on-exit set on new fd. */
188+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
189+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
190 #endif
191
192 /* For F_[GET|SET]FD. */
193diff --git a/libc/sysdeps/linux/m68k/bits/fcntl.h b/libc/sysdeps/linux/m68k/bits/fcntl.h
194index d7beb6c..66df337 100644
195--- a/libc/sysdeps/linux/m68k/bits/fcntl.h
196+++ b/libc/sysdeps/linux/m68k/bits/fcntl.h
197@@ -98,6 +98,8 @@
198 # define F_NOTIFY 1026 /* Request notfications on a directory. */
199 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
200 close-on-exit set on new fd. */
201+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
202+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
203 #endif
204
205 /* For F_[GET|SET]FL. */
206diff --git a/libc/sysdeps/linux/metag/bits/fcntl.h b/libc/sysdeps/linux/metag/bits/fcntl.h
207index c4f641b..e10abd7 100644
208--- a/libc/sysdeps/linux/metag/bits/fcntl.h
209+++ b/libc/sysdeps/linux/metag/bits/fcntl.h
210@@ -100,6 +100,8 @@
211 # define F_NOTIFY 1026 /* Request notfications on a directory. */
212 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
213 close-on-exit set on new fd. */
214+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
215+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
216 #endif
217
218 /* For F_[GET|SET]FD. */
219diff --git a/libc/sysdeps/linux/microblaze/bits/fcntl.h b/libc/sysdeps/linux/microblaze/bits/fcntl.h
220index a2e3573..20b7597 100644
221--- a/libc/sysdeps/linux/microblaze/bits/fcntl.h
222+++ b/libc/sysdeps/linux/microblaze/bits/fcntl.h
223@@ -98,6 +98,8 @@
224 # define F_NOTIFY 1026 /* Request notfications on a directory. */
225 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
226 close-on-exit set on new fd. */
227+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
228+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
229 # define F_SETPIPE_SZ 1031 /* Set of pipe page size array */
230 # define F_GETPIPE_SZ 1032 /* Get of pipe page size array */
231 #endif
232diff --git a/libc/sysdeps/linux/mips/bits/fcntl.h b/libc/sysdeps/linux/mips/bits/fcntl.h
233index 4291f6e..8c4c115 100644
234--- a/libc/sysdeps/linux/mips/bits/fcntl.h
235+++ b/libc/sysdeps/linux/mips/bits/fcntl.h
236@@ -111,6 +111,8 @@
237 # define F_NOTIFY 1026 /* Request notfications on a directory. */
238 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
239 close-on-exit set on new fd. */
240+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
241+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
242 #endif
243
244 /* For F_[GET|SET]FL. */
245diff --git a/libc/sysdeps/linux/nios/bits/fcntl.h b/libc/sysdeps/linux/nios/bits/fcntl.h
246index 5854c18..36ca766 100644
247--- a/libc/sysdeps/linux/nios/bits/fcntl.h
248+++ b/libc/sysdeps/linux/nios/bits/fcntl.h
249@@ -96,6 +96,8 @@
250 # define F_NOTIFY 1026 /* Request notfications on a directory. */
251 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
252 close-on-exit set on new fd. */
253+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
254+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
255 #endif
256
257 /* For F_[GET|SET]FL. */
258diff --git a/libc/sysdeps/linux/nios2/bits/fcntl.h b/libc/sysdeps/linux/nios2/bits/fcntl.h
259index d7beb6c..66df337 100644
260--- a/libc/sysdeps/linux/nios2/bits/fcntl.h
261+++ b/libc/sysdeps/linux/nios2/bits/fcntl.h
262@@ -98,6 +98,8 @@
263 # define F_NOTIFY 1026 /* Request notfications on a directory. */
264 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
265 close-on-exit set on new fd. */
266+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
267+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
268 #endif
269
270 /* For F_[GET|SET]FL. */
271diff --git a/libc/sysdeps/linux/powerpc/bits/fcntl.h b/libc/sysdeps/linux/powerpc/bits/fcntl.h
272index 217f54a..d150a31 100644
273--- a/libc/sysdeps/linux/powerpc/bits/fcntl.h
274+++ b/libc/sysdeps/linux/powerpc/bits/fcntl.h
275@@ -99,6 +99,8 @@
276 # define F_NOTIFY 1026 /* Request notfications on a directory. */
277 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
278 close-on-exit set on new fd. */
279+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
280+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
281 #endif
282
283 /* For F_[GET|SET]FD. */
284diff --git a/libc/sysdeps/linux/sh/bits/fcntl.h b/libc/sysdeps/linux/sh/bits/fcntl.h
285index 5c9f047..aceaec6 100644
286--- a/libc/sysdeps/linux/sh/bits/fcntl.h
287+++ b/libc/sysdeps/linux/sh/bits/fcntl.h
288@@ -99,6 +99,8 @@
289 # define F_NOTIFY 1026 /* Request notfications on a directory. */
290 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
291 close-on-exit set on new fd. */
292+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
293+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
294 #endif
295
296 /* For F_[GET|SET]FD. */
297diff --git a/libc/sysdeps/linux/sh64/bits/fcntl.h b/libc/sysdeps/linux/sh64/bits/fcntl.h
298index ff741cb..b319e8b 100644
299--- a/libc/sysdeps/linux/sh64/bits/fcntl.h
300+++ b/libc/sysdeps/linux/sh64/bits/fcntl.h
301@@ -95,6 +95,8 @@
302 # define F_NOTIFY 1026 /* Request notfications on a directory. */
303 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
304 close-on-exit set on new fd. */
305+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
306+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
307 #endif
308
309 /* For F_[GET|SET]FL. */
310diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h
311index 235d2ad..7e80d9e 100644
312--- a/libc/sysdeps/linux/sparc/bits/fcntl.h
313+++ b/libc/sysdeps/linux/sparc/bits/fcntl.h
314@@ -106,6 +106,8 @@
315 # define F_NOTIFY 1026 /* Request notfications on a directory. */
316 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
317 close-on-exit set on new fd. */
318+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
319+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
320 #endif
321
322 #if __WORDSIZE == 64
323diff --git a/libc/sysdeps/linux/v850/bits/fcntl.h b/libc/sysdeps/linux/v850/bits/fcntl.h
324index d0b8310..45deec4 100644
325--- a/libc/sysdeps/linux/v850/bits/fcntl.h
326+++ b/libc/sysdeps/linux/v850/bits/fcntl.h
327@@ -93,6 +93,8 @@
328 # define F_NOTIFY 1026 /* Request notfications on a directory. */
329 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
330 close-on-exit set on new fd. */
331+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
332+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
333 #endif
334
335 /* For F_[GET|SET]FL. */
336diff --git a/libc/sysdeps/linux/vax/bits/fcntl.h b/libc/sysdeps/linux/vax/bits/fcntl.h
337index ff5bff3..a30d5e1 100644
338--- a/libc/sysdeps/linux/vax/bits/fcntl.h
339+++ b/libc/sysdeps/linux/vax/bits/fcntl.h
340@@ -92,6 +92,8 @@
341 # define F_NOTIFY 1026 /* Request notfications on a directory. */
342 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
343 close-on-exit set on new fd. */
344+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
345+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
346 #endif
347
348 /* For F_[GET|SET]FL. */
349diff --git a/libc/sysdeps/linux/x86_64/bits/fcntl.h b/libc/sysdeps/linux/x86_64/bits/fcntl.h
350index a899dcf..02e011d 100644
351--- a/libc/sysdeps/linux/x86_64/bits/fcntl.h
352+++ b/libc/sysdeps/linux/x86_64/bits/fcntl.h
353@@ -113,6 +113,8 @@
354 # define F_NOTIFY 1026 /* Request notfications on a directory. */
355 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
356 close-on-exit set on new fd. */
357+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
358+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
359 #endif
360
361 /* For F_[GET|SET]FD. */
362diff --git a/libc/sysdeps/linux/xtensa/bits/fcntl.h b/libc/sysdeps/linux/xtensa/bits/fcntl.h
363index 5d28547..4e9aa7e 100644
364--- a/libc/sysdeps/linux/xtensa/bits/fcntl.h
365+++ b/libc/sysdeps/linux/xtensa/bits/fcntl.h
366@@ -99,6 +99,8 @@
367 # define F_NOTIFY 1026 /* Request notfications on a directory. */
368 # define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
369 close-on-exit set on new fd. */
370+# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */
371+# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */
372 #endif
373
374 /* For F_[GET|SET]FD. */
375--
3761.9.0
377
diff --git a/meta/recipes-core/uclibc/uclibc-git/0004-Add-clock_adjtime-syscall.patch b/meta/recipes-core/uclibc/uclibc-git/0004-Add-clock_adjtime-syscall.patch
new file mode 100644
index 0000000000..3062ae4abc
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0004-Add-clock_adjtime-syscall.patch
@@ -0,0 +1,73 @@
1From 8e19e651145554fbcb90179f3dfbc7ea8a07c900 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 15 Mar 2014 09:32:20 -0700
4Subject: [PATCH 4/4] Add clock_adjtime syscall
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7---
8 include/sys/timex.h | 5 ++++-
9 libc/sysdeps/linux/common/Makefile.in | 2 +-
10 libc/sysdeps/linux/common/clock_adjtime.c | 15 +++++++++++++++
11 3 files changed, 20 insertions(+), 2 deletions(-)
12 create mode 100644 libc/sysdeps/linux/common/clock_adjtime.c
13
14diff --git a/include/sys/timex.h b/include/sys/timex.h
15index 621afce..9082a28 100644
16--- a/include/sys/timex.h
17+++ b/include/sys/timex.h
18@@ -20,6 +20,7 @@
19
20 #include <features.h>
21 #include <sys/time.h>
22+#include <time.h>
23
24 /* These definitions from linux/timex.h as of 2.2.0. */
25
26@@ -125,7 +126,9 @@ libc_hidden_proto(adjtimex)
27 extern int ntp_gettime (struct ntptimeval *__ntv) __THROW;
28 extern int ntp_adjtime (struct timex *__tntx) __THROW;
29 #endif
30-
31+#if defined __UCLIBC_HAS_REALTIME__
32+extern int clock_adjtime (clockid_t __clock_id, struct timex *__ntx) __THROW;
33+#endif
34 __END_DECLS
35
36 #endif /* sys/timex.h */
37diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
38index 10d9884..bb985b6 100644
39--- a/libc/sysdeps/linux/common/Makefile.in
40+++ b/libc/sysdeps/linux/common/Makefile.in
41@@ -84,7 +84,7 @@ CSRC-$(ARCH_USE_MMU) += msync.c
42 CSRC-$(UCLIBC_BSD_SPECIFIC) += mincore.c setdomainname.c
43 CSRC-$(UCLIBC_NTP_LEGACY) += ntp_gettime.c
44 # aio_cancel|aio_error|aio_fsync|aio_read|aio_return|aio_suspend|aio_write|clock_getres|clock_gettime|clock_settime|clock_settime|fdatasync|lio_listio|mlockall|munlockall|mlock|munlock|mq_close|mq_getattr|mq_notify|mq_open|mq_receive|mq_timedreceive|mq_send|mq_timedsend|mq_setattr|mq_unlink|nanosleep|sched_getparam|sched_get_priority_max|sched_get_priority_min|sched_getscheduler|sched_rr_get_interval|sched_setparam|sched_setscheduler|sem_close|sem_destroy|sem_getvalue|sem_init|sem_open|sem_post|sem_trywait|sem_wait|sem_unlink|sem_wait|shm_open|shm_unlink|sigqueue|sigtimedwait|sigwaitinfo|timer_create|timer_delete|timer_getoverrun|timer_gettime|timer_settime
45-CSRC-$(UCLIBC_HAS_REALTIME) += clock_getres.c clock_gettime.c clock_settime.c \
46+CSRC-$(UCLIBC_HAS_REALTIME) += clock_adjtime.c clock_getres.c clock_gettime.c clock_settime.c \
47 fdatasync.c mlockall.c mlock.c munlockall.c munlock.c \
48 nanosleep.c __rt_sigtimedwait.c __rt_sigwaitinfo.c sched_getparam.c \
49 sched_get_priority_max.c sched_get_priority_min.c sched_getscheduler.c \
50diff --git a/libc/sysdeps/linux/common/clock_adjtime.c b/libc/sysdeps/linux/common/clock_adjtime.c
51new file mode 100644
52index 0000000..968ec27
53--- /dev/null
54+++ b/libc/sysdeps/linux/common/clock_adjtime.c
55@@ -0,0 +1,15 @@
56+/*
57+ * clock_adjtime() for uClibc
58+ *
59+ * Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
60+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
61+ *
62+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
63+ */
64+
65+#include <sys/syscall.h>
66+#include <sys/timex.h>
67+
68+#ifdef __NR_clock_adjtime
69+_syscall2(int, clock_adjtime, clockid_t, clock_id, struct timex*, ntx)
70+#endif
71--
721.9.0
73
diff --git a/meta/recipes-core/uclibc/uclibc-git/argp-headers.patch b/meta/recipes-core/uclibc/uclibc-git/argp-headers.patch
new file mode 100644
index 0000000000..b31b991846
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/argp-headers.patch
@@ -0,0 +1,583 @@
1Added headers file needed by argp sources.
2
3Signed-off-by: Salvatore Cro <salvatore.cro at st.com>
4---
5 include/argp.h | 566 ++++++++++++++++++++++++++++++++++++++++++++
6 libc/argp/argp-fmtstream.h | 314 ++++++++++++++++++++++++
7 2 files changed, 880 insertions(+), 0 deletions(-)
8 create mode 100644 include/argp.h
9 create mode 100644 libc/argp/argp-fmtstream.h
10
11Upstream-Status: Pending
12
13Index: git/include/argp.h
14===================================================================
15--- /dev/null
16+++ git/include/argp.h
17@@ -0,0 +1,566 @@
18+/* Hierarchial argument parsing, layered over getopt.
19+ Copyright (C) 1995-1999, 2003, 2004, 2005, 2006, 2007, 2009
20+ Free Software Foundation, Inc.
21+ This file is part of the GNU C Library.
22+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
23+
24+ The GNU C Library is free software; you can redistribute it and/or
25+ modify it under the terms of the GNU Lesser General Public
26+ License as published by the Free Software Foundation; either
27+ version 2.1 of the License, or (at your option) any later version.
28+
29+ The GNU C Library is distributed in the hope that it will be useful,
30+ but WITHOUT ANY WARRANTY; without even the implied warranty of
31+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32+ Lesser General Public License for more details.
33+
34+ You should have received a copy of the GNU Lesser General Public
35+ License along with the GNU C Library; if not, write to the Free
36+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
37+ 02111-1307 USA.
38+
39+ Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
40+*/
41+
42+#ifndef _ARGP_H
43+#define _ARGP_H
44+
45+#include <stdio.h>
46+#include <ctype.h>
47+#include <limits.h>
48+
49+#define __need_error_t
50+#include <errno.h>
51+
52+#ifndef __const
53+# define __const const
54+#endif
55+
56+#ifndef __THROW
57+# define __THROW
58+#endif
59+#ifndef __NTH
60+# define __NTH(fct) fct __THROW
61+#endif
62+
63+#ifndef __attribute__
64+/* This feature is available in gcc versions 2.5 and later. */
65+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__)
66+# define __attribute__(Spec) /* empty */
67+# endif
68+/* The __-protected variants of `format' and `printf' attributes
69+ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
70+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__)
71+# define __format__ format
72+# define __printf__ printf
73+# endif
74+#endif
75+
76+/* GCC 2.95 and later have "__restrict"; C99 compilers have
77+ "restrict", and "configure" may have defined "restrict". */
78+#ifndef __restrict
79+# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
80+# if defined restrict || 199901L <= __STDC_VERSION__
81+# define __restrict restrict
82+# else
83+# define __restrict
84+# endif
85+# endif
86+#endif
87+
88+#ifndef __error_t_defined
89+typedef int error_t;
90+# define __error_t_defined
91+#endif
92+
93+#ifdef __cplusplus
94+extern "C" {
95+#endif
96+
97+/* A description of a particular option. A pointer to an array of
98+ these is passed in the OPTIONS field of an argp structure. Each option
99+ entry can correspond to one long option and/or one short option; more
100+ names for the same option can be added by following an entry in an option
101+ array with options having the OPTION_ALIAS flag set. */
102+struct argp_option
103+{
104+ /* The long option name. For more than one name for the same option, you
105+ can use following options with the OPTION_ALIAS flag set. */
106+ __const char *name;
107+
108+ /* What key is returned for this option. If > 0 and printable, then it's
109+ also accepted as a short option. */
110+ int key;
111+
112+ /* If non-NULL, this is the name of the argument associated with this
113+ option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
114+ __const char *arg;
115+
116+ /* OPTION_ flags. */
117+ int flags;
118+
119+ /* The doc string for this option. If both NAME and KEY are 0, This string
120+ will be printed outdented from the normal option column, making it
121+ useful as a group header (it will be the first thing printed in its
122+ group); in this usage, it's conventional to end the string with a `:'. */
123+ __const char *doc;
124+
125+ /* The group this option is in. In a long help message, options are sorted
126+ alphabetically within each group, and the groups presented in the order
127+ 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with
128+ if this field 0 will inherit the group number of the previous entry, or
129+ zero if it's the first one, unless its a group header (NAME and KEY both
130+ 0), in which case, the previous entry + 1 is the default. Automagic
131+ options such as --help are put into group -1. */
132+ int group;
133+};
134+
135+/* The argument associated with this option is optional. */
136+#define OPTION_ARG_OPTIONAL 0x1
137+
138+/* This option isn't displayed in any help messages. */
139+#define OPTION_HIDDEN 0x2
140+
141+/* This option is an alias for the closest previous non-alias option. This
142+ means that it will be displayed in the same help entry, and will inherit
143+ fields other than NAME and KEY from the aliased option. */
144+#define OPTION_ALIAS 0x4
145+
146+/* This option isn't actually an option (and so should be ignored by the
147+ actual option parser), but rather an arbitrary piece of documentation that
148+ should be displayed in much the same manner as the options. If this flag
149+ is set, then the option NAME field is displayed unmodified (e.g., no `--'
150+ prefix is added) at the left-margin (where a *short* option would normally
151+ be displayed), and the documentation string in the normal place. For
152+ purposes of sorting, any leading whitespace and punctuation is ignored,
153+ except that if the first non-whitespace character is not `-', this entry
154+ is displayed after all options (and OPTION_DOC entries with a leading `-')
155+ in the same group. */
156+#define OPTION_DOC 0x8
157+
158+/* This option shouldn't be included in `long' usage messages (but is still
159+ included in help messages). This is mainly intended for options that are
160+ completely documented in an argp's ARGS_DOC field, in which case including
161+ the option in the generic usage list would be redundant. For instance,
162+ if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to
163+ distinguish these two cases, -x should probably be marked
164+ OPTION_NO_USAGE. */
165+#define OPTION_NO_USAGE 0x10
166+
167+struct argp; /* fwd declare this type */
168+struct argp_state; /* " */
169+struct argp_child; /* " */
170+
171+/* The type of a pointer to an argp parsing function. */
172+typedef error_t (*argp_parser_t) (int __key, char *__arg,
173+ struct argp_state *__state);
174+
175+/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
176+ returns will simply be ignored. For user keys, this error will be turned
177+ into EINVAL (if the call to argp_parse is such that errors are propagated
178+ back to the user instead of exiting); returning EINVAL itself would result
179+ in an immediate stop to parsing in *all* cases. */
180+#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */
181+
182+/* Special values for the KEY argument to an argument parsing function.
183+ ARGP_ERR_UNKNOWN should be returned if they aren't understood.
184+
185+ The sequence of keys to a parsing function is either (where each
186+ uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key):
187+
188+ INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
189+ or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
190+ or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized
191+
192+ The third case is where every parser returned ARGP_KEY_UNKNOWN for an
193+ argument, in which case parsing stops at that argument (returning the
194+ unparsed arguments to the caller of argp_parse if requested, or stopping
195+ with an error message if not).
196+
197+ If an error occurs (either detected by argp, or because the parsing
198+ function returned an error value), then the parser is called with
199+ ARGP_KEY_ERROR, and no further calls are made. */
200+
201+/* This is not an option at all, but rather a command line argument. If a
202+ parser receiving this key returns success, the fact is recorded, and the
203+ ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the
204+ argument, a parser function decrements the NEXT field of the state it's
205+ passed, the option won't be considered processed; this is to allow you to
206+ actually modify the argument (perhaps into an option), and have it
207+ processed again. */
208+#define ARGP_KEY_ARG 0
209+/* There are remaining arguments not parsed by any parser, which may be found
210+ starting at (STATE->argv + STATE->next). If success is returned, but
211+ STATE->next left untouched, it's assumed that all arguments were consume,
212+ otherwise, the parser should adjust STATE->next to reflect any arguments
213+ consumed. */
214+#define ARGP_KEY_ARGS 0x1000006
215+/* There are no more command line arguments at all. */
216+#define ARGP_KEY_END 0x1000001
217+/* Because it's common to want to do some special processing if there aren't
218+ any non-option args, user parsers are called with this key if they didn't
219+ successfully process any non-option arguments. Called just before
220+ ARGP_KEY_END (where more general validity checks on previously parsed
221+ arguments can take place). */
222+#define ARGP_KEY_NO_ARGS 0x1000002
223+/* Passed in before any parsing is done. Afterwards, the values of each
224+ element of the CHILD_INPUT field, if any, in the state structure is
225+ copied to each child's state to be the initial value of the INPUT field. */
226+#define ARGP_KEY_INIT 0x1000003
227+/* Use after all other keys, including SUCCESS & END. */
228+#define ARGP_KEY_FINI 0x1000007
229+/* Passed in when parsing has successfully been completed (even if there are
230+ still arguments remaining). */
231+#define ARGP_KEY_SUCCESS 0x1000004
232+/* Passed in if an error occurs. */
233+#define ARGP_KEY_ERROR 0x1000005
234+
235+/* An argp structure contains a set of options declarations, a function to
236+ deal with parsing one, documentation string, a possible vector of child
237+ argp's, and perhaps a function to filter help output. When actually
238+ parsing options, getopt is called with the union of all the argp
239+ structures chained together through their CHILD pointers, with conflicts
240+ being resolved in favor of the first occurrence in the chain. */
241+struct argp
242+{
243+ /* An array of argp_option structures, terminated by an entry with both
244+ NAME and KEY having a value of 0. */
245+ __const struct argp_option *options;
246+
247+ /* What to do with an option from this structure. KEY is the key
248+ associated with the option, and ARG is any associated argument (NULL if
249+ none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be
250+ returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
251+ parsing is stopped immediately, and that value is returned from
252+ argp_parse(). For special (non-user-supplied) values of KEY, see the
253+ ARGP_KEY_ definitions below. */
254+ argp_parser_t parser;
255+
256+ /* A string describing what other arguments are wanted by this program. It
257+ is only used by argp_usage to print the `Usage:' message. If it
258+ contains newlines, the strings separated by them are considered
259+ alternative usage patterns, and printed on separate lines (lines after
260+ the first are prefix by ` or: ' instead of `Usage:'). */
261+ __const char *args_doc;
262+
263+ /* If non-NULL, a string containing extra text to be printed before and
264+ after the options in a long help message (separated by a vertical tab
265+ `\v' character). */
266+ __const char *doc;
267+
268+ /* A vector of argp_children structures, terminated by a member with a 0
269+ argp field, pointing to child argps should be parsed with this one. Any
270+ conflicts are resolved in favor of this argp, or early argps in the
271+ CHILDREN list. This field is useful if you use libraries that supply
272+ their own argp structure, which you want to use in conjunction with your
273+ own. */
274+ __const struct argp_child *children;
275+
276+ /* If non-zero, this should be a function to filter the output of help
277+ messages. KEY is either a key from an option, in which case TEXT is
278+ that option's help text, or a special key from the ARGP_KEY_HELP_
279+ defines, below, describing which other help text TEXT is. The function
280+ should return either TEXT, if it should be used as-is, a replacement
281+ string, which should be malloced, and will be freed by argp, or NULL,
282+ meaning `print nothing'. The value for TEXT is *after* any translation
283+ has been done, so if any of the replacement text also needs translation,
284+ that should be done by the filter function. INPUT is either the input
285+ supplied to argp_parse, or NULL, if argp_help was called directly. */
286+ char *(*help_filter) (int __key, __const char *__text, void *__input);
287+
288+ /* If non-zero the strings used in the argp library are translated using
289+ the domain described by this string. Otherwise the currently installed
290+ default domain is used. */
291+ const char *argp_domain;
292+};
293+
294+/* Possible KEY arguments to a help filter function. */
295+#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */
296+#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
297+#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
298+#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
299+ TEXT is NULL for this key. */
300+/* Explanatory note emitted when duplicate option arguments have been
301+ suppressed. */
302+#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
303+#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
304+
305+/* When an argp has a non-zero CHILDREN field, it should point to a vector of
306+ argp_child structures, each of which describes a subsidiary argp. */
307+struct argp_child
308+{
309+ /* The child parser. */
310+ __const struct argp *argp;
311+
312+ /* Flags for this child. */
313+ int flags;
314+
315+ /* If non-zero, an optional header to be printed in help output before the
316+ child options. As a side-effect, a non-zero value forces the child
317+ options to be grouped together; to achieve this effect without actually
318+ printing a header string, use a value of "". */
319+ __const char *header;
320+
321+ /* Where to group the child options relative to the other (`consolidated')
322+ options in the parent argp; the values are the same as the GROUP field
323+ in argp_option structs, but all child-groupings follow parent options at
324+ a particular group level. If both this field and HEADER are zero, then
325+ they aren't grouped at all, but rather merged with the parent options
326+ (merging the child's grouping levels with the parents). */
327+ int group;
328+};
329+
330+/* Parsing state. This is provided to parsing functions called by argp,
331+ which may examine and, as noted, modify fields. */
332+struct argp_state
333+{
334+ /* The top level ARGP being parsed. */
335+ __const struct argp *root_argp;
336+
337+ /* The argument vector being parsed. May be modified. */
338+ int argc;
339+ char **argv;
340+
341+ /* The index in ARGV of the next arg that to be parsed. May be modified. */
342+ int next;
343+
344+ /* The flags supplied to argp_parse. May be modified. */
345+ unsigned flags;
346+
347+ /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
348+ number of the current arg, starting at zero, and incremented after each
349+ such call returns. At all other times, this is the number of such
350+ arguments that have been processed. */
351+ unsigned arg_num;
352+
353+ /* If non-zero, the index in ARGV of the first argument following a special
354+ `--' argument (which prevents anything following being interpreted as an
355+ option). Only set once argument parsing has proceeded past this point. */
356+ int quoted;
357+
358+ /* An arbitrary pointer passed in from the user. */
359+ void *input;
360+ /* Values to pass to child parsers. This vector will be the same length as
361+ the number of children for the current parser. */
362+ void **child_inputs;
363+
364+ /* For the parser's use. Initialized to 0. */
365+ void *hook;
366+
367+ /* The name used when printing messages. This is initialized to ARGV[0],
368+ or PROGRAM_INVOCATION_NAME if that is unavailable. */
369+ char *name;
370+
371+ /* Streams used when argp prints something. */
372+ FILE *err_stream; /* For errors; initialized to stderr. */
373+ FILE *out_stream; /* For information; initialized to stdout. */
374+
375+ void *pstate; /* Private, for use by argp. */
376+};
377+
378+/* Flags for argp_parse (note that the defaults are those that are
379+ convenient for program command line parsing): */
380+
381+/* Don't ignore the first element of ARGV. Normally (and always unless
382+ ARGP_NO_ERRS is set) the first element of the argument vector is
383+ skipped for option parsing purposes, as it corresponds to the program name
384+ in a command line. */
385+#define ARGP_PARSE_ARGV0 0x01
386+
387+/* Don't print error messages for unknown options to stderr; unless this flag
388+ is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
389+ name in the error messages. This flag implies ARGP_NO_EXIT (on the
390+ assumption that silent exiting upon errors is bad behaviour). */
391+#define ARGP_NO_ERRS 0x02
392+
393+/* Don't parse any non-option args. Normally non-option args are parsed by
394+ calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
395+ as the value. Since it's impossible to know which parse function wants to
396+ handle it, each one is called in turn, until one returns 0 or an error
397+ other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
398+ argp_parse returns prematurely (but with a return value of 0). If all
399+ args have been parsed without error, all parsing functions are called one
400+ last time with a key of ARGP_KEY_END. This flag needn't normally be set,
401+ as the normal behavior is to stop parsing as soon as some argument can't
402+ be handled. */
403+#define ARGP_NO_ARGS 0x04
404+
405+/* Parse options and arguments in the same order they occur on the command
406+ line -- normally they're rearranged so that all options come first. */
407+#define ARGP_IN_ORDER 0x08
408+
409+/* Don't provide the standard long option --help, which causes usage and
410+ option help information to be output to stdout, and exit (0) called. */
411+#define ARGP_NO_HELP 0x10
412+
413+/* Don't exit on errors (they may still result in error messages). */
414+#define ARGP_NO_EXIT 0x20
415+
416+/* Use the gnu getopt `long-only' rules for parsing arguments. */
417+#define ARGP_LONG_ONLY 0x40
418+
419+/* Turns off any message-printing/exiting options. */
420+#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
421+
422+/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
423+ FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the
424+ index in ARGV of the first unparsed option is returned in it. If an
425+ unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
426+ routine returned a non-zero value, it is returned; otherwise 0 is
427+ returned. This function may also call exit unless the ARGP_NO_HELP flag
428+ is set. INPUT is a pointer to a value to be passed in to the parser. */
429+extern error_t argp_parse (__const struct argp *__restrict __argp,
430+ int __argc, char **__restrict __argv,
431+ unsigned __flags, int *__restrict __arg_index,
432+ void *__restrict __input);
433+
434+/* Global variables. */
435+
436+/* If defined or set by the user program to a non-zero value, then a default
437+ option --version is added (unless the ARGP_NO_HELP flag is used), which
438+ will print this string followed by a newline and exit (unless the
439+ ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
440+extern __const char *argp_program_version;
441+
442+/* If defined or set by the user program to a non-zero value, then a default
443+ option --version is added (unless the ARGP_NO_HELP flag is used), which
444+ calls this function with a stream to print the version to and a pointer to
445+ the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
446+ used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
447+extern void (*argp_program_version_hook) (FILE *__restrict __stream,
448+ struct argp_state *__restrict
449+ __state);
450+
451+/* If defined or set by the user program, it should point to string that is
452+ the bug-reporting address for the program. It will be printed by
453+ argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
454+ standard help messages), embedded in a sentence that says something like
455+ `Report bugs to ADDR.'. */
456+extern __const char *argp_program_bug_address;
457+
458+/* The exit status that argp will use when exiting due to a parsing error.
459+ If not defined or set by the user program, this defaults to EX_USAGE from
460+ <sysexits.h>. */
461+extern error_t argp_err_exit_status;
462+
463+/* Flags for argp_help. */
464+#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
465+#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
466+#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */
467+#define ARGP_HELP_LONG 0x08 /* a long help message. */
468+#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
469+#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
470+#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
471+#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */
472+#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to
473+ reflect ARGP_LONG_ONLY mode. */
474+
475+/* These ARGP_HELP flags are only understood by argp_state_help. */
476+#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */
477+#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */
478+
479+/* The standard thing to do after a program command line parsing error, if an
480+ error message has already been printed. */
481+#define ARGP_HELP_STD_ERR \
482+ (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
483+/* The standard thing to do after a program command line parsing error, if no
484+ more specific error message has been printed. */
485+#define ARGP_HELP_STD_USAGE \
486+ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
487+/* The standard thing to do in response to a --help option. */
488+#define ARGP_HELP_STD_HELP \
489+ (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
490+ | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
491+
492+/* Output a usage message for ARGP to STREAM. FLAGS are from the set
493+ ARGP_HELP_*. */
494+extern void argp_help (__const struct argp *__restrict __argp,
495+ FILE *__restrict __stream,
496+ unsigned __flags, char *__restrict __name);
497+
498+/* The following routines are intended to be called from within an argp
499+ parsing routine (thus taking an argp_state structure as the first
500+ argument). They may or may not print an error message and exit, depending
501+ on the flags in STATE -- in any case, the caller should be prepared for
502+ them *not* to exit, and should return an appropiate error after calling
503+ them. [argp_usage & argp_error should probably be called argp_state_...,
504+ but they're used often enough that they should be short] */
505+
506+/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
507+ from the set ARGP_HELP_*. */
508+extern void argp_state_help (__const struct argp_state *__restrict __state,
509+ FILE *__restrict __stream,
510+ unsigned int __flags);
511+/* Possibly output the standard usage message for ARGP to stderr and exit. */
512+extern void argp_usage (__const struct argp_state *__state);
513+
514+/* If appropriate, print the printf string FMT and following args, preceded
515+ by the program name and `:', to stderr, and followed by a `Try ... --help'
516+ message, then exit (1). */
517+extern void argp_error (__const struct argp_state *__restrict __state,
518+ __const char *__restrict __fmt, ...)
519+ __attribute__ ((__format__ (__printf__, 2, 3)));
520+/* Similar to the standard gnu error-reporting function error(), but will
521+ respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
522+ to STATE->err_stream. This is useful for argument parsing code that is
523+ shared between program startup (when exiting is desired) and runtime
524+ option parsing (when typically an error code is returned instead). The
525+ difference between this function and argp_error is that the latter is for
526+ *parsing errors*, and the former is for other problems that occur during
527+ parsing but don't reflect a (syntactic) problem with the input. */
528+extern void argp_failure (__const struct argp_state *__restrict __state,
529+ int __status, int __errnum,
530+ __const char *__restrict __fmt, ...)
531+ __attribute__ ((__format__ (__printf__, 4, 5)));
532+/* Returns true if the option OPT is a valid short option. */
533+extern int _option_is_short (__const struct argp_option *__opt) __THROW;
534+extern int __option_is_short (__const struct argp_option *__opt) __THROW;
535+
536+/* Returns true if the option OPT is in fact the last (unused) entry in an
537+ options array. */
538+extern int _option_is_end (__const struct argp_option *__opt) __THROW;
539+extern int __option_is_end (__const struct argp_option *__opt) __THROW;
540+
541+/* Return the input field for ARGP in the parser corresponding to STATE; used
542+ by the help routines. */
543+/* We think this should not be exported */
544+extern void *__argp_input (__const struct argp *__restrict __argp,
545+ __const struct argp_state *__restrict __state)
546+ __THROW;
547+
548+#ifdef __USE_EXTERN_INLINES
549+
550+# ifndef ARGP_EI
551+# define ARGP_EI __extern_inline
552+# endif
553+
554+ARGP_EI void
555+argp_usage (__const struct argp_state *__state)
556+{
557+ argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
558+}
559+
560+ARGP_EI int
561+__NTH (__option_is_short (__const struct argp_option *__opt))
562+{
563+ if (__opt->flags & OPTION_DOC)
564+ return 0;
565+ else
566+ {
567+ int __key = __opt->key;
568+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
569+ }
570+}
571+
572+ARGP_EI int
573+__NTH (__option_is_end (__const struct argp_option *__opt))
574+{
575+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
576+}
577+#endif /* Use extern inlines. */
578+
579+#ifdef __cplusplus
580+}
581+#endif
582+
583+#endif /* argp.h */
diff --git a/meta/recipes-core/uclibc/uclibc-git/argp-support.patch b/meta/recipes-core/uclibc/uclibc-git/argp-support.patch
new file mode 100644
index 0000000000..bcec6a593a
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/argp-support.patch
@@ -0,0 +1,5192 @@
1From: Salvatore Cro <salvatore.cro at st.com>
2
3Argp is an advanced support for parsing unix-style argument vectors.
4In addition to the common getopt interface, it provides automatic response
5to `--help' and `--version' options and use of custom parser in conjunction
6with argp native option parser, among others.
7Argp support is required by elfutils package and prelink.
8
9In uClibc argp functionalities has been moved from C library to libuargp.so
10Further the libc.so linker script contains an AS_NEEDED entry so that
11it doesn't need to link libuargp.so explicitely.
12
13Signed-off-by: Salvatore Cro <salvatore.cro at st.com>
14Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono at st.com>
15Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
16
17Upstream-Status: Pending
18
19---
20 Makefile.in | 8 +
21 Makerules | 8 +-
22 Rules.mak | 7 +
23 extra/Configs/Config.in | 17 +
24 libc/sysdeps/linux/common/bits/getopt_int.h | 136 ++
25 libc/unistd/getopt.c | 18 +-
26 libc/unistd/getopt_int.h | 134 --
27 libuargp/Makefile | 14 +
28 libuargp/Makefile.in | 76 ++
29 libuargp/argp-ba.c | 26 +
30 libuargp/argp-eexst.c | 32 +
31 libuargp/argp-fmtstream.c | 439 +++++++
32 libuargp/argp-fmtstream.h | 314 +++++
33 libuargp/argp-fs-xinl.c | 44 +
34 libuargp/argp-help.c | 1882 +++++++++++++++++++++++++++
35 libuargp/argp-parse.c | 949 ++++++++++++++
36 libuargp/argp-pv.c | 25 +
37 libuargp/argp-pvh.c | 32 +
38 libuargp/argp-xinl.c | 35 +
39 test/argp/Makefile | 7 +
40 test/argp/Makefile.in | 12 +
41 test/argp/argp-ex1.c | 15 +
42 test/argp/argp-ex2.c | 45 +
43 test/argp/argp-ex3.c | 153 +++
44 test/argp/argp-ex4.c | 167 +++
45 test/argp/argp-test.c | 209 +++
46 test/argp/bug-argp1.c | 26 +
47 test/argp/tst-argp1.c | 118 ++
48 test/argp/tst-argp2.c | 101 ++
49 29 files changed, 4911 insertions(+), 138 deletions(-)
50 create mode 100644 libc/sysdeps/linux/common/bits/getopt_int.h
51 delete mode 100644 libc/unistd/getopt_int.h
52 create mode 100644 libuargp/Makefile
53 create mode 100644 libuargp/Makefile.in
54 create mode 100644 libuargp/argp-ba.c
55 create mode 100644 libuargp/argp-eexst.c
56 create mode 100644 libuargp/argp-fmtstream.c
57 create mode 100644 libuargp/argp-fmtstream.h
58 create mode 100644 libuargp/argp-fs-xinl.c
59 create mode 100644 libuargp/argp-help.c
60 create mode 100644 libuargp/argp-parse.c
61 create mode 100644 libuargp/argp-pv.c
62 create mode 100644 libuargp/argp-pvh.c
63 create mode 100644 libuargp/argp-xinl.c
64 create mode 100644 test/argp/Makefile
65 create mode 100644 test/argp/Makefile.in
66 create mode 100644 test/argp/argp-ex1.c
67 create mode 100644 test/argp/argp-ex2.c
68 create mode 100644 test/argp/argp-ex3.c
69 create mode 100644 test/argp/argp-ex4.c
70 create mode 100644 test/argp/argp-test.c
71 create mode 100644 test/argp/bug-argp1.c
72 create mode 100644 test/argp/tst-argp1.c
73 create mode 100644 test/argp/tst-argp2.c
74
75Index: git/Makefile.in
76===================================================================
77--- git.orig/Makefile.in 2012-06-18 13:10:12.000000000 -0700
78+++ git/Makefile.in 2012-06-18 13:12:06.448829343 -0700
79@@ -48,6 +48,7 @@
80 include $(top_srcdir)libutil/Makefile.in
81 include $(top_srcdir)libpthread/Makefile.in
82 include $(top_srcdir)librt/Makefile.in
83+include $(top_srcdir)libuargp/Makefile.in
84 include $(top_srcdir)libubacktrace/Makefile.in
85 include $(top_srcdir)extra/locale/Makefile.in
86
87@@ -250,6 +251,7 @@
88 endif
89 HEADERS_RM-$(HAVE_SHARED) += dlfcn.h bits/dlfcn.h
90 HEADERS_RM-$(PTHREADS_DEBUG_SUPPORT) += thread_db.h
91+HEADERS_RM-$(UCLIBC_HAS_ARGP) += argp.h
92 HEADERS_RM-$(UCLIBC_HAS_BSD_ERR) += err.h
93 HEADERS_RM-$(UCLIBC_HAS_CRYPT) += crypt.h
94 HEADERS_RM-$(UCLIBC_HAS_EPOLL) += sys/epoll.h
95@@ -368,6 +370,12 @@
96 -$(INSTALL) -m 755 $(top_builddir)lib/libc.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
97 endif
98 echo "$(UBACKTRACE_ASNEEDED)" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so
99+ifeq ($(UCLIBC_HAS_ARGP),y)
100+# Add the AS_NEEDED entry for libuargp.so
101+ if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)lib/$(SHARED_MAJORNAME) ] ; then \
102+ echo "GROUP ( $(UARGP_ASNEEDED) )" >> $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \
103+ fi
104+endif
105 ifeq ($(UCLIBC_HAS_THREADS),y)
106 ifneq ($(LINUXTHREADS_OLD),y)
107 ifeq ($(HARDWIRED_ABSPATH),y)
108Index: git/Makerules
109===================================================================
110--- git.orig/Makerules 2012-06-18 13:10:12.000000000 -0700
111+++ git/Makerules 2012-06-18 13:10:44.052825547 -0700
112@@ -32,12 +32,12 @@
113 $(libpthread-so-y) $(libpthread-nonshared-y) $(libthread_db-so-y) \
114 $(libresolv-so-y) $(librt-so-y) \
115 $(ldso-y) \
116- $(libutil-so-y) $(libubacktrace-so-y)
117+ $(libutil-so-y) $(libubacktrace-so-y) $(libuargp-so-y)
118
119 ar_objs = $(libc-y) $(libc-static-y) $(libcrypt-a-y) \
120 $(libdl-a-y) $(libintl-a-y) $(libm-a-y) $(libnsl-a-y) \
121 $(libpthread-a-y) $(libthread_db-a-y) \
122- $(libresolv-a-y) $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y)
123+ $(libresolv-a-y) $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y) $(libuargp-a-y)
124 ifeq ($(DOPIC),y)
125 ar_objs := $(ar_objs:.o=.os)
126 endif
127@@ -472,7 +472,7 @@
128 $(librt-a-y) $(librt-so-y) $(libresolv-a-y) $(libresolv-so-y) \
129 $(libcrypt-a-y) $(libcrypt-so-y) $(libutil-a-y) $(libutil-so-y) \
130 $(libnsl-a-y) $(libnsl-so-y) $(ldso-y) $(libdl-a-y) $(libdl-so-y) \
131- $(libubacktrace-a-y) $(libubacktrace-so-y)
132+ $(libubacktrace-a-y) $(libubacktrace-so-y) $(libuargp-so-y) $(libuargp-a-y)
133 .depends.dep := \
134 $(patsubst %.s,%.s.dep,$(filter %.s,$(files.dep))) \
135 $(patsubst %.o,%.o.dep,$(filter %.o,$(files.dep))) \
136Index: git/Rules.mak
137===================================================================
138--- git.orig/Rules.mak 2012-06-18 13:10:12.000000000 -0700
139+++ git/Rules.mak 2012-06-18 13:10:44.056825544 -0700
140@@ -589,6 +589,13 @@
141 else
142 export UBACKTRACE_ASNEEDED:=""
143 endif
144+ifeq ($(UCLIBC_HAS_ARGP),y)
145+# Only used in installed libc.so linker script
146+UARGP_FULL_NAME := $(RUNTIME_PREFIX)lib/libuargp.so.$(MAJOR_VERSION)
147+export UARGP_ASNEEDED:=$(shell $(LD) --help 2>/dev/null | grep -q -- --as-needed && echo "AS_NEEDED ( $(UARGP_FULL_NAME) )" || echo "$(UARGP_FULL_NAME)")
148+else
149+export UARGP_ASNEEDED:=""
150+endif
151 endif
152
153 # Add a bunch of extra pedantic annoyingly strict checks
154Index: git/extra/Configs/Config.in
155===================================================================
156--- git.orig/extra/Configs/Config.in 2012-06-18 13:10:12.000000000 -0700
157+++ git/extra/Configs/Config.in 2012-06-18 13:10:44.056825544 -0700
158@@ -1853,6 +1853,23 @@
159 smaller SUSv3 compatible getsubopt().
160
161 Most people will answer Y.
162+
163+config UCLIBC_HAS_ARGP
164+ bool "Support argp (as standalone shared object)"
165+ default n
166+ help
167+ Argp is an interface for parsing unix-style argument vectors. Unlike
168+ the common getopt interface, it provides many advanced features in
169+ addition to parsing options, such as automatic output in response to
170+ `--help' and `--version' options.
171+ A library can export an argp option parser, which programs can easily
172+ use in conjunction with their own option parser.
173+ A new shared object "libuargp" is created. The "libc.so" linker script
174+ contains the AS_NEEDED entry for getting the libuargp linked automatically.
175+ Argp support is needed by elfutils libdw.
176+
177+ Most people can safely answer N.
178+
179 endmenu
180
181
182Index: git/libc/sysdeps/linux/common/bits/getopt_int.h
183===================================================================
184--- /dev/null 1970-01-01 00:00:00.000000000 +0000
185+++ git/libc/sysdeps/linux/common/bits/getopt_int.h 2012-06-18 13:10:44.056825544 -0700
186@@ -0,0 +1,136 @@
187+/* Internal declarations for getopt.
188+ Copyright (C) 1989-1994,1996-1999,2001,2003,2004
189+ Free Software Foundation, Inc.
190+ This file is part of the GNU C Library.
191+
192+ The GNU C Library is free software; you can redistribute it and/or
193+ modify it under the terms of the GNU Lesser General Public
194+ License as published by the Free Software Foundation; either
195+ version 2.1 of the License, or (at your option) any later version.
196+
197+ The GNU C Library is distributed in the hope that it will be useful,
198+ but WITHOUT ANY WARRANTY; without even the implied warranty of
199+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
200+ Lesser General Public License for more details.
201+
202+ You should have received a copy of the GNU Lesser General Public
203+ License along with the GNU C Library; if not, write to the Free
204+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
205+ 02111-1307 USA. */
206+
207+#ifndef _GETOPT_INT_H
208+#define _GETOPT_INT_H 1
209+
210+extern int _getopt_internal (int ___argc, char *const *___argv,
211+ const char *__shortopts,
212+ const struct option *__longopts, int *__longind,
213+ int __long_only) attribute_hidden;
214+
215+
216+/* Reentrant versions which can handle parsing multiple argument
217+ vectors at the same time. */
218+
219+/* For __ordering member */
220+enum {
221+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
222+};
223+
224+/* Data type for reentrant functions. */
225+
226+struct _getopt_data
227+{
228+ /* These have exactly the same meaning as the corresponding global
229+ variables, except that they are used for the reentrant
230+ versions of getopt. */
231+ int optind;
232+ int opterr;
233+ char *optarg;
234+ smalluint optopt; /* we store characters here, a byte is enough */
235+
236+ /* Internal members. */
237+
238+ /* True if the internal members have been initialized. */
239+ smallint __initialized;
240+
241+ /* Describe how to deal with options that follow non-option ARGV-elements.
242+
243+ If the caller did not specify anything,
244+ the default is REQUIRE_ORDER if the environment variable
245+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
246+
247+ REQUIRE_ORDER means don't recognize them as options;
248+ stop option processing when the first non-option is seen.
249+ This is what Unix does.
250+ This mode of operation is selected by either setting the environment
251+ variable POSIXLY_CORRECT, or using `+' as the first character
252+ of the list of option characters.
253+
254+ PERMUTE is the default. We permute the contents of ARGV as we
255+ scan, so that eventually all the non-options are at the end.
256+ This allows options to be given in any order, even with programs
257+ that were not written to expect this.
258+
259+ RETURN_IN_ORDER is an option available to programs that were
260+ written to expect options and other ARGV-elements in any order
261+ and that care about the ordering of the two. We describe each
262+ non-option ARGV-element as if it were the argument of an option
263+ with character code 1. Using `-' as the first character of the
264+ list of option characters selects this mode of operation.
265+
266+ The special argument `--' forces an end of option-scanning regardless
267+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
268+ `--' can cause `getopt' to return -1 with `optind' != ARGC. */
269+ smallint __ordering;
270+
271+ /* If the POSIXLY_CORRECT environment variable is set. */
272+ smallint __posixly_correct;
273+
274+ /* The next char to be scanned in the option-element
275+ in which the last option character we returned was found.
276+ This allows us to pick up the scan where we left off.
277+
278+ If this is zero, or a null string, it means resume the scan
279+ by advancing to the next ARGV-element. */
280+ char *__nextchar;
281+
282+
283+ /* Handle permutation of arguments. */
284+
285+ /* Describe the part of ARGV that contains non-options that have
286+ been skipped. `first_nonopt' is the index in ARGV of the first
287+ of them; `last_nonopt' is the index after the last of them. */
288+
289+ int __first_nonopt;
290+ int __last_nonopt;
291+
292+#if defined _LIBC && defined USE_NONOPTION_FLAGS
293+ int __nonoption_flags_max_len;
294+ int __nonoption_flags_len;
295+# endif
296+};
297+
298+/* The initializer is necessary to set OPTIND and OPTERR to their
299+ default values and to clear the initialization flag. */
300+#define _GETOPT_DATA_INITIALIZER { 1, 1 }
301+
302+#if 0 /* first is static on uClibc, the others not used */
303+extern int _getopt_internal_r (int ___argc, char *const *___argv,
304+ const char *__shortopts,
305+ const struct option *__longopts, int *__longind,
306+ int __long_only, struct _getopt_data *__data);
307+#endif
308+#if defined __UCLIBC_HAS_GNU_GETOPT__ || defined __UCLIBC_HAS_GETOPT_LONG__
309+#ifndef __need_getopt
310+extern int _getopt_long_r (int ___argc, char *const *___argv,
311+ const char *__shortopts,
312+ const struct option *__longopts, int *__longind,
313+ struct _getopt_data *__data);
314+
315+extern int _getopt_long_only_r (int ___argc, char *const *___argv,
316+ const char *__shortopts,
317+ const struct option *__longopts,
318+ int *__longind,
319+ struct _getopt_data *__data);
320+#endif
321+#endif
322+#endif /* getopt_int.h */
323Index: git/libc/unistd/getopt.c
324===================================================================
325--- git.orig/libc/unistd/getopt.c 2012-06-18 13:10:12.000000000 -0700
326+++ git/libc/unistd/getopt.c 2012-06-18 13:10:44.056825544 -0700
327@@ -106,7 +106,7 @@
328 they can distinguish the relative order of options and other arguments. */
329
330 #include <getopt.h>
331-#include "getopt_int.h"
332+#include <bits/getopt_int.h>
333
334
335 /* For communication from `getopt' to the caller.
336@@ -1170,6 +1170,15 @@
337 return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
338 }
339
340+int
341+_getopt_long_r (int argc, char *const *argv, const char *options,
342+ const struct option *long_options, int *opt_index,
343+ struct _getopt_data *d)
344+{
345+ return _getopt_internal_r (argc, argv, options, long_options, opt_index,
346+ 0, d);
347+}
348+
349 /* Like getopt_long, but '-' as well as '--' can indicate a long option.
350 If an option that starts with '-' (not '--') doesn't match a long option,
351 but does match a short option, it is parsed as a short option
352@@ -1182,4 +1191,12 @@
353 return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
354 }
355
356+int
357+_getopt_long_only_r (int argc, char *const *argv, const char *options,
358+ const struct option *long_options, int *opt_index,
359+ struct _getopt_data *d)
360+{
361+ return _getopt_internal_r (argc, argv, options, long_options, opt_index, 1, d);
362+}
363+
364 #endif /* Not ELIDE_CODE. */
365Index: git/libuargp/Makefile
366===================================================================
367--- /dev/null 1970-01-01 00:00:00.000000000 +0000
368+++ git/libuargp/Makefile 2012-06-18 13:10:44.056825544 -0700
369@@ -0,0 +1,14 @@
370+# Makefile for uClibc (libuargp)
371+#
372+# Copyright (C) 2010 STMicroelectronics Ltd
373+# Author(s): Filippo Arcidiacono <filippo.arcidiacono at st.com>
374+#
375+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
376+#
377+
378+top_srcdir=../
379+top_builddir=../
380+include $(top_builddir)Rules.mak
381+all: libs
382+include Makefile.in
383+include $(top_srcdir)Makerules
384Index: git/libuargp/Makefile.in
385===================================================================
386--- /dev/null 1970-01-01 00:00:00.000000000 +0000
387+++ git/libuargp/Makefile.in 2012-06-18 13:10:44.056825544 -0700
388@@ -0,0 +1,73 @@
389+# Makefile for uClibc (libuargp)
390+#
391+# Copyright (C) 2009, 2010 STMicroelectronics Ltd.
392+# Author(s): Salvatore Cro <salvatore.cro at st.com>
393+# - First implementation, embedded into libc
394+# Filippo Arcidiacono <filippo.arcidiacono at st.com>
395+# - Reworked for stand-alone libuargp implementation
396+
397+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
398+#
399+
400+CFLAGS-libuargp := -DNOT_IN_libc -DIS_IN_libuargp $(SSP_ALL_CFLAGS)
401+
402+LDFLAGS-libuargp.so := $(LDFLAGS)
403+
404+LIBS-libuargp.so := $(LIBS)
405+
406+libuargp_FULL_NAME := libuargp-$(VERSION).so
407+
408+libuargp_DIR := $(top_srcdir)libuargp
409+libuargp_OUT := $(top_builddir)libuargp
410+
411+libuargp_SRC-y :=
412+libuargp_SRC-$(UCLIBC_HAS_ARGP) := $(addsuffix .c,$(addprefix argp-, ba \
413+ eexst fmtstream fs-xinl help parse pv pvh xinl))
414+
415+CFLAGS-argp-xinl.c = -fgnu89-inline
416+
417+libuargp_SRC := $(addprefix $(libuargp_DIR)/,$(libuargp_SRC-y))
418+libuargp_OBJ := $(patsubst $(libuargp_DIR)/%.c,$(libuargp_OUT)/%.o,$(libuargp_SRC))
419+
420+libuargp_SRCS := $(libuargp_SRC)
421+libuargp_OBJS := $(libuargp_OBJ)
422+
423+ifeq ($(DOPIC),y)
424+libuargp-a-y := $(libuargp_OBJS:.o=.os)
425+else
426+libuargp-a-y := $(libuargp_OBJS)
427+endif
428+libuargp-so-y := $(libuargp_OBJS:.o=.os)
429+
430+lib-a-$(UCLIBC_HAS_ARGP) += $(top_builddir)lib/libuargp.a
431+lib-so-$(UCLIBC_HAS_ARGP) += $(top_builddir)lib/libuargp.so
432+
433+objclean-y += CLEAN_libuargp
434+
435+ifeq ($(DOMULTI),n)
436+ifeq ($(DOPIC),y)
437+$(top_builddir)lib/libuargp.so: $(top_builddir)lib/libuargp.a $(libc.depend)
438+else
439+$(top_builddir)lib/libuargp.so: $(libuargp_OUT)/libuargp_so.a $(libc.depend)
440+endif
441+ $(call link.so,$(libuargp_FULL_NAME),$(MAJOR_VERSION))
442+else
443+$(top_builddir)lib/libuargp.so: $(libuargp_OUT)/libuargp.oS $(libc.depend)
444+ $(call linkm.so,$(libuargp_FULL_NAME),$(MAJOR_VERSION))
445+endif
446+
447+$(libuargp_OUT)/libuargp_so.a: $(libuargp-so-y)
448+ $(Q)$(RM) $@
449+ $(do_ar)
450+
451+$(libuargp_OUT)/libuargp.oS: $(libuargp_SRCS)
452+ $(Q)$(RM) $@
453+ $(compile-m)
454+
455+$(top_builddir)lib/libuargp.a: $(libuargp-a-y)
456+ $(Q)$(INSTALL) -d $(dir $@)
457+ $(Q)$(RM) $@
458+ $(do_ar)
459+
460+CLEAN_libuargp:
461+ $(do_rm) $(addprefix $(libuargp_OUT)/*., o os oS a)
462Index: git/libuargp/argp-ba.c
463===================================================================
464--- /dev/null 1970-01-01 00:00:00.000000000 +0000
465+++ git/libuargp/argp-ba.c 2012-06-18 13:10:44.056825544 -0700
466@@ -0,0 +1,26 @@
467+/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
468+ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
469+ This file is part of the GNU C Library.
470+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
471+
472+ The GNU C Library is free software; you can redistribute it and/or
473+ modify it under the terms of the GNU Lesser General Public
474+ License as published by the Free Software Foundation; either
475+ version 2.1 of the License, or (at your option) any later version.
476+
477+ The GNU C Library is distributed in the hope that it will be useful,
478+ but WITHOUT ANY WARRANTY; without even the implied warranty of
479+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
480+ Lesser General Public License for more details.
481+
482+ You should have received a copy of the GNU Lesser General Public
483+ License along with the GNU C Library; if not, write to the Free
484+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
485+ 02111-1307 USA. */
486+
487+/* If set by the user program, it should point to string that is the
488+ bug-reporting address for the program. It will be printed by argp_help if
489+ the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help
490+ messages), embedded in a sentence that says something like `Report bugs to
491+ ADDR.'. */
492+const char *argp_program_bug_address;
493Index: git/libuargp/argp-eexst.c
494===================================================================
495--- /dev/null 1970-01-01 00:00:00.000000000 +0000
496+++ git/libuargp/argp-eexst.c 2012-06-18 13:10:44.056825544 -0700
497@@ -0,0 +1,32 @@
498+/* Default definition for ARGP_ERR_EXIT_STATUS
499+ Copyright (C) 1997 Free Software Foundation, Inc.
500+ This file is part of the GNU C Library.
501+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
502+
503+ The GNU C Library is free software; you can redistribute it and/or
504+ modify it under the terms of the GNU Lesser General Public
505+ License as published by the Free Software Foundation; either
506+ version 2.1 of the License, or (at your option) any later version.
507+
508+ The GNU C Library is distributed in the hope that it will be useful,
509+ but WITHOUT ANY WARRANTY; without even the implied warranty of
510+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
511+ Lesser General Public License for more details.
512+
513+ You should have received a copy of the GNU Lesser General Public
514+ License along with the GNU C Library; if not, write to the Free
515+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
516+ 02111-1307 USA. */
517+
518+#ifdef HAVE_CONFIG_H
519+# include <config.h>
520+#endif
521+
522+#include <sysexits.h>
523+
524+#include <argp.h>
525+
526+/* The exit status that argp will use when exiting due to a parsing error.
527+ If not defined or set by the user program, this defaults to EX_USAGE from
528+ <sysexits.h>. */
529+error_t argp_err_exit_status = EX_USAGE;
530Index: git/libuargp/argp-fmtstream.c
531===================================================================
532--- /dev/null 1970-01-01 00:00:00.000000000 +0000
533+++ git/libuargp/argp-fmtstream.c 2012-06-18 13:10:44.056825544 -0700
534@@ -0,0 +1,439 @@
535+/* Word-wrapping and line-truncating streams
536+ Copyright (C) 1997-1999,2001,2002,2003,2005 Free Software Foundation, Inc.
537+ This file is part of the GNU C Library.
538+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
539+
540+ The GNU C Library is free software; you can redistribute it and/or
541+ modify it under the terms of the GNU Lesser General Public
542+ License as published by the Free Software Foundation; either
543+ version 2.1 of the License, or (at your option) any later version.
544+
545+ The GNU C Library is distributed in the hope that it will be useful,
546+ but WITHOUT ANY WARRANTY; without even the implied warranty of
547+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
548+ Lesser General Public License for more details.
549+
550+ You should have received a copy of the GNU Lesser General Public
551+ License along with the GNU C Library; if not, write to the Free
552+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
553+ 02111-1307 USA.
554+
555+ Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
556+*/
557+
558+/* This package emulates glibc `line_wrap_stream' semantics for systems that
559+ don't have that. */
560+
561+#ifdef HAVE_CONFIG_H
562+# include <config.h>
563+#endif
564+
565+#include <stdlib.h>
566+#include <string.h>
567+#include <errno.h>
568+#include <stdarg.h>
569+#include <ctype.h>
570+
571+#include "argp-fmtstream.h"
572+
573+#ifndef ARGP_FMTSTREAM_USE_LINEWRAP
574+
575+#ifndef isblank
576+#define isblank(ch) ((ch)==' ' || (ch)=='\t')
577+#endif
578+
579+#if defined _LIBC && defined USE_IN_LIBIO
580+# include <wchar.h>
581+# include <libio/libioP.h>
582+# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
583+#else
584+# define __vsnprintf(s, l, f, a) vsnprintf (s, l, f, a)
585+#endif
586+
587+#define INIT_BUF_SIZE 200
588+#define PRINTF_SIZE_GUESS 150
589+
590+/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
591+ written on it with LMARGIN spaces and limits them to RMARGIN columns
592+ total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
593+ replacing the whitespace before them with a newline and WMARGIN spaces.
594+ Otherwise, chars beyond RMARGIN are simply dropped until a newline.
595+ Returns NULL if there was an error. */
596+argp_fmtstream_t
597+__argp_make_fmtstream (FILE *stream,
598+ size_t lmargin, size_t rmargin, ssize_t wmargin)
599+{
600+ argp_fmtstream_t fs;
601+
602+ fs = (struct argp_fmtstream *) malloc (sizeof (struct argp_fmtstream));
603+ if (fs != NULL)
604+ {
605+ fs->stream = stream;
606+
607+ fs->lmargin = lmargin;
608+ fs->rmargin = rmargin;
609+ fs->wmargin = wmargin;
610+ fs->point_col = 0;
611+ fs->point_offs = 0;
612+
613+ fs->buf = (char *) malloc (INIT_BUF_SIZE);
614+ if (! fs->buf)
615+ {
616+ free (fs);
617+ fs = 0;
618+ }
619+ else
620+ {
621+ fs->p = fs->buf;
622+ fs->end = fs->buf + INIT_BUF_SIZE;
623+ }
624+ }
625+
626+ return fs;
627+}
628+#if 0
629+/* Not exported. */
630+#ifdef weak_alias
631+weak_alias (__argp_make_fmtstream, argp_make_fmtstream)
632+#endif
633+#endif
634+
635+/* Flush FS to its stream, and free it (but don't close the stream). */
636+void
637+__argp_fmtstream_free (argp_fmtstream_t fs)
638+{
639+ __argp_fmtstream_update (fs);
640+ if (fs->p > fs->buf)
641+ {
642+#ifdef USE_IN_LIBIO
643+ __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
644+#else
645+ fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
646+#endif
647+ }
648+ free (fs->buf);
649+ free (fs);
650+}
651+#if 0
652+/* Not exported. */
653+#ifdef weak_alias
654+weak_alias (__argp_fmtstream_free, argp_fmtstream_free)
655+#endif
656+#endif
657+
658+/* Process FS's buffer so that line wrapping is done from POINT_OFFS to the
659+ end of its buffer. This code is mostly from glibc stdio/linewrap.c. */
660+void
661+__argp_fmtstream_update (argp_fmtstream_t fs)
662+{
663+ char *buf, *nl;
664+ size_t len;
665+
666+ /* Scan the buffer for newlines. */
667+ buf = fs->buf + fs->point_offs;
668+ while (buf < fs->p)
669+ {
670+ size_t r;
671+
672+ if (fs->point_col == 0 && fs->lmargin != 0)
673+ {
674+ /* We are starting a new line. Print spaces to the left margin. */
675+ const size_t pad = fs->lmargin;
676+ if (fs->p + pad < fs->end)
677+ {
678+ /* We can fit in them in the buffer by moving the
679+ buffer text up and filling in the beginning. */
680+ memmove (buf + pad, buf, fs->p - buf);
681+ fs->p += pad; /* Compensate for bigger buffer. */
682+ memset (buf, ' ', pad); /* Fill in the spaces. */
683+ buf += pad; /* Don't bother searching them. */
684+ }
685+ else
686+ {
687+ /* No buffer space for spaces. Must flush. */
688+ size_t i;
689+ for (i = 0; i < pad; i++)
690+ {
691+#ifdef USE_IN_LIBIO
692+ if (_IO_fwide (fs->stream, 0) > 0)
693+ putwc_unlocked (L' ', fs->stream);
694+ else
695+#endif
696+ putc_unlocked (' ', fs->stream);
697+ }
698+ }
699+ fs->point_col = pad;
700+ }
701+
702+ len = fs->p - buf;
703+ nl = memchr (buf, '\n', len);
704+
705+ if (fs->point_col < 0)
706+ fs->point_col = 0;
707+
708+ if (!nl)
709+ {
710+ /* The buffer ends in a partial line. */
711+
712+ if (fs->point_col + len < fs->rmargin)
713+ {
714+ /* The remaining buffer text is a partial line and fits
715+ within the maximum line width. Advance point for the
716+ characters to be written and stop scanning. */
717+ fs->point_col += len;
718+ break;
719+ }
720+ else
721+ /* Set the end-of-line pointer for the code below to
722+ the end of the buffer. */
723+ nl = fs->p;
724+ }
725+ else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin)
726+ {
727+ /* The buffer contains a full line that fits within the maximum
728+ line width. Reset point and scan the next line. */
729+ fs->point_col = 0;
730+ buf = nl + 1;
731+ continue;
732+ }
733+
734+ /* This line is too long. */
735+ r = fs->rmargin - 1;
736+
737+ if (fs->wmargin < 0)
738+ {
739+ /* Truncate the line by overwriting the excess with the
740+ newline and anything after it in the buffer. */
741+ if (nl < fs->p)
742+ {
743+ memmove (buf + (r - fs->point_col), nl, fs->p - nl);
744+ fs->p -= buf + (r - fs->point_col) - nl;
745+ /* Reset point for the next line and start scanning it. */
746+ fs->point_col = 0;
747+ buf += r + 1; /* Skip full line plus \n. */
748+ }
749+ else
750+ {
751+ /* The buffer ends with a partial line that is beyond the
752+ maximum line width. Advance point for the characters
753+ written, and discard those past the max from the buffer. */
754+ fs->point_col += len;
755+ fs->p -= fs->point_col - r;
756+ break;
757+ }
758+ }
759+ else
760+ {
761+ /* Do word wrap. Go to the column just past the maximum line
762+ width and scan back for the beginning of the word there.
763+ Then insert a line break. */
764+
765+ char *p, *nextline;
766+ int i;
767+
768+ p = buf + (r + 1 - fs->point_col);
769+ while (p >= buf && !isblank (*p))
770+ --p;
771+ nextline = p + 1; /* This will begin the next line. */
772+
773+ if (nextline > buf)
774+ {
775+ /* Swallow separating blanks. */
776+ if (p >= buf)
777+ do
778+ --p;
779+ while (p >= buf && isblank (*p));
780+ nl = p + 1; /* The newline will replace the first blank. */
781+ }
782+ else
783+ {
784+ /* A single word that is greater than the maximum line width.
785+ Oh well. Put it on an overlong line by itself. */
786+ p = buf + (r + 1 - fs->point_col);
787+ /* Find the end of the long word. */
788+ do
789+ ++p;
790+ while (p < nl && !isblank (*p));
791+ if (p == nl)
792+ {
793+ /* It already ends a line. No fussing required. */
794+ fs->point_col = 0;
795+ buf = nl + 1;
796+ continue;
797+ }
798+ /* We will move the newline to replace the first blank. */
799+ nl = p;
800+ /* Swallow separating blanks. */
801+ do
802+ ++p;
803+ while (isblank (*p));
804+ /* The next line will start here. */
805+ nextline = p;
806+ }
807+
808+ /* Note: There are a bunch of tests below for
809+ NEXTLINE == BUF + LEN + 1; this case is where NL happens to fall
810+ at the end of the buffer, and NEXTLINE is in fact empty (and so
811+ we need not be careful to maintain its contents). */
812+
813+ if ((nextline == buf + len + 1
814+ ? fs->end - nl < fs->wmargin + 1
815+ : nextline - (nl + 1) < fs->wmargin)
816+ && fs->p > nextline)
817+ {
818+ /* The margin needs more blanks than we removed. */
819+ if (fs->end - fs->p > fs->wmargin + 1)
820+ /* Make some space for them. */
821+ {
822+ size_t mv = fs->p - nextline;
823+ memmove (nl + 1 + fs->wmargin, nextline, mv);
824+ nextline = nl + 1 + fs->wmargin;
825+ len = nextline + mv - buf;
826+ *nl++ = '\n';
827+ }
828+ else
829+ /* Output the first line so we can use the space. */
830+ {
831+#if defined _LIBC && defined USE_IN_LIBIO
832+ __fxprintf (fs->stream, "%.*s\n",
833+ (int) (nl - fs->buf), fs->buf);
834+#else
835+ if (nl > fs->buf)
836+ fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream);
837+ putc_unlocked ('\n', fs->stream);
838+#endif
839+
840+ len += buf - fs->buf;
841+ nl = buf = fs->buf;
842+ }
843+ }
844+ else
845+ /* We can fit the newline and blanks in before
846+ the next word. */
847+ *nl++ = '\n';
848+
849+ if (nextline - nl >= fs->wmargin
850+ || (nextline == buf + len + 1 && fs->end - nextline >= fs->wmargin))
851+ /* Add blanks up to the wrap margin column. */
852+ for (i = 0; i < fs->wmargin; ++i)
853+ *nl++ = ' ';
854+ else
855+ for (i = 0; i < fs->wmargin; ++i)
856+#ifdef USE_IN_LIBIO
857+ if (_IO_fwide (fs->stream, 0) > 0)
858+ putwc_unlocked (L' ', fs->stream);
859+ else
860+#endif
861+ putc_unlocked (' ', fs->stream);
862+
863+ /* Copy the tail of the original buffer into the current buffer
864+ position. */
865+ if (nl < nextline)
866+ memmove (nl, nextline, buf + len - nextline);
867+ len -= nextline - buf;
868+
869+ /* Continue the scan on the remaining lines in the buffer. */
870+ buf = nl;
871+
872+ /* Restore bufp to include all the remaining text. */
873+ fs->p = nl + len;
874+
875+ /* Reset the counter of what has been output this line. If wmargin
876+ is 0, we want to avoid the lmargin getting added, so we set
877+ point_col to a magic value of -1 in that case. */
878+ fs->point_col = fs->wmargin ? fs->wmargin : -1;
879+ }
880+ }
881+
882+ /* Remember that we've scanned as far as the end of the buffer. */
883+ fs->point_offs = fs->p - fs->buf;
884+}
885+
886+/* Ensure that FS has space for AMOUNT more bytes in its buffer, either by
887+ growing the buffer, or by flushing it. True is returned iff we succeed. */
888+int
889+__argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
890+{
891+ if ((size_t) (fs->end - fs->p) < amount)
892+ {
893+ ssize_t wrote;
894+
895+ /* Flush FS's buffer. */
896+ __argp_fmtstream_update (fs);
897+
898+#if defined _LIBC && defined USE_IN_LIBIO
899+ __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
900+ wrote = fs->p - fs->buf;
901+#else
902+ wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
903+#endif
904+ if (wrote == fs->p - fs->buf)
905+ {
906+ fs->p = fs->buf;
907+ fs->point_offs = 0;
908+ }
909+ else
910+ {
911+ fs->p -= wrote;
912+ fs->point_offs -= wrote;
913+ memmove (fs->buf, fs->buf + wrote, fs->p - fs->buf);
914+ return 0;
915+ }
916+
917+ if ((size_t) (fs->end - fs->buf) < amount)
918+ /* Gotta grow the buffer. */
919+ {
920+ size_t old_size = fs->end - fs->buf;
921+ size_t new_size = old_size + amount;
922+ char *new_buf;
923+
924+ if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size)))
925+ {
926+ __set_errno (ENOMEM);
927+ return 0;
928+ }
929+
930+ fs->buf = new_buf;
931+ fs->end = new_buf + new_size;
932+ fs->p = fs->buf;
933+ }
934+ }
935+
936+ return 1;
937+}
938+
939+ssize_t
940+__argp_fmtstream_printf (struct argp_fmtstream *fs, const char *fmt, ...)
941+{
942+ int out;
943+ size_t avail;
944+ size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to reserve. */
945+
946+ do
947+ {
948+ va_list args;
949+
950+ if (! __argp_fmtstream_ensure (fs, size_guess))
951+ return -1;
952+
953+ va_start (args, fmt);
954+ avail = fs->end - fs->p;
955+ out = __vsnprintf (fs->p, avail, fmt, args);
956+ va_end (args);
957+ if ((size_t) out >= avail)
958+ size_guess = out + 1;
959+ }
960+ while ((size_t) out >= avail);
961+
962+ fs->p += out;
963+
964+ return out;
965+}
966+#if 0
967+/* Not exported. */
968+#ifdef weak_alias
969+weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
970+#endif
971+#endif
972+
973+#endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
974Index: git/libuargp/argp-fmtstream.h
975===================================================================
976--- /dev/null 1970-01-01 00:00:00.000000000 +0000
977+++ git/libuargp/argp-fmtstream.h 2012-06-18 13:10:44.056825544 -0700
978@@ -0,0 +1,314 @@
979+/* Word-wrapping and line-truncating streams.
980+ Copyright (C) 1997 Free Software Foundation, Inc.
981+ This file is part of the GNU C Library.
982+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
983+
984+ The GNU C Library is free software; you can redistribute it and/or
985+ modify it under the terms of the GNU Lesser General Public
986+ License as published by the Free Software Foundation; either
987+ version 2.1 of the License, or (at your option) any later version.
988+
989+ The GNU C Library is distributed in the hope that it will be useful,
990+ but WITHOUT ANY WARRANTY; without even the implied warranty of
991+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
992+ Lesser General Public License for more details.
993+
994+ You should have received a copy of the GNU Lesser General Public
995+ License along with the GNU C Library; if not, write to the Free
996+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
997+ 02111-1307 USA.
998+
999+ Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
1000+*/
1001+
1002+/* This package emulates glibc `line_wrap_stream' semantics for systems that
1003+ don't have that. If the system does have it, it is just a wrapper for
1004+ that. This header file is only used internally while compiling argp, and
1005+ shouldn't be installed. */
1006+
1007+#ifndef _ARGP_FMTSTREAM_H
1008+#define _ARGP_FMTSTREAM_H
1009+
1010+#include <stdio.h>
1011+#include <string.h>
1012+#include <unistd.h>
1013+
1014+#ifndef __attribute__
1015+/* This feature is available in gcc versions 2.5 and later. */
1016+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__)
1017+# define __attribute__(Spec) /* empty */
1018+# endif
1019+/* The __-protected variants of `format' and `printf' attributes
1020+ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
1021+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__)
1022+# define __format__ format
1023+# define __printf__ printf
1024+# endif
1025+#endif
1026+
1027+#if 0 /* uClibc: disabled */
1028+#if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \
1029+ || (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H))
1030+/* line_wrap_stream is available, so use that. */
1031+#define ARGP_FMTSTREAM_USE_LINEWRAP
1032+#endif
1033+#else
1034+/* line_wrap stream NOT available */
1035+# undef ARGP_FMTSTREAM_USE_LINEWRAP
1036+#endif
1037+
1038+#ifdef ARGP_FMTSTREAM_USE_LINEWRAP
1039+/* Just be a simple wrapper for line_wrap_stream; the semantics are
1040+ *slightly* different, as line_wrap_stream doesn't actually make a new
1041+ object, it just modifies the given stream (reversibly) to do
1042+ line-wrapping. Since we control who uses this code, it doesn't matter. */
1043+
1044+#include <linewrap.h>
1045+
1046+typedef FILE *argp_fmtstream_t;
1047+
1048+#define argp_make_fmtstream line_wrap_stream
1049+#define __argp_make_fmtstream line_wrap_stream
1050+#define argp_fmtstream_free line_unwrap_stream
1051+#define __argp_fmtstream_free line_unwrap_stream
1052+
1053+#define __argp_fmtstream_putc(fs,ch) putc(ch,fs)
1054+#define argp_fmtstream_putc(fs,ch) putc(ch,fs)
1055+#define __argp_fmtstream_puts(fs,str) fputs(str,fs)
1056+#define argp_fmtstream_puts(fs,str) fputs(str,fs)
1057+#define __argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
1058+#define argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
1059+#define __argp_fmtstream_printf fprintf
1060+#define argp_fmtstream_printf fprintf
1061+
1062+#define __argp_fmtstream_lmargin line_wrap_lmargin
1063+#define argp_fmtstream_lmargin line_wrap_lmargin
1064+#define __argp_fmtstream_set_lmargin line_wrap_set_lmargin
1065+#define argp_fmtstream_set_lmargin line_wrap_set_lmargin
1066+#define __argp_fmtstream_rmargin line_wrap_rmargin
1067+#define argp_fmtstream_rmargin line_wrap_rmargin
1068+#define __argp_fmtstream_set_rmargin line_wrap_set_rmargin
1069+#define argp_fmtstream_set_rmargin line_wrap_set_rmargin
1070+#define __argp_fmtstream_wmargin line_wrap_wmargin
1071+#define argp_fmtstream_wmargin line_wrap_wmargin
1072+#define __argp_fmtstream_set_wmargin line_wrap_set_wmargin
1073+#define argp_fmtstream_set_wmargin line_wrap_set_wmargin
1074+#define __argp_fmtstream_point line_wrap_point
1075+#define argp_fmtstream_point line_wrap_point
1076+
1077+#else /* !ARGP_FMTSTREAM_USE_LINEWRAP */
1078+/* Guess we have to define our own version. */
1079+
1080+#ifndef __const
1081+#define __const const
1082+#endif
1083+
1084+struct argp_fmtstream
1085+{
1086+ FILE *stream; /* The stream we're outputting to. */
1087+
1088+ size_t lmargin, rmargin; /* Left and right margins. */
1089+ ssize_t wmargin; /* Margin to wrap to, or -1 to truncate. */
1090+
1091+ /* Point in buffer to which we've processed for wrapping, but not output. */
1092+ size_t point_offs;
1093+ /* Output column at POINT_OFFS, or -1 meaning 0 but don't add lmargin. */
1094+ ssize_t point_col;
1095+
1096+ char *buf; /* Output buffer. */
1097+ char *p; /* Current end of text in BUF. */
1098+ char *end; /* Absolute end of BUF. */
1099+};
1100+
1101+typedef struct argp_fmtstream *argp_fmtstream_t;
1102+
1103+/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
1104+ written on it with LMARGIN spaces and limits them to RMARGIN columns
1105+ total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
1106+ replacing the whitespace before them with a newline and WMARGIN spaces.
1107+ Otherwise, chars beyond RMARGIN are simply dropped until a newline.
1108+ Returns NULL if there was an error. */
1109+extern argp_fmtstream_t __argp_make_fmtstream (FILE *__stream,
1110+ size_t __lmargin,
1111+ size_t __rmargin,
1112+ ssize_t __wmargin);
1113+extern argp_fmtstream_t argp_make_fmtstream (FILE *__stream,
1114+ size_t __lmargin,
1115+ size_t __rmargin,
1116+ ssize_t __wmargin);
1117+
1118+/* Flush __FS to its stream, and free it (but don't close the stream). */
1119+extern void __argp_fmtstream_free (argp_fmtstream_t __fs);
1120+extern void argp_fmtstream_free (argp_fmtstream_t __fs);
1121+
1122+extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs,
1123+ __const char *__fmt, ...)
1124+ __attribute__ ((__format__ (printf, 2, 3)));
1125+extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs,
1126+ __const char *__fmt, ...)
1127+ __attribute__ ((__format__ (printf, 2, 3)));
1128+
1129+extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
1130+extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
1131+
1132+extern int __argp_fmtstream_puts (argp_fmtstream_t __fs, __const char *__str);
1133+extern int argp_fmtstream_puts (argp_fmtstream_t __fs, __const char *__str);
1134+
1135+extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs,
1136+ __const char *__str, size_t __len);
1137+extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
1138+ __const char *__str, size_t __len);
1139+
1140+/* Access macros for various bits of state. */
1141+#define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
1142+#define argp_fmtstream_rmargin(__fs) ((__fs)->rmargin)
1143+#define argp_fmtstream_wmargin(__fs) ((__fs)->wmargin)
1144+#define __argp_fmtstream_lmargin argp_fmtstream_lmargin
1145+#define __argp_fmtstream_rmargin argp_fmtstream_rmargin
1146+#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
1147+
1148+/* Set __FS's left margin to LMARGIN and return the old value. */
1149+extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
1150+ size_t __lmargin);
1151+extern size_t __argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
1152+ size_t __lmargin);
1153+
1154+/* Set __FS's right margin to __RMARGIN and return the old value. */
1155+extern size_t argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
1156+ size_t __rmargin);
1157+extern size_t __argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
1158+ size_t __rmargin);
1159+
1160+/* Set __FS's wrap margin to __WMARGIN and return the old value. */
1161+extern size_t argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
1162+ size_t __wmargin);
1163+extern size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
1164+ size_t __wmargin);
1165+
1166+/* Return the column number of the current output point in __FS. */
1167+extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
1168+extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
1169+
1170+/* Internal routines. */
1171+extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
1172+extern void __argp_fmtstream_update (argp_fmtstream_t __fs);
1173+extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
1174+extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
1175+
1176+#ifdef __OPTIMIZE__
1177+/* Inline versions of above routines. */
1178+
1179+#if !_LIBC
1180+#define __argp_fmtstream_putc argp_fmtstream_putc
1181+#define __argp_fmtstream_puts argp_fmtstream_puts
1182+#define __argp_fmtstream_write argp_fmtstream_write
1183+#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin
1184+#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin
1185+#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin
1186+#define __argp_fmtstream_point argp_fmtstream_point
1187+#define __argp_fmtstream_update _argp_fmtstream_update
1188+#define __argp_fmtstream_ensure _argp_fmtstream_ensure
1189+#endif
1190+
1191+#ifndef ARGP_FS_EI
1192+#define ARGP_FS_EI __extern_inline
1193+#endif
1194+
1195+ARGP_FS_EI size_t
1196+__argp_fmtstream_write (argp_fmtstream_t __fs,
1197+ __const char *__str, size_t __len)
1198+{
1199+ if (__fs->p + __len <= __fs->end || __argp_fmtstream_ensure (__fs, __len))
1200+ {
1201+ memcpy (__fs->p, __str, __len);
1202+ __fs->p += __len;
1203+ return __len;
1204+ }
1205+ else
1206+ return 0;
1207+}
1208+
1209+ARGP_FS_EI int
1210+__argp_fmtstream_puts (argp_fmtstream_t __fs, __const char *__str)
1211+{
1212+ size_t __len = strlen (__str);
1213+ if (__len)
1214+ {
1215+ size_t __wrote = __argp_fmtstream_write (__fs, __str, __len);
1216+ return __wrote == __len ? 0 : -1;
1217+ }
1218+ else
1219+ return 0;
1220+}
1221+
1222+ARGP_FS_EI int
1223+__argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch)
1224+{
1225+ if (__fs->p < __fs->end || __argp_fmtstream_ensure (__fs, 1))
1226+ return *__fs->p++ = __ch;
1227+ else
1228+ return EOF;
1229+}
1230+
1231+/* Set __FS's left margin to __LMARGIN and return the old value. */
1232+ARGP_FS_EI size_t
1233+__argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin)
1234+{
1235+ size_t __old;
1236+ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
1237+ __argp_fmtstream_update (__fs);
1238+ __old = __fs->lmargin;
1239+ __fs->lmargin = __lmargin;
1240+ return __old;
1241+}
1242+
1243+/* Set __FS's right margin to __RMARGIN and return the old value. */
1244+ARGP_FS_EI size_t
1245+__argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin)
1246+{
1247+ size_t __old;
1248+ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
1249+ __argp_fmtstream_update (__fs);
1250+ __old = __fs->rmargin;
1251+ __fs->rmargin = __rmargin;
1252+ return __old;
1253+}
1254+
1255+/* Set FS's wrap margin to __WMARGIN and return the old value. */
1256+ARGP_FS_EI size_t
1257+__argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin)
1258+{
1259+ size_t __old;
1260+ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
1261+ __argp_fmtstream_update (__fs);
1262+ __old = __fs->wmargin;
1263+ __fs->wmargin = __wmargin;
1264+ return __old;
1265+}
1266+
1267+/* Return the column number of the current output point in __FS. */
1268+ARGP_FS_EI size_t
1269+__argp_fmtstream_point (argp_fmtstream_t __fs)
1270+{
1271+ if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
1272+ __argp_fmtstream_update (__fs);
1273+ return __fs->point_col >= 0 ? __fs->point_col : 0;
1274+}
1275+
1276+#if !_LIBC
1277+#undef __argp_fmtstream_putc
1278+#undef __argp_fmtstream_puts
1279+#undef __argp_fmtstream_write
1280+#undef __argp_fmtstream_set_lmargin
1281+#undef __argp_fmtstream_set_rmargin
1282+#undef __argp_fmtstream_set_wmargin
1283+#undef __argp_fmtstream_point
1284+#undef __argp_fmtstream_update
1285+#undef __argp_fmtstream_ensure
1286+#endif
1287+
1288+#endif /* __OPTIMIZE__ */
1289+
1290+#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
1291+
1292+#endif /* argp-fmtstream.h */
1293Index: git/libuargp/argp-fs-xinl.c
1294===================================================================
1295--- /dev/null 1970-01-01 00:00:00.000000000 +0000
1296+++ git/libuargp/argp-fs-xinl.c 2012-06-18 13:10:44.056825544 -0700
1297@@ -0,0 +1,44 @@
1298+/* Real definitions for extern inline functions in argp-fmtstream.h
1299+ Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc.
1300+ This file is part of the GNU C Library.
1301+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
1302+
1303+ The GNU C Library is free software; you can redistribute it and/or
1304+ modify it under the terms of the GNU Lesser General Public
1305+ License as published by the Free Software Foundation; either
1306+ version 2.1 of the License, or (at your option) any later version.
1307+
1308+ The GNU C Library is distributed in the hope that it will be useful,
1309+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1310+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1311+ Lesser General Public License for more details.
1312+
1313+ You should have received a copy of the GNU Lesser General Public
1314+ License along with the GNU C Library; if not, write to the Free
1315+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1316+ 02111-1307 USA. */
1317+
1318+#ifdef HAVE_CONFIG_H
1319+# include <config.h>
1320+#endif
1321+
1322+#define ARGP_FS_EI
1323+#undef __OPTIMIZE__
1324+#define __OPTIMIZE__ 1
1325+#include "argp-fmtstream.h"
1326+
1327+#if 0
1328+/* Not exported. */
1329+/* Add weak aliases. */
1330+#if _LIBC - 0 && !defined (ARGP_FMTSTREAM_USE_LINEWRAP) && defined (weak_alias)
1331+
1332+weak_alias (__argp_fmtstream_putc, argp_fmtstream_putc)
1333+weak_alias (__argp_fmtstream_puts, argp_fmtstream_puts)
1334+weak_alias (__argp_fmtstream_write, argp_fmtstream_write)
1335+weak_alias (__argp_fmtstream_set_lmargin, argp_fmtstream_set_lmargin)
1336+weak_alias (__argp_fmtstream_set_rmargin, argp_fmtstream_set_rmargin)
1337+weak_alias (__argp_fmtstream_set_wmargin, argp_fmtstream_set_wmargin)
1338+weak_alias (__argp_fmtstream_point, argp_fmtstream_point)
1339+
1340+#endif
1341+#endif
1342Index: git/libuargp/argp-help.c
1343===================================================================
1344--- /dev/null 1970-01-01 00:00:00.000000000 +0000
1345+++ git/libuargp/argp-help.c 2012-06-18 13:10:44.060825542 -0700
1346@@ -0,0 +1,1882 @@
1347+/* Hierarchial argument parsing help output
1348+ Copyright (C) 1995-2003, 2004, 2005, 2006, 2007
1349+ Free Software Foundation, Inc.
1350+ This file is part of the GNU C Library.
1351+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
1352+
1353+ The GNU C Library is free software; you can redistribute it and/or
1354+ modify it under the terms of the GNU Lesser General Public
1355+ License as published by the Free Software Foundation; either
1356+ version 2.1 of the License, or (at your option) any later version.
1357+
1358+ The GNU C Library is distributed in the hope that it will be useful,
1359+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1360+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1361+ Lesser General Public License for more details.
1362+
1363+ You should have received a copy of the GNU Lesser General Public
1364+ License along with the GNU C Library; if not, write to the Free
1365+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1366+ 02111-1307 USA.
1367+
1368+ Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
1369+*/
1370+
1371+#ifndef _GNU_SOURCE
1372+# define _GNU_SOURCE 1
1373+#endif
1374+
1375+#ifdef HAVE_CONFIG_H
1376+#include <config.h>
1377+#endif
1378+
1379+/* AIX requires this to be the first thing in the file. */
1380+#ifndef __GNUC__
1381+# if HAVE_ALLOCA_H || defined _LIBC
1382+# include <alloca.h>
1383+# else
1384+# ifdef _AIX
1385+#pragma alloca
1386+# else
1387+# ifndef alloca /* predefined by HP cc +Olibcalls */
1388+char *alloca ();
1389+# endif
1390+# endif
1391+# endif
1392+#endif
1393+
1394+#include <stddef.h>
1395+#include <stdlib.h>
1396+#include <string.h>
1397+#include <assert.h>
1398+#include <stdarg.h>
1399+#include <ctype.h>
1400+#include <limits.h>
1401+#ifdef _LIBC
1402+# include <wchar.h>
1403+#endif
1404+
1405+#include <features.h>
1406+#ifndef _
1407+/* This is for other GNU distributions with internationalized messages. */
1408+# if (defined HAVE_LIBINTL_H || defined _LIBC) && defined __UCLIBC_HAS_GETTEXT_AWARENESS__
1409+# include <libintl.h>
1410+# ifdef _LIBC
1411+# undef dgettext
1412+# define dgettext(domain, msgid) \
1413+ INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
1414+# endif
1415+# else
1416+# define dgettext(domain, msgid) (msgid)
1417+# endif
1418+#endif
1419+
1420+#ifndef _LIBC
1421+# if HAVE_STRERROR_R
1422+# if !HAVE_DECL_STRERROR_R
1423+char *strerror_r (int errnum, char *buf, size_t buflen);
1424+# endif
1425+# else
1426+# if !HAVE_DECL_STRERROR
1427+char *strerror (int errnum);
1428+# endif
1429+# endif
1430+#endif
1431+
1432+#include <argp.h>
1433+#include "argp-fmtstream.h"
1434+#include <stdbool.h>
1435+#include <stdint.h>
1436+
1437+#ifndef SIZE_MAX
1438+# define SIZE_MAX ((size_t) -1)
1439+#endif
1440+
1441+/* User-selectable (using an environment variable) formatting parameters.
1442+
1443+ These may be specified in an environment variable called `ARGP_HELP_FMT',
1444+ with a contents like: VAR1=VAL1,VAR2=VAL2,BOOLVAR2,no-BOOLVAR2
1445+ Where VALn must be a positive integer. The list of variables is in the
1446+ UPARAM_NAMES vector, below. */
1447+
1448+/* Default parameters. */
1449+#define DUP_ARGS 0 /* True if option argument can be duplicated. */
1450+#define DUP_ARGS_NOTE 1 /* True to print a note about duplicate args. */
1451+#define SHORT_OPT_COL 2 /* column in which short options start */
1452+#define LONG_OPT_COL 6 /* column in which long options start */
1453+#define DOC_OPT_COL 2 /* column in which doc options start */
1454+#define OPT_DOC_COL 29 /* column in which option text starts */
1455+#define HEADER_COL 1 /* column in which group headers are printed */
1456+#define USAGE_INDENT 12 /* indentation of wrapped usage lines */
1457+#define RMARGIN 79 /* right margin used for wrapping */
1458+
1459+/* User-selectable (using an environment variable) formatting parameters.
1460+ They must all be of type `int' for the parsing code to work. */
1461+struct uparams
1462+{
1463+ /* If true, arguments for an option are shown with both short and long
1464+ options, even when a given option has both, e.g. `-x ARG, --longx=ARG'.
1465+ If false, then if an option has both, the argument is only shown with
1466+ the long one, e.g., `-x, --longx=ARG', and a message indicating that
1467+ this really means both is printed below the options. */
1468+ int dup_args;
1469+
1470+ /* This is true if when DUP_ARGS is false, and some duplicate arguments have
1471+ been suppressed, an explanatory message should be printed. */
1472+ int dup_args_note;
1473+
1474+ /* Various output columns. */
1475+ int short_opt_col;
1476+ int long_opt_col;
1477+ int doc_opt_col;
1478+ int opt_doc_col;
1479+ int header_col;
1480+ int usage_indent;
1481+ int rmargin;
1482+};
1483+
1484+/* This is a global variable, as user options are only ever read once. */
1485+static struct uparams uparams = {
1486+ DUP_ARGS, DUP_ARGS_NOTE,
1487+ SHORT_OPT_COL, LONG_OPT_COL, DOC_OPT_COL, OPT_DOC_COL, HEADER_COL,
1488+ USAGE_INDENT, RMARGIN
1489+};
1490+
1491+/* A particular uparam, and what the user name is. */
1492+struct uparam_name
1493+{
1494+ const char name[14]; /* User name. */
1495+ bool is_bool; /* Whether it's `boolean'. */
1496+ uint8_t uparams_offs; /* Location of the (int) field in UPARAMS. */
1497+};
1498+
1499+/* The name-field mappings we know about. */
1500+static const struct uparam_name uparam_names[] =
1501+{
1502+ { "dup-args", true, offsetof (struct uparams, dup_args) },
1503+ { "dup-args-note", true, offsetof (struct uparams, dup_args_note) },
1504+ { "short-opt-col", false, offsetof (struct uparams, short_opt_col) },
1505+ { "long-opt-col", false, offsetof (struct uparams, long_opt_col) },
1506+ { "doc-opt-col", false, offsetof (struct uparams, doc_opt_col) },
1507+ { "opt-doc-col", false, offsetof (struct uparams, opt_doc_col) },
1508+ { "header-col", false, offsetof (struct uparams, header_col) },
1509+ { "usage-indent", false, offsetof (struct uparams, usage_indent) },
1510+ { "rmargin", false, offsetof (struct uparams, rmargin) }
1511+};
1512+#define nuparam_names (sizeof (uparam_names) / sizeof (uparam_names[0]))
1513+
1514+/* Read user options from the environment, and fill in UPARAMS appropiately. */
1515+static void
1516+fill_in_uparams (const struct argp_state *state)
1517+{
1518+ const char *var = getenv ("ARGP_HELP_FMT");
1519+
1520+#define SKIPWS(p) do { while (isspace (*p)) p++; } while (0);
1521+
1522+ if (var)
1523+ /* Parse var. */
1524+ while (*var)
1525+ {
1526+ SKIPWS (var);
1527+
1528+ if (isalpha (*var))
1529+ {
1530+ size_t var_len;
1531+ const struct uparam_name *un;
1532+ int unspec = 0, val = 0;
1533+ const char *arg = var;
1534+
1535+ while (isalnum (*arg) || *arg == '-' || *arg == '_')
1536+ arg++;
1537+ var_len = arg - var;
1538+
1539+ SKIPWS (arg);
1540+
1541+ if (*arg == '\0' || *arg == ',')
1542+ unspec = 1;
1543+ else if (*arg == '=')
1544+ {
1545+ arg++;
1546+ SKIPWS (arg);
1547+ }
1548+
1549+ if (unspec)
1550+ {
1551+ if (var[0] == 'n' && var[1] == 'o' && var[2] == '-')
1552+ {
1553+ val = 0;
1554+ var += 3;
1555+ var_len -= 3;
1556+ }
1557+ else
1558+ val = 1;
1559+ }
1560+ else if (isdigit (*arg))
1561+ {
1562+ val = atoi (arg);
1563+ while (isdigit (*arg))
1564+ arg++;
1565+ SKIPWS (arg);
1566+ }
1567+
1568+ un = uparam_names;
1569+ size_t u;
1570+ for (u = 0; u < nuparam_names; ++un, ++u)
1571+ if (strlen (un->name) == var_len
1572+ && strncmp (var, un->name, var_len) == 0)
1573+ {
1574+ if (unspec && !un->is_bool)
1575+ argp_failure (state, 0, 0,
1576+ dgettext (state == NULL ? NULL
1577+ : state->root_argp->argp_domain,
1578+ "\
1579+%.*s: ARGP_HELP_FMT parameter requires a value"),
1580+ (int) var_len, var);
1581+ else
1582+ *(int *)((char *)&uparams + un->uparams_offs) = val;
1583+ break;
1584+ }
1585+ if (u == nuparam_names)
1586+ argp_failure (state, 0, 0,
1587+ dgettext (state == NULL ? NULL
1588+ : state->root_argp->argp_domain, "\
1589+%.*s: Unknown ARGP_HELP_FMT parameter"),
1590+ (int) var_len, var);
1591+
1592+ var = arg;
1593+ if (*var == ',')
1594+ var++;
1595+ }
1596+ else if (*var)
1597+ {
1598+ argp_failure (state, 0, 0,
1599+ dgettext (state == NULL ? NULL
1600+ : state->root_argp->argp_domain,
1601+ "Garbage in ARGP_HELP_FMT: %s"), var);
1602+ break;
1603+ }
1604+ }
1605+}
1606+
1607+/* Returns true if OPT hasn't been marked invisible. Visibility only affects
1608+ whether OPT is displayed or used in sorting, not option shadowing. */
1609+#define ovisible(opt) (! ((opt)->flags & OPTION_HIDDEN))
1610+
1611+/* Returns true if OPT is an alias for an earlier option. */
1612+#define oalias(opt) ((opt)->flags & OPTION_ALIAS)
1613+
1614+/* Returns true if OPT is an documentation-only entry. */
1615+#define odoc(opt) ((opt)->flags & OPTION_DOC)
1616+
1617+/* Returns true if OPT is the end-of-list marker for a list of options. */
1618+#define oend(opt) __option_is_end (opt)
1619+
1620+/* Returns true if OPT has a short option. */
1621+#define oshort(opt) __option_is_short (opt)
1622+
1623+/*
1624+ The help format for a particular option is like:
1625+
1626+ -xARG, -yARG, --long1=ARG, --long2=ARG Documentation...
1627+
1628+ Where ARG will be omitted if there's no argument, for this option, or
1629+ will be surrounded by "[" and "]" appropiately if the argument is
1630+ optional. The documentation string is word-wrapped appropiately, and if
1631+ the list of options is long enough, it will be started on a separate line.
1632+ If there are no short options for a given option, the first long option is
1633+ indented slighly in a way that's supposed to make most long options appear
1634+ to be in a separate column.
1635+
1636+ For example, the following output (from ps):
1637+
1638+ -p PID, --pid=PID List the process PID
1639+ --pgrp=PGRP List processes in the process group PGRP
1640+ -P, -x, --no-parent Include processes without parents
1641+ -Q, --all-fields Don't elide unusable fields (normally if there's
1642+ some reason ps can't print a field for any
1643+ process, it's removed from the output entirely)
1644+ -r, --reverse, --gratuitously-long-reverse-option
1645+ Reverse the order of any sort
1646+ --session[=SID] Add the processes from the session SID (which
1647+ defaults to the sid of the current process)
1648+
1649+ Here are some more options:
1650+ -f ZOT, --foonly=ZOT Glork a foonly
1651+ -z, --zaza Snit a zar
1652+
1653+ -?, --help Give this help list
1654+ --usage Give a short usage message
1655+ -V, --version Print program version
1656+
1657+ The struct argp_option array for the above could look like:
1658+
1659+ {
1660+ {"pid", 'p', "PID", 0, "List the process PID"},
1661+ {"pgrp", OPT_PGRP, "PGRP", 0, "List processes in the process group PGRP"},
1662+ {"no-parent", 'P', 0, 0, "Include processes without parents"},
1663+ {0, 'x', 0, OPTION_ALIAS},
1664+ {"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally"
1665+ " if there's some reason ps can't"
1666+ " print a field for any process, it's"
1667+ " removed from the output entirely)" },
1668+ {"reverse", 'r', 0, 0, "Reverse the order of any sort"},
1669+ {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS},
1670+ {"session", OPT_SESS, "SID", OPTION_ARG_OPTIONAL,
1671+ "Add the processes from the session"
1672+ " SID (which defaults to the sid of"
1673+ " the current process)" },
1674+
1675+ {0,0,0,0, "Here are some more options:"},
1676+ {"foonly", 'f', "ZOT", 0, "Glork a foonly"},
1677+ {"zaza", 'z', 0, 0, "Snit a zar"},
1678+
1679+ {0}
1680+ }
1681+
1682+ Note that the last three options are automatically supplied by argp_parse,
1683+ unless you tell it not to with ARGP_NO_HELP.
1684+
1685+*/
1686+
1687+/* Returns true if CH occurs between BEG and END. */
1688+static int
1689+find_char (char ch, char *beg, char *end)
1690+{
1691+ while (beg < end)
1692+ if (*beg == ch)
1693+ return 1;
1694+ else
1695+ beg++;
1696+ return 0;
1697+}
1698+
1699+struct hol_cluster; /* fwd decl */
1700+
1701+struct hol_entry
1702+{
1703+ /* First option. */
1704+ const struct argp_option *opt;
1705+ /* Number of options (including aliases). */
1706+ unsigned num;
1707+
1708+ /* A pointers into the HOL's short_options field, to the first short option
1709+ letter for this entry. The order of the characters following this point
1710+ corresponds to the order of options pointed to by OPT, and there are at
1711+ most NUM. A short option recorded in a option following OPT is only
1712+ valid if it occurs in the right place in SHORT_OPTIONS (otherwise it's
1713+ probably been shadowed by some other entry). */
1714+ char *short_options;
1715+
1716+ /* Entries are sorted by their group first, in the order:
1717+ 1, 2, ..., n, 0, -m, ..., -2, -1
1718+ and then alphabetically within each group. The default is 0. */
1719+ int group;
1720+
1721+ /* The cluster of options this entry belongs to, or 0 if none. */
1722+ struct hol_cluster *cluster;
1723+
1724+ /* The argp from which this option came. */
1725+ const struct argp *argp;
1726+};
1727+
1728+/* A cluster of entries to reflect the argp tree structure. */
1729+struct hol_cluster
1730+{
1731+ /* A descriptive header printed before options in this cluster. */
1732+ const char *header;
1733+
1734+ /* Used to order clusters within the same group with the same parent,
1735+ according to the order in which they occurred in the parent argp's child
1736+ list. */
1737+ int index;
1738+
1739+ /* How to sort this cluster with respect to options and other clusters at the
1740+ same depth (clusters always follow options in the same group). */
1741+ int group;
1742+
1743+ /* The cluster to which this cluster belongs, or 0 if it's at the base
1744+ level. */
1745+ struct hol_cluster *parent;
1746+
1747+ /* The argp from which this cluster is (eventually) derived. */
1748+ const struct argp *argp;
1749+
1750+ /* The distance this cluster is from the root. */
1751+ int depth;
1752+
1753+ /* Clusters in a given hol are kept in a linked list, to make freeing them
1754+ possible. */
1755+ struct hol_cluster *next;
1756+};
1757+
1758+/* A list of options for help. */
1759+struct hol
1760+{
1761+ /* An array of hol_entry's. */
1762+ struct hol_entry *entries;
1763+ /* The number of entries in this hol. If this field is zero, the others
1764+ are undefined. */
1765+ unsigned num_entries;
1766+
1767+ /* A string containing all short options in this HOL. Each entry contains
1768+ pointers into this string, so the order can't be messed with blindly. */
1769+ char *short_options;
1770+
1771+ /* Clusters of entries in this hol. */
1772+ struct hol_cluster *clusters;
1773+};
1774+
1775+/* Create a struct hol from the options in ARGP. CLUSTER is the
1776+ hol_cluster in which these entries occur, or 0, if at the root. */
1777+static struct hol *
1778+make_hol (const struct argp *argp, struct hol_cluster *cluster)
1779+{
1780+ char *so;
1781+ const struct argp_option *o;
1782+ const struct argp_option *opts = argp->options;
1783+ struct hol_entry *entry;
1784+ unsigned num_short_options = 0;
1785+ struct hol *hol = malloc (sizeof (struct hol));
1786+
1787+ assert (hol);
1788+
1789+ hol->num_entries = 0;
1790+ hol->clusters = 0;
1791+
1792+ if (opts)
1793+ {
1794+ int cur_group = 0;
1795+
1796+ /* The first option must not be an alias. */
1797+ assert (! oalias (opts));
1798+
1799+ /* Calculate the space needed. */
1800+ for (o = opts; ! oend (o); o++)
1801+ {
1802+ if (! oalias (o))
1803+ hol->num_entries++;
1804+ if (oshort (o))
1805+ num_short_options++; /* This is an upper bound. */
1806+ }
1807+
1808+ hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries);
1809+ hol->short_options = malloc (num_short_options + 1);
1810+
1811+ assert (hol->entries && hol->short_options);
1812+#if SIZE_MAX <= UINT_MAX
1813+ assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
1814+#endif
1815+
1816+ /* Fill in the entries. */
1817+ so = hol->short_options;
1818+ for (o = opts, entry = hol->entries; ! oend (o); entry++)
1819+ {
1820+ entry->opt = o;
1821+ entry->num = 0;
1822+ entry->short_options = so;
1823+ entry->group = cur_group =
1824+ o->group
1825+ ? o->group
1826+ : ((!o->name && !o->key)
1827+ ? cur_group + 1
1828+ : cur_group);
1829+ entry->cluster = cluster;
1830+ entry->argp = argp;
1831+
1832+ do
1833+ {
1834+ entry->num++;
1835+ if (oshort (o) && ! find_char (o->key, hol->short_options, so))
1836+ /* O has a valid short option which hasn't already been used.*/
1837+ *so++ = o->key;
1838+ o++;
1839+ }
1840+ while (! oend (o) && oalias (o));
1841+ }
1842+ *so = '\0'; /* null terminated so we can find the length */
1843+ }
1844+
1845+ return hol;
1846+}
1847+
1848+/* Add a new cluster to HOL, with the given GROUP and HEADER (taken from the
1849+ associated argp child list entry), INDEX, and PARENT, and return a pointer
1850+ to it. ARGP is the argp that this cluster results from. */
1851+static struct hol_cluster *
1852+hol_add_cluster (struct hol *hol, int group, const char *header, int index,
1853+ struct hol_cluster *parent, const struct argp *argp)
1854+{
1855+ struct hol_cluster *cl = malloc (sizeof (struct hol_cluster));
1856+ if (cl)
1857+ {
1858+ cl->group = group;
1859+ cl->header = header;
1860+
1861+ cl->index = index;
1862+ cl->parent = parent;
1863+ cl->argp = argp;
1864+ cl->depth = parent ? parent->depth + 1 : 0;
1865+
1866+ cl->next = hol->clusters;
1867+ hol->clusters = cl;
1868+ }
1869+ return cl;
1870+}
1871+
1872+/* Free HOL and any resources it uses. */
1873+static void
1874+hol_free (struct hol *hol)
1875+{
1876+ struct hol_cluster *cl = hol->clusters;
1877+
1878+ while (cl)
1879+ {
1880+ struct hol_cluster *next = cl->next;
1881+ free (cl);
1882+ cl = next;
1883+ }
1884+
1885+ if (hol->num_entries > 0)
1886+ {
1887+ free (hol->entries);
1888+ free (hol->short_options);
1889+ }
1890+
1891+ free (hol);
1892+}
1893+
1894+static int
1895+hol_entry_short_iterate (const struct hol_entry *entry,
1896+ int (*func)(const struct argp_option *opt,
1897+ const struct argp_option *real,
1898+ const char *domain, void *cookie),
1899+ const char *domain, void *cookie)
1900+{
1901+ unsigned nopts;
1902+ int val = 0;
1903+ const struct argp_option *opt, *real = entry->opt;
1904+ char *so = entry->short_options;
1905+
1906+ for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
1907+ if (oshort (opt) && *so == opt->key)
1908+ {
1909+ if (!oalias (opt))
1910+ real = opt;
1911+ if (ovisible (opt))
1912+ val = (*func)(opt, real, domain, cookie);
1913+ so++;
1914+ }
1915+
1916+ return val;
1917+}
1918+
1919+static __inline__ int
1920+__attribute__ ((always_inline))
1921+hol_entry_long_iterate (const struct hol_entry *entry,
1922+ int (*func)(const struct argp_option *opt,
1923+ const struct argp_option *real,
1924+ const char *domain, void *cookie),
1925+ const char *domain, void *cookie)
1926+{
1927+ unsigned nopts;
1928+ int val = 0;
1929+ const struct argp_option *opt, *real = entry->opt;
1930+
1931+ for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
1932+ if (opt->name)
1933+ {
1934+ if (!oalias (opt))
1935+ real = opt;
1936+ if (ovisible (opt))
1937+ val = (*func)(opt, real, domain, cookie);
1938+ }
1939+
1940+ return val;
1941+}
1942+
1943+/* Iterator that returns true for the first short option. */
1944+static __inline__ int
1945+until_short (const struct argp_option *opt, const struct argp_option *real,
1946+ const char *domain, void *cookie)
1947+{
1948+ return oshort (opt) ? opt->key : 0;
1949+}
1950+
1951+/* Returns the first valid short option in ENTRY, or 0 if there is none. */
1952+static char
1953+hol_entry_first_short (const struct hol_entry *entry)
1954+{
1955+ return hol_entry_short_iterate (entry, until_short,
1956+ entry->argp->argp_domain, 0);
1957+}
1958+
1959+/* Returns the first valid long option in ENTRY, or 0 if there is none. */
1960+static const char *
1961+hol_entry_first_long (const struct hol_entry *entry)
1962+{
1963+ const struct argp_option *opt;
1964+ unsigned num;
1965+ for (opt = entry->opt, num = entry->num; num > 0; opt++, num--)
1966+ if (opt->name && ovisible (opt))
1967+ return opt->name;
1968+ return 0;
1969+}
1970+
1971+/* Returns the entry in HOL with the long option name NAME, or 0 if there is
1972+ none. */
1973+static struct hol_entry *
1974+hol_find_entry (struct hol *hol, const char *name)
1975+{
1976+ struct hol_entry *entry = hol->entries;
1977+ unsigned num_entries = hol->num_entries;
1978+
1979+ while (num_entries-- > 0)
1980+ {
1981+ const struct argp_option *opt = entry->opt;
1982+ unsigned num_opts = entry->num;
1983+
1984+ while (num_opts-- > 0)
1985+ if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0)
1986+ return entry;
1987+ else
1988+ opt++;
1989+
1990+ entry++;
1991+ }
1992+
1993+ return 0;
1994+}
1995+
1996+/* If an entry with the long option NAME occurs in HOL, set it's special
1997+ sort position to GROUP. */
1998+static void
1999+hol_set_group (struct hol *hol, const char *name, int group)
2000+{
2001+ struct hol_entry *entry = hol_find_entry (hol, name);
2002+ if (entry)
2003+ entry->group = group;
2004+}
2005+
2006+/* Order by group: 0, 1, 2, ..., n, -m, ..., -2, -1.
2007+ EQ is what to return if GROUP1 and GROUP2 are the same. */
2008+static int
2009+group_cmp (int group1, int group2, int eq)
2010+{
2011+ if (group1 == group2)
2012+ return eq;
2013+ else if ((group1 < 0 && group2 < 0) || (group1 >= 0 && group2 >= 0))
2014+ return group1 - group2;
2015+ else
2016+ return group2 - group1;
2017+}
2018+
2019+/* Compare clusters CL1 & CL2 by the order that they should appear in
2020+ output. */
2021+static int
2022+hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2)
2023+{
2024+ /* If one cluster is deeper than the other, use its ancestor at the same
2025+ level, so that finding the common ancestor is straightforward. */
2026+ while (cl1->depth > cl2->depth)
2027+ cl1 = cl1->parent;
2028+ while (cl2->depth > cl1->depth)
2029+ cl2 = cl2->parent;
2030+
2031+ /* Now reduce both clusters to their ancestors at the point where both have
2032+ a common parent; these can be directly compared. */
2033+ while (cl1->parent != cl2->parent)
2034+ cl1 = cl1->parent, cl2 = cl2->parent;
2035+
2036+ return group_cmp (cl1->group, cl2->group, cl2->index - cl1->index);
2037+}
2038+
2039+/* Return the ancestor of CL that's just below the root (i.e., has a parent
2040+ of 0). */
2041+static struct hol_cluster *
2042+hol_cluster_base (struct hol_cluster *cl)
2043+{
2044+ while (cl->parent)
2045+ cl = cl->parent;
2046+ return cl;
2047+}
2048+
2049+/* Return true if CL1 is a child of CL2. */
2050+static int
2051+hol_cluster_is_child (const struct hol_cluster *cl1,
2052+ const struct hol_cluster *cl2)
2053+{
2054+ while (cl1 && cl1 != cl2)
2055+ cl1 = cl1->parent;
2056+ return cl1 == cl2;
2057+}
2058+
2059+/* Given the name of a OPTION_DOC option, modifies NAME to start at the tail
2060+ that should be used for comparisons, and returns true iff it should be
2061+ treated as a non-option. */
2062+static int
2063+canon_doc_option (const char **name)
2064+{
2065+ int non_opt;
2066+ /* Skip initial whitespace. */
2067+ while (isspace (**name))
2068+ (*name)++;
2069+ /* Decide whether this looks like an option (leading `-') or not. */
2070+ non_opt = (**name != '-');
2071+ /* Skip until part of name used for sorting. */
2072+ while (**name && !isalnum (**name))
2073+ (*name)++;
2074+ return non_opt;
2075+}
2076+
2077+/* Order ENTRY1 & ENTRY2 by the order which they should appear in a help
2078+ listing. */
2079+static int
2080+hol_entry_cmp (const struct hol_entry *entry1,
2081+ const struct hol_entry *entry2)
2082+{
2083+ /* The group numbers by which the entries should be ordered; if either is
2084+ in a cluster, then this is just the group within the cluster. */
2085+ int group1 = entry1->group, group2 = entry2->group;
2086+
2087+ if (entry1->cluster != entry2->cluster)
2088+ {
2089+ /* The entries are not within the same cluster, so we can't compare them
2090+ directly, we have to use the appropiate clustering level too. */
2091+ if (! entry1->cluster)
2092+ /* ENTRY1 is at the `base level', not in a cluster, so we have to
2093+ compare it's group number with that of the base cluster in which
2094+ ENTRY2 resides. Note that if they're in the same group, the
2095+ clustered option always comes laster. */
2096+ return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1);
2097+ else if (! entry2->cluster)
2098+ /* Likewise, but ENTRY2's not in a cluster. */
2099+ return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1);
2100+ else
2101+ /* Both entries are in clusters, we can just compare the clusters. */
2102+ return hol_cluster_cmp (entry1->cluster, entry2->cluster);
2103+ }
2104+ else if (group1 == group2)
2105+ /* The entries are both in the same cluster and group, so compare them
2106+ alphabetically. */
2107+ {
2108+ int short1 = hol_entry_first_short (entry1);
2109+ int short2 = hol_entry_first_short (entry2);
2110+ int doc1 = odoc (entry1->opt);
2111+ int doc2 = odoc (entry2->opt);
2112+ const char *long1 = hol_entry_first_long (entry1);
2113+ const char *long2 = hol_entry_first_long (entry2);
2114+
2115+ if (doc1)
2116+ doc1 = long1 != NULL && canon_doc_option (&long1);
2117+ if (doc2)
2118+ doc2 = long2 != NULL && canon_doc_option (&long2);
2119+
2120+ if (doc1 != doc2)
2121+ /* `documentation' options always follow normal options (or
2122+ documentation options that *look* like normal options). */
2123+ return doc1 - doc2;
2124+ else if (!short1 && !short2 && long1 && long2)
2125+ /* Only long options. */
2126+ return strcasecmp (long1, long2);
2127+ else
2128+ /* Compare short/short, long/short, short/long, using the first
2129+ character of long options. Entries without *any* valid
2130+ options (such as options with OPTION_HIDDEN set) will be put
2131+ first, but as they're not displayed, it doesn't matter where
2132+ they are. */
2133+ {
2134+ char first1 = short1 ? short1 : long1 ? *long1 : 0;
2135+ char first2 = short2 ? short2 : long2 ? *long2 : 0;
2136+#ifdef _tolower
2137+ int lower_cmp = _tolower (first1) - _tolower (first2);
2138+#else
2139+ int lower_cmp = tolower (first1) - tolower (first2);
2140+#endif
2141+ /* Compare ignoring case, except when the options are both the
2142+ same letter, in which case lower-case always comes first. */
2143+ return lower_cmp ? lower_cmp : first2 - first1;
2144+ }
2145+ }
2146+ else
2147+ /* Within the same cluster, but not the same group, so just compare
2148+ groups. */
2149+ return group_cmp (group1, group2, 0);
2150+}
2151+
2152+/* Version of hol_entry_cmp with correct signature for qsort. */
2153+static int
2154+hol_entry_qcmp (const void *entry1_v, const void *entry2_v)
2155+{
2156+ return hol_entry_cmp (entry1_v, entry2_v);
2157+}
2158+
2159+/* Sort HOL by group and alphabetically by option name (with short options
2160+ taking precedence over long). Since the sorting is for display purposes
2161+ only, the shadowing of options isn't effected. */
2162+static void
2163+hol_sort (struct hol *hol)
2164+{
2165+ if (hol->num_entries > 0)
2166+ qsort (hol->entries, hol->num_entries, sizeof (struct hol_entry),
2167+ hol_entry_qcmp);
2168+}
2169+
2170+/* Append MORE to HOL, destroying MORE in the process. Options in HOL shadow
2171+ any in MORE with the same name. */
2172+static void
2173+hol_append (struct hol *hol, struct hol *more)
2174+{
2175+ struct hol_cluster **cl_end = &hol->clusters;
2176+
2177+ /* Steal MORE's cluster list, and add it to the end of HOL's. */
2178+ while (*cl_end)
2179+ cl_end = &(*cl_end)->next;
2180+ *cl_end = more->clusters;
2181+ more->clusters = 0;
2182+
2183+ /* Merge entries. */
2184+ if (more->num_entries > 0)
2185+ {
2186+ if (hol->num_entries == 0)
2187+ {
2188+ hol->num_entries = more->num_entries;
2189+ hol->entries = more->entries;
2190+ hol->short_options = more->short_options;
2191+ more->num_entries = 0; /* Mark MORE's fields as invalid. */
2192+ }
2193+ else
2194+ /* Append the entries in MORE to those in HOL, taking care to only add
2195+ non-shadowed SHORT_OPTIONS values. */
2196+ {
2197+ unsigned left;
2198+ char *so, *more_so;
2199+ struct hol_entry *e;
2200+ unsigned num_entries = hol->num_entries + more->num_entries;
2201+ struct hol_entry *entries =
2202+ malloc (num_entries * sizeof (struct hol_entry));
2203+ unsigned hol_so_len = strlen (hol->short_options);
2204+ char *short_options =
2205+ malloc (hol_so_len + strlen (more->short_options) + 1);
2206+
2207+ assert (entries && short_options);
2208+#if SIZE_MAX <= UINT_MAX
2209+ assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry));
2210+#endif
2211+
2212+ mempcpy (mempcpy (entries, hol->entries,
2213+ hol->num_entries * sizeof (struct hol_entry)),
2214+ more->entries,
2215+ more->num_entries * sizeof (struct hol_entry));
2216+
2217+ mempcpy (short_options, hol->short_options, hol_so_len);
2218+
2219+ /* Fix up the short options pointers from HOL. */
2220+ for (e = entries, left = hol->num_entries; left > 0; e++, left--)
2221+ e->short_options += (short_options - hol->short_options);
2222+
2223+ /* Now add the short options from MORE, fixing up its entries
2224+ too. */
2225+ so = short_options + hol_so_len;
2226+ more_so = more->short_options;
2227+ for (left = more->num_entries; left > 0; e++, left--)
2228+ {
2229+ int opts_left;
2230+ const struct argp_option *opt;
2231+
2232+ e->short_options = so;
2233+
2234+ for (opts_left = e->num, opt = e->opt; opts_left; opt++, opts_left--)
2235+ {
2236+ int ch = *more_so;
2237+ if (oshort (opt) && ch == opt->key)
2238+ /* The next short option in MORE_SO, CH, is from OPT. */
2239+ {
2240+ if (! find_char (ch, short_options,
2241+ short_options + hol_so_len))
2242+ /* The short option CH isn't shadowed by HOL's options,
2243+ so add it to the sum. */
2244+ *so++ = ch;
2245+ more_so++;
2246+ }
2247+ }
2248+ }
2249+
2250+ *so = '\0';
2251+
2252+ free (hol->entries);
2253+ free (hol->short_options);
2254+
2255+ hol->entries = entries;
2256+ hol->num_entries = num_entries;
2257+ hol->short_options = short_options;
2258+ }
2259+ }
2260+
2261+ hol_free (more);
2262+}
2263+
2264+/* Inserts enough spaces to make sure STREAM is at column COL. */
2265+static void
2266+indent_to (argp_fmtstream_t stream, unsigned col)
2267+{
2268+ int needed = col - __argp_fmtstream_point (stream);
2269+ while (needed-- > 0)
2270+ __argp_fmtstream_putc (stream, ' ');
2271+}
2272+
2273+/* Output to STREAM either a space, or a newline if there isn't room for at
2274+ least ENSURE characters before the right margin. */
2275+static void
2276+space (argp_fmtstream_t stream, size_t ensure)
2277+{
2278+ if (__argp_fmtstream_point (stream) + ensure
2279+ >= __argp_fmtstream_rmargin (stream))
2280+ __argp_fmtstream_putc (stream, '\n');
2281+ else
2282+ __argp_fmtstream_putc (stream, ' ');
2283+}
2284+
2285+/* If the option REAL has an argument, we print it in using the printf
2286+ format REQ_FMT or OPT_FMT depending on whether it's a required or
2287+ optional argument. */
2288+static void
2289+arg (const struct argp_option *real, const char *req_fmt, const char *opt_fmt,
2290+ const char *domain, argp_fmtstream_t stream)
2291+{
2292+ if (real->arg)
2293+ {
2294+ if (real->flags & OPTION_ARG_OPTIONAL)
2295+ __argp_fmtstream_printf (stream, opt_fmt,
2296+ dgettext (domain, real->arg));
2297+ else
2298+ __argp_fmtstream_printf (stream, req_fmt,
2299+ dgettext (domain, real->arg));
2300+ }
2301+}
2302+
2303+/* Helper functions for hol_entry_help. */
2304+
2305+/* State used during the execution of hol_help. */
2306+struct hol_help_state
2307+{
2308+ /* PREV_ENTRY should contain the previous entry printed, or 0. */
2309+ struct hol_entry *prev_entry;
2310+
2311+ /* If an entry is in a different group from the previous one, and SEP_GROUPS
2312+ is true, then a blank line will be printed before any output. */
2313+ int sep_groups;
2314+
2315+ /* True if a duplicate option argument was suppressed (only ever set if
2316+ UPARAMS.dup_args is false). */
2317+ int suppressed_dup_arg;
2318+};
2319+
2320+/* Some state used while printing a help entry (used to communicate with
2321+ helper functions). See the doc for hol_entry_help for more info, as most
2322+ of the fields are copied from its arguments. */
2323+struct pentry_state
2324+{
2325+ const struct hol_entry *entry;
2326+ argp_fmtstream_t stream;
2327+ struct hol_help_state *hhstate;
2328+
2329+ /* True if nothing's been printed so far. */
2330+ int first;
2331+
2332+ /* If non-zero, the state that was used to print this help. */
2333+ const struct argp_state *state;
2334+};
2335+
2336+/* If a user doc filter should be applied to DOC, do so. */
2337+static const char *
2338+filter_doc (const char *doc, int key, const struct argp *argp,
2339+ const struct argp_state *state)
2340+{
2341+ if (argp && argp->help_filter)
2342+ /* We must apply a user filter to this output. */
2343+ {
2344+ void *input = __argp_input (argp, state);
2345+ return (*argp->help_filter) (key, doc, input);
2346+ }
2347+ else
2348+ /* No filter. */
2349+ return doc;
2350+}
2351+
2352+/* Prints STR as a header line, with the margin lines set appropiately, and
2353+ notes the fact that groups should be separated with a blank line. ARGP is
2354+ the argp that should dictate any user doc filtering to take place. Note
2355+ that the previous wrap margin isn't restored, but the left margin is reset
2356+ to 0. */
2357+static void
2358+print_header (const char *str, const struct argp *argp,
2359+ struct pentry_state *pest)
2360+{
2361+ const char *tstr = dgettext (argp->argp_domain, str);
2362+ const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_HEADER, argp, pest->state);
2363+
2364+ if (fstr)
2365+ {
2366+ if (*fstr)
2367+ {
2368+ if (pest->hhstate->prev_entry)
2369+ /* Precede with a blank line. */
2370+ __argp_fmtstream_putc (pest->stream, '\n');
2371+ indent_to (pest->stream, uparams.header_col);
2372+ __argp_fmtstream_set_lmargin (pest->stream, uparams.header_col);
2373+ __argp_fmtstream_set_wmargin (pest->stream, uparams.header_col);
2374+ __argp_fmtstream_puts (pest->stream, fstr);
2375+ __argp_fmtstream_set_lmargin (pest->stream, 0);
2376+ __argp_fmtstream_putc (pest->stream, '\n');
2377+ }
2378+
2379+ pest->hhstate->sep_groups = 1; /* Separate subsequent groups. */
2380+ }
2381+
2382+ if (fstr != tstr)
2383+ free ((char *) fstr);
2384+}
2385+
2386+/* Inserts a comma if this isn't the first item on the line, and then makes
2387+ sure we're at least to column COL. If this *is* the first item on a line,
2388+ prints any pending whitespace/headers that should precede this line. Also
2389+ clears FIRST. */
2390+static void
2391+comma (unsigned col, struct pentry_state *pest)
2392+{
2393+ if (pest->first)
2394+ {
2395+ const struct hol_entry *pe = pest->hhstate->prev_entry;
2396+ const struct hol_cluster *cl = pest->entry->cluster;
2397+
2398+ if (pest->hhstate->sep_groups && pe && pest->entry->group != pe->group)
2399+ __argp_fmtstream_putc (pest->stream, '\n');
2400+
2401+ if (cl && cl->header && *cl->header
2402+ && (!pe
2403+ || (pe->cluster != cl
2404+ && !hol_cluster_is_child (pe->cluster, cl))))
2405+ /* If we're changing clusters, then this must be the start of the
2406+ ENTRY's cluster unless that is an ancestor of the previous one
2407+ (in which case we had just popped into a sub-cluster for a bit).
2408+ If so, then print the cluster's header line. */
2409+ {
2410+ int old_wm = __argp_fmtstream_wmargin (pest->stream);
2411+ print_header (cl->header, cl->argp, pest);
2412+ __argp_fmtstream_set_wmargin (pest->stream, old_wm);
2413+ }
2414+
2415+ pest->first = 0;
2416+ }
2417+ else
2418+ __argp_fmtstream_puts (pest->stream, ", ");
2419+
2420+ indent_to (pest->stream, col);
2421+}
2422+
2423+/* Print help for ENTRY to STREAM. */
2424+static void
2425+hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
2426+ argp_fmtstream_t stream, struct hol_help_state *hhstate)
2427+{
2428+ unsigned num;
2429+ const struct argp_option *real = entry->opt, *opt;
2430+ char *so = entry->short_options;
2431+ int have_long_opt = 0; /* We have any long options. */
2432+ /* Saved margins. */
2433+ int old_lm = __argp_fmtstream_set_lmargin (stream, 0);
2434+ int old_wm = __argp_fmtstream_wmargin (stream);
2435+ /* PEST is a state block holding some of our variables that we'd like to
2436+ share with helper functions. */
2437+ struct pentry_state pest = { entry, stream, hhstate, 1, state };
2438+
2439+ if (! odoc (real))
2440+ for (opt = real, num = entry->num; num > 0; opt++, num--)
2441+ if (opt->name && ovisible (opt))
2442+ {
2443+ have_long_opt = 1;
2444+ break;
2445+ }
2446+
2447+ /* First emit short options. */
2448+ __argp_fmtstream_set_wmargin (stream, uparams.short_opt_col); /* For truly bizarre cases. */
2449+ for (opt = real, num = entry->num; num > 0; opt++, num--)
2450+ if (oshort (opt) && opt->key == *so)
2451+ /* OPT has a valid (non shadowed) short option. */
2452+ {
2453+ if (ovisible (opt))
2454+ {
2455+ comma (uparams.short_opt_col, &pest);
2456+ __argp_fmtstream_putc (stream, '-');
2457+ __argp_fmtstream_putc (stream, *so);
2458+ if (!have_long_opt || uparams.dup_args)
2459+ arg (real, " %s", "[%s]",
2460+ state == NULL ? NULL : state->root_argp->argp_domain,
2461+ stream);
2462+ else if (real->arg)
2463+ hhstate->suppressed_dup_arg = 1;
2464+ }
2465+ so++;
2466+ }
2467+
2468+ /* Now, long options. */
2469+ if (odoc (real))
2470+ /* A `documentation' option. */
2471+ {
2472+ __argp_fmtstream_set_wmargin (stream, uparams.doc_opt_col);
2473+ for (opt = real, num = entry->num; num > 0; opt++, num--)
2474+ if (opt->name && ovisible (opt))
2475+ {
2476+ comma (uparams.doc_opt_col, &pest);
2477+ /* Calling gettext here isn't quite right, since sorting will
2478+ have been done on the original; but documentation options
2479+ should be pretty rare anyway... */
2480+ __argp_fmtstream_puts (stream,
2481+ dgettext (state == NULL ? NULL
2482+ : state->root_argp->argp_domain,
2483+ opt->name));
2484+ }
2485+ }
2486+ else
2487+ /* A real long option. */
2488+ {
2489+ __argp_fmtstream_set_wmargin (stream, uparams.long_opt_col);
2490+ for (opt = real, num = entry->num; num > 0; opt++, num--)
2491+ if (opt->name && ovisible (opt))
2492+ {
2493+ comma (uparams.long_opt_col, &pest);
2494+ __argp_fmtstream_printf (stream, "--%s", opt->name);
2495+ arg (real, "=%s", "[=%s]",
2496+ state == NULL ? NULL : state->root_argp->argp_domain, stream);
2497+ }
2498+ }
2499+
2500+ /* Next, documentation strings. */
2501+ __argp_fmtstream_set_lmargin (stream, 0);
2502+
2503+ if (pest.first)
2504+ {
2505+ /* Didn't print any switches, what's up? */
2506+ if (!oshort (real) && !real->name)
2507+ /* This is a group header, print it nicely. */
2508+ print_header (real->doc, entry->argp, &pest);
2509+ else
2510+ /* Just a totally shadowed option or null header; print nothing. */
2511+ goto cleanup; /* Just return, after cleaning up. */
2512+ }
2513+ else
2514+ {
2515+ const char *tstr = real->doc ? dgettext (state == NULL ? NULL
2516+ : state->root_argp->argp_domain,
2517+ real->doc) : 0;
2518+ const char *fstr = filter_doc (tstr, real->key, entry->argp, state);
2519+ if (fstr && *fstr)
2520+ {
2521+ unsigned int col = __argp_fmtstream_point (stream);
2522+
2523+ __argp_fmtstream_set_lmargin (stream, uparams.opt_doc_col);
2524+ __argp_fmtstream_set_wmargin (stream, uparams.opt_doc_col);
2525+
2526+ if (col > (unsigned int) (uparams.opt_doc_col + 3))
2527+ __argp_fmtstream_putc (stream, '\n');
2528+ else if (col >= (unsigned int) uparams.opt_doc_col)
2529+ __argp_fmtstream_puts (stream, " ");
2530+ else
2531+ indent_to (stream, uparams.opt_doc_col);
2532+
2533+ __argp_fmtstream_puts (stream, fstr);
2534+ }
2535+ if (fstr && fstr != tstr)
2536+ free ((char *) fstr);
2537+
2538+ /* Reset the left margin. */
2539+ __argp_fmtstream_set_lmargin (stream, 0);
2540+ __argp_fmtstream_putc (stream, '\n');
2541+ }
2542+
2543+ hhstate->prev_entry = entry;
2544+
2545+cleanup:
2546+ __argp_fmtstream_set_lmargin (stream, old_lm);
2547+ __argp_fmtstream_set_wmargin (stream, old_wm);
2548+}
2549+
2550+/* Output a long help message about the options in HOL to STREAM. */
2551+static void
2552+hol_help (struct hol *hol, const struct argp_state *state,
2553+ argp_fmtstream_t stream)
2554+{
2555+ unsigned num;
2556+ struct hol_entry *entry;
2557+ struct hol_help_state hhstate = { 0, 0, 0 };
2558+
2559+ for (entry = hol->entries, num = hol->num_entries; num > 0; entry++, num--)
2560+ hol_entry_help (entry, state, stream, &hhstate);
2561+
2562+ if (hhstate.suppressed_dup_arg && uparams.dup_args_note)
2563+ {
2564+ const char *tstr = dgettext (state == NULL ? NULL
2565+ : state->root_argp->argp_domain, "\
2566+Mandatory or optional arguments to long options are also mandatory or \
2567+optional for any corresponding short options.");
2568+ const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE,
2569+ state ? state->root_argp : 0, state);
2570+ if (fstr && *fstr)
2571+ {
2572+ __argp_fmtstream_putc (stream, '\n');
2573+ __argp_fmtstream_puts (stream, fstr);
2574+ __argp_fmtstream_putc (stream, '\n');
2575+ }
2576+ if (fstr && fstr != tstr)
2577+ free ((char *) fstr);
2578+ }
2579+}
2580+
2581+/* Helper functions for hol_usage. */
2582+
2583+/* If OPT is a short option without an arg, append its key to the string
2584+ pointer pointer to by COOKIE, and advance the pointer. */
2585+static int
2586+add_argless_short_opt (const struct argp_option *opt,
2587+ const struct argp_option *real,
2588+ const char *domain, void *cookie)
2589+{
2590+ char **snao_end = cookie;
2591+ if (!(opt->arg || real->arg)
2592+ && !((opt->flags | real->flags) & OPTION_NO_USAGE))
2593+ *(*snao_end)++ = opt->key;
2594+ return 0;
2595+}
2596+
2597+/* If OPT is a short option with an arg, output a usage entry for it to the
2598+ stream pointed at by COOKIE. */
2599+static int
2600+usage_argful_short_opt (const struct argp_option *opt,
2601+ const struct argp_option *real,
2602+ const char *domain, void *cookie)
2603+{
2604+ argp_fmtstream_t stream = cookie;
2605+ const char *arg = opt->arg;
2606+ int flags = opt->flags | real->flags;
2607+
2608+ if (! arg)
2609+ arg = real->arg;
2610+
2611+ if (arg && !(flags & OPTION_NO_USAGE))
2612+ {
2613+ arg = dgettext (domain, arg);
2614+
2615+ if (flags & OPTION_ARG_OPTIONAL)
2616+ __argp_fmtstream_printf (stream, " [-%c[%s]]", opt->key, arg);
2617+ else
2618+ {
2619+ /* Manually do line wrapping so that it (probably) won't
2620+ get wrapped at the embedded space. */
2621+ space (stream, 6 + strlen (arg));
2622+ __argp_fmtstream_printf (stream, "[-%c %s]", opt->key, arg);
2623+ }
2624+ }
2625+
2626+ return 0;
2627+}
2628+
2629+/* Output a usage entry for the long option opt to the stream pointed at by
2630+ COOKIE. */
2631+static int
2632+usage_long_opt (const struct argp_option *opt,
2633+ const struct argp_option *real,
2634+ const char *domain, void *cookie)
2635+{
2636+ argp_fmtstream_t stream = cookie;
2637+ const char *arg = opt->arg;
2638+ int flags = opt->flags | real->flags;
2639+
2640+ if (! arg)
2641+ arg = real->arg;
2642+
2643+ if (! (flags & OPTION_NO_USAGE))
2644+ {
2645+ if (arg)
2646+ {
2647+ arg = dgettext (domain, arg);
2648+ if (flags & OPTION_ARG_OPTIONAL)
2649+ __argp_fmtstream_printf (stream, " [--%s[=%s]]", opt->name, arg);
2650+ else
2651+ __argp_fmtstream_printf (stream, " [--%s=%s]", opt->name, arg);
2652+ }
2653+ else
2654+ __argp_fmtstream_printf (stream, " [--%s]", opt->name);
2655+ }
2656+
2657+ return 0;
2658+}
2659+
2660+/* Print a short usage description for the arguments in HOL to STREAM. */
2661+static void
2662+hol_usage (struct hol *hol, argp_fmtstream_t stream)
2663+{
2664+ if (hol->num_entries > 0)
2665+ {
2666+ unsigned nentries;
2667+ struct hol_entry *entry;
2668+ char *short_no_arg_opts = alloca (strlen (hol->short_options) + 1);
2669+ char *snao_end = short_no_arg_opts;
2670+
2671+ /* First we put a list of short options without arguments. */
2672+ for (entry = hol->entries, nentries = hol->num_entries
2673+ ; nentries > 0
2674+ ; entry++, nentries--)
2675+ hol_entry_short_iterate (entry, add_argless_short_opt,
2676+ entry->argp->argp_domain, &snao_end);
2677+ if (snao_end > short_no_arg_opts)
2678+ {
2679+ *snao_end++ = 0;
2680+ __argp_fmtstream_printf (stream, " [-%s]", short_no_arg_opts);
2681+ }
2682+
2683+ /* Now a list of short options *with* arguments. */
2684+ for (entry = hol->entries, nentries = hol->num_entries
2685+ ; nentries > 0
2686+ ; entry++, nentries--)
2687+ hol_entry_short_iterate (entry, usage_argful_short_opt,
2688+ entry->argp->argp_domain, stream);
2689+
2690+ /* Finally, a list of long options (whew!). */
2691+ for (entry = hol->entries, nentries = hol->num_entries
2692+ ; nentries > 0
2693+ ; entry++, nentries--)
2694+ hol_entry_long_iterate (entry, usage_long_opt,
2695+ entry->argp->argp_domain, stream);
2696+ }
2697+}
2698+
2699+/* Make a HOL containing all levels of options in ARGP. CLUSTER is the
2700+ cluster in which ARGP's entries should be clustered, or 0. */
2701+static struct hol *
2702+argp_hol (const struct argp *argp, struct hol_cluster *cluster)
2703+{
2704+ const struct argp_child *child = argp->children;
2705+ struct hol *hol = make_hol (argp, cluster);
2706+ if (child)
2707+ while (child->argp)
2708+ {
2709+ struct hol_cluster *child_cluster =
2710+ ((child->group || child->header)
2711+ /* Put CHILD->argp within its own cluster. */
2712+ ? hol_add_cluster (hol, child->group, child->header,
2713+ child - argp->children, cluster, argp)
2714+ /* Just merge it into the parent's cluster. */
2715+ : cluster);
2716+ hol_append (hol, argp_hol (child->argp, child_cluster)) ;
2717+ child++;
2718+ }
2719+ return hol;
2720+}
2721+
2722+/* Calculate how many different levels with alternative args strings exist in
2723+ ARGP. */
2724+static size_t
2725+argp_args_levels (const struct argp *argp)
2726+{
2727+ size_t levels = 0;
2728+ const struct argp_child *child = argp->children;
2729+
2730+ if (argp->args_doc && strchr (argp->args_doc, '\n'))
2731+ levels++;
2732+
2733+ if (child)
2734+ while (child->argp)
2735+ levels += argp_args_levels ((child++)->argp);
2736+
2737+ return levels;
2738+}
2739+
2740+/* Print all the non-option args documented in ARGP to STREAM. Any output is
2741+ preceded by a space. LEVELS is a pointer to a byte vector the length
2742+ returned by argp_args_levels; it should be initialized to zero, and
2743+ updated by this routine for the next call if ADVANCE is true. True is
2744+ returned as long as there are more patterns to output. */
2745+static int
2746+argp_args_usage (const struct argp *argp, const struct argp_state *state,
2747+ char **levels, int advance, argp_fmtstream_t stream)
2748+{
2749+ char *our_level = *levels;
2750+ int multiple = 0;
2751+ const struct argp_child *child = argp->children;
2752+ const char *tdoc = dgettext (argp->argp_domain, argp->args_doc), *nl = 0;
2753+ const char *fdoc = filter_doc (tdoc, ARGP_KEY_HELP_ARGS_DOC, argp, state);
2754+
2755+ if (fdoc)
2756+ {
2757+ const char *cp = fdoc;
2758+ nl = strchrnul (cp, '\n');
2759+ if (*nl != '\0')
2760+ /* This is a `multi-level' args doc; advance to the correct position
2761+ as determined by our state in LEVELS, and update LEVELS. */
2762+ {
2763+ int i;
2764+ multiple = 1;
2765+ for (i = 0; i < *our_level; i++)
2766+ cp = nl + 1, nl = strchrnul (cp, '\n');
2767+ (*levels)++;
2768+ }
2769+
2770+ /* Manually do line wrapping so that it (probably) won't get wrapped at
2771+ any embedded spaces. */
2772+ space (stream, 1 + nl - cp);
2773+
2774+ __argp_fmtstream_write (stream, cp, nl - cp);
2775+ }
2776+ if (fdoc && fdoc != tdoc)
2777+ free ((char *)fdoc); /* Free user's modified doc string. */
2778+
2779+ if (child)
2780+ while (child->argp)
2781+ advance = !argp_args_usage ((child++)->argp, state, levels, advance, stream);
2782+
2783+ if (advance && multiple)
2784+ {
2785+ /* Need to increment our level. */
2786+ if (*nl)
2787+ /* There's more we can do here. */
2788+ {
2789+ (*our_level)++;
2790+ advance = 0; /* Our parent shouldn't advance also. */
2791+ }
2792+ else if (*our_level > 0)
2793+ /* We had multiple levels, but used them up; reset to zero. */
2794+ *our_level = 0;
2795+ }
2796+
2797+ return !advance;
2798+}
2799+
2800+/* Print the documentation for ARGP to STREAM; if POST is false, then
2801+ everything preceeding a `\v' character in the documentation strings (or
2802+ the whole string, for those with none) is printed, otherwise, everything
2803+ following the `\v' character (nothing for strings without). Each separate
2804+ bit of documentation is separated a blank line, and if PRE_BLANK is true,
2805+ then the first is as well. If FIRST_ONLY is true, only the first
2806+ occurrence is output. Returns true if anything was output. */
2807+static int
2808+argp_doc (const struct argp *argp, const struct argp_state *state,
2809+ int post, int pre_blank, int first_only,
2810+ argp_fmtstream_t stream)
2811+{
2812+ const char *text;
2813+ const char *inp_text;
2814+ void *input = 0;
2815+ int anything = 0;
2816+ size_t inp_text_limit = 0;
2817+ const char *doc = dgettext (argp->argp_domain, argp->doc);
2818+ const struct argp_child *child = argp->children;
2819+
2820+ if (doc)
2821+ {
2822+ char *vt = strchr (doc, '\v');
2823+ inp_text = post ? (vt ? vt + 1 : 0) : doc;
2824+ inp_text_limit = (!post && vt) ? (vt - doc) : 0;
2825+ }
2826+ else
2827+ inp_text = 0;
2828+
2829+ if (argp->help_filter)
2830+ /* We have to filter the doc strings. */
2831+ {
2832+ if (inp_text_limit)
2833+ /* Copy INP_TEXT so that it's nul-terminated. */
2834+ inp_text = strndup (inp_text, inp_text_limit);
2835+ input = __argp_input (argp, state);
2836+ text =
2837+ (*argp->help_filter) (post
2838+ ? ARGP_KEY_HELP_POST_DOC
2839+ : ARGP_KEY_HELP_PRE_DOC,
2840+ inp_text, input);
2841+ }
2842+ else
2843+ text = (const char *) inp_text;
2844+
2845+ if (text)
2846+ {
2847+ if (pre_blank)
2848+ __argp_fmtstream_putc (stream, '\n');
2849+
2850+ if (text == inp_text && inp_text_limit)
2851+ __argp_fmtstream_write (stream, inp_text, inp_text_limit);
2852+ else
2853+ __argp_fmtstream_puts (stream, text);
2854+
2855+ if (__argp_fmtstream_point (stream) > __argp_fmtstream_lmargin (stream))
2856+ __argp_fmtstream_putc (stream, '\n');
2857+
2858+ anything = 1;
2859+ }
2860+
2861+ if (text && text != inp_text)
2862+ free ((char *) text); /* Free TEXT returned from the help filter. */
2863+ if (inp_text && inp_text_limit && argp->help_filter)
2864+ free ((char *) inp_text); /* We copied INP_TEXT, so free it now. */
2865+
2866+ if (post && argp->help_filter)
2867+ /* Now see if we have to output a ARGP_KEY_HELP_EXTRA text. */
2868+ {
2869+ text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input);
2870+ if (text)
2871+ {
2872+ if (anything || pre_blank)
2873+ __argp_fmtstream_putc (stream, '\n');
2874+ __argp_fmtstream_puts (stream, text);
2875+ free ((char *) text);
2876+ if (__argp_fmtstream_point (stream)
2877+ > __argp_fmtstream_lmargin (stream))
2878+ __argp_fmtstream_putc (stream, '\n');
2879+ anything = 1;
2880+ }
2881+ }
2882+
2883+ if (child)
2884+ while (child->argp && !(first_only && anything))
2885+ anything |=
2886+ argp_doc ((child++)->argp, state,
2887+ post, anything || pre_blank, first_only,
2888+ stream);
2889+
2890+ return anything;
2891+}
2892+
2893+/* Output a usage message for ARGP to STREAM. If called from
2894+ argp_state_help, STATE is the relevent parsing state. FLAGS are from the
2895+ set ARGP_HELP_*. NAME is what to use wherever a `program name' is
2896+ needed. */
2897+static void
2898+_help (const struct argp *argp, const struct argp_state *state, FILE *stream,
2899+ unsigned flags, char *name)
2900+{
2901+ int anything = 0; /* Whether we've output anything. */
2902+ struct hol *hol = 0;
2903+ argp_fmtstream_t fs;
2904+
2905+ if (! stream)
2906+ return;
2907+
2908+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
2909+ flockfile (stream);
2910+#endif
2911+
2912+ fill_in_uparams (state);
2913+
2914+ fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0);
2915+ if (! fs)
2916+ {
2917+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
2918+ funlockfile (stream);
2919+#endif
2920+ return;
2921+ }
2922+
2923+ if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG))
2924+ {
2925+ hol = argp_hol (argp, 0);
2926+
2927+ /* If present, these options always come last. */
2928+ hol_set_group (hol, "help", -1);
2929+ hol_set_group (hol, "version", -1);
2930+
2931+ hol_sort (hol);
2932+ }
2933+
2934+ if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE))
2935+ /* Print a short `Usage:' message. */
2936+ {
2937+ int first_pattern = 1, more_patterns;
2938+ size_t num_pattern_levels = argp_args_levels (argp);
2939+ char *pattern_levels = alloca (num_pattern_levels);
2940+
2941+ memset (pattern_levels, 0, num_pattern_levels);
2942+
2943+ do
2944+ {
2945+ int old_lm;
2946+ int old_wm = __argp_fmtstream_set_wmargin (fs, uparams.usage_indent);
2947+ char *levels = pattern_levels;
2948+
2949+ if (first_pattern)
2950+ __argp_fmtstream_printf (fs, "%s %s",
2951+ dgettext (argp->argp_domain, "Usage:"),
2952+ name);
2953+ else
2954+ __argp_fmtstream_printf (fs, "%s %s",
2955+ dgettext (argp->argp_domain, " or: "),
2956+ name);
2957+
2958+ /* We set the lmargin as well as the wmargin, because hol_usage
2959+ manually wraps options with newline to avoid annoying breaks. */
2960+ old_lm = __argp_fmtstream_set_lmargin (fs, uparams.usage_indent);
2961+
2962+ if (flags & ARGP_HELP_SHORT_USAGE)
2963+ /* Just show where the options go. */
2964+ {
2965+ if (hol->num_entries > 0)
2966+ __argp_fmtstream_puts (fs, dgettext (argp->argp_domain,
2967+ " [OPTION...]"));
2968+ }
2969+ else
2970+ /* Actually print the options. */
2971+ {
2972+ hol_usage (hol, fs);
2973+ flags |= ARGP_HELP_SHORT_USAGE; /* But only do so once. */
2974+ }
2975+
2976+ more_patterns = argp_args_usage (argp, state, &levels, 1, fs);
2977+
2978+ __argp_fmtstream_set_wmargin (fs, old_wm);
2979+ __argp_fmtstream_set_lmargin (fs, old_lm);
2980+
2981+ __argp_fmtstream_putc (fs, '\n');
2982+ anything = 1;
2983+
2984+ first_pattern = 0;
2985+ }
2986+ while (more_patterns);
2987+ }
2988+
2989+ if (flags & ARGP_HELP_PRE_DOC)
2990+ anything |= argp_doc (argp, state, 0, 0, 1, fs);
2991+
2992+ if (flags & ARGP_HELP_SEE)
2993+ {
2994+ __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, "\
2995+Try `%s --help' or `%s --usage' for more information.\n"),
2996+ name, name);
2997+ anything = 1;
2998+ }
2999+
3000+ if (flags & ARGP_HELP_LONG)
3001+ /* Print a long, detailed help message. */
3002+ {
3003+ /* Print info about all the options. */
3004+ if (hol->num_entries > 0)
3005+ {
3006+ if (anything)
3007+ __argp_fmtstream_putc (fs, '\n');
3008+ hol_help (hol, state, fs);
3009+ anything = 1;
3010+ }
3011+ }
3012+
3013+ if (flags & ARGP_HELP_POST_DOC)
3014+ /* Print any documentation strings at the end. */
3015+ anything |= argp_doc (argp, state, 1, anything, 0, fs);
3016+
3017+ if ((flags & ARGP_HELP_BUG_ADDR) && argp_program_bug_address)
3018+ {
3019+ if (anything)
3020+ __argp_fmtstream_putc (fs, '\n');
3021+ __argp_fmtstream_printf (fs, dgettext (argp->argp_domain,
3022+ "Report bugs to %s.\n"),
3023+ argp_program_bug_address);
3024+ anything = 1;
3025+ }
3026+
3027+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
3028+ funlockfile (stream);
3029+#endif
3030+
3031+ if (hol)
3032+ hol_free (hol);
3033+
3034+ __argp_fmtstream_free (fs);
3035+}
3036+
3037+/* Output a usage message for ARGP to STREAM. FLAGS are from the set
3038+ ARGP_HELP_*. NAME is what to use wherever a `program name' is needed. */
3039+void argp_help (const struct argp *argp, FILE *stream,
3040+ unsigned flags, char *name)
3041+{
3042+ _help (argp, 0, stream, flags, name);
3043+}
3044+
3045+char *
3046+__argp_short_program_name (void)
3047+{
3048+# ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
3049+/*
3050+ * uClibc provides both program_invocation_name and
3051+ * program_invocation_short_name
3052+ */
3053+ return (char *) program_invocation_short_name;
3054+# else
3055+ /* FIXME: What now? Miles suggests that it is better to use NULL,
3056+ but currently the value is passed on directly to fputs_unlocked,
3057+ so that requires more changes. */
3058+# if __GNUC__
3059+# warning No reasonable value to return
3060+# endif /* __GNUC__ */
3061+ return "";
3062+# endif
3063+}
3064+
3065+/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
3066+ from the set ARGP_HELP_*. */
3067+void
3068+argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags)
3069+{
3070+ if ((!state || ! (state->flags & ARGP_NO_ERRS)) && stream)
3071+ {
3072+ if (state && (state->flags & ARGP_LONG_ONLY))
3073+ flags |= ARGP_HELP_LONG_ONLY;
3074+
3075+ _help (state ? state->root_argp : 0, state, stream, flags,
3076+ state ? state->name : __argp_short_program_name ());
3077+
3078+ if (!state || ! (state->flags & ARGP_NO_EXIT))
3079+ {
3080+ if (flags & ARGP_HELP_EXIT_ERR)
3081+ exit (argp_err_exit_status);
3082+ if (flags & ARGP_HELP_EXIT_OK)
3083+ exit (0);
3084+ }
3085+ }
3086+}
3087+
3088+/* If appropriate, print the printf string FMT and following args, preceded
3089+ by the program name and `:', to stderr, and followed by a `Try ... --help'
3090+ message, then exit (1). */
3091+void
3092+argp_error (const struct argp_state *state, const char *fmt, ...)
3093+{
3094+ if (!state || !(state->flags & ARGP_NO_ERRS))
3095+ {
3096+ FILE *stream = state ? state->err_stream : stderr;
3097+
3098+ if (stream)
3099+ {
3100+ va_list ap;
3101+
3102+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
3103+ flockfile (stream);
3104+#endif
3105+
3106+ va_start (ap, fmt);
3107+
3108+#if defined _LIBC && defined USE_IN_LIBIO
3109+ char *buf;
3110+
3111+ if (_IO_vasprintf (&buf, fmt, ap) < 0)
3112+ buf = NULL;
3113+
3114+ __fxprintf (stream, "%s: %s\n",
3115+ state ? state->name : __argp_short_program_name (), buf);
3116+
3117+ free (buf);
3118+#else
3119+ fputs_unlocked (state ? state->name : __argp_short_program_name (),
3120+ stream);
3121+ putc_unlocked (':', stream);
3122+ putc_unlocked (' ', stream);
3123+
3124+ vfprintf (stream, fmt, ap);
3125+
3126+ putc_unlocked ('\n', stream);
3127+#endif
3128+
3129+ argp_state_help (state, stream, ARGP_HELP_STD_ERR);
3130+
3131+ va_end (ap);
3132+
3133+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
3134+ funlockfile (stream);
3135+#endif
3136+ }
3137+ }
3138+}
3139+
3140+/* Similar to the standard gnu error-reporting function error(), but will
3141+ respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
3142+ to STATE->err_stream. This is useful for argument parsing code that is
3143+ shared between program startup (when exiting is desired) and runtime
3144+ option parsing (when typically an error code is returned instead). The
3145+ difference between this function and argp_error is that the latter is for
3146+ *parsing errors*, and the former is for other problems that occur during
3147+ parsing but don't reflect a (syntactic) problem with the input. */
3148+void
3149+argp_failure (const struct argp_state *state, int status, int errnum,
3150+ const char *fmt, ...)
3151+{
3152+ if (!state || !(state->flags & ARGP_NO_ERRS))
3153+ {
3154+ FILE *stream = state ? state->err_stream : stderr;
3155+
3156+ if (stream)
3157+ {
3158+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
3159+ flockfile (stream);
3160+#endif
3161+
3162+#if defined _LIBC && defined USE_IN_LIBIO
3163+ __fxprintf (stream, "%s",
3164+ state ? state->name : __argp_short_program_name ());
3165+#else
3166+ fputs_unlocked (state ? state->name : __argp_short_program_name (),
3167+ stream);
3168+#endif
3169+
3170+ if (fmt)
3171+ {
3172+ va_list ap;
3173+
3174+ va_start (ap, fmt);
3175+#if defined _LIBC && defined USE_IN_LIBIO
3176+ char *buf;
3177+
3178+ if (_IO_vasprintf (&buf, fmt, ap) < 0)
3179+ buf = NULL;
3180+
3181+ __fxprintf (stream, ": %s", buf);
3182+
3183+ free (buf);
3184+#else
3185+ putc_unlocked (':', stream);
3186+ putc_unlocked (' ', stream);
3187+
3188+ vfprintf (stream, fmt, ap);
3189+#endif
3190+
3191+ va_end (ap);
3192+ }
3193+
3194+ if (errnum)
3195+ {
3196+#if (defined _LIBC && defined USE_IN_LIBIO) || defined HAVE_STRERROR_R
3197+ char buf[200];
3198+#endif
3199+#if defined _LIBC && defined USE_IN_LIBIO
3200+ __fxprintf (stream, ": %s",
3201+ strerror_r (errnum, buf, sizeof (buf)));
3202+#else
3203+ putc_unlocked (':', stream);
3204+ putc_unlocked (' ', stream);
3205+# ifdef HAVE_STRERROR_R
3206+ fputs (strerror_r (errnum, buf, sizeof (buf)), stream);
3207+# else
3208+ fputs (strerror (errnum), stream);
3209+# endif
3210+#endif
3211+ }
3212+
3213+#ifdef USE_IN_LIBIO
3214+ if (_IO_fwide (stream, 0) > 0)
3215+ putwc_unlocked (L'\n', stream);
3216+ else
3217+#endif
3218+ putc_unlocked ('\n', stream);
3219+
3220+#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
3221+ funlockfile (stream);
3222+#endif
3223+
3224+ if (status && (!state || !(state->flags & ARGP_NO_EXIT)))
3225+ exit (status);
3226+ }
3227+ }
3228+}
3229Index: git/libuargp/argp-parse.c
3230===================================================================
3231--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3232+++ git/libuargp/argp-parse.c 2012-06-18 13:10:44.060825542 -0700
3233@@ -0,0 +1,949 @@
3234+/* Hierarchial argument parsing, layered over getopt
3235+ Copyright (C) 1995-2000, 2002, 2003, 2004 Free Software Foundation, Inc.
3236+ This file is part of the GNU C Library.
3237+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
3238+
3239+ The GNU C Library is free software; you can redistribute it and/or
3240+ modify it under the terms of the GNU Lesser General Public
3241+ License as published by the Free Software Foundation; either
3242+ version 2.1 of the License, or (at your option) any later version.
3243+
3244+ The GNU C Library is distributed in the hope that it will be useful,
3245+ but WITHOUT ANY WARRANTY; without even the implied warranty of
3246+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3247+ Lesser General Public License for more details.
3248+
3249+ You should have received a copy of the GNU Lesser General Public
3250+ License along with the GNU C Library; if not, write to the Free
3251+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
3252+ 02111-1307 USA.
3253+
3254+ Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
3255+*/
3256+
3257+#ifdef HAVE_CONFIG_H
3258+#include <config.h>
3259+#endif
3260+
3261+/* AIX requires this to be the first thing in the file. */
3262+#ifndef __GNUC__
3263+# if HAVE_ALLOCA_H || defined _LIBC
3264+# include <alloca.h>
3265+# else
3266+# ifdef _AIX
3267+#pragma alloca
3268+# else
3269+# ifndef alloca /* predefined by HP cc +Olibcalls */
3270+char *alloca ();
3271+# endif
3272+# endif
3273+# endif
3274+#endif
3275+
3276+#include <stdlib.h>
3277+#include <string.h>
3278+#include <unistd.h>
3279+#include <limits.h>
3280+#include <getopt.h>
3281+#include <bits/getopt_int.h>
3282+
3283+#include <features.h>
3284+#ifndef _
3285+/* This is for other GNU distributions with internationalized messages.
3286+ When compiling libc, the _ macro is predefined. */
3287+# if (defined HAVE_LIBINTL_H || defined _LIBC) && defined __UCLIBC_HAS_GETTEXT_AWARENESS__
3288+# include <libintl.h>
3289+# ifdef _LIBC
3290+# undef dgettext
3291+# define dgettext(domain, msgid) \
3292+ INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
3293+# endif
3294+# else
3295+# define dgettext(domain, msgid) (msgid)
3296+# define gettext(msgid) (msgid)
3297+# endif
3298+#endif
3299+#ifndef N_
3300+# define N_(msgid) (msgid)
3301+#endif
3302+
3303+#include <argp.h>
3304+
3305+/* Getopt return values. */
3306+#define KEY_END (-1) /* The end of the options. */
3307+#define KEY_ARG 1 /* A non-option argument. */
3308+#define KEY_ERR '?' /* An error parsing the options. */
3309+
3310+/* The meta-argument used to prevent any further arguments being interpreted
3311+ as options. */
3312+#define QUOTE "--"
3313+
3314+/* The number of bits we steal in a long-option value for our own use. */
3315+#define GROUP_BITS CHAR_BIT
3316+
3317+/* The number of bits available for the user value. */
3318+#define USER_BITS ((sizeof ((struct option *)0)->val * CHAR_BIT) - GROUP_BITS)
3319+#define USER_MASK ((1 << USER_BITS) - 1)
3320+
3321+/* EZ alias for ARGP_ERR_UNKNOWN. */
3322+#define EBADKEY ARGP_ERR_UNKNOWN
3323+
3324+/* Default options. */
3325+
3326+/* When argp is given the --HANG switch, _ARGP_HANG is set and argp will sleep
3327+ for one second intervals, decrementing _ARGP_HANG until it's zero. Thus
3328+ you can force the program to continue by attaching a debugger and setting
3329+ it to 0 yourself. */
3330+static volatile int _argp_hang;
3331+
3332+#define OPT_PROGNAME -2
3333+#define OPT_USAGE -3
3334+#define OPT_HANG -4
3335+
3336+static const struct argp_option argp_default_options[] =
3337+{
3338+ {"help", '?', 0, 0, N_("Give this help list"), -1},
3339+ {"usage", OPT_USAGE, 0, 0, N_("Give a short usage message")},
3340+ {"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name")},
3341+ {"HANG", OPT_HANG, "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
3342+ N_("Hang for SECS seconds (default 3600)")},
3343+ {0, 0}
3344+};
3345+
3346+static error_t
3347+argp_default_parser (int key, char *arg, struct argp_state *state)
3348+{
3349+ switch (key)
3350+ {
3351+ case '?':
3352+ argp_state_help (state, state->out_stream, ARGP_HELP_STD_HELP);
3353+ break;
3354+ case OPT_USAGE:
3355+ argp_state_help (state, state->out_stream,
3356+ ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
3357+ break;
3358+
3359+ case OPT_PROGNAME: /* Set the program name. */
3360+#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_NAME
3361+ program_invocation_name = arg;
3362+#endif
3363+ /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka
3364+ __PROGNAME), in which case, PROGRAM_INVOCATION_NAME is just defined
3365+ to be that, so we have to be a bit careful here.] */
3366+
3367+ /* Update what we use for messages. */
3368+ state->name = strrchr (arg, '/');
3369+ if (state->name)
3370+ state->name++;
3371+ else
3372+ state->name = arg;
3373+
3374+#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
3375+ program_invocation_short_name = state->name;
3376+#endif
3377+
3378+ if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS))
3379+ == ARGP_PARSE_ARGV0)
3380+ /* Update what getopt uses too. */
3381+ state->argv[0] = arg;
3382+
3383+ break;
3384+
3385+ case OPT_HANG:
3386+ _argp_hang = atoi (arg ? arg : "3600");
3387+ while (_argp_hang-- > 0)
3388+ sleep (1);
3389+ break;
3390+
3391+ default:
3392+ return EBADKEY;
3393+ }
3394+ return 0;
3395+}
3396+
3397+static const struct argp argp_default_argp =
3398+ {argp_default_options, &argp_default_parser, NULL, NULL, NULL, NULL, "libc"};
3399+
3400+
3401+static const struct argp_option argp_version_options[] =
3402+{
3403+ {"version", 'V', 0, 0, N_("Print program version"), -1},
3404+ {0, 0}
3405+};
3406+
3407+static error_t
3408+argp_version_parser (int key, char *arg, struct argp_state *state)
3409+{
3410+ switch (key)
3411+ {
3412+ case 'V':
3413+ if (argp_program_version_hook)
3414+ (*argp_program_version_hook) (state->out_stream, state);
3415+ else if (argp_program_version)
3416+ fprintf (state->out_stream, "%s\n", argp_program_version);
3417+ else
3418+ argp_error (state, dgettext (state->root_argp->argp_domain,
3419+ "(PROGRAM ERROR) No version known!?"));
3420+ if (! (state->flags & ARGP_NO_EXIT))
3421+ exit (0);
3422+ break;
3423+ default:
3424+ return EBADKEY;
3425+ }
3426+ return 0;
3427+}
3428+
3429+static const struct argp argp_version_argp =
3430+ {argp_version_options, &argp_version_parser, NULL, NULL, NULL, NULL, "libc"};
3431+
3432+/* Returns the offset into the getopt long options array LONG_OPTIONS of a
3433+ long option with called NAME, or -1 if none is found. Passing NULL as
3434+ NAME will return the number of options. */
3435+static int
3436+find_long_option (struct option *long_options, const char *name)
3437+{
3438+ struct option *l = long_options;
3439+ while (l->name != NULL)
3440+ if (name != NULL && strcmp (l->name, name) == 0)
3441+ return l - long_options;
3442+ else
3443+ l++;
3444+ if (name == NULL)
3445+ return l - long_options;
3446+ else
3447+ return -1;
3448+}
3449+
3450+
3451+/* The state of a `group' during parsing. Each group corresponds to a
3452+ particular argp structure from the tree of such descending from the top
3453+ level argp passed to argp_parse. */
3454+struct group
3455+{
3456+ /* This group's parsing function. */
3457+ argp_parser_t parser;
3458+
3459+ /* Which argp this group is from. */
3460+ const struct argp *argp;
3461+
3462+ /* Points to the point in SHORT_OPTS corresponding to the end of the short
3463+ options for this group. We use it to determine from which group a
3464+ particular short options is from. */
3465+ char *short_end;
3466+
3467+ /* The number of non-option args sucessfully handled by this parser. */
3468+ unsigned args_processed;
3469+
3470+ /* This group's parser's parent's group. */
3471+ struct group *parent;
3472+ unsigned parent_index; /* And the our position in the parent. */
3473+
3474+ /* These fields are swapped into and out of the state structure when
3475+ calling this group's parser. */
3476+ void *input, **child_inputs;
3477+ void *hook;
3478+};
3479+
3480+/* Call GROUP's parser with KEY and ARG, swapping any group-specific info
3481+ from STATE before calling, and back into state afterwards. If GROUP has
3482+ no parser, EBADKEY is returned. */
3483+static error_t
3484+group_parse (struct group *group, struct argp_state *state, int key, char *arg)
3485+{
3486+ if (group->parser)
3487+ {
3488+ error_t err;
3489+ state->hook = group->hook;
3490+ state->input = group->input;
3491+ state->child_inputs = group->child_inputs;
3492+ state->arg_num = group->args_processed;
3493+ err = (*group->parser)(key, arg, state);
3494+ group->hook = state->hook;
3495+ return err;
3496+ }
3497+ else
3498+ return EBADKEY;
3499+}
3500+
3501+struct parser
3502+{
3503+ const struct argp *argp;
3504+
3505+ /* SHORT_OPTS is the getopt short options string for the union of all the
3506+ groups of options. */
3507+ char *short_opts;
3508+ /* LONG_OPTS is the array of getop long option structures for the union of
3509+ all the groups of options. */
3510+ struct option *long_opts;
3511+ /* OPT_DATA is the getopt data used for the re-entrant getopt. */
3512+ struct _getopt_data opt_data;
3513+
3514+ /* States of the various parsing groups. */
3515+ struct group *groups;
3516+ /* The end of the GROUPS array. */
3517+ struct group *egroup;
3518+ /* An vector containing storage for the CHILD_INPUTS field in all groups. */
3519+ void **child_inputs;
3520+
3521+ /* True if we think using getopt is still useful; if false, then
3522+ remaining arguments are just passed verbatim with ARGP_KEY_ARG. This is
3523+ cleared whenever getopt returns KEY_END, but may be set again if the user
3524+ moves the next argument pointer backwards. */
3525+ int try_getopt;
3526+
3527+ /* State block supplied to parsing routines. */
3528+ struct argp_state state;
3529+
3530+ /* Memory used by this parser. */
3531+ void *storage;
3532+};
3533+
3534+/* The next usable entries in the various parser tables being filled in by
3535+ convert_options. */
3536+struct parser_convert_state
3537+{
3538+ struct parser *parser;
3539+ char *short_end;
3540+ struct option *long_end;
3541+ void **child_inputs_end;
3542+};
3543+
3544+/* Converts all options in ARGP (which is put in GROUP) and ancestors
3545+ into getopt options stored in SHORT_OPTS and LONG_OPTS; SHORT_END and
3546+ CVT->LONG_END are the points at which new options are added. Returns the
3547+ next unused group entry. CVT holds state used during the conversion. */
3548+static struct group *
3549+convert_options (const struct argp *argp,
3550+ struct group *parent, unsigned parent_index,
3551+ struct group *group, struct parser_convert_state *cvt)
3552+{
3553+ /* REAL is the most recent non-alias value of OPT. */
3554+ const struct argp_option *real = argp->options;
3555+ const struct argp_child *children = argp->children;
3556+
3557+ if (real || argp->parser)
3558+ {
3559+ const struct argp_option *opt;
3560+
3561+ if (real)
3562+ for (opt = real; !__option_is_end (opt); opt++)
3563+ {
3564+ if (! (opt->flags & OPTION_ALIAS))
3565+ /* OPT isn't an alias, so we can use values from it. */
3566+ real = opt;
3567+
3568+ if (! (real->flags & OPTION_DOC))
3569+ /* A real option (not just documentation). */
3570+ {
3571+ if (__option_is_short (opt))
3572+ /* OPT can be used as a short option. */
3573+ {
3574+ *cvt->short_end++ = opt->key;
3575+ if (real->arg)
3576+ {
3577+ *cvt->short_end++ = ':';
3578+ if (real->flags & OPTION_ARG_OPTIONAL)
3579+ *cvt->short_end++ = ':';
3580+ }
3581+ *cvt->short_end = '\0'; /* keep 0 terminated */
3582+ }
3583+
3584+ if (opt->name
3585+ && find_long_option (cvt->parser->long_opts, opt->name) < 0)
3586+ /* OPT can be used as a long option. */
3587+ {
3588+ cvt->long_end->name = opt->name;
3589+ cvt->long_end->has_arg =
3590+ (real->arg
3591+ ? (real->flags & OPTION_ARG_OPTIONAL
3592+ ? optional_argument
3593+ : required_argument)
3594+ : no_argument);
3595+ cvt->long_end->flag = 0;
3596+ /* we add a disambiguating code to all the user's
3597+ values (which is removed before we actually call
3598+ the function to parse the value); this means that
3599+ the user loses use of the high 8 bits in all his
3600+ values (the sign of the lower bits is preserved
3601+ however)... */
3602+ cvt->long_end->val =
3603+ ((opt->key | real->key) & USER_MASK)
3604+ + (((group - cvt->parser->groups) + 1) << USER_BITS);
3605+
3606+ /* Keep the LONG_OPTS list terminated. */
3607+ (++cvt->long_end)->name = NULL;
3608+ }
3609+ }
3610+ }
3611+
3612+ group->parser = argp->parser;
3613+ group->argp = argp;
3614+ group->short_end = cvt->short_end;
3615+ group->args_processed = 0;
3616+ group->parent = parent;
3617+ group->parent_index = parent_index;
3618+ group->input = 0;
3619+ group->hook = 0;
3620+ group->child_inputs = 0;
3621+
3622+ if (children)
3623+ /* Assign GROUP's CHILD_INPUTS field some space from
3624+ CVT->child_inputs_end.*/
3625+ {
3626+ unsigned num_children = 0;
3627+ while (children[num_children].argp)
3628+ num_children++;
3629+ group->child_inputs = cvt->child_inputs_end;
3630+ cvt->child_inputs_end += num_children;
3631+ }
3632+
3633+ parent = group++;
3634+ }
3635+ else
3636+ parent = 0;
3637+
3638+ if (children)
3639+ {
3640+ unsigned index = 0;
3641+ while (children->argp)
3642+ group =
3643+ convert_options (children++->argp, parent, index++, group, cvt);
3644+ }
3645+
3646+ return group;
3647+}
3648+
3649+/* Find the merged set of getopt options, with keys appropiately prefixed. */
3650+static void
3651+parser_convert (struct parser *parser, const struct argp *argp, int flags)
3652+{
3653+ struct parser_convert_state cvt;
3654+
3655+ cvt.parser = parser;
3656+ cvt.short_end = parser->short_opts;
3657+ cvt.long_end = parser->long_opts;
3658+ cvt.child_inputs_end = parser->child_inputs;
3659+
3660+ if (flags & ARGP_IN_ORDER)
3661+ *cvt.short_end++ = '-';
3662+ else if (flags & ARGP_NO_ARGS)
3663+ *cvt.short_end++ = '+';
3664+ *cvt.short_end = '\0';
3665+
3666+ cvt.long_end->name = NULL;
3667+
3668+ parser->argp = argp;
3669+
3670+ if (argp)
3671+ parser->egroup = convert_options (argp, 0, 0, parser->groups, &cvt);
3672+ else
3673+ parser->egroup = parser->groups; /* No parsers at all! */
3674+}
3675+
3676+/* Lengths of various parser fields which we will allocated. */
3677+struct parser_sizes
3678+{
3679+ size_t short_len; /* Getopt short options string. */
3680+ size_t long_len; /* Getopt long options vector. */
3681+ size_t num_groups; /* Group structures we allocate. */
3682+ size_t num_child_inputs; /* Child input slots. */
3683+};
3684+
3685+/* For ARGP, increments the NUM_GROUPS field in SZS by the total number of
3686+ argp structures descended from it, and the SHORT_LEN & LONG_LEN fields by
3687+ the maximum lengths of the resulting merged getopt short options string and
3688+ long-options array, respectively. */
3689+static void
3690+calc_sizes (const struct argp *argp, struct parser_sizes *szs)
3691+{
3692+ const struct argp_child *child = argp->children;
3693+ const struct argp_option *opt = argp->options;
3694+
3695+ if (opt || argp->parser)
3696+ {
3697+ szs->num_groups++;
3698+ if (opt)
3699+ {
3700+ int num_opts = 0;
3701+ while (!__option_is_end (opt++))
3702+ num_opts++;
3703+ szs->short_len += num_opts * 3; /* opt + up to 2 `:'s */
3704+ szs->long_len += num_opts;
3705+ }
3706+ }
3707+
3708+ if (child)
3709+ while (child->argp)
3710+ {
3711+ calc_sizes ((child++)->argp, szs);
3712+ szs->num_child_inputs++;
3713+ }
3714+}
3715+
3716+
3717+extern char * __argp_short_program_name (void);
3718+/* Initializes PARSER to parse ARGP in a manner described by FLAGS. */
3719+static error_t
3720+parser_init (struct parser *parser, const struct argp *argp,
3721+ int argc, char **argv, int flags, void *input)
3722+{
3723+ error_t err = 0;
3724+ struct group *group;
3725+ struct parser_sizes szs;
3726+ struct _getopt_data opt_data = _GETOPT_DATA_INITIALIZER;
3727+
3728+ szs.short_len = (flags & ARGP_NO_ARGS) ? 0 : 1;
3729+ szs.long_len = 0;
3730+ szs.num_groups = 0;
3731+ szs.num_child_inputs = 0;
3732+
3733+ if (argp)
3734+ calc_sizes (argp, &szs);
3735+
3736+ /* Lengths of the various bits of storage used by PARSER. */
3737+#define GLEN (szs.num_groups + 1) * sizeof (struct group)
3738+#define CLEN (szs.num_child_inputs * sizeof (void *))
3739+#define LLEN ((szs.long_len + 1) * sizeof (struct option))
3740+#define SLEN (szs.short_len + 1)
3741+
3742+ parser->storage = malloc (GLEN + CLEN + LLEN + SLEN);
3743+ if (! parser->storage)
3744+ return ENOMEM;
3745+
3746+ parser->groups = parser->storage;
3747+ parser->child_inputs = parser->storage + GLEN;
3748+ parser->long_opts = parser->storage + GLEN + CLEN;
3749+ parser->short_opts = parser->storage + GLEN + CLEN + LLEN;
3750+ parser->opt_data = opt_data;
3751+
3752+ memset (parser->child_inputs, 0, szs.num_child_inputs * sizeof (void *));
3753+ parser_convert (parser, argp, flags);
3754+
3755+ memset (&parser->state, 0, sizeof (struct argp_state));
3756+ parser->state.root_argp = parser->argp;
3757+ parser->state.argc = argc;
3758+ parser->state.argv = argv;
3759+ parser->state.flags = flags;
3760+ parser->state.err_stream = stderr;
3761+ parser->state.out_stream = stdout;
3762+ parser->state.next = 0; /* Tell getopt to initialize. */
3763+ parser->state.pstate = parser;
3764+
3765+ parser->try_getopt = 1;
3766+
3767+ /* Call each parser for the first time, giving it a chance to propagate
3768+ values to child parsers. */
3769+ if (parser->groups < parser->egroup)
3770+ parser->groups->input = input;
3771+ for (group = parser->groups;
3772+ group < parser->egroup && (!err || err == EBADKEY);
3773+ group++)
3774+ {
3775+ if (group->parent)
3776+ /* If a child parser, get the initial input value from the parent. */
3777+ group->input = group->parent->child_inputs[group->parent_index];
3778+
3779+ if (!group->parser
3780+ && group->argp->children && group->argp->children->argp)
3781+ /* For the special case where no parsing function is supplied for an
3782+ argp, propagate its input to its first child, if any (this just
3783+ makes very simple wrapper argps more convenient). */
3784+ group->child_inputs[0] = group->input;
3785+
3786+ err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0);
3787+ }
3788+ if (err == EBADKEY)
3789+ err = 0; /* Some parser didn't understand. */
3790+
3791+ if (err)
3792+ return err;
3793+
3794+ if (parser->state.flags & ARGP_NO_ERRS)
3795+ {
3796+ parser->opt_data.opterr = 0;
3797+ if (parser->state.flags & ARGP_PARSE_ARGV0)
3798+ /* getopt always skips ARGV[0], so we have to fake it out. As long
3799+ as OPTERR is 0, then it shouldn't actually try to access it. */
3800+ parser->state.argv--, parser->state.argc++;
3801+ }
3802+ else
3803+ parser->opt_data.opterr = 1; /* Print error messages. */
3804+
3805+ if (parser->state.argv == argv && argv[0])
3806+ /* There's an argv[0]; use it for messages. */
3807+ {
3808+ char *short_name = strrchr (argv[0], '/');
3809+ parser->state.name = short_name ? short_name + 1 : argv[0];
3810+ }
3811+ else
3812+ parser->state.name = __argp_short_program_name ();
3813+
3814+ return 0;
3815+}
3816+
3817+/* Free any storage consumed by PARSER (but not PARSER itself). */
3818+static error_t
3819+parser_finalize (struct parser *parser,
3820+ error_t err, int arg_ebadkey, int *end_index)
3821+{
3822+ struct group *group;
3823+
3824+ if (err == EBADKEY && arg_ebadkey)
3825+ /* Suppress errors generated by unparsed arguments. */
3826+ err = 0;
3827+
3828+ if (! err)
3829+ {
3830+ if (parser->state.next == parser->state.argc)
3831+ /* We successfully parsed all arguments! Call all the parsers again,
3832+ just a few more times... */
3833+ {
3834+ for (group = parser->groups;
3835+ group < parser->egroup && (!err || err==EBADKEY);
3836+ group++)
3837+ if (group->args_processed == 0)
3838+ err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, 0);
3839+ for (group = parser->egroup - 1;
3840+ group >= parser->groups && (!err || err==EBADKEY);
3841+ group--)
3842+ err = group_parse (group, &parser->state, ARGP_KEY_END, 0);
3843+
3844+ if (err == EBADKEY)
3845+ err = 0; /* Some parser didn't understand. */
3846+
3847+ /* Tell the user that all arguments are parsed. */
3848+ if (end_index)
3849+ *end_index = parser->state.next;
3850+ }
3851+ else if (end_index)
3852+ /* Return any remaining arguments to the user. */
3853+ *end_index = parser->state.next;
3854+ else
3855+ /* No way to return the remaining arguments, they must be bogus. */
3856+ {
3857+ if (!(parser->state.flags & ARGP_NO_ERRS)
3858+ && parser->state.err_stream)
3859+ fprintf (parser->state.err_stream,
3860+ dgettext (parser->argp->argp_domain,
3861+ "%s: Too many arguments\n"),
3862+ parser->state.name);
3863+ err = EBADKEY;
3864+ }
3865+ }
3866+
3867+ /* Okay, we're all done, with either an error or success; call the parsers
3868+ to indicate which one. */
3869+
3870+ if (err)
3871+ {
3872+ /* Maybe print an error message. */
3873+ if (err == EBADKEY)
3874+ /* An appropriate message describing what the error was should have
3875+ been printed earlier. */
3876+ argp_state_help (&parser->state, parser->state.err_stream,
3877+ ARGP_HELP_STD_ERR);
3878+
3879+ /* Since we didn't exit, give each parser an error indication. */
3880+ for (group = parser->groups; group < parser->egroup; group++)
3881+ group_parse (group, &parser->state, ARGP_KEY_ERROR, 0);
3882+ }
3883+ else
3884+ /* Notify parsers of success, and propagate back values from parsers. */
3885+ {
3886+ /* We pass over the groups in reverse order so that child groups are
3887+ given a chance to do there processing before passing back a value to
3888+ the parent. */
3889+ for (group = parser->egroup - 1
3890+ ; group >= parser->groups && (!err || err == EBADKEY)
3891+ ; group--)
3892+ err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, 0);
3893+ if (err == EBADKEY)
3894+ err = 0; /* Some parser didn't understand. */
3895+ }
3896+
3897+ /* Call parsers once more, to do any final cleanup. Errors are ignored. */
3898+ for (group = parser->egroup - 1; group >= parser->groups; group--)
3899+ group_parse (group, &parser->state, ARGP_KEY_FINI, 0);
3900+
3901+ if (err == EBADKEY)
3902+ err = EINVAL;
3903+
3904+ free (parser->storage);
3905+
3906+ return err;
3907+}
3908+
3909+/* Call the user parsers to parse the non-option argument VAL, at the current
3910+ position, returning any error. The state NEXT pointer is assumed to have
3911+ been adjusted (by getopt) to point after this argument; this function will
3912+ adjust it correctly to reflect however many args actually end up being
3913+ consumed. */
3914+static error_t
3915+parser_parse_arg (struct parser *parser, char *val)
3916+{
3917+ /* Save the starting value of NEXT, first adjusting it so that the arg
3918+ we're parsing is again the front of the arg vector. */
3919+ int index = --parser->state.next;
3920+ error_t err = EBADKEY;
3921+ struct group *group;
3922+ int key = 0; /* Which of ARGP_KEY_ARG[S] we used. */
3923+
3924+ /* Try to parse the argument in each parser. */
3925+ for (group = parser->groups
3926+ ; group < parser->egroup && err == EBADKEY
3927+ ; group++)
3928+ {
3929+ parser->state.next++; /* For ARGP_KEY_ARG, consume the arg. */
3930+ key = ARGP_KEY_ARG;
3931+ err = group_parse (group, &parser->state, key, val);
3932+
3933+ if (err == EBADKEY)
3934+ /* This parser doesn't like ARGP_KEY_ARG; try ARGP_KEY_ARGS instead. */
3935+ {
3936+ parser->state.next--; /* For ARGP_KEY_ARGS, put back the arg. */
3937+ key = ARGP_KEY_ARGS;
3938+ err = group_parse (group, &parser->state, key, 0);
3939+ }
3940+ }
3941+
3942+ if (! err)
3943+ {
3944+ if (key == ARGP_KEY_ARGS)
3945+ /* The default for ARGP_KEY_ARGS is to assume that if NEXT isn't
3946+ changed by the user, *all* arguments should be considered
3947+ consumed. */
3948+ parser->state.next = parser->state.argc;
3949+
3950+ if (parser->state.next > index)
3951+ /* Remember that we successfully processed a non-option
3952+ argument -- but only if the user hasn't gotten tricky and set
3953+ the clock back. */
3954+ (--group)->args_processed += (parser->state.next - index);
3955+ else
3956+ /* The user wants to reparse some args, give getopt another try. */
3957+ parser->try_getopt = 1;
3958+ }
3959+
3960+ return err;
3961+}
3962+
3963+/* Call the user parsers to parse the option OPT, with argument VAL, at the
3964+ current position, returning any error. */
3965+static error_t
3966+parser_parse_opt (struct parser *parser, int opt, char *val)
3967+{
3968+ /* The group key encoded in the high bits; 0 for short opts or
3969+ group_number + 1 for long opts. */
3970+ int group_key = opt >> USER_BITS;
3971+ error_t err = EBADKEY;
3972+
3973+ if (group_key == 0)
3974+ /* A short option. By comparing OPT's position in SHORT_OPTS to the
3975+ various starting positions in each group's SHORT_END field, we can
3976+ determine which group OPT came from. */
3977+ {
3978+ struct group *group;
3979+ char *short_index = strchr (parser->short_opts, opt);
3980+
3981+ if (short_index)
3982+ for (group = parser->groups; group < parser->egroup; group++)
3983+ if (group->short_end > short_index)
3984+ {
3985+ err = group_parse (group, &parser->state, opt,
3986+ parser->opt_data.optarg);
3987+ break;
3988+ }
3989+ }
3990+ else
3991+ /* A long option. We use shifts instead of masking for extracting
3992+ the user value in order to preserve the sign. */
3993+ err =
3994+ group_parse (&parser->groups[group_key - 1], &parser->state,
3995+ (opt << GROUP_BITS) >> GROUP_BITS,
3996+ parser->opt_data.optarg);
3997+
3998+ if (err == EBADKEY)
3999+ /* At least currently, an option not recognized is an error in the
4000+ parser, because we pre-compute which parser is supposed to deal
4001+ with each option. */
4002+ {
4003+ static const char bad_key_err[] =
4004+ N_("(PROGRAM ERROR) Option should have been recognized!?");
4005+ if (group_key == 0)
4006+ argp_error (&parser->state, "-%c: %s", opt,
4007+ dgettext (parser->argp->argp_domain, bad_key_err));
4008+ else
4009+ {
4010+ struct option *long_opt = parser->long_opts;
4011+ while (long_opt->val != opt && long_opt->name)
4012+ long_opt++;
4013+ argp_error (&parser->state, "--%s: %s",
4014+ long_opt->name ? long_opt->name : "???",
4015+ dgettext (parser->argp->argp_domain, bad_key_err));
4016+ }
4017+ }
4018+
4019+ return err;
4020+}
4021+
4022+/* Parse the next argument in PARSER (as indicated by PARSER->state.next).
4023+ Any error from the parsers is returned, and *ARGP_EBADKEY indicates
4024+ whether a value of EBADKEY is due to an unrecognized argument (which is
4025+ generally not fatal). */
4026+static error_t
4027+parser_parse_next (struct parser *parser, int *arg_ebadkey)
4028+{
4029+ int opt;
4030+ error_t err = 0;
4031+
4032+ if (parser->state.quoted && parser->state.next < parser->state.quoted)
4033+ /* The next argument pointer has been moved to before the quoted
4034+ region, so pretend we never saw the quoting `--', and give getopt
4035+ another chance. If the user hasn't removed it, getopt will just
4036+ process it again. */
4037+ parser->state.quoted = 0;
4038+
4039+ if (parser->try_getopt && !parser->state.quoted)
4040+ /* Give getopt a chance to parse this. */
4041+ {
4042+ /* Put it back in OPTIND for getopt. */
4043+ parser->opt_data.optind = parser->state.next;
4044+ /* Distinguish KEY_ERR from a real option. */
4045+ parser->opt_data.optopt = KEY_END;
4046+ if (parser->state.flags & ARGP_LONG_ONLY)
4047+ opt = _getopt_long_only_r (parser->state.argc, parser->state.argv,
4048+ parser->short_opts, parser->long_opts, 0,
4049+ &parser->opt_data);
4050+ else
4051+ opt = _getopt_long_r (parser->state.argc, parser->state.argv,
4052+ parser->short_opts, parser->long_opts, 0,
4053+ &parser->opt_data);
4054+ /* And see what getopt did. */
4055+ parser->state.next = parser->opt_data.optind;
4056+
4057+ if (opt == KEY_END)
4058+ /* Getopt says there are no more options, so stop using
4059+ getopt; we'll continue if necessary on our own. */
4060+ {
4061+ parser->try_getopt = 0;
4062+ if (parser->state.next > 1
4063+ && strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
4064+ == 0)
4065+ /* Not only is this the end of the options, but it's a
4066+ `quoted' region, which may have args that *look* like
4067+ options, so we definitely shouldn't try to use getopt past
4068+ here, whatever happens. */
4069+ parser->state.quoted = parser->state.next;
4070+ }
4071+ else if (opt == KEY_ERR && parser->opt_data.optopt != KEY_END)
4072+ /* KEY_ERR can have the same value as a valid user short
4073+ option, but in the case of a real error, getopt sets OPTOPT
4074+ to the offending character, which can never be KEY_END. */
4075+ {
4076+ *arg_ebadkey = 0;
4077+ return EBADKEY;
4078+ }
4079+ }
4080+ else
4081+ opt = KEY_END;
4082+
4083+ if (opt == KEY_END)
4084+ {
4085+ /* We're past what getopt considers the options. */
4086+ if (parser->state.next >= parser->state.argc
4087+ || (parser->state.flags & ARGP_NO_ARGS))
4088+ /* Indicate that we're done. */
4089+ {
4090+ *arg_ebadkey = 1;
4091+ return EBADKEY;
4092+ }
4093+ else
4094+ /* A non-option arg; simulate what getopt might have done. */
4095+ {
4096+ opt = KEY_ARG;
4097+ parser->opt_data.optarg = parser->state.argv[parser->state.next++];
4098+ }
4099+ }
4100+
4101+ if (opt == KEY_ARG)
4102+ /* A non-option argument; try each parser in turn. */
4103+ err = parser_parse_arg (parser, parser->opt_data.optarg);
4104+ else
4105+ err = parser_parse_opt (parser, opt, parser->opt_data.optarg);
4106+
4107+ if (err == EBADKEY)
4108+ *arg_ebadkey = (opt == KEY_END || opt == KEY_ARG);
4109+
4110+ return err;
4111+}
4112+
4113+/* Parse the options strings in ARGC & ARGV according to the argp in ARGP.
4114+ FLAGS is one of the ARGP_ flags above. If END_INDEX is non-NULL, the
4115+ index in ARGV of the first unparsed option is returned in it. If an
4116+ unknown option is present, EINVAL is returned; if some parser routine
4117+ returned a non-zero value, it is returned; otherwise 0 is returned. */
4118+error_t
4119+argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
4120+ int *end_index, void *input)
4121+{
4122+ error_t err;
4123+ struct parser parser;
4124+
4125+ /* If true, then err == EBADKEY is a result of a non-option argument failing
4126+ to be parsed (which in some cases isn't actually an error). */
4127+ int arg_ebadkey = 0;
4128+
4129+ if (! (flags & ARGP_NO_HELP))
4130+ /* Add our own options. */
4131+ {
4132+ struct argp_child *child = alloca (4 * sizeof (struct argp_child));
4133+ struct argp *top_argp = alloca (sizeof (struct argp));
4134+
4135+ /* TOP_ARGP has no options, it just serves to group the user & default
4136+ argps. */
4137+ memset (top_argp, 0, sizeof (*top_argp));
4138+ top_argp->children = child;
4139+
4140+ memset (child, 0, 4 * sizeof (struct argp_child));
4141+
4142+ if (argp)
4143+ (child++)->argp = argp;
4144+ (child++)->argp = &argp_default_argp;
4145+ if (argp_program_version || argp_program_version_hook)
4146+ (child++)->argp = &argp_version_argp;
4147+ child->argp = 0;
4148+
4149+ argp = top_argp;
4150+ }
4151+
4152+ /* Construct a parser for these arguments. */
4153+ err = parser_init (&parser, argp, argc, argv, flags, input);
4154+
4155+ if (! err)
4156+ /* Parse! */
4157+ {
4158+ while (! err)
4159+ err = parser_parse_next (&parser, &arg_ebadkey);
4160+ err = parser_finalize (&parser, err, arg_ebadkey, end_index);
4161+ }
4162+
4163+ return err;
4164+}
4165+
4166+/* Return the input field for ARGP in the parser corresponding to STATE; used
4167+ by the help routines. */
4168+void *
4169+__argp_input (const struct argp *argp, const struct argp_state *state)
4170+{
4171+ if (state)
4172+ {
4173+ struct group *group;
4174+ struct parser *parser = state->pstate;
4175+
4176+ for (group = parser->groups; group < parser->egroup; group++)
4177+ if (group->argp == argp)
4178+ return group->input;
4179+ }
4180+
4181+ return 0;
4182+}
4183Index: git/libuargp/argp-pv.c
4184===================================================================
4185--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4186+++ git/libuargp/argp-pv.c 2012-06-18 13:10:44.060825542 -0700
4187@@ -0,0 +1,25 @@
4188+/* Default definition for ARGP_PROGRAM_VERSION.
4189+ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
4190+ This file is part of the GNU C Library.
4191+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
4192+
4193+ The GNU C Library is free software; you can redistribute it and/or
4194+ modify it under the terms of the GNU Lesser General Public
4195+ License as published by the Free Software Foundation; either
4196+ version 2.1 of the License, or (at your option) any later version.
4197+
4198+ The GNU C Library is distributed in the hope that it will be useful,
4199+ but WITHOUT ANY WARRANTY; without even the implied warranty of
4200+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4201+ Lesser General Public License for more details.
4202+
4203+ You should have received a copy of the GNU Lesser General Public
4204+ License along with the GNU C Library; if not, write to the Free
4205+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4206+ 02111-1307 USA. */
4207+
4208+/* If set by the user program to a non-zero value, then a default option
4209+ --version is added (unless the ARGP_NO_HELP flag is used), which will
4210+ print this this string followed by a newline and exit (unless the
4211+ ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
4212+const char *argp_program_version;
4213Index: git/libuargp/argp-pvh.c
4214===================================================================
4215--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4216+++ git/libuargp/argp-pvh.c 2012-06-18 13:10:44.060825542 -0700
4217@@ -0,0 +1,32 @@
4218+/* Default definition for ARGP_PROGRAM_VERSION_HOOK.
4219+ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
4220+ This file is part of the GNU C Library.
4221+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
4222+
4223+ The GNU C Library is free software; you can redistribute it and/or
4224+ modify it under the terms of the GNU Lesser General Public
4225+ License as published by the Free Software Foundation; either
4226+ version 2.1 of the License, or (at your option) any later version.
4227+
4228+ The GNU C Library is distributed in the hope that it will be useful,
4229+ but WITHOUT ANY WARRANTY; without even the implied warranty of
4230+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4231+ Lesser General Public License for more details.
4232+
4233+ You should have received a copy of the GNU Lesser General Public
4234+ License along with the GNU C Library; if not, write to the Free
4235+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4236+ 02111-1307 USA. */
4237+
4238+#ifdef HAVE_CONFIG_H
4239+#include <config.h>
4240+#endif
4241+
4242+#include <argp.h>
4243+
4244+/* If set by the user program to a non-zero value, then a default option
4245+ --version is added (unless the ARGP_NO_HELP flag is used), which calls
4246+ this function with a stream to print the version to and a pointer to the
4247+ current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
4248+ used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
4249+void (*argp_program_version_hook) (FILE *stream, struct argp_state *state);
4250Index: git/libuargp/argp-xinl.c
4251===================================================================
4252--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4253+++ git/libuargp/argp-xinl.c 2012-06-18 13:10:44.060825542 -0700
4254@@ -0,0 +1,35 @@
4255+/* Real definitions for extern inline functions in argp.h
4256+ Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
4257+ This file is part of the GNU C Library.
4258+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
4259+
4260+ The GNU C Library is free software; you can redistribute it and/or
4261+ modify it under the terms of the GNU Lesser General Public
4262+ License as published by the Free Software Foundation; either
4263+ version 2.1 of the License, or (at your option) any later version.
4264+
4265+ The GNU C Library is distributed in the hope that it will be useful,
4266+ but WITHOUT ANY WARRANTY; without even the implied warranty of
4267+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4268+ Lesser General Public License for more details.
4269+
4270+ You should have received a copy of the GNU Lesser General Public
4271+ License along with the GNU C Library; if not, write to the Free
4272+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4273+ 02111-1307 USA. */
4274+
4275+#ifdef HAVE_CONFIG_H
4276+# include <config.h>
4277+#endif
4278+
4279+#if defined _LIBC || defined HAVE_FEATURES_H
4280+# include <features.h>
4281+#endif
4282+
4283+#ifndef __USE_EXTERN_INLINES
4284+# define __USE_EXTERN_INLINES 1
4285+#endif
4286+#define ARGP_EI
4287+#undef __OPTIMIZE__
4288+#define __OPTIMIZE__ 1
4289+#include <argp.h>
4290Index: git/test/argp/Makefile
4291===================================================================
4292--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4293+++ git/test/argp/Makefile 2012-06-18 13:10:44.060825542 -0700
4294@@ -0,0 +1,7 @@
4295+# uClibc argp tests
4296+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
4297+
4298+top_builddir=../../
4299+include ../Rules.mak
4300+-include Makefile.in
4301+include ../Test.mak
4302Index: git/test/argp/Makefile.in
4303===================================================================
4304--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4305+++ git/test/argp/Makefile.in 2012-06-18 13:10:44.060825542 -0700
4306@@ -0,0 +1,12 @@
4307+# uClibc argp tests
4308+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
4309+
4310+TESTS := $(addprefix argp-, ex1 ex2 ex3 ex4 test) \
4311+ bug-argp1 tst-argp1 tst-argp2
4312+
4313+EXTRA_LDFLAGS = -luargp
4314+
4315+OPTS_argp-ex3 = ARG1 ARG2
4316+OPTS_argp-ex4 = ARG1 string1 string2 string3
4317+OPTS_bug-argp1 = -- --help
4318+
4319Index: git/test/argp/argp-ex1.c
4320===================================================================
4321--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4322+++ git/test/argp/argp-ex1.c 2012-06-18 13:10:44.060825542 -0700
4323@@ -0,0 +1,15 @@
4324+/* Argp example #1 -- a minimal program using argp */
4325+
4326+/* This is (probably) the smallest possible program that
4327+ uses argp. It won't do much except give an error
4328+ messages and exit when there are any arguments, and print
4329+ a (rather pointless) messages for --help. */
4330+
4331+#include <stdlib.h>
4332+#include <argp.h>
4333+
4334+int main (int argc, char **argv)
4335+{
4336+ argp_parse (0, argc, argv, 0, 0, 0);
4337+ exit (0);
4338+}
4339Index: git/test/argp/argp-ex2.c
4340===================================================================
4341--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4342+++ git/test/argp/argp-ex2.c 2012-06-18 13:10:44.060825542 -0700
4343@@ -0,0 +1,45 @@
4344+/* Argp example #2 -- a pretty minimal program using argp */
4345+
4346+/* This program doesn't use any options or arguments, but uses
4347+ argp to be compliant with the GNU standard command line
4348+ format.
4349+
4350+ In addition to making sure no arguments are given, and
4351+ implementing a --help option, this example will have a
4352+ --version option, and will put the given documentation string
4353+ and bug address in the --help output, as per GNU standards.
4354+
4355+ The variable ARGP contains the argument parser specification;
4356+ adding fields to this structure is the way most parameters are
4357+ passed to argp_parse (the first three fields are usually used,
4358+ but not in this small program). There are also two global
4359+ variables that argp knows about defined here,
4360+ ARGP_PROGRAM_VERSION and ARGP_PROGRAM_BUG_ADDRESS (they are
4361+ global variables because they will almost always be constant
4362+ for a given program, even if it uses different argument
4363+ parsers for various tasks). */
4364+
4365+#include <stdlib.h>
4366+#include <argp.h>
4367+
4368+const char *argp_program_version =
4369+ "argp-ex2 1.0";
4370+const char *argp_program_bug_address =
4371+ "<bug-gnu-utils@@gnu.org>";
4372+
4373+/* Program documentation. */
4374+static char doc[] =
4375+ "Argp example #2 -- a pretty minimal program using argp";
4376+
4377+/* Our argument parser. The @code{options}, @code{parser}, and
4378+ @code{args_doc} fields are zero because we have neither options or
4379+ arguments; @code{doc} and @code{argp_program_bug_address} will be
4380+ used in the output for @samp{--help}, and the @samp{--version}
4381+ option will print out @code{argp_program_version}. */
4382+static struct argp argp = { 0, 0, 0, doc };
4383+
4384+int main (int argc, char **argv)
4385+{
4386+ argp_parse (&argp, argc, argv, 0, 0, 0);
4387+ exit (0);
4388+}
4389Index: git/test/argp/argp-ex3.c
4390===================================================================
4391--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4392+++ git/test/argp/argp-ex3.c 2012-06-18 13:10:44.060825542 -0700
4393@@ -0,0 +1,153 @@
4394+/* Argp example #3 -- a program with options and arguments using argp */
4395+
4396+/* This program uses the same features as example 2, and uses options and
4397+ arguments.
4398+
4399+ We now use the first four fields in ARGP, so here's a description of them:
4400+ OPTIONS -- A pointer to a vector of struct argp_option (see below)
4401+ PARSER -- A function to parse a single option, called by argp
4402+ ARGS_DOC -- A string describing how the non-option arguments should look
4403+ DOC -- A descriptive string about this program; if it contains a
4404+ vertical tab character (\v), the part after it will be
4405+ printed *following* the options
4406+
4407+ The function PARSER takes the following arguments:
4408+ KEY -- An integer specifying which option this is (taken
4409+ from the KEY field in each struct argp_option), or
4410+ a special key specifying something else; the only
4411+ special keys we use here are ARGP_KEY_ARG, meaning
4412+ a non-option argument, and ARGP_KEY_END, meaning
4413+ that all arguments have been parsed
4414+ ARG -- For an option KEY, the string value of its
4415+ argument, or NULL if it has none
4416+ STATE-- A pointer to a struct argp_state, containing
4417+ various useful information about the parsing state; used here
4418+ are the INPUT field, which reflects the INPUT argument to
4419+ argp_parse, and the ARG_NUM field, which is the number of the
4420+ current non-option argument being parsed
4421+ It should return either 0, meaning success, ARGP_ERR_UNKNOWN, meaning the
4422+ given KEY wasn't recognized, or an errno value indicating some other
4423+ error.
4424+
4425+ Note that in this example, main uses a structure to communicate with the
4426+ parse_opt function, a pointer to which it passes in the INPUT argument to
4427+ argp_parse. Of course, it's also possible to use global variables
4428+ instead, but this is somewhat more flexible.
4429+
4430+ The OPTIONS field contains a pointer to a vector of struct argp_option's;
4431+ that structure has the following fields (if you assign your option
4432+ structures using array initialization like this example, unspecified
4433+ fields will be defaulted to 0, and need not be specified):
4434+ NAME -- The name of this option's long option (may be zero)
4435+ KEY -- The KEY to pass to the PARSER function when parsing this option,
4436+ *and* the name of this option's short option, if it is a
4437+ printable ascii character
4438+ ARG -- The name of this option's argument, if any
4439+ FLAGS -- Flags describing this option; some of them are:
4440+ OPTION_ARG_OPTIONAL -- The argument to this option is optional
4441+ OPTION_ALIAS -- This option is an alias for the
4442+ previous option
4443+ OPTION_HIDDEN -- Don't show this option in --help output
4444+ DOC -- A documentation string for this option, shown in --help output
4445+
4446+ An options vector should be terminated by an option with all fields zero. */
4447+
4448+#include <stdlib.h>
4449+#include <argp.h>
4450+
4451+const char *argp_program_version =
4452+ "argp-ex3 1.0";
4453+const char *argp_program_bug_address =
4454+ "<bug-gnu-utils@@gnu.org>";
4455+
4456+/* Program documentation. */
4457+static char doc[] =
4458+ "Argp example #3 -- a program with options and arguments using argp";
4459+
4460+/* A description of the arguments we accept. */
4461+static char args_doc[] = "ARG1 ARG2";
4462+
4463+/* The options we understand. */
4464+static struct argp_option options[] = {
4465+ {"verbose", 'v', 0, 0, "Produce verbose output" },
4466+ {"quiet", 'q', 0, 0, "Don't produce any output" },
4467+ {"silent", 's', 0, OPTION_ALIAS },
4468+ {"output", 'o', "FILE", 0,
4469+ "Output to FILE instead of standard output" },
4470+ { 0 }
4471+};
4472+
4473+/* Used by @code{main} to communicate with @code{parse_opt}. */
4474+struct arguments
4475+{
4476+ char *args[2]; /* @var{arg1} & @var{arg2} */
4477+ int silent, verbose;
4478+ char *output_file;
4479+};
4480+
4481+/* Parse a single option. */
4482+static error_t
4483+parse_opt (int key, char *arg, struct argp_state *state)
4484+{
4485+ /* Get the @var{input} argument from @code{argp_parse}, which we
4486+ know is a pointer to our arguments structure. */
4487+ struct arguments *arguments = state->input;
4488+
4489+ switch (key)
4490+ {
4491+ case 'q': case 's':
4492+ arguments->silent = 1;
4493+ break;
4494+ case 'v':
4495+ arguments->verbose = 1;
4496+ break;
4497+ case 'o':
4498+ arguments->output_file = arg;
4499+ break;
4500+
4501+ case ARGP_KEY_ARG:
4502+ if (state->arg_num >= 2)
4503+ /* Too many arguments. */
4504+ argp_usage (state);
4505+
4506+ arguments->args[state->arg_num] = arg;
4507+
4508+ break;
4509+
4510+ case ARGP_KEY_END:
4511+ if (state->arg_num < 2)
4512+ /* Not enough arguments. */
4513+ argp_usage (state);
4514+ break;
4515+
4516+ default:
4517+ return ARGP_ERR_UNKNOWN;
4518+ }
4519+ return 0;
4520+}
4521+
4522+/* Our argp parser. */
4523+static struct argp argp = { options, parse_opt, args_doc, doc };
4524+
4525+int main (int argc, char **argv)
4526+{
4527+ struct arguments arguments;
4528+
4529+ /* Default values. */
4530+ arguments.silent = 0;
4531+ arguments.verbose = 0;
4532+ arguments.output_file = "-";
4533+
4534+ /* Parse our arguments; every option seen by @code{parse_opt} will
4535+ be reflected in @code{arguments}. */
4536+ argp_parse (&argp, argc, argv, 0, 0, &arguments);
4537+
4538+ printf ("ARG1 = %s\nARG2 = %s\nOUTPUT_FILE = %s\n"
4539+ "VERBOSE = %s\nSILENT = %s\n",
4540+ arguments.args[0], arguments.args[1],
4541+ arguments.output_file,
4542+ arguments.verbose ? "yes" : "no",
4543+ arguments.silent ? "yes" : "no");
4544+
4545+ exit (0);
4546+}
4547Index: git/test/argp/argp-ex4.c
4548===================================================================
4549--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4550+++ git/test/argp/argp-ex4.c 2012-06-18 13:10:44.060825542 -0700
4551@@ -0,0 +1,167 @@
4552+/* Argp example #4 -- a program with somewhat more complicated options */
4553+
4554+/* This program uses the same features as example 3, but has more
4555+ options, and somewhat more structure in the -help output. It
4556+ also shows how you can `steal' the remainder of the input
4557+ arguments past a certain point, for programs that accept a
4558+ list of items. It also shows the special argp KEY value
4559+ ARGP_KEY_NO_ARGS, which is only given if no non-option
4560+ arguments were supplied to the program.
4561+
4562+ For structuring the help output, two features are used,
4563+ *headers* which are entries in the options vector with the
4564+ first four fields being zero, and a two part documentation
4565+ string (in the variable DOC), which allows documentation both
4566+ before and after the options; the two parts of DOC are
4567+ separated by a vertical-tab character ('\v', or '\013'). By
4568+ convention, the documentation before the options is just a
4569+ short string saying what the program does, and that afterwards
4570+ is longer, describing the behavior in more detail. All
4571+ documentation strings are automatically filled for output,
4572+ although newlines may be included to force a line break at a
4573+ particular point. All documentation strings are also passed to
4574+ the `gettext' function, for possible translation into the
4575+ current locale. */
4576+
4577+#include <stdlib.h>
4578+#include <error.h>
4579+#include <argp.h>
4580+
4581+const char *argp_program_version =
4582+ "argp-ex4 1.0";
4583+const char *argp_program_bug_address =
4584+ "<bug-gnu-utils@@prep.ai.mit.edu>";
4585+
4586+/* Program documentation. */
4587+static char doc[] =
4588+ "Argp example #4 -- a program with somewhat more complicated\
4589+options\
4590+\vThis part of the documentation comes *after* the options;\
4591+ note that the text is automatically filled, but it's possible\
4592+ to force a line-break, e.g.\n<-- here.";
4593+
4594+/* A description of the arguments we accept. */
4595+static char args_doc[] = "ARG1 [STRING...]";
4596+
4597+/* Keys for options without short-options. */
4598+#define OPT_ABORT 1 /* --abort */
4599+
4600+/* The options we understand. */
4601+static struct argp_option options[] = {
4602+ {"verbose", 'v', 0, 0, "Produce verbose output" },
4603+ {"quiet", 'q', 0, 0, "Don't produce any output" },
4604+ {"silent", 's', 0, OPTION_ALIAS },
4605+ {"output", 'o', "FILE", 0,
4606+ "Output to FILE instead of standard output" },
4607+
4608+ {0,0,0,0, "The following options should be grouped together:" },
4609+ {"repeat", 'r', "COUNT", OPTION_ARG_OPTIONAL,
4610+ "Repeat the output COUNT (default 10) times"},
4611+ {"abort", OPT_ABORT, 0, 0, "Abort before showing any output"},
4612+
4613+ { 0 }
4614+};
4615+
4616+/* Used by @code{main} to communicate with @code{parse_opt}. */
4617+struct arguments
4618+{
4619+ char *arg1; /* @var{arg1} */
4620+ char **strings; /* [@var{string}@dots{}] */
4621+ int silent, verbose, abort; /* @samp{-s}, @samp{-v}, @samp{--abort} */
4622+ char *output_file; /* @var{file} arg to @samp{--output} */
4623+ int repeat_count; /* @var{count} arg to @samp{--repeat} */
4624+};
4625+
4626+/* Parse a single option. */
4627+static error_t
4628+parse_opt (int key, char *arg, struct argp_state *state)
4629+{
4630+ /* Get the @code{input} argument from @code{argp_parse}, which we
4631+ know is a pointer to our arguments structure. */
4632+ struct arguments *arguments = state->input;
4633+
4634+ switch (key)
4635+ {
4636+ case 'q': case 's':
4637+ arguments->silent = 1;
4638+ break;
4639+ case 'v':
4640+ arguments->verbose = 1;
4641+ break;
4642+ case 'o':
4643+ arguments->output_file = arg;
4644+ break;
4645+ case 'r':
4646+ arguments->repeat_count = arg ? atoi (arg) : 10;
4647+ break;
4648+ case OPT_ABORT:
4649+ arguments->abort = 1;
4650+ break;
4651+
4652+ case ARGP_KEY_NO_ARGS:
4653+ argp_usage (state);
4654+
4655+ case ARGP_KEY_ARG:
4656+ /* Here we know that @code{state->arg_num == 0}, since we
4657+ force argument parsing to end before any more arguments can
4658+ get here. */
4659+ arguments->arg1 = arg;
4660+
4661+ /* Now we consume all the rest of the arguments.
4662+ @code{state->next} is the index in @code{state->argv} of the
4663+ next argument to be parsed, which is the first @var{string}
4664+ we're interested in, so we can just use
4665+ @code{&state->argv[state->next]} as the value for
4666+ arguments->strings.
4667+
4668+ @emph{In addition}, by setting @code{state->next} to the end
4669+ of the arguments, we can force argp to stop parsing here and
4670+ return. */
4671+ arguments->strings = &state->argv[state->next];
4672+ state->next = state->argc;
4673+
4674+ break;
4675+
4676+ default:
4677+ return ARGP_ERR_UNKNOWN;
4678+ }
4679+ return 0;
4680+}
4681+
4682+/* Our argp parser. */
4683+static struct argp argp = { options, parse_opt, args_doc, doc };
4684+
4685+int main (int argc, char **argv)
4686+{
4687+ int i, j;
4688+ struct arguments arguments;
4689+
4690+ /* Default values. */
4691+ arguments.silent = 0;
4692+ arguments.verbose = 0;
4693+ arguments.output_file = "-";
4694+ arguments.repeat_count = 1;
4695+ arguments.abort = 0;
4696+
4697+ /* Parse our arguments; every option seen by @code{parse_opt} will be
4698+ reflected in @code{arguments}. */
4699+ argp_parse (&argp, argc, argv, 0, 0, &arguments);
4700+
4701+ if (arguments.abort)
4702+ error (10, 0, "ABORTED");
4703+
4704+ for (i = 0; i < arguments.repeat_count; i++)
4705+ {
4706+ printf ("ARG1 = %s\n", arguments.arg1);
4707+ printf ("STRINGS = ");
4708+ for (j = 0; arguments.strings[j]; j++)
4709+ printf (j == 0 ? "%s" : ", %s", arguments.strings[j]);
4710+ printf ("\n");
4711+ printf ("OUTPUT_FILE = %s\nVERBOSE = %s\nSILENT = %s\n",
4712+ arguments.output_file,
4713+ arguments.verbose ? "yes" : "no",
4714+ arguments.silent ? "yes" : "no");
4715+ }
4716+
4717+ exit (0);
4718+}
4719Index: git/test/argp/argp-test.c
4720===================================================================
4721--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4722+++ git/test/argp/argp-test.c 2012-06-18 13:10:44.060825542 -0700
4723@@ -0,0 +1,209 @@
4724+/* Test program for argp argument parser
4725+ Copyright (C) 1997 Free Software Foundation, Inc.
4726+ This file is part of the GNU C Library.
4727+ Written by Miles Bader <miles at gnu.ai.mit.edu>.
4728+
4729+ The GNU C Library is free software; you can redistribute it and/or
4730+ modify it under the terms of the GNU Lesser General Public
4731+ License as published by the Free Software Foundation; either
4732+ version 2.1 of the License, or (at your option) any later version.
4733+
4734+ The GNU C Library is distributed in the hope that it will be useful,
4735+ but WITHOUT ANY WARRANTY; without even the implied warranty of
4736+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4737+ Lesser General Public License for more details.
4738+
4739+ You should have received a copy of the GNU Lesser General Public
4740+ License along with the GNU C Library; if not, write to the Free
4741+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4742+ 02111-1307 USA. */
4743+
4744+#ifdef HAVE_CONFIG_H
4745+#include <config.h>
4746+#endif
4747+
4748+#include <stdlib.h>
4749+#include <time.h>
4750+#include <string.h>
4751+#include <argp.h>
4752+
4753+const char *argp_program_version = "argp-test 1.0";
4754+
4755+struct argp_option sub_options[] =
4756+{
4757+ {"subopt1", 's', 0, 0, "Nested option 1"},
4758+ {"subopt2", 'S', 0, 0, "Nested option 2"},
4759+
4760+ { 0, 0, 0, 0, "Some more nested options:", 10},
4761+ {"subopt3", 'p', 0, 0, "Nested option 3"},
4762+
4763+ {"subopt4", 'q', 0, 0, "Nested option 4", 1},
4764+
4765+ {0}
4766+};
4767+
4768+static const char sub_args_doc[] = "STRING...\n-";
4769+static const char sub_doc[] = "\vThis is the doc string from the sub-arg-parser.";
4770+
4771+static error_t
4772+sub_parse_opt (int key, char *arg, struct argp_state *state)
4773+{
4774+ switch (key)
4775+ {
4776+ case ARGP_KEY_NO_ARGS:
4777+ printf ("NO SUB ARGS\n");
4778+ break;
4779+ case ARGP_KEY_ARG:
4780+ printf ("SUB ARG: %s\n", arg);
4781+ break;
4782+
4783+ case 's' : case 'S': case 'p': case 'q':
4784+ printf ("SUB KEY %c\n", key);
4785+ break;
4786+
4787+ default:
4788+ return ARGP_ERR_UNKNOWN;
4789+ }
4790+ return 0;
4791+}
4792+
4793+static char *
4794+sub_help_filter (int key, const char *text, void *input)
4795+{
4796+ if (key == ARGP_KEY_HELP_EXTRA)
4797+ return strdup ("This is some extra text from the sub parser (note that it \
4798+is preceded by a blank line).");
4799+ else
4800+ return (char *)text;
4801+}
4802+
4803+static struct argp sub_argp = {
4804+ sub_options, sub_parse_opt, sub_args_doc, sub_doc, 0, sub_help_filter
4805+};
4806+
4807+/* Structure used to communicate with the parsing functions. */
4808+struct params
4809+{
4810+ unsigned foonly; /* Value parsed for foonly. */
4811+ unsigned foonly_default; /* Default value for it. */
4812+};
4813+
4814+#define OPT_PGRP 1
4815+#define OPT_SESS 2
4816+
4817+struct argp_option options[] =
4818+{
4819+ {"pid", 'p', "PID", 0, "List the process PID"},
4820+ {"pgrp", OPT_PGRP,"PGRP",0, "List processes in the process group PGRP"},
4821+ {"no-parent", 'P', 0, 0, "Include processes without parents"},
4822+ {0, 'x', 0, OPTION_ALIAS},
4823+ {"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally"
4824+ " if there's some reason ps can't"
4825+ " print a field for any process, it's"
4826+ " removed from the output entirely)" },
4827+ {"reverse", 'r', 0, 0, "Reverse the order of any sort"},
4828+ {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS},
4829+ {"session", OPT_SESS,"SID", OPTION_ARG_OPTIONAL,
4830+ "Add the processes from the session"
4831+ " SID (which defaults to the sid of"
4832+ " the current process)" },
4833+
4834+ {0,0,0,0, "Here are some more options:"},
4835+ {"foonly", 'f', "ZOT", OPTION_ARG_OPTIONAL, "Glork a foonly"},
4836+ {"zaza", 'z', 0, 0, "Snit a zar"},
4837+
4838+ {0}
4839+};
4840+
4841+static const char args_doc[] = "STRING";
4842+static const char doc[] = "Test program for argp."
4843+ "\vThis doc string comes after the options."
4844+ "\nHey! Some manual formatting!"
4845+ "\nThe current time is: %s";
4846+
4847+static void
4848+popt (int key, char *arg)
4849+{
4850+ char buf[10];
4851+ if (isprint (key))
4852+ sprintf (buf, "%c", key);
4853+ else
4854+ sprintf (buf, "%d", key);
4855+ if (arg)
4856+ printf ("KEY %s: %s\n", buf, arg);
4857+ else
4858+ printf ("KEY %s\n", buf);
4859+}
4860+
4861+static error_t
4862+parse_opt (int key, char *arg, struct argp_state *state)
4863+{
4864+ struct params *params = state->input;
4865+
4866+ switch (key)
4867+ {
4868+ case ARGP_KEY_NO_ARGS:
4869+ printf ("NO ARGS\n");
4870+ break;
4871+
4872+ case ARGP_KEY_ARG:
4873+ if (state->arg_num > 0)
4874+ return ARGP_ERR_UNKNOWN; /* Leave it for the sub-arg parser. */
4875+ printf ("ARG: %s\n", arg);
4876+ break;
4877+
4878+ case 'f':
4879+ if (arg)
4880+ params->foonly = atoi (arg);
4881+ else
4882+ params->foonly = params->foonly_default;
4883+ popt (key, arg);
4884+ break;
4885+
4886+ case 'p': case 'P': case OPT_PGRP: case 'x': case 'Q':
4887+ case 'r': case OPT_SESS: case 'z':
4888+ popt (key, arg);
4889+ break;
4890+
4891+ default:
4892+ return ARGP_ERR_UNKNOWN;
4893+ }
4894+ return 0;
4895+}
4896+
4897+static char *
4898+help_filter (int key, const char *text, void *input)
4899+{
4900+ char *new_text;
4901+ struct params *params = input;
4902+
4903+ if (key == ARGP_KEY_HELP_POST_DOC && text)
4904+ {
4905+ time_t now = time (0);
4906+ asprintf (&new_text, text, ctime (&now));
4907+ }
4908+ else if (key == 'f')
4909+ /* Show the default for the --foonly option. */
4910+ asprintf (&new_text, "%s (ZOT defaults to %x)",
4911+ text, params->foonly_default);
4912+ else
4913+ new_text = (char *)text;
4914+
4915+ return new_text;
4916+}
4917+
4918+static struct argp_child argp_children[] = { { &sub_argp }, { 0 } };
4919+static struct argp argp = {
4920+ options, parse_opt, args_doc, doc, argp_children, help_filter
4921+};
4922+
4923+int
4924+main (int argc, char **argv)
4925+{
4926+ struct params params;
4927+ params.foonly = 0;
4928+ params.foonly_default = random ();
4929+ argp_parse (&argp, argc, argv, 0, 0, &params);
4930+ printf ("After parsing: foonly = %x\n", params.foonly);
4931+ return 0;
4932+}
4933Index: git/test/argp/bug-argp1.c
4934===================================================================
4935--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4936+++ git/test/argp/bug-argp1.c 2012-06-18 13:10:44.060825542 -0700
4937@@ -0,0 +1,26 @@
4938+#include <argp.h>
4939+
4940+
4941+static const struct argp_option test_options[] =
4942+{
4943+ { NULL, 'a', NULL, OPTION_DOC, NULL },
4944+ { NULL, 'b', NULL, OPTION_DOC, NULL },
4945+ { NULL, 0, NULL, 0, NULL }
4946+};
4947+
4948+static struct argp test_argp =
4949+{
4950+ test_options
4951+};
4952+
4953+
4954+static int
4955+do_test (int argc, char *argv[])
4956+{
4957+ int i;
4958+ argp_parse (&test_argp, argc, argv, 0, &i, NULL);
4959+ return 0;
4960+}
4961+
4962+#define TEST_FUNCTION do_test (argc, argv)
4963+#include "../test-skeleton.c"
4964Index: git/test/argp/tst-argp1.c
4965===================================================================
4966--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4967+++ git/test/argp/tst-argp1.c 2012-06-18 13:10:44.060825542 -0700
4968@@ -0,0 +1,118 @@
4969+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4970+ This file is part of the GNU C Library.
4971+ Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
4972+
4973+ The GNU C Library is free software; you can redistribute it and/or
4974+ modify it under the terms of the GNU Lesser General Public
4975+ License as published by the Free Software Foundation; either
4976+ version 2.1 of the License, or (at your option) any later version.
4977+
4978+ The GNU C Library is distributed in the hope that it will be useful,
4979+ but WITHOUT ANY WARRANTY; without even the implied warranty of
4980+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4981+ Lesser General Public License for more details.
4982+
4983+ You should have received a copy of the GNU Lesser General Public
4984+ License along with the GNU C Library; if not, write to the Free
4985+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
4986+ 02111-1307 USA. */
4987+
4988+#include <argp.h>
4989+
4990+
4991+
4992+
4993+#define OPT_TO_THREAD 300
4994+#define OPT_TO_PROCESS 301
4995+#define OPT_SYNC_SIGNAL 302
4996+#define OPT_SYNC_JOIN 303
4997+#define OPT_TOPLEVEL 304
4998+
4999+
5000+static const struct argp_option test_options[] =
5001+ {
5002+ { NULL, 0, NULL, 0, "\
5003+This is a test for threads so we allow ther user to selection the number of \
5004+threads which are used at any one time. Independently the total number of \
5005+rounds can be selected. This is the total number of threads which will have \
5006+run when the process terminates:" },
5007+ { "threads", 't', "NUMBER", 0, "Number of threads used at once" },
5008+ { "starts", 's', "NUMBER", 0, "Total number of working threads" },
5009+ { "toplevel", OPT_TOPLEVEL, "NUMBER", 0,
5010+ "Number of toplevel threads which start the other threads; this \
5011+implies --sync-join" },
5012+
5013+ { NULL, 0, NULL, 0, "\
5014+Each thread can do one of two things: sleep or do work. The latter is 100% \
5015+CPU bound. The work load is the probability a thread does work. All values \
5016+from zero to 100 (inclusive) are valid. How often each thread repeats this \
5017+can be determined by the number of rounds. The work cost determines how long \
5018+each work session (not sleeping) takes. If it is zero a thread would \
5019+effectively nothing. By setting the number of rounds to zero the thread \
5020+does no work at all and pure thread creation times can be measured." },
5021+ { "workload", 'w', "PERCENT", 0, "Percentage of time spent working" },
5022+ { "workcost", 'c', "NUMBER", 0,
5023+ "Factor in the cost of each round of working" },
5024+ { "rounds", 'r', "NUMBER", 0, "Number of rounds each thread runs" },
5025+
5026+ { NULL, 0, NULL, 0, "\
5027+There are a number of different methods how thread creation can be \
5028+synchronized. Synchronization is necessary since the number of concurrently \
5029+running threads is limited." },
5030+ { "sync-signal", OPT_SYNC_SIGNAL, NULL, 0,
5031+ "Synchronize using a signal (default)" },
5032+ { "sync-join", OPT_SYNC_JOIN, NULL, 0, "Synchronize using pthread_join" },
5033+
5034+ { NULL, 0, NULL, 0, "\
5035+One parameter for each threads execution is the size of the stack. If this \
5036+parameter is not used the system's default stack size is used. If many \
5037+threads are used the stack size should be chosen quite small." },
5038+ { "stacksize", 'S', "BYTES", 0, "Size of threads stack" },
5039+ { "guardsize", 'g', "BYTES", 0,
5040+ "Size of stack guard area; must fit into the stack" },
5041+
5042+ { NULL, 0, NULL, 0, "Signal options:" },
5043+ { "to-thread", OPT_TO_THREAD, NULL, 0, "Send signal to main thread" },
5044+ { "to-process", OPT_TO_PROCESS, NULL, 0,
5045+ "Send signal to process (default)" },
5046+
5047+ { NULL, 0, NULL, 0, "Administrative options:" },
5048+ { "progress", 'p', NULL, 0, "Show signs of progress" },
5049+ { "timing", 'T', NULL, 0,
5050+ "Measure time from startup to the last thread finishing" },
5051+ { NULL, 0, NULL, 0, NULL }
5052+ };
5053+
5054+/* Prototype for option handler. */
5055+static error_t parse_opt (int key, char *arg, struct argp_state *state);
5056+
5057+/* Data structure to communicate with argp functions. */
5058+static struct argp argp =
5059+{
5060+ test_options, parse_opt
5061+};
5062+
5063+
5064+static int
5065+do_test (void)
5066+{
5067+ int argc = 2;
5068+ char *argv[3] = { (char *) "tst-argp1", (char *) "--help", NULL };
5069+ int remaining;
5070+
5071+ /* Parse and process arguments. */
5072+ argp_parse (&argp, argc, argv, 0, &remaining, NULL);
5073+
5074+ return 0;
5075+}
5076+
5077+
5078+/* Handle program arguments. */
5079+static error_t
5080+parse_opt (int key, char *arg, struct argp_state *state)
5081+{
5082+ return ARGP_ERR_UNKNOWN;
5083+}
5084+
5085+#define TEST_FUNCTION do_test ()
5086+#include "../test-skeleton.c"
5087Index: git/test/argp/tst-argp2.c
5088===================================================================
5089--- /dev/null 1970-01-01 00:00:00.000000000 +0000
5090+++ git/test/argp/tst-argp2.c 2012-06-18 13:10:44.064825538 -0700
5091@@ -0,0 +1,101 @@
5092+/* Copyright (C) 2007 Free Software Foundation, Inc.
5093+ This file is part of the GNU C Library.
5094+ Contributed by Jakub Jelinek <jakub at redhat.com>, 2007.
5095+
5096+ The GNU C Library is free software; you can redistribute it and/or
5097+ modify it under the terms of the GNU Lesser General Public
5098+ License as published by the Free Software Foundation; either
5099+ version 2.1 of the License, or (at your option) any later version.
5100+
5101+ The GNU C Library is distributed in the hope that it will be useful,
5102+ but WITHOUT ANY WARRANTY; without even the implied warranty of
5103+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5104+ Lesser General Public License for more details.
5105+
5106+ You should have received a copy of the GNU Lesser General Public
5107+ License along with the GNU C Library; if not, write to the Free
5108+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
5109+ 02111-1307 USA. */
5110+
5111+#include <argp.h>
5112+
5113+static const struct argp_option opt1[] =
5114+ {
5115+ { "opt1", '1', "NUMBER", 0, "Option 1" },
5116+ { NULL, 0, NULL, 0, NULL }
5117+ };
5118+
5119+static const struct argp_option opt2[] =
5120+ {
5121+ { "opt2", '2', "NUMBER", 0, "Option 2" },
5122+ { NULL, 0, NULL, 0, NULL }
5123+ };
5124+
5125+static const struct argp_option opt3[] =
5126+ {
5127+ { "opt3", '3', "NUMBER", 0, "Option 3" },
5128+ { NULL, 0, NULL, 0, NULL }
5129+ };
5130+
5131+static const struct argp_option opt4[] =
5132+ {
5133+ { "opt4", '4', "NUMBER", 0, "Option 4" },
5134+ { NULL, 0, NULL, 0, NULL }
5135+ };
5136+
5137+static const struct argp_option opt5[] =
5138+ {
5139+ { "opt5", '5', "NUMBER", 0, "Option 5" },
5140+ { NULL, 0, NULL, 0, NULL }
5141+ };
5142+
5143+static struct argp argp5 =
5144+ {
5145+ opt5, NULL, "args doc5", "doc5", NULL, NULL, NULL
5146+ };
5147+
5148+static struct argp argp4 =
5149+ {
5150+ opt4, NULL, "args doc4", "doc4", NULL, NULL, NULL
5151+ };
5152+
5153+static struct argp argp3 =
5154+ {
5155+ opt3, NULL, "args doc3", "doc3", NULL, NULL, NULL
5156+ };
5157+
5158+static struct argp_child children2[] =
5159+ {
5160+ { &argp4, 0, "child3", 3 },
5161+ { &argp5, 0, "child4", 4 },
5162+ { NULL, 0, NULL, 0 }
5163+ };
5164+
5165+static struct argp argp2 =
5166+ {
5167+ opt2, NULL, "args doc2", "doc2", children2, NULL, NULL
5168+ };
5169+
5170+static struct argp_child children1[] =
5171+ {
5172+ { &argp2, 0, "child1", 1 },
5173+ { &argp3, 0, "child2", 2 },
5174+ { NULL, 0, NULL, 0 }
5175+ };
5176+
5177+static struct argp argp1 =
5178+ {
5179+ opt1, NULL, "args doc1", "doc1", children1, NULL, NULL
5180+ };
5181+
5182+
5183+static int
5184+do_test (void)
5185+{
5186+ argp_help (&argp1, stdout, ARGP_HELP_LONG, (char *) "tst-argp2");
5187+ return 0;
5188+}
5189+
5190+
5191+#define TEST_FUNCTION do_test ()
5192+#include "../test-skeleton.c"
diff --git a/meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch b/meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch
new file mode 100644
index 0000000000..15ee0ca156
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/compile-arm-fork-with-O2.patch
@@ -0,0 +1,21 @@
1When compiling in thumb mode for arm with -Os gcc gives up since it can not find registers
2to spill. So we use -O2 option for compiling fork.c It may be addressable in gcc.
3
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Upstream-Status: Pending
7
8diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
9index 329d8a9..41e3646 100644
10--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
11+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
12@@ -30,3 +30,9 @@ CFLAGS-OMIT-libc-lowlevellock.c = -DNOT_IN_libc -DIS_IN_libpthread
13 # This macro should be alternatively implemented in THUMB
14 # assembly.
15 ASFLAGS-vfork.S = -marm
16+
17+# For arm fork.c does not compile with -Os when in compiling
18+# in thumb1 mode
19+ifeq ($(COMPILE_IN_THUMB_MODE),y)
20+CFLAGS-fork.c = -O2
21+endif
diff --git a/meta/recipes-core/uclibc/uclibc-git/locale.cfg b/meta/recipes-core/uclibc/uclibc-git/locale.cfg
new file mode 100644
index 0000000000..fc66435163
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/locale.cfg
@@ -0,0 +1,3 @@
1UCLIBC_HAS_LOCALE=y
2UCLIBC_HAS_XLOCALE=y
3UCLIBC_BUILD_MINIMAL_LOCALE=y
diff --git a/meta/recipes-core/uclibc/uclibc-git/obstack.cfg b/meta/recipes-core/uclibc/uclibc-git/obstack.cfg
new file mode 100644
index 0000000000..36bf9d6e4a
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/obstack.cfg
@@ -0,0 +1 @@
UCLIBC_HAS_OBSTACK=y
diff --git a/meta/recipes-core/uclibc/uclibc-git/orign_path.patch b/meta/recipes-core/uclibc/uclibc-git/orign_path.patch
new file mode 100644
index 0000000000..81bb8f8459
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/orign_path.patch
@@ -0,0 +1,186 @@
1Patch is backported from
2http://lists.busybox.net/pipermail/uclibc/2011-March/045003.html
3
4Upstream-Status: Pending
5
6Index: git/ldso/ldso/dl-elf.c
7===================================================================
8--- git.orig/ldso/ldso/dl-elf.c 2012-06-19 18:29:08.629931662 -0700
9+++ git/ldso/ldso/dl-elf.c 2012-06-19 21:21:14.798431393 -0700
10@@ -133,56 +133,60 @@
11 * in uClibc/ldso/util/ldd.c */
12 static struct elf_resolve *
13 search_for_named_library(const char *name, unsigned rflags, const char *path_list,
14- struct dyn_elf **rpnt)
15+ struct dyn_elf **rpnt, const char* origin)
16 {
17- char *path, *path_n, *mylibname;
18+ char *mylibname;
19 struct elf_resolve *tpnt;
20- int done;
21+ const char *p, *pn;
22+ int plen;
23
24 if (path_list==NULL)
25 return NULL;
26
27- /* We need a writable copy of this string, but we don't
28- * need this allocated permanently since we don't want
29- * to leak memory, so use alloca to put path on the stack */
30- done = _dl_strlen(path_list);
31- path = alloca(done + 1);
32-
33 /* another bit of local storage */
34 mylibname = alloca(2050);
35
36- _dl_memcpy(path, path_list, done+1);
37-
38 /* Unlike ldd.c, don't bother to eliminate double //s */
39
40 /* Replace colons with zeros in path_list */
41 /* : at the beginning or end of path maps to CWD */
42 /* :: anywhere maps CWD */
43 /* "" maps to CWD */
44- done = 0;
45- path_n = path;
46- do {
47- if (*path == 0) {
48- *path = ':';
49- done = 1;
50+ for (p = path_list; p != NULL; p = pn) {
51+ pn = _dl_strchr(p + 1, ':');
52+ if (pn != NULL) {
53+ plen = pn - p;
54+ pn++;
55+ } else
56+ plen = _dl_strlen(p);
57+
58+ if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) {
59+ int olen;
60+ if (rflags && plen != 7)
61+ continue;
62+ if (origin == NULL)
63+ continue;
64+ for (olen = _dl_strlen(origin) - 1; olen >= 0 && origin[olen] != '/'; olen--)
65+ ;
66+ if (olen <= 0)
67+ continue;
68+ _dl_memcpy(&mylibname[0], origin, olen);
69+ _dl_memcpy(&mylibname[olen], p + 7, plen - 7);
70+ mylibname[olen + plen - 7] = 0;
71+ } else if (plen != 0) {
72+ _dl_memcpy(mylibname, p, plen);
73+ mylibname[plen] = 0;
74+ } else {
75+ _dl_strcpy(mylibname, ".");
76 }
77- if (*path == ':') {
78- *path = 0;
79- if (*path_n)
80- _dl_strcpy(mylibname, path_n);
81- else
82- _dl_strcpy(mylibname, "."); /* Assume current dir if empty path */
83- _dl_strcat(mylibname, "/");
84- _dl_strcat(mylibname, name);
85+ _dl_strcat(mylibname, "/");
86+ _dl_strcat(mylibname, name);
87 #ifdef __LDSO_SAFE_RUNPATH__
88- if (*mylibname == '/')
89+ if (*mylibname == '/')
90 #endif
91- if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != NULL)
92- return tpnt;
93- path_n = path+1;
94- }
95- path++;
96- } while (!done);
97+ if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != NULL)
98+ return tpnt;
99+ }
100 return NULL;
101 }
102
103@@ -234,8 +238,10 @@
104 if (pnt) {
105 pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
106 _dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt);
107- if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL)
108+ if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt,
109+ tpnt->libname)) != NULL)
110 return tpnt1;
111+
112 }
113 #endif
114
115@@ -243,7 +249,7 @@
116 /* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
117 if (_dl_library_path) {
118 _dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path);
119- if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt)) != NULL)
120+ if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt, NULL)) != NULL)
121 {
122 return tpnt1;
123 }
124@@ -257,7 +263,7 @@
125 if (pnt) {
126 pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
127 _dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt);
128- if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL)
129+ if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt, NULL)) != NULL)
130 return tpnt1;
131 }
132 #endif
133@@ -291,7 +297,7 @@
134 /* Look for libraries wherever the shared library loader
135 * was installed */
136 _dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath);
137- tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt);
138+ tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt, NULL);
139 if (tpnt1 != NULL)
140 return tpnt1;
141 #endif
142@@ -304,7 +310,7 @@
143 #ifndef __LDSO_CACHE_SUPPORT__
144 ":" UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib"
145 #endif
146- , rpnt);
147+ , rpnt, NULL);
148 if (tpnt1 != NULL)
149 return tpnt1;
150
151Index: git/ldso/ldso/ldso.c
152===================================================================
153--- git.orig/ldso/ldso/ldso.c 2012-06-19 18:29:08.633931663 -0700
154+++ git/ldso/ldso/ldso.c 2012-06-19 18:29:10.197931738 -0700
155@@ -403,6 +403,20 @@
156 return p - list;
157 }
158
159+static void _dl_setup_progname(const char *argv0)
160+{
161+ char image[PATH_MAX];
162+ ssize_t s;
163+
164+ s = _dl_readlink("/proc/self/exe", image, sizeof(image));
165+ if (s > 0 && image[0] == '/') {
166+ image[s] = 0;
167+ _dl_progname = _dl_strdup(image);
168+ } else if (argv0) {
169+ _dl_progname = argv0;
170+ }
171+}
172+
173 void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
174 ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv
175 DL_GET_READY_TO_RUN_EXTRA_PARMS)
176@@ -454,9 +468,7 @@
177 * been fixed up by now. Still no function calls outside of this
178 * library, since the dynamic resolver is not yet ready.
179 */
180- if (argv[0]) {
181- _dl_progname = argv[0];
182- }
183+ _dl_setup_progname(argv[0]);
184
185 #ifdef __DSBT__
186 _dl_ldso_dsbt = (void *)tpnt->dynamic_info[DT_DSBT_BASE_IDX];
diff --git a/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch b/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch
new file mode 100644
index 0000000000..2f014cd91e
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/powerpc_copysignl.patch
@@ -0,0 +1,113 @@
1Add ppc copysignl implementation
2
3Upstream-Status: Pending
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: git/libc/sysdeps/linux/powerpc/Makefile.arch
8===================================================================
9--- git.orig/libc/sysdeps/linux/powerpc/Makefile.arch 2013-05-23 11:09:50.000000000 -0700
10+++ git/libc/sysdeps/linux/powerpc/Makefile.arch 2013-05-23 11:12:06.072328399 -0700
11@@ -5,7 +5,7 @@
12 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
13 #
14
15-CSRC-y := __syscall_error.c ioctl.c
16+CSRC-y := __syscall_error.c ioctl.c copysignl.c
17
18 SSRC-y := \
19 __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
20Index: git/libc/sysdeps/linux/powerpc/copysignl.c
21===================================================================
22--- /dev/null 1970-01-01 00:00:00.000000000 +0000
23+++ git/libc/sysdeps/linux/powerpc/copysignl.c 2013-05-23 11:11:37.600327865 -0700
24@@ -0,0 +1,89 @@
25+/* s_copysignl.c -- long double version of s_copysign.c.
26+ * Conversion to long double by Ulrich Drepper,
27+ * Cygnus Support, drepper@cygnus.com.
28+ */
29+
30+/*
31+ * ====================================================
32+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
33+ *
34+ * Developed at SunPro, a Sun Microsystems, Inc. business.
35+ * Permission to use, copy, modify, and distribute this
36+ * software is freely granted, provided that this notice
37+ * is preserved.
38+ * ====================================================
39+ */
40+
41+/*
42+ * copysignl(long double x, long double y)
43+ * copysignl(x,y) returns a value with the magnitude of x and
44+ * with the sign bit of y.
45+ */
46+
47+#include <endian.h>
48+#include <stdint.h>
49+
50+#if __FLOAT_WORD_ORDER == BIG_ENDIAN
51+
52+typedef union
53+{
54+ long double value;
55+ struct
56+ {
57+ int sign_exponent:16;
58+ unsigned int empty:16;
59+ uint32_t msw;
60+ uint32_t lsw;
61+ } parts;
62+} ieee_long_double_shape_type;
63+
64+#endif
65+
66+#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
67+
68+typedef union
69+{
70+ long double value;
71+ struct
72+ {
73+ uint32_t lsw;
74+ uint32_t msw;
75+ int sign_exponent:16;
76+ unsigned int empty:16;
77+ } parts;
78+} ieee_long_double_shape_type;
79+
80+#endif
81+
82+/* Get int from the exponent of a long double. */
83+
84+#define GET_LDOUBLE_EXP(exp,d) \
85+do { \
86+ ieee_long_double_shape_type ge_u; \
87+ ge_u.value = (d); \
88+ (exp) = ge_u.parts.sign_exponent; \
89+} while (0)
90+
91+/* Set exponent of a long double from an int. */
92+
93+#define SET_LDOUBLE_EXP(d,exp) \
94+do { \
95+ ieee_long_double_shape_type se_u; \
96+ se_u.value = (d); \
97+ se_u.parts.sign_exponent = (exp); \
98+ (d) = se_u.value; \
99+} while (0)
100+
101+long double copysignl(long double x, long double y);
102+libc_hidden_proto(copysignl);
103+
104+long double copysignl(long double x, long double y)
105+{
106+ uint32_t es1,es2;
107+ GET_LDOUBLE_EXP(es1,x);
108+ GET_LDOUBLE_EXP(es2,y);
109+ SET_LDOUBLE_EXP(x,(es1&0x7fff)|(es2&0x8000));
110+ return x;
111+}
112+
113+libc_hidden_def(copysignl);
diff --git a/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch b/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch
new file mode 100644
index 0000000000..d2a8a81b94
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/remove_attribute_optimize_Os.patch
@@ -0,0 +1,140 @@
1Dont support localised optimizations this helps to have a global -O level
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
6Index: git/libpthread/nptl/pthread_mutex_timedlock.c
7===================================================================
8--- git.orig/libpthread/nptl/pthread_mutex_timedlock.c 2013-01-21 16:22:20.000000000 -0800
9+++ git/libpthread/nptl/pthread_mutex_timedlock.c 2013-01-21 16:24:12.275557670 -0800
10@@ -28,7 +28,9 @@
11 * error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
12 */
13 int
14+#ifndef __OPTIMIZE__
15 attribute_optimize("Os")
16+#endif
17 pthread_mutex_timedlock (
18 pthread_mutex_t *mutex,
19 const struct timespec *abstime)
20Index: git/libc/sysdeps/linux/powerpc/bits/mathinline.h
21===================================================================
22--- git.orig/libc/sysdeps/linux/powerpc/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800
23+++ git/libc/sysdeps/linux/powerpc/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800
24@@ -26,7 +26,7 @@
25 #ifdef __cplusplus
26 # define __MATH_INLINE __inline
27 #else
28-# define __MATH_INLINE extern __inline
29+# define __MATH_INLINE __extern_inline
30 #endif /* __cplusplus */
31
32 #if defined __GNUC__ && !defined _SOFT_FLOAT
33Index: git/libc/sysdeps/linux/alpha/bits/mathinline.h
34===================================================================
35--- git.orig/libc/sysdeps/linux/alpha/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800
36+++ git/libc/sysdeps/linux/alpha/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800
37@@ -24,7 +24,7 @@
38 #ifdef __cplusplus
39 # define __MATH_INLINE __inline
40 #else
41-# define __MATH_INLINE extern __inline
42+# define __MATH_INLINE __extern_inline
43 #endif
44
45 #if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
46Index: git/libc/sysdeps/linux/i386/bits/mathinline.h
47===================================================================
48--- git.orig/libc/sysdeps/linux/i386/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800
49+++ git/libc/sysdeps/linux/i386/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800
50@@ -25,7 +25,7 @@
51 #ifdef __cplusplus
52 # define __MATH_INLINE __inline
53 #else
54-# define __MATH_INLINE extern __inline
55+# define __MATH_INLINE __extern_inline
56 #endif
57
58
59Index: git/libc/sysdeps/linux/ia64/bits/mathinline.h
60===================================================================
61--- git.orig/libc/sysdeps/linux/ia64/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800
62+++ git/libc/sysdeps/linux/ia64/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800
63@@ -23,7 +23,7 @@
64 #ifdef __cplusplus
65 # define __MATH_INLINE __inline
66 #else
67-# define __MATH_INLINE extern __inline
68+# define __MATH_INLINE __extern_inline
69 #endif
70
71 #if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
72Index: git/libc/sysdeps/linux/m68k/bits/mathinline.h
73===================================================================
74--- git.orig/libc/sysdeps/linux/m68k/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800
75+++ git/libc/sysdeps/linux/m68k/bits/mathinline.h 2013-01-21 16:24:12.275557670 -0800
76@@ -91,7 +91,7 @@
77 # ifdef __cplusplus
78 # define __m81_inline __inline
79 # else
80-# define __m81_inline extern __inline
81+# define __m81_inline __extern_inline
82 # endif
83 # define __M81_MATH_INLINES 1
84 #endif
85@@ -350,14 +350,14 @@
86 /* Note that there must be no whitespace before the argument passed for
87 NAME, to make token pasting work correctly with -traditional. */
88 # define __inline_forward_c(rettype, name, args1, args2) \
89-extern __inline rettype __attribute__((__const__)) \
90+__extern_inline rettype __attribute__((__const__)) \
91 name args1 \
92 { \
93 return __CONCAT(__,name) args2; \
94 }
95
96 # define __inline_forward(rettype, name, args1, args2) \
97-extern __inline rettype name args1 \
98+__extern_inline rettype name args1 \
99 { \
100 return __CONCAT(__,name) args2; \
101 }
102Index: git/libc/sysdeps/linux/mips/sys/tas.h
103===================================================================
104--- git.orig/libc/sysdeps/linux/mips/sys/tas.h 2013-01-21 16:22:20.000000000 -0800
105+++ git/libc/sysdeps/linux/mips/sys/tas.h 2013-01-21 16:24:12.275557670 -0800
106@@ -29,7 +29,7 @@
107 #ifdef __USE_EXTERN_INLINES
108
109 # ifndef _EXTERN_INLINE
110-# define _EXTERN_INLINE extern __inline
111+# define _EXTERN_INLINE __extern_inline
112 # endif
113
114 _EXTERN_INLINE int
115Index: git/libc/sysdeps/linux/sparc/bits/mathinline.h
116===================================================================
117--- git.orig/libc/sysdeps/linux/sparc/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800
118+++ git/libc/sysdeps/linux/sparc/bits/mathinline.h 2013-01-21 16:24:12.279557671 -0800
119@@ -130,7 +130,7 @@
120 # ifdef __cplusplus
121 # define __MATH_INLINE __inline
122 # else
123-# define __MATH_INLINE extern __inline
124+# define __MATH_INLINE __extern_inline
125 # endif /* __cplusplus */
126
127 /* The gcc, version 2.7 or below, has problems with all this inlining
128Index: git/libc/sysdeps/linux/x86_64/bits/mathinline.h
129===================================================================
130--- git.orig/libc/sysdeps/linux/x86_64/bits/mathinline.h 2013-01-21 16:22:20.000000000 -0800
131+++ git/libc/sysdeps/linux/x86_64/bits/mathinline.h 2013-01-21 16:24:12.279557671 -0800
132@@ -24,7 +24,7 @@
133 #ifdef __cplusplus
134 # define __MATH_INLINE __inline
135 #else
136-# define __MATH_INLINE extern __inline
137+# define __MATH_INLINE __extern_inline
138 #endif
139
140
diff --git a/meta/recipes-core/uclibc/uclibc-git/uClibc.distro b/meta/recipes-core/uclibc/uclibc-git/uClibc.distro
new file mode 100644
index 0000000000..c309e6f79a
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/uClibc.distro
@@ -0,0 +1,192 @@
1#
2# General Library Settings
3#
4# HAVE_NO_PIC is not set
5# DOPIC is not set
6# HAVE_NO_SHARED is not set
7# ARCH_HAS_NO_LDSO is not set
8HAVE_SHARED=y
9# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
10LDSO_LDD_SUPPORT=y
11LDSO_CACHE_SUPPORT=y
12# LDSO_PRELOAD_FILE_SUPPORT is not set
13LDSO_BASE_FILENAME="ld.so"
14# UCLIBC_STATIC_LDCONFIG is not set
15LDSO_RUNPATH=y
16UCLIBC_CTOR_DTOR=y
17LDSO_GNU_HASH_SUPPORT=y
18# HAS_NO_THREADS is not set
19UCLIBC_HAS_THREADS=y
20UCLIBC_HAS_THREADS_NATIVE=y
21PTHREADS_DEBUG_SUPPORT=y
22# LINUXTHREADS_OLD is not set
23UCLIBC_HAS_LFS=y
24# MALLOC is not set
25# MALLOC_SIMPLE is not set
26MALLOC_STANDARD=y
27MALLOC_GLIBC_COMPAT=y
28UCLIBC_DYNAMIC_ATEXIT=y
29COMPAT_ATEXIT=y
30UCLIBC_SUSV3_LEGACY=y
31UCLIBC_SUSV3_LEGACY_MACROS=y
32UCLIBC_SUSV4_LEGACY=y
33UCLIBC_HAS_SHADOW=y
34UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
35UCLIBC_HAS___PROGNAME=y
36UNIX98PTY_ONLY=y
37ASSUME_DEVPTS=y
38UCLIBC_HAS_LIBUTIL=y
39UCLIBC_HAS_TM_EXTENSIONS=y
40UCLIBC_HAS_TZ_CACHING=y
41UCLIBC_HAS_TZ_FILE=y
42UCLIBC_HAS_TZ_FILE_READ_MANY=y
43UCLIBC_TZ_FILE_PATH="/etc/TZ"
44
45#
46# Advanced Library Settings
47#
48UCLIBC_PWD_BUFFER_SIZE=256
49UCLIBC_GRP_BUFFER_SIZE=256
50
51#
52# Networking Support
53#
54UCLIBC_HAS_IPV6=y
55UCLIBC_HAS_RPC=y
56UCLIBC_HAS_FULL_RPC=y
57UCLIBC_HAS_REENTRANT_RPC=y
58UCLIBC_USE_NETLINK=y
59UCLIBC_SUPPORT_AI_ADDRCONFIG=y
60
61UCLIBC_HAS_BSD_RES_CLOSE=y
62UCLIBC_HAS_LIBRESOLV_STUB=y
63UCLIBC_HAS_LIBNSL_STUB=y
64
65#
66# String and Stdio Support
67#
68UCLIBC_HAS_STRING_GENERIC_OPT=y
69UCLIBC_HAS_STRING_ARCH_OPT=y
70UCLIBC_HAS_CTYPE_TABLES=y
71UCLIBC_HAS_CTYPE_SIGNED=y
72# UCLIBC_HAS_CTYPE_UNSAFE is not set
73UCLIBC_HAS_CTYPE_CHECKED=y
74# UCLIBC_HAS_CTYPE_ENFORCED is not set
75UCLIBC_HAS_WCHAR=y
76# UCLIBC_HAS_LOCALE is not set
77UCLIBC_HAS_HEXADECIMAL_FLOATS=y
78UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
79UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
80UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
81# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
82UCLIBC_HAS_STDIO_BUFSIZ_256=y
83# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
84# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
85# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
86# UCLIBC_HAS_STDIO_BUFSIZ_4096 is not set
87# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
88UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
89# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
90# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
91# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
92UCLIBC_HAS_STDIO_GETC_MACRO=y
93UCLIBC_HAS_STDIO_PUTC_MACRO=y
94UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
95# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
96UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
97UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
98UCLIBC_HAS_PRINTF_M_SPEC=y
99UCLIBC_HAS_ERRNO_MESSAGES=y
100# UCLIBC_HAS_SYS_ERRLIST is not set
101UCLIBC_HAS_SIGNUM_MESSAGES=y
102# UCLIBC_HAS_SYS_SIGLIST is not set
103UCLIBC_HAS_GNU_GETOPT=y
104UCLIBC_HAS_GNU_GETSUBOPT=y
105
106#
107# Big and Tall
108#
109UCLIBC_HAS_REGEX=y
110# UCLIBC_HAS_REGEX_OLD is not set
111UCLIBC_HAS_FNMATCH=y
112# UCLIBC_HAS_FNMATCH_OLD is not set
113UCLIBC_HAS_WORDEXP=y
114UCLIBC_HAS_NFTW=y
115UCLIBC_HAS_FTW=y
116UCLIBC_HAS_FTS=y
117UCLIBC_HAS_GLOB=y
118UCLIBC_HAS_GNU_GLOB=y
119
120#
121# Library Installation Options
122#
123SHARED_LIB_LOADER_PREFIX="/lib"
124RUNTIME_PREFIX="/"
125DEVEL_PREFIX="//usr"
126
127#
128# Security options
129#
130# UCLIBC_BUILD_PIE is not set
131# UCLIBC_HAS_ARC4RANDOM is not set
132# HAVE_NO_SSP is not set
133# UCLIBC_HAS_SSP is not set
134UCLIBC_BUILD_RELRO=y
135UCLIBC_BUILD_NOW=y
136UCLIBC_BUILD_NOEXECSTACK=y
137
138#
139# uClibc development/debugging options
140#
141CROSS_COMPILER_PREFIX=""
142UCLIBC_EXTRA_CFLAGS=""
143# DODEBUG is not set
144# DODEBUG_PT is not set
145# DOSTRIP is not set
146# DOASSERTS is not set
147# SUPPORT_LD_DEBUG is not set
148# SUPPORT_LD_DEBUG_EARLY is not set
149# UCLIBC_MALLOC_DEBUGGING is not set
150UCLIBC_HAS_BACKTRACE=y
151WARNINGS="-Wall"
152# EXTRA_WARNINGS is not set
153# DOMULTI is not set
154# UCLIBC_MJN3_ONLY is not set
155
156# math stuff for perl
157DO_C99_MATH=y
158UCLIBC_HAS_LONG_DOUBLE_MATH=y
159UCLIBC_HAS_FENV=y
160UCLIBC_LINUX_MODULE_26=y
161# UCLIBC_LINUX_MODULE_24 is not set
162UCLIBC_LINUX_SPECIFIC=y
163UCLIBC_HAS_REALTIME=y
164UCLIBC_HAS_ADVANCED_REALTIME=y
165UCLIBC_HAS_NETWORK_SUPPORT=y
166UCLIBC_HAS_SOCKET=y
167UCLIBC_HAS_BSD_ERR=y
168UCLIBC_HAS_SYSLOG=y
169UCLIBC_HAS_CRYPT=y
170UCLIBC_HAS_CRYPT_IMPL=y
171UCLIBC_HAS_GNU_ERROR=y
172UCLIBC_HAS_PTY=y
173UCLIBC_BSD_SPECIFIC=y
174UCLIBC_HAS_EPOLL=y
175UCLIBC_HAS_FLOATS=y
176
177# The below option is needed for ARM since depending
178# upong what intruction set is chosen this will be
179# enabled. As such it is harmless and will be punted
180# by menuconfig for other arches.
181
182# COMPILE_IN_THUMB_MODE is not set
183
184# needed by systemd
185UCLIBC_HAS_UTMPX=y
186UCLIBC_LINUX_MODULE_26=y
187UCLIBC_HAS_RESOLVER_SUPPORT=y
188# needed for LTP
189UCLIBC_SUSV4_LEGACY=y
190UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y
191DO_XSI_MATH=y
192UCLIBC_SV4_DEPRECATED=y
diff --git a/meta/recipes-core/uclibc/uclibc-git/uClibc.machine b/meta/recipes-core/uclibc/uclibc-git/uClibc.machine
new file mode 100644
index 0000000000..595f444dac
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/uClibc.machine
@@ -0,0 +1,14 @@
1#
2# Automatically generated make config: don't edit
3# Version: 0.9.32-git
4# Mon Jul 19 01:34:29 2010
5#
6#
7# Using ELF file format
8#
9FORCE_OPTIONS_FOR_ARCH=y
10ARCH_HAS_MMU=y
11ARCH_USE_MMU=y
12KERNEL_HEADERS="/usr/include"
13HAVE_DOT_CONFIG=y
14
diff --git a/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch b/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch
new file mode 100644
index 0000000000..37a59884b8
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/uclibc_enable_log2_test.patch
@@ -0,0 +1,35 @@
1uclibc now has log2 so enable the tests
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
6Index: uClibc/test/math/libm-test.inc
7===================================================================
8--- uClibc/test/math/libm-test.inc (revision 23784)
9+++ uClibc/test/math/libm-test.inc (working copy)
10@@ -3414,7 +3414,6 @@
11 }
12
13
14-#if 0
15 static void
16 log2_test (void)
17 {
18@@ -3444,7 +3443,6 @@
19
20 END (log2);
21 }
22-#endif
23
24
25 static void
26@@ -4967,9 +4965,7 @@
27 log_test ();
28 log10_test ();
29 log1p_test ();
30-#if 0
31 log2_test ();
32-#endif
33 logb_test ();
34 modf_test ();
35 ilogb_test ();
diff --git a/meta/recipes-core/uclibc/uclibc-initial_git.bb b/meta/recipes-core/uclibc/uclibc-initial_git.bb
new file mode 100644
index 0000000000..3a1140e57b
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-initial_git.bb
@@ -0,0 +1,36 @@
1SECTION = "base"
2require uclibc.inc
3require uclibc-git.inc
4
5DEPENDS = "linux-libc-headers ncurses-native virtual/${TARGET_PREFIX}gcc-initial kern-tools-native"
6PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
7
8PACKAGES = ""
9PACKAGES_DYNAMIC = ""
10
11STAGINGCC = "gcc-cross-initial"
12STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
13
14do_install() {
15 # Install initial headers into the cross dir
16 make PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
17 install_headers install_startfiles
18
19 # add links to linux-libc-headers: final uclibc build need this.
20 for t in linux asm asm-generic; do
21 if [ -d ${D}${includedir}/$t ]; then
22 rm -rf ${D}${includedir}/$t
23 fi
24 ln -sf ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
25 done
26
27}
28do_compile() {
29 :
30}
31
32do_siteconfig () {
33 :
34}
35
36do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
diff --git a/meta/recipes-core/uclibc/uclibc-package.inc b/meta/recipes-core/uclibc/uclibc-package.inc
new file mode 100644
index 0000000000..c1815f9a31
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-package.inc
@@ -0,0 +1,37 @@
1# Ensure the uclibc-dev package is processed before uclibc-staticdev to allow
2# *_nonshared.a libraries to be packaged in the uclibc-dev package.
3PACKAGES = "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db uclibc-argp uclibc-backtrace uclibc-libcrypt uclibc-libintl uclibc-libnsl uclibc-libresolv uclibc-libm uclibc-libdl uclibc-libutil uclibc-libpthread uclibc-librt ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}"
4
5FILES_uclibc-libcrypt = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so"
6FILES_uclibc-libintl = "${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so"
7FILES_uclibc-libnsl = "${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so"
8FILES_uclibc-libresolv = "${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so"
9FILES_uclibc-libm = "${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so"
10FILES_uclibc-libdl = "${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so"
11FILES_uclibc-libutil = "${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so"
12FILES_uclibc-libpthread = "${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so"
13FILES_uclibc-librt = "${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so"
14
15FILES_ldd = "${bindir}/ldd"
16FILES_uclibc-utils = "${bindir} ${sbindir}"
17FILES_uclibc-utils-dbg += "${bindir}/.debug ${sbindir}/.debug"
18FILES_uclibc-gconv = "${libdir}/gconv"
19FILES_uclibc-thread-db = "${base_libdir}/libthread_db*"
20FILES_uclibc-argp = "${base_libdir}/libuargp-*.so ${base_libdir}/libuargp*.so.*"
21FILES_uclibc-backtrace = "${base_libdir}/libubacktrace-*.so ${base_libdir}/libubacktrace*.so.*"
22
23# The last line (gdb and lib1) is for uclinux-uclibc builds
24uclibc_baselibs = "${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \
25 ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \
26 ${libdir}/libc.gdb ${libdir}/libc ${base_libdir}/lib1.so \
27 "
28FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
29FILES_${PN}-dev += "\
30 ${libdir}/lib*.so \
31 ${libdir}/*_nonshared.a \
32 ${libdir}/[S]*crt[1in].o \
33 ${libdir}/crtreloc*.o \
34 ${includedir}/*.h ${includedir}/*/*.h \
35 "
36FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \
37 ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale"
diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
new file mode 100644
index 0000000000..e00de62f90
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc.inc
@@ -0,0 +1,166 @@
1SUMMARY = "C library for embedded systems"
2DESCRIPTION = "The name uClibc is an abbreviation for 'the \
3microcontroller C library'. For simplicity, uClibc is pronounced \
4'yew-see-lib-see'. The goal of uClibc is to provide as much \
5functionality as possible in a small amount of space, and it is intended \
6primarily for embedded use. It is also highly configurable in supported \
7features, at the cost of ABI differences for different configurations. \
8uClibc has been designed from the ground up to be a C library for \
9embedded Linux. It is NOT compatible with binaries linked against glibc."
10
11LICENSE = "LGPLv2.1+"
12SECTION = "libs"
13LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
14 file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \
15file://${S}/test/regex/testregex.c;beginline=1;endline=31;md5=234efb227d0a40677f895e4a1e26e960"
16PR = "r9"
17
18require uclibc-config.inc
19
20PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
21TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
22
23# siteconfig.bbclass runs configure which needs a working compiler
24# For the compiler to work we need a working libc yet libc isn't
25# in the sysroots directory at this point. This means the libc.so
26# linker script won't work as the --sysroot setting isn't correct.
27# Here we create a hacked up libc linker script and pass in the right
28# flags to let configure work. Ugly.
29EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
30siteconfig_do_siteconfig_gencache_prepend = " \
31mkdir -p ${WORKDIR}/site_config_libc; \
32cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
33sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
34"
35
36# For now, we will skip building of a gcc package if it is a uclibc one
37# and our build is not a uclibc one, and we skip a glibc one if our build
38# is a uclibc build.
39COMPATIBLE_HOST = ".*-uclibc.*"
40
41INHIBIT_DEFAULT_DEPS = "1"
42
43# do_stage barfs on a CC with whitespace, therefore put the 'HOST_CC_ARCH' in
44# the CFLAGS (when building the utils).
45OEMAKE_NO_CC = "'STRIPTOOL=true' 'LD=${LD}'"
46EXTRA_OEMAKE = "${OEMAKE_NO_CC} \
47 'HOSTCC=${BUILD_CC}' \
48 'HOST_CFLAGS=${BUILD_CFLAGS}' \
49 'CC=${CC}' \
50 ARCH=${UCLIBC_ARCH}"
51
52EXTRA_OEMAKE_task_do_package = "${OEMAKE_NO_CC}"
53
54# enable verbose output:
55export V="2"
56
57# -O<n> -fno-omit-frame-pointer ends up with GCC ICE on thumb as reported
58# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44860
59#
60CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}', d)}"
61UCLIBC_EXTRA_CFLAGS := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}"
62UCLIBC_EXTRA_LDFLAGS := "${@oe_filter_out('(-L\S+|-l\S+)', '${LDFLAGS}', d)}"
63
64do_compile_prepend () {
65 unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
66 oe_runmake pregen
67}
68
69configmangle = '/^KERNEL_HEADERS/d; \
70 /^RUNTIME_PREFIX/d; \
71 /^DEVEL_PREFIX/d; \
72 /^SHARED_LIB_LOADER_PREFIX/d; \
73 /^UCLIBC_EXTRA_CFLAGS/d; \
74 s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \
75 ${@["","s,.*COMPILE_IN_THUMB_MODE.*,COMPILE_IN_THUMB_MODE=y,;"][d.getVar("ARM_INSTRUCTION_SET", True) != "arm"]} \
76 ${@["","s,.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y,;"][d.getVar("USE_NLS", True) == "yes"]} \
77 ${@["","s,.*LDSO_GNU_HASH_SUPPORT.*,# LDSO_GNU_HASH_SUPPORT is not set,;"][d.getVar("TARGET_ARCH", True) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]} \
78 /^CROSS/d; \
79 /^TARGET_ARCH=/d; \
80 /^TARGET_/s,^\([^=]*\).*,# \1 is not set,g; \
81 s,^DOSTRIP.*,# DOSTRIP is not set,g; \
82 /_[EO]*ABI/d; \
83 /HAS_FPU/d; \
84 '
85OE_FEATURES := "${@features_to_uclibc_conf(d)}"
86OE_DEL := "${@features_to_uclibc_del(d)}"
87python () {
88 if "${OE_DEL}":
89 d.setVar('configmangle_append', "${OE_DEL}" + "\n")
90
91 # by default uclibc uses mips1 ISA for o32 ABI
92 # if we use TARGET_CC_ARCH="-march=mips32" we end up
93 # with conflicting march options to gcc. Here we
94 # ask for MIPS32 ISA to match the chosen arch
95
96 if "mips32" in d.getVar("TUNE_FEATURES",True):
97 d.setVar('configmangle_append',
98 "/^### MIPS32_CHECK$/a\\\nCONFIG_MIPS_ISA_MIPS32=y\n\n")
99 if "${OE_FEATURES}":
100 d.setVar('configmangle_append',
101 "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
102 ("\\n".join((d.expand("${OE_FEATURES}").split("\n")))))
103 d.setVar('configmangle_append',
104 "/^### CROSS$/a\\\n%s\n" %
105 ("\\n".join(["CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"",
106 "UCLIBC_EXTRA_CFLAGS=\"${UCLIBC_EXTRA_CFLAGS}\"",
107 "KERNEL_HEADERS=\"${STAGING_INCDIR}\"",
108 "RUNTIME_PREFIX=\"/\"",
109 "DEVEL_PREFIX=\"/${prefix}\"",
110 "SHARED_LIB_LOADER_PREFIX=\"/lib\"",
111 ])
112 ))
113 d.setVar('configmangle_append',
114 "/^### TGT$/a\\\nTARGET_ARCH=\"%s\"\\nTARGET_%s=y\n" %
115 ("${UCLIBC_ARCH}", "${UCLIBC_ARCH}"))
116 d.setVar('configmangle_append',
117 "/^### FPU$/a\\\n%s\n\n" % (["UCLIBC_HAS_FPU=y","# UCLIBC_HAS_FPU is not set"][d.getVar('TARGET_FPU', True) in [ 'soft' ]]))
118 if "${UCLIBC_ENDIAN}":
119 d.setVar('configmangle_append',
120 "/^### ABI$/a\\\nARCH_WANTS_%s_ENDIAN=y\n\n" % ("${UCLIBC_ENDIAN}"))
121 if "${UCLIBC_ABI}":
122 d.setVar('configmangle_append',
123 "/^### ABI$/a\\\nCONFIG_%s=y\n\n" % ("${UCLIBC_ABI}"))
124}
125
126python do_patch_append() {
127 import subprocess
128 subprocess.call("ln -sf ${STAGING_INCDIR}/linux ${S}/include/linux", shell=True)
129 subprocess.call("ln -sf ${STAGING_INCDIR}/asm ${S}/include/asm", shell=True)
130}
131
132do_configure() {
133 rm -f ${S}/.config
134
135 # OpenEmbedded splits the uClibc.config in two parts:
136 # uClibc.machine, uClibc.distro
137 echo "### uClibc.machine ###" >${S}/merged.config
138 cat ${WORKDIR}/uClibc.machine >>${S}/merged.config
139 echo "### uClibc.distro ###" >>${S}/merged.config
140 cat ${WORKDIR}/uClibc.distro >>${S}/merged.config
141 echo "### CROSS" >>${S}/merged.config
142 echo "### TGT" >>${S}/merged.config
143 echo "### MMU" >>${S}/merged.config
144 echo "### FPU" >>${S}/merged.config
145 echo "### ABI" >>${S}/merged.config
146 echo "### DISTRO FEATURES" >>${S}/merged.config
147 echo "### MIPS32_CHECK" >>${S}/merged.config
148
149 # Mangle the resulting .config depending on OE variables
150 sed -i -e '${configmangle}' ${S}/merged.config
151 cp ${S}/merged.config .config
152 merge_config.sh -r -n -m .config ${@" ".join(find_cfgs(d))}
153 cml1_do_configure
154
155}
156
157do_install() {
158 oe_runmake PREFIX=${D} install
159 rm -rf ${D}${includedir}/iconv.h
160}
161
162# build ldd, ldconfig and friends but only for full uclibc
163do_install_append_pn-uclibc () {
164 oe_runmake PREFIX=${D} "SSP_ALL_CFLAGS=${TARGET_LINK_HASH_STYLE}" -C utils utils_install
165}
166
diff --git a/meta/recipes-core/uclibc/uclibc_git.bb b/meta/recipes-core/uclibc/uclibc_git.bb
new file mode 100644
index 0000000000..b4f5d9c9dc
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc_git.bb
@@ -0,0 +1,22 @@
1require uclibc.inc
2require uclibc-package.inc
3require uclibc-git.inc
4
5STAGINGCC = "gcc-cross-initial"
6STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
7
8PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
9
10DEPENDS = "virtual/${TARGET_PREFIX}binutils \
11 virtual/${TARGET_PREFIX}gcc-initial \
12 virtual/${TARGET_PREFIX}libc-initial \
13 linux-libc-headers ncurses-native \
14 kern-tools-native"
15
16RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
17RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
18# uclibc does not really have libsegfault but then using the one from glibc is also not
19# going to work. So we pretend that we have it to make bitbake not pull other recipes
20# to satisfy this dependency for the images/tasks
21
22RPROVIDES_${PN} += "libsegfault rtld(GNU_HASH)"
diff --git a/meta/recipes-core/udev/udev-extraconf/automount.rules b/meta/recipes-core/udev/udev-extraconf/automount.rules
new file mode 100644
index 0000000000..7e844c31bd
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/automount.rules
@@ -0,0 +1,19 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Media automounting
17SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
18SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
19
diff --git a/meta/recipes-core/udev/udev-extraconf/autonet.rules b/meta/recipes-core/udev/udev-extraconf/autonet.rules
new file mode 100644
index 0000000000..19676aa13b
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/autonet.rules
@@ -0,0 +1,19 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Handle network interface setup
17SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
18SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
19
diff --git a/meta/recipes-core/udev/udev-extraconf/localextra.rules b/meta/recipes-core/udev/udev-extraconf/localextra.rules
new file mode 100644
index 0000000000..3d51d3e395
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/localextra.rules
@@ -0,0 +1,23 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# The first rtc device is symlinked to /dev/rtc
17KERNEL=="rtc0", SYMLINK+="rtc"
18
19#The first framebuffer is symlinked to /dev/fb
20KERNEL=="fb0", SYMLINK+="fb"
21
22# Make all input devices read-write to the input group
23SUBSYSTEM=="input", GROUP="input", MODE="660"
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.blacklist b/meta/recipes-core/udev/udev-extraconf/mount.blacklist
new file mode 100644
index 0000000000..e49349428b
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/mount.blacklist
@@ -0,0 +1,5 @@
1/dev/loop
2/dev/ram
3/dev/mtdblock
4/dev/md
5/dev/dm-*
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
new file mode 100644
index 0000000000..cb57e47a90
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -0,0 +1,91 @@
1#!/bin/sh
2#
3# Called from udev
4#
5# Attempt to mount any added block devices and umount any removed devices
6
7
8MOUNT="/bin/mount"
9PMOUNT="/usr/bin/pmount"
10UMOUNT="/bin/umount"
11for line in `grep -v ^# /etc/udev/mount.blacklist`
12do
13 if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ];
14 then
15 logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
16 exit 0
17 fi
18done
19
20automount() {
21 name="`basename "$DEVNAME"`"
22
23 ! test -d "/media/$name" && mkdir -p "/media/$name"
24 # Silent util-linux's version of mounting auto
25 if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ;
26 then
27 MOUNT="$MOUNT -o silent"
28 fi
29
30 # If filesystem type is vfat, change the ownership group to 'disk', and
31 # grant it with w/r/x permissions.
32 case $ID_FS_TYPE in
33 vfat|fat)
34 MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`"
35 ;;
36 # TODO
37 *)
38 ;;
39 esac
40
41 if ! $MOUNT -t auto $DEVNAME "/media/$name"
42 then
43 #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"
44 rm_dir "/media/$name"
45 else
46 logger "mount.sh/automount" "Auto-mount of [/media/$name] successful"
47 touch "/tmp/.automount-$name"
48 fi
49}
50
51rm_dir() {
52 # We do not want to rm -r populated directories
53 if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1"
54 then
55 ! test -z "$1" && rm -r "$1"
56 else
57 logger "mount.sh/automount" "Not removing non-empty directory [$1]"
58 fi
59}
60
61# No ID_FS_TYPE for cdrom device, yet it should be mounted
62name="`basename "$DEVNAME"`"
63[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
64
65if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
66 if [ -x "$PMOUNT" ]; then
67 $PMOUNT $DEVNAME 2> /dev/null
68 elif [ -x $MOUNT ]; then
69 $MOUNT $DEVNAME 2> /dev/null
70 fi
71
72 # If the device isn't mounted at this point, it isn't
73 # configured in fstab (note the root filesystem can show up as
74 # /dev/root in /proc/mounts, so check the device number too)
75 if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then
76 grep -q "^$DEVNAME " /proc/mounts || automount
77 fi
78fi
79
80
81
82if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
83 for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
84 do
85 $UMOUNT $mnt
86 done
87
88 # Remove empty directories from auto-mounter
89 name="`basename "$DEVNAME"`"
90 test -e "/tmp/.automount-$name" && rm_dir "/media/$name"
91fi
diff --git a/meta/recipes-core/udev/udev-extraconf/network.sh b/meta/recipes-core/udev/udev-extraconf/network.sh
new file mode 100644
index 0000000000..3ee92714af
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/network.sh
@@ -0,0 +1,54 @@
1#!/bin/sh
2
3# We get two "add" events for hostap cards due to wifi0
4echo "$INTERFACE" | grep -q wifi && exit 0
5
6# udevd does clearenv(). Export shell PATH to children.
7export PATH
8
9# Check if /etc/init.d/network has been run yet to see if we are
10# called by starting /etc/rcS.d/S03udev and not by hotplugging a device
11#
12# At this stage, network interfaces should not be brought up
13# automatically because:
14# a) /etc/init.d/network has not been run yet (security issue)
15# b) /var has not been populated yet so /etc/resolv,conf points to
16# oblivion, making the network unusable
17#
18
19spoofp="`grep ^spoofprotect /etc/network/options`"
20if test -z "$spoofp"
21then
22 # This is the default from /etc/init.d/network
23 spoofp_val=yes
24else
25 spoofp_val=${spoofp#spoofprotect=}
26fi
27
28test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0
29
30# I think it is safe to assume that "lo" will always be there ;)
31if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val"
32then
33 echo "$INTERFACE" >> /dev/udev_network_queue
34 exit 0
35fi
36
37#
38# Code taken from pcmcia-cs:/etc/pcmcia/network
39#
40
41# if this interface has an entry in /etc/network/interfaces, let ifupdown
42# handle it
43if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then
44 case $ACTION in
45 add)
46 ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE
47 ;;
48 remove)
49 ifdown $INTERFACE
50 ;;
51 esac
52
53 exit 0
54fi
diff --git a/meta/recipes-core/udev/udev-extraconf_1.0.bb b/meta/recipes-core/udev/udev-extraconf_1.0.bb
new file mode 100644
index 0000000000..3810b28155
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf_1.0.bb
@@ -0,0 +1,41 @@
1SUMMARY = "Extra machine specific configuration files"
2DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information."
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
5 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
6
7PR = "r16"
8
9SRC_URI = " \
10 file://automount.rules \
11 file://mount.sh \
12 file://mount.blacklist \
13 file://autonet.rules \
14 file://network.sh \
15 file://localextra.rules \
16"
17
18
19do_install() {
20 install -d ${D}${sysconfdir}/udev/rules.d
21
22 install -m 0644 ${WORKDIR}/automount.rules ${D}${sysconfdir}/udev/rules.d/automount.rules
23 install -m 0644 ${WORKDIR}/autonet.rules ${D}${sysconfdir}/udev/rules.d/autonet.rules
24 install -m 0644 ${WORKDIR}/localextra.rules ${D}${sysconfdir}/udev/rules.d/localextra.rules
25
26 install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/
27
28 install -d ${D}${sysconfdir}/udev/scripts/
29
30 install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
31 install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
32}
33
34FILES_${PN} = "${sysconfdir}/udev"
35RDEPENDS_${PN} = "udev"
36CONFFILES_${PN} = "${sysconfdir}/udev/mount.blacklist"
37
38# to replace udev-extra-rules from meta-oe
39RPROVIDES_${PN} = "udev-extra-rules"
40RREPLACES_${PN} = "udev-extra-rules"
41RCONFLICTS_${PN} = "udev-extra-rules"
diff --git a/meta/recipes-core/udev/udev.inc b/meta/recipes-core/udev/udev.inc
new file mode 100644
index 0000000000..1b22525436
--- /dev/null
+++ b/meta/recipes-core/udev/udev.inc
@@ -0,0 +1,107 @@
1SUMMARY = "/dev/ and hotplug management daemon"
2DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \
3/dev/, handles hotplug events and loads drivers at boot time."
4HOMEPAGE = "http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html"
5LICENSE = "GPLv2.0+ & LGPLv2.1+"
6LICENSE_${PN} = "GPLv2.0+"
7LICENSE_libudev = "LGPLv2.1+"
8LICENSE_libgudev = "LGPLv2.1+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
10 file://src/COPYING;md5=17c4e5fb495e6707ac92a3864926f979 \
11 file://src/gudev/COPYING;md5=fb494485a7d0505308cb68e4997cc266"
12
13LDFLAGS += "-lrt"
14
15DEPENDS = "acl glib-2.0 libusb usbutils pciutils gperf-native libxslt-native util-linux"
16RPROVIDES_${PN} = "hotplug"
17
18SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
19 file://0001-Fixing-keyboard_force_release.sh-shell-script-path.patch \
20 file://avoid-mouse-autosuspend.patch \
21 file://run.rules \
22 file://udev.rules \
23 file://devfs-udev.rules \
24 file://links.conf \
25 file://permissions.rules \
26 file://local.rules \
27 file://udev-cache \
28 file://udev-cache.default \
29 file://add-install-ptest.patch \
30 file://run-ptest \
31 file://init"
32
33inherit autotools pkgconfig update-rc.d ptest
34RDEPENDS_${PN}-ptest += "make"
35
36libexecdir = "${base_libdir}"
37EXTRA_OECONF = "--disable-introspection \
38 --with-rootlibdir=${base_libdir} \
39 --with-pci-ids-path=${datadir}/pci.ids \
40 ac_cv_file__usr_share_pci_ids=no \
41 ac_cv_file__usr_share_hwdata_pci_ids=no \
42 ac_cv_file__usr_share_misc_pci_ids=yes \
43 --sbindir=${base_sbindir} \
44 --libexecdir=${nonarch_base_libdir} \
45 --with-rootlibdir=${base_libdir} \
46 --with-rootprefix= \
47 --without-systemdsystemunitdir \
48 "
49
50PACKAGES =+ "udev-utils udev-cache"
51PACKAGES =+ "libudev"
52PACKAGES =+ "libgudev"
53
54INITSCRIPT_PACKAGES = "udev udev-cache"
55INITSCRIPT_NAME_udev = "udev"
56INITSCRIPT_PARAMS_udev = "start 04 S ."
57INITSCRIPT_NAME_udev-cache = "udev-cache"
58INITSCRIPT_PARAMS_udev-cache = "start 36 S ."
59
60FILES_${PN} += "${libexecdir} ${libdir}/ConsoleKit ${nonarch_base_libdir}/udev"
61RRECOMMENDS_${PN} += "udev-utils udev-cache"
62
63FILES_${PN}-dbg += "${libexecdir}/.debug"
64FILES_${PN}-dbg += "${base_libdir}/udev/.debug/"
65FILES_${PN}-dbg += "${base_libdir}/udev/.debug/*"
66FILES_${PN}-dbg += "${nonarch_base_libdir}/udev/.debug/*"
67FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
68 ${includedir}/libudev.h ${libdir}/libudev.so ${libdir}/libudev.la \
69 ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc \
70 ${includedir}/gudev* ${libdir}/libgudev*.so ${libdir}/libgudev*.la \
71 ${libdir}/libgudev*.a ${libdir}/pkgconfig/gudev*.pc"
72FILES_libudev = "${base_libdir}/libudev.so.*"
73FILES_libgudev = "${base_libdir}/libgudev*.so.* ${libdir}/libgudev*.so.*"
74FILES_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-cache"
75
76FILES_udev-utils = "${bindir}/udevadm"
77
78do_install_append () {
79 install -d ${D}${sysconfdir}/init.d
80 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
81 install -m 0755 ${WORKDIR}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
82 sed -i s%@UDEVD@%${nonarch_base_libdir}/udev/udevd% ${D}${sysconfdir}/init.d/udev
83 sed -i s%@UDEVD@%${nonarch_base_libdir}/udev/udevd% ${D}${sysconfdir}/init.d/udev-cache
84
85 install -d ${D}${sysconfdir}/default
86 install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache
87
88 touch ${D}${sysconfdir}/udev/cache.data
89
90 install -d ${D}${sysconfdir}/udev/rules.d/
91
92 install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
93
94 # hid2hci has moved to bluez4. removed in udev as of version 169
95 rm -f ${D}${base_libdir}/udev/hid2hci
96
97 echo 'udev_run="/var/run/udev"' >> ${D}${sysconfdir}/udev/udev.conf
98}
99
100# As systemd also builds udev, skip this package if we're doing a systemd build.
101python () {
102 if oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
103 raise bb.parse.SkipPackage("'systemd' in DISTRO_FEATURES")
104}
105do_compile_ptest() {
106 oe_runmake test-udev
107}
diff --git a/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch b/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch
new file mode 100644
index 0000000000..41deafa918
--- /dev/null
+++ b/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch
@@ -0,0 +1,35 @@
1From 0f8290c943da298abd269ca60fd8375dfb219971 Mon Sep 17 00:00:00 2001
2From: Alexandru DAMIAN <alexandru.damian@intel.com>
3Date: Thu, 12 Jul 2012 12:54:48 +0300
4Subject: [PATCH] Fixing keyboard_force_release.sh shell script path
5
6With the introduction of rootprefix, the keyboard-force-release.sh.in
7was modified to be executed with @rootprefix@/bin/sh, which is wrong
8because @rootprefix@ defaults to /usr (which is correct), but the
9shell is always at /bin/sh (IEEE Std 1003.2-1992).
10
11Therefore the interpreter for shell scripts needs to be /bin/sh at all times.
12
13The upstream moved to configurable root prefix, this patch taclkes a
14transition bug, and will not be applied upstream.
15
16Upstream-Status: Inappropriate [legacy version]
17
18Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
19---
20 src/keymap/keyboard-force-release.sh.in | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/src/keymap/keyboard-force-release.sh.in b/src/keymap/keyboard-force-release.sh.in
24index dd040ce..597a3a6 100755
25--- a/src/keymap/keyboard-force-release.sh.in
26+++ b/src/keymap/keyboard-force-release.sh.in
27@@ -1,4 +1,4 @@
28-#!@rootprefix@/bin/sh -e
29+#!/bin/sh -e
30 # read list of scancodes, convert hex to decimal and
31 # append to the atkbd force_release sysfs attribute
32 # $1 sysfs devpath for serioX
33--
341.7.9.5
35
diff --git a/meta/recipes-core/udev/udev/add-install-ptest.patch b/meta/recipes-core/udev/udev/add-install-ptest.patch
new file mode 100644
index 0000000000..44365c69e6
--- /dev/null
+++ b/meta/recipes-core/udev/udev/add-install-ptest.patch
@@ -0,0 +1,73 @@
1Adjustements for ptest:
2
3- Add 'install-ptest' rule.
4- Print a standard result line for each test.
5- Replace the use of "tree" with "find".
6
7Signed-off-by: Björn Stenberg <bjst@enea.com>
8Signed-off-by: Alexandra Safta <alst@enea.com>
9Upstream-status: Pending
10
11--- a/Makefile.am 2012-03-18 16:28:14.000000000 +0100
12+++ b/Makefile.am 2013-02-18 10:03:36.531101244 +0100
13@@ -708,3 +708,11 @@
14 for i in src/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/libudev/; done
15 for i in src/gudev/docs/html/*.{html,css,png}; do rm -f $$i.sign; gpg --armor --detach-sign --output=$$i.sign $$i; done
16 for i in src/gudev/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/gudev/; done
17+
18+install-ptest:
19+ install test-udev $(DESTDIR)
20+ cp Makefile $(DESTDIR)
21+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
22+ $(MKDIR_P) $(DESTDIR)/test
23+ (cd $(top_srcdir) && install $(TESTS) $(DESTDIR)/test)
24+ tar -C $(DESTDIR)/test/ -xJf $(top_srcdir)/test/sys.tar.xz
25--- a/test/udev-test.pl 2012-03-18 16:43:36.000000000 +0100
26+++ b/test/udev-test.pl 2013-02-18 10:31:29.706357321 +0100
27@@ -1459,11 +1459,13 @@
28 print "add: error";
29 if ($rules->{exp_add_error}) {
30 print " as expected\n";
31+ print "XFAIL: TEST $number: $rules->{desc}: add\n";
32 } else {
33 print "\n";
34- system("tree $udev_root");
35+ system("find $udev_root");
36 print "\n";
37 $error++;
38+ print "FAIL: TEST $number: $rules->{desc}: add\n";
39 sleep(1);
40 }
41 }
42@@ -1479,15 +1481,18 @@
43 print "remove: error";
44 if ($rules->{exp_rem_error}) {
45 print " as expected\n";
46+ print "XFAIL: TEST $number: $rules->{desc}: remove\n";
47 } else {
48 print "\n";
49- system("tree $udev_root");
50+ system("find $udev_root");
51 print "\n";
52 $error++;
53+ print "FAIL: TEST $number: $rules->{desc}: remove\n";
54 sleep(1);
55 }
56 } else {
57 print "remove: ok\n";
58+ print "PASS: TEST $number: $rules->{desc}: remove\n";
59 }
60
61 print "\n";
62--- a/configure.ac 2013-11-28 09:14:02.814248826 +0100
63+++ b/configure.ac 2013-11-28 09:14:34.260874296 +0100
64@@ -6,7 +6,7 @@
65 [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html])
66 AC_CONFIG_SRCDIR([src/udevd.c])
67 AC_CONFIG_AUX_DIR([build-aux])
68-AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
69+AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects serial-tests])
70 AC_USE_SYSTEM_EXTENSIONS
71 AC_SYS_LARGEFILE
72 AC_CONFIG_MACRO_DIR([m4])
73
diff --git a/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch b/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch
new file mode 100644
index 0000000000..2c31b33b02
--- /dev/null
+++ b/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch
@@ -0,0 +1,25 @@
1Source: http://cgit.freedesktop.org/systemd/systemd/commit/rules/42-usb-hid-pm.rules?id=e0386cf2809219bbdd30895f46f1f567b56902b6
2
3Some USB ports on external hubs may be reported as "fixed". We only want
4to auto-enable this on ports that are internal to the machine, so check
5the parent state as well.
6
7Upstream-Status: backport
8
9Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
102013/09/13
11
12Index: udev-182/rules/42-usb-hid-pm.rules
13===================================================================
14--- udev-182.orig/rules/42-usb-hid-pm.rules
15+++ udev-182/rules/42-usb-hid-pm.rules
16@@ -46,4 +46,9 @@ ACTION=="add", SUBSYSTEM=="usb", ATTRS{i
17 ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="14dd", ATTR{idProduct}="0002", TEST=="power/control", ATTR{power/control}="auto"
18
19 # USB HID devices that are internal to the machine should also be safe to autosuspend
20+# And skip it for devices which are external but say "fixed"
21+ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTRS{removable}=="removable", GOTO="usb_hid_pm_end"
22+ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTRS{removable}=="unknown", GOTO="usb_hid_pm_end"
23 ACTION=="add", SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="03", ATTRS{removable}=="fixed", TEST=="../power/control", ATTR{../power/control}="auto"
24+LABEL="usb_hid_pm_end"
25+
diff --git a/meta/recipes-core/udev/udev/devfs-udev.rules b/meta/recipes-core/udev/udev/devfs-udev.rules
new file mode 100644
index 0000000000..0ba1ad4e7f
--- /dev/null
+++ b/meta/recipes-core/udev/udev/devfs-udev.rules
@@ -0,0 +1,108 @@
1# The use of these rules is not recommended or supported.
2# In a world where devices can come and go at any time, the devfs scheme
3# of simple device enumeration does not help _anything_. Just forget about
4# it. Use custom rules to name your device or look at the persistent device
5# naming scheme, which is implemented for disks and add your subsystem.
6
7# ide block devices
8BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}"
9
10# md block devices
11KERNEL="md[0-9]*", NAME="md/%n"
12
13# floppy devices
14KERNEL="fd[0-9]*", NAME="floppy/%n"
15
16# tty devices
17KERNEL="tty[0-9]*", NAME="vc/%n", SYMLINK="%k"
18KERNEL="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k"
19KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n"
20
21# vc devices
22KERNEL="vcs", NAME="vcc/0"
23KERNEL="vcs[0-9]*", NAME="vcc/%n"
24KERNEL="vcsa", NAME="vcc/a0"
25KERNEL="vcsa[0-9]*", NAME="vcc/a%n"
26
27# v4l devices
28KERNEL="video[0-9]*", NAME="v4l/video%n"
29KERNEL="radio[0-9]*", NAME="v4l/radio%n"
30KERNEL="vbi[0-9]*", NAME="v4l/vbi%n"
31KERNEL="vtx[0-9]*", NAME="v4l/vtx%n"
32
33# dm devices (ignore them)
34KERNEL="dm-[0-9]*", NAME=""
35
36# i2c devices
37KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"
38
39# loop devices
40KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
41
42# ramdisks
43KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k"
44
45# framebuffer devices
46KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"
47
48# misc
49KERNEL="rtc", NAME="misc/%k", SYMLINK="%k"
50KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
51KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k"
52KERNEL="rtc", NAME="misc/%k", SYMLINK="%k"
53KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
54KERNEL="uinput", NAME="misc/%k", SYMLINK="%k"
55
56# alsa devices
57KERNEL="controlC[0-9]*", NAME="snd/%k"
58KERNEL="hw[CD0-9]*", NAME="snd/%k"
59KERNEL="pcm[CD0-9cp]*", NAME="snd/%k"
60KERNEL="midi[CD0-9]*", NAME="snd/%k"
61KERNEL="timer", NAME="snd/%k"
62KERNEL="seq", NAME="snd/%k"
63
64# oss devices
65KERNEL="audio*", NAME="sound/%k", SYMLINK="%k"
66KERNEL="dmmidi", NAME="sound/%k", SYMLINK="%k"
67KERNEL="dsp*", NAME="sound/%k", SYMLINK="%k"
68KERNEL="midi*", NAME="sound/%k", SYMLINK="%k"
69KERNEL="mixer*", NAME="sound/%k", SYMLINK="%k"
70KERNEL="sequencer*", NAME="sound/%k", SYMLINK="%k"
71
72# input devices
73KERNEL="mice", NAME="input/%k"
74KERNEL="mouse*", NAME="input/%k"
75KERNEL="event*", NAME="input/%k"
76KERNEL="js*", NAME="input/%k"
77KERNEL="ts*", NAME="input/%k"
78
79# USB devices
80KERNEL="hiddev*", NAME="usb/%k"
81KERNEL="auer*", NAME="usb/%k"
82KERNEL="legousbtower*", NAME="usb/%k"
83KERNEL="dabusb*", NAME="usb/%k"
84BUS="usb", KERNEL="lp[0-9]*", NAME="usb/%k"
85
86# netlink devices
87KERNEL="route", NAME="netlink/%k"
88KERNEL="skip", NAME="netlink/%k"
89KERNEL="usersock", NAME="netlink/%k"
90KERNEL="fwmonitor", NAME="netlink/%k"
91KERNEL="tcpdiag", NAME="netlink/%k"
92KERNEL="nflog", NAME="netlink/%k"
93KERNEL="xfrm", NAME="netlink/%k"
94KERNEL="arpd", NAME="netlink/%k"
95KERNEL="route6", NAME="netlink/%k"
96KERNEL="ip6_fw", NAME="netlink/%k"
97KERNEL="dnrtmsg", NAME="netlink/%k"
98KERNEL="tap*", NAME="netlink/%k"
99
100# CAPI devices
101KERNEL="capi", NAME="capi20", SYMLINK="isdn/capi20"
102KERNEL="capi*", NAME="capi/%n"
103
104# Network devices
105KERNEL="tun", NAME="net/%k"
106
107# raw devices
108KERNEL="raw[0-9]*", NAME="raw/%k"
diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
new file mode 100644
index 0000000000..410a650bd1
--- /dev/null
+++ b/meta/recipes-core/udev/udev/init
@@ -0,0 +1,133 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: udev
5# Required-Start: mountvirtfs
6# Required-Stop:
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Start udevd, populate /dev and load drivers.
10### END INIT INFO
11
12export TZ=/etc/localtime
13
14[ -d /sys/class ] || exit 1
15[ -r /proc/mounts ] || exit 1
16[ -x @UDEVD@ ] || exit 1
17[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
18[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
19[ -f /etc/default/rcS ] && . /etc/default/rcS
20
21readfiles () {
22 READDATA=""
23 for filename in $@; do
24 if [ -r $filename ]; then
25 while read line; do
26 READDATA="$READDATA$line"
27 done < $filename
28 fi
29 done
30}
31
32kill_udevd () {
33 pid=`pidof -x udevd`
34 [ -n "$pid" ] && kill $pid
35}
36
37case "$1" in
38 start)
39 export ACTION=add
40 # propagate /dev from /sys
41 echo "Starting udev"
42
43 # Check for requireed devtmpfs before trying to start udev and
44 # mount a no-existant fs.
45 if ! grep -q devtmpfs /proc/filesystems
46 then
47 echo "Missing devtmpfs, which is required for udev to run";
48 echo "Halting..."
49 halt
50 fi
51 # mount the devtmpfs on /dev, if not already done
52 LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
53 mount -n -o mode=0755 -t devtmpfs none "/dev"
54 }
55 [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
56 [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
57 # the automount rule for udev needs /tmp directory available, as /tmp is a symlink
58 # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure
59 # /var/volatile/tmp directory to be available.
60 mkdir -p /var/volatile/tmp
61
62 # Cache handling.
63 # A list of files which are used as a criteria to judge whether the udev cache could be reused.
64 CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags"
65 if [ "$DEVCACHE" != "" ]; then
66 if [ -e $DEVCACHE ]; then
67 readfiles $CMP_FILE_LIST
68 NEWDATA="$READDATA"
69 readfiles /etc/udev/cache.data
70 OLDDATA="$READDATA"
71 if [ "$OLDDATA" = "$NEWDATA" ]; then
72 (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
73 not_first_boot=1
74 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
75 [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
76 else
77 # Output detailed reason why the cached /dev is not used
78 if [ "$VERBOSE" != "no" ]; then
79 echo "udev: udev cache not used"
80 echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued"
81 echo "udev: olddata: $OLDDATA"
82 echo "udev: newdata: $NEWDATA"
83 fi
84 echo "$NEWDATA" > /dev/shm/udev.cache
85 fi
86 else
87 if [ "$ROOTFS_READ_ONLY" != "yes" ]; then
88 # If rootfs is not read-only, it's possible that a new udev cache would be generated;
89 # otherwise, we do not bother to read files.
90 readfiles $CMP_FILE_LIST
91 echo "$READDATA" > /dev/shm/udev.cache
92 fi
93 fi
94 fi
95
96 # make_extra_nodes
97 kill_udevd > "/dev/null" 2>&1
98
99 # trigger the sorted events
100 echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
101 @UDEVD@ -d
102
103 udevadm control --env=STARTUP=1
104 if [ "$not_first_boot" != "" ];then
105 udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform
106 (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
107 else
108 udevadm trigger --action=add
109 udevadm settle
110 fi
111 ;;
112 stop)
113 echo "Stopping udevd"
114 start-stop-daemon --stop --name udevd --quiet
115 ;;
116 restart)
117 $0 stop
118 sleep 1
119 $0 start
120 ;;
121 status)
122 pid=`pidof -x udevd`
123 if [ -n "$pid" ]; then
124 echo "udevd (pid $pid) is running ..."
125 else
126 echo "udevd is stopped"
127 fi
128 ;;
129 *)
130 echo "Usage: $0 {start|stop|status|restart}"
131 exit 1
132esac
133exit 0
diff --git a/meta/recipes-core/udev/udev/links.conf b/meta/recipes-core/udev/udev/links.conf
new file mode 100644
index 0000000000..8fff922db6
--- /dev/null
+++ b/meta/recipes-core/udev/udev/links.conf
@@ -0,0 +1,21 @@
1# This file does not exist. Please do not ask the debian maintainer about it.
2# You may use it to do strange and wonderful things, at your risk.
3
4L fd /proc/self/fd
5L stdin /proc/self/fd/0
6L stdout /proc/self/fd/1
7L stderr /proc/self/fd/2
8L core /proc/kcore
9L sndstat /proc/asound/oss/sndstat
10L MAKEDEV /sbin/MAKEDEV
11
12D pts
13D shm
14
15# Hic sunt leones.
16M ppp c 108 0
17D loop
18M loop/0 b 7 0
19D net
20M net/tun c 10 200
21
diff --git a/meta/recipes-core/udev/udev/local.rules b/meta/recipes-core/udev/udev/local.rules
new file mode 100644
index 0000000000..9d4da493f7
--- /dev/null
+++ b/meta/recipes-core/udev/udev/local.rules
@@ -0,0 +1,22 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Try and modprobe for drivers for new hardware
17ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
18
19# Create a symlink to any touchscreen input device
20# Trigger based on input type, that the evbit (-e) has EV_SYN and EV_ABS,
21# has an EV_ABS value (-a) which is used for touchscreen type devices.
22SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0"
diff --git a/meta/recipes-core/udev/udev/permissions.rules b/meta/recipes-core/udev/udev/permissions.rules
new file mode 100644
index 0000000000..205b733292
--- /dev/null
+++ b/meta/recipes-core/udev/udev/permissions.rules
@@ -0,0 +1,131 @@
1ACTION!="add", GOTO="permissions_end"
2
3# workarounds needed to synchronize with sysfs
4# only needed for kernels < v2.6.18-rc1
5ENV{PHYSDEVPATH}!="?*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
6SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt"
7# only needed for kernels < 2.6.16
8SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
9# only needed for kernels < 2.6.17
10SUBSYSTEM=="net", ENV{DRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
11
12# devices needed to load the drivers providing them
13KERNEL=="tun", OPTIONS+="ignore_remove"
14KERNEL=="ppp", OPTIONS+="ignore_remove"
15KERNEL=="loop[0-9]*", OPTIONS+="ignore_remove"
16
17# default permissions for block devices
18SUBSYSTEM=="block", GROUP="disk"
19# the aacraid driver is broken and reports that disks removable (see #404927)
20SUBSYSTEM=="block", ATTRS{removable}=="1", \
21 DRIVERS!="aacraid", GROUP="floppy"
22# all block devices on these buses are "removable"
23SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy"
24
25# IDE devices
26KERNEL=="hd[a-z]|pcd[0-9]*", DRIVERS=="ide-cdrom|pcd", \
27 IMPORT{program}="cdrom_id --export $tempnode"
28ENV{ID_CDROM}=="?*", GROUP="cdrom"
29KERNEL=="ht[0-9]*", GROUP="tape"
30KERNEL=="nht[0-9]*", GROUP="tape"
31
32# SCSI devices
33KERNEL=="sr[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
34SUBSYSTEMS=="scsi", ATTRS{type}=="1", GROUP="tape"
35SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="HP", GROUP="scanner"
36SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="Epson", GROUP="scanner"
37SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="EPSON", GROUP="scanner"
38SUBSYSTEMS=="scsi", ATTRS{type}=="4", GROUP="cdrom"
39SUBSYSTEMS=="scsi", ATTRS{type}=="5", GROUP="cdrom"
40SUBSYSTEMS=="scsi", ATTRS{type}=="6", GROUP="scanner"
41SUBSYSTEMS=="scsi", ATTRS{type}=="8", GROUP="tape"
42
43# USB devices
44KERNEL=="legousbtower*", MODE="0666"
45KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp"
46
47# usbfs-like devices
48SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
49 MODE="0664"
50
51# iRiver music players
52SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \
53 ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]"
54
55# serial devices
56SUBSYSTEM=="tty", GROUP="dialout"
57SUBSYSTEM=="capi", GROUP="dialout"
58SUBSYSTEM=="slamr", GROUP="dialout"
59SUBSYSTEM=="zaptel", GROUP="dialout"
60
61# vc devices (all members of the tty subsystem)
62KERNEL=="ptmx", MODE="0666", GROUP="root"
63KERNEL=="console", MODE="0600", GROUP="root"
64KERNEL=="tty", MODE="0666", GROUP="root"
65KERNEL=="tty[0-9]*", GROUP="root"
66KERNEL=="pty*", MODE="0666", GROUP="tty"
67
68# video devices
69SUBSYSTEM=="video4linux", GROUP="video"
70SUBSYSTEM=="drm", GROUP="video"
71SUBSYSTEM=="dvb", GROUP="video"
72SUBSYSTEM=="em8300", GROUP="video"
73SUBSYSTEM=="graphics", GROUP="video"
74SUBSYSTEM=="nvidia", GROUP="video"
75
76# misc devices
77KERNEL=="random", MODE="0666"
78KERNEL=="urandom", MODE="0666"
79KERNEL=="mem", MODE="0640", GROUP="kmem"
80KERNEL=="kmem", MODE="0640", GROUP="kmem"
81KERNEL=="port", MODE="0640", GROUP="kmem"
82KERNEL=="full", MODE="0666"
83KERNEL=="null", MODE="0666"
84KERNEL=="zero", MODE="0666"
85KERNEL=="inotify", MODE="0666"
86KERNEL=="sgi_fetchop", MODE="0666"
87KERNEL=="sonypi", MODE="0666"
88KERNEL=="agpgart", GROUP="video"
89KERNEL=="nvram", GROUP="nvram"
90KERNEL=="rtc|rtc[0-9]*", GROUP="audio"
91KERNEL=="tpm*", MODE="0600", OWNER="tss", GROUP="tss"
92KERNEL=="fuse", GROUP="fuse"
93KERNEL=="kqemu", MODE="0666"
94KERNEL=="kvm", GROUP="kvm"
95KERNEL=="tun", MODE="0666",
96
97KERNEL=="cdemu[0-9]*", GROUP="cdrom"
98KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
99KERNEL=="pktcdvd", MODE="0644"
100
101KERNEL=="uverbs*", GROUP="rdma"
102KERNEL=="ucm*", GROUP="rdma"
103KERNEL=="rdma_ucm", GROUP="rdma"
104
105# printers and parallel devices
106SUBSYSTEM=="printer", GROUP="lp"
107SUBSYSTEM=="ppdev", GROUP="lp"
108KERNEL=="irlpt*", GROUP="lp"
109KERNEL=="pt[0-9]*", GROUP="tape"
110KERNEL=="pht[0-9]*", GROUP="tape"
111
112# sound devices
113SUBSYSTEM=="sound", GROUP="audio"
114
115# ieee1394 devices
116KERNEL=="raw1394", GROUP="disk"
117KERNEL=="dv1394*", GROUP="video"
118KERNEL=="video1394*", GROUP="video"
119
120# input devices
121KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \
122 MODE="0664", GROUP="video"
123KERNEL=="js[0-9]*", MODE="0664"
124KERNEL=="lirc[0-9]*", GROUP="video"
125
126# AOE character devices
127SUBSYSTEM=="aoe", MODE="0220", GROUP="disk"
128SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
129
130LABEL="permissions_end"
131
diff --git a/meta/recipes-core/udev/udev/run-ptest b/meta/recipes-core/udev/udev/run-ptest
new file mode 100644
index 0000000000..6817ef70e6
--- /dev/null
+++ b/meta/recipes-core/udev/udev/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3make -k check-TESTS \ No newline at end of file
diff --git a/meta/recipes-core/udev/udev/run.rules b/meta/recipes-core/udev/udev/run.rules
new file mode 100644
index 0000000000..75d71375bb
--- /dev/null
+++ b/meta/recipes-core/udev/udev/run.rules
@@ -0,0 +1,14 @@
1# debugging monitor
2RUN+="socket:/org/kernel/udev/monitor"
3
4# run a command on remove events
5ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}"
6
7# ignore the events generated by virtual consoles
8KERNEL=="ptmx", OPTIONS+="last_rule"
9KERNEL=="console", OPTIONS+="last_rule"
10KERNEL=="tty" , OPTIONS+="last_rule"
11KERNEL=="tty[0-9]*", OPTIONS+="last_rule"
12KERNEL=="pty*", OPTIONS+="last_rule"
13SUBSYSTEM=="vc", OPTIONS+="last_rule"
14
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
new file mode 100644
index 0000000000..db5a513e14
--- /dev/null
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -0,0 +1,32 @@
1#!/bin/sh -e
2
3### BEGIN INIT INFO
4# Provides: udev-cache
5# Required-Start: mountall
6# Required-Stop:
7# Default-Start: S
8# Default-Stop:
9# Short-Description: cache /dev to speedup the udev next boot
10### END INIT INFO
11
12export TZ=/etc/localtime
13
14[ -r /proc/mounts ] || exit 1
15[ -x @UDEVD@ ] || exit 1
16[ -d /sys/class ] || exit 1
17
18[ -f /etc/default/rcS ] && . /etc/default/rcS
19[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
20
21if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
22 [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache"
23 exit 0
24fi
25
26if [ "$DEVCACHE" != "" -a -e /dev/shm/udev.cache ]; then
27 echo "Populating dev cache"
28 (cd /; tar cf "$DEVCACHE" dev)
29 mv /dev/shm/udev.cache /etc/udev/cache.data
30fi
31
32exit 0
diff --git a/meta/recipes-core/udev/udev/udev-cache.default b/meta/recipes-core/udev/udev/udev-cache.default
new file mode 100644
index 0000000000..5c4937a9a0
--- /dev/null
+++ b/meta/recipes-core/udev/udev/udev-cache.default
@@ -0,0 +1,4 @@
1# Default for /etc/init.d/udev
2
3# Comment this out to disable device cache
4DEVCACHE="/etc/dev.tar"
diff --git a/meta/recipes-core/udev/udev/udev.rules b/meta/recipes-core/udev/udev/udev.rules
new file mode 100644
index 0000000000..a19d4a0bf6
--- /dev/null
+++ b/meta/recipes-core/udev/udev/udev.rules
@@ -0,0 +1,116 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# workaround for devices which do not report media changes
17SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \
18 ENV{ID_MODEL}=="IOMEGA_ZIP*", NAME="%k", OPTIONS+="all_partitions"
19SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{media}=="floppy", \
20 OPTIONS+="all_partitions"
21
22# SCSI devices
23SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n"
24
25# USB devices
26SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k"
27SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k"
28SUBSYSTEMS=="usb", KERNEL=="dabusb*", NAME="usb/%k"
29SUBSYSTEMS=="usb", KERNEL=="hiddev*", NAME="usb/%k"
30SUBSYSTEMS=="usb", KERNEL=="legousbtower*", NAME="usb/%k"
31SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
32SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \
33 ATTRS{product}=="Palm Handheld*|Handspring Visor|palmOne Handheld", \
34 SYMLINK+="pilot"
35
36# usbfs-like devices
37SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \
38 NAME="%c"
39SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"
40
41# serial devices
42KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
43KERNEL=="capi[0-9]*", NAME="capi/%n"
44
45# video devices
46KERNEL=="dvb*", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION=="add", \
47 NAME="%c"
48KERNEL=="card[0-9]*", NAME="dri/%k"
49
50# misc devices
51KERNEL=="hw_random", NAME="hwrng"
52KERNEL=="tun", NAME="net/%k"
53KERNEL=="evtchn", NAME="xen/%k"
54
55KERNEL=="cdemu[0-9]*", NAME="cdemu/%n"
56KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n"
57KERNEL=="pktcdvd", NAME="pktcdvd/control"
58
59KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
60KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
61KERNEL=="microcode", NAME="cpu/microcode"
62
63KERNEL=="umad*", NAME="infiniband/%k"
64KERNEL=="issm*", NAME="infiniband/%k"
65KERNEL=="uverbs*", NAME="infiniband/%k"
66KERNEL=="ucm*", NAME="infiniband/%k"
67KERNEL=="rdma_ucm", NAME="infiniband/%k"
68
69# ALSA devices
70KERNEL=="controlC[0-9]*", NAME="snd/%k"
71KERNEL=="hwC[D0-9]*", NAME="snd/%k"
72KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
73KERNEL=="midiC[D0-9]*", NAME="snd/%k"
74KERNEL=="timer", NAME="snd/%k"
75KERNEL=="seq", NAME="snd/%k"
76
77# ieee1394 devices
78KERNEL=="dv1394*", NAME="dv1394/%n"
79KERNEL=="video1394*", NAME="video1394/%n"
80
81# input devices
82KERNEL=="mice", NAME="input/%k"
83KERNEL=="mouse[0-9]*", NAME="input/%k"
84KERNEL=="event[0-9]*", NAME="input/%k"
85KERNEL=="js[0-9]*", NAME="input/%k"
86KERNEL=="ts[0-9]*", NAME="input/%k"
87KERNEL=="uinput", NAME="input/%k"
88
89# Zaptel
90KERNEL=="zapctl", NAME="zap/ctl"
91KERNEL=="zaptimer", NAME="zap/timer"
92KERNEL=="zapchannel", NAME="zap/channel"
93KERNEL=="zappseudo", NAME="zap/pseudo"
94KERNEL=="zap[0-9]*", NAME="zap/%n"
95
96# AOE character devices
97SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k"
98SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k"
99SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k"
100SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k"
101
102# device mapper creates its own device nodes, so ignore these
103KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device"
104KERNEL=="device-mapper", NAME="mapper/control"
105
106KERNEL=="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660"
107
108# Firmware Helper
109ACTION=="add", SUBSYSTEM=="firmware", RUN+="/lib/udev/firmware.sh"
110
111# Samsung UARTS
112KERNEL=="s3c2410_serial[0-9]", NAME="ttySAC%n"
113
114# MXC UARTs
115KERNEL=="ttymxc[0-4]", NAME="ttymxc%n"
116
diff --git a/meta/recipes-core/udev/udev_182.bb b/meta/recipes-core/udev/udev_182.bb
new file mode 100644
index 0000000000..d66292ed7a
--- /dev/null
+++ b/meta/recipes-core/udev/udev_182.bb
@@ -0,0 +1,9 @@
1include udev.inc
2
3PR = "r7"
4
5# module-init-tools from kmod_git will provide libkmod runtime
6DEPENDS += "module-init-tools"
7
8SRC_URI[md5sum] = "1b964456177fbf48023dfee7db3a708d"
9SRC_URI[sha256sum] = "7857ed19fafd8f3ca8de410194e8c7336e9eb8a20626ea8a4ba6449b017faba4"
diff --git a/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch b/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch
new file mode 100644
index 0000000000..fb443ff15e
--- /dev/null
+++ b/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch
@@ -0,0 +1,49 @@
1Upstream-Status: Pending
2
3--- update-rc.d/update-rc.d.org 2005-01-03 00:30:47.000000000 +0200
4+++ update-rc.d/update-rc.d 2007-12-01 19:41:08.000000000 +0200
5@@ -19,6 +19,7 @@
6 notreally=0
7 force=0
8 dostart=0
9+verbose=0
10
11 usage()
12 {
13@@ -28,6 +29,7 @@
14 update-rc.d [-n] [-r <root>] [-s] <basename> start|stop NN runlvl [runlvl] [...] .
15 -n: not really
16 -f: force
17+ -v: verbose
18 -r: alternate root path (default is /)
19 -s: invoke start methods if appropriate to current runlevel
20 EOF
21@@ -69,7 +71,7 @@
22 lev=`echo $2 | cut -d/ -f1`
23 nn=`echo $2 | cut -d/ -f2`
24 fn="${etcd}${lev}.d/${startstop}${nn}${bn}"
25- echo " $fn -> ../init.d/$bn"
26+ [ $verbose -eq 1 ] && echo " $fn -> ../init.d/$bn"
27 if [ $notreally -eq 0 ]; then
28 mkdir -p `dirname $fn`
29 ln -s ../init.d/$bn $fn
30@@ -89,7 +91,7 @@
31 exit 0
32 fi
33
34- echo " Adding system startup for $initd/$bn ..."
35+ echo " Adding system startup for $initd/$bn."
36
37 for i in $startlinks; do
38 dolink S $i
39@@ -105,6 +107,10 @@
40 shift
41 continue
42 ;;
43+ -v) verbose=1
44+ shift
45+ continue
46+ ;;
47 -f) force=1
48 shift
49 continue
diff --git a/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch b/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch
new file mode 100644
index 0000000000..075171a5a3
--- /dev/null
+++ b/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch
@@ -0,0 +1,59 @@
1Check if symlinks are valid
2
3When using root option and $initd/$bn is a symlink, the script would fail because
4the symlink points to a path on target. For example:
5
6/path/to/target/rootfs/etc/init.d/syslog -> /etc/init.d/syslog.busybox
7
8Hence, [ -f /path/to/target/rootfs/etc/init.d/syslog ] condition would return
9false.
10
11This patch adds the posibility to check whether the file the symlink points to
12actually exists in rootfs path and then continue.
13
14Upstream-Status: Pending
15
16Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
17Signed-off-by: Christopher Larson <chris_larson@mentor.com>
18
19Index: git/update-rc.d
20===================================================================
21--- git.orig/update-rc.d
22+++ git/update-rc.d
23@@ -147,13 +147,34 @@ fi
24 bn=$1
25 shift
26
27+sn=$initd/$bn
28+if [ -L "$sn" -a -n "$root" ]; then
29+ if which readlink >/dev/null; then
30+ while true; do
31+ linksn="$(readlink "$sn")"
32+ if [ -z "$linksn" ]; then
33+ break
34+ fi
35+
36+ sn="$linksn"
37+ case "$sn" in
38+ /*) sn="$root$sn" ;;
39+ *) sn="$initd/$sn" ;;
40+ esac
41+ done
42+ else
43+ echo "update-rc.d: readlink tool not present, cannot check whether \
44+ $sn symlink points to a valid file." >&2
45+ fi
46+fi
47+
48 if [ $1 != "remove" ]; then
49- if [ ! -f "$initd/$bn" ]; then
50+ if [ ! -f "$sn" ]; then
51 echo "update-rc.d: $initd/$bn: file does not exist" >&2
52 exit 1
53 fi
54 else
55- if [ -f "$initd/$bn" ]; then
56+ if [ -f "$sn" ]; then
57 if [ $force -eq 1 ]; then
58 echo "update-rc.d: $initd/$bn exists during rc.d purge (continuing)" >&2
59 else
diff --git a/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb b/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb
new file mode 100644
index 0000000000..50dcaa2d3f
--- /dev/null
+++ b/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb
@@ -0,0 +1,30 @@
1SUMMARY = "manage symlinks in /etc/rcN.d"
2DESCRIPTION = "update-rc.d is a utilities that allows the management of symlinks to the initscripts in the /etc/rcN.d directory structure."
3SECTION = "base"
4
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://update-rc.d;beginline=5;endline=15;md5=148a48321b10eb37c1fa3ee02b940a75"
7
8PR = "r5"
9
10# Revision corresponding to tag update-rc.d_0.7
11SRCREV = "eca680ddf28d024954895f59a241a622dd575c11"
12
13SRC_URI = "git://github.com/philb/update-rc.d.git \
14 file://add-verbose.patch \
15 file://check-if-symlinks-are-valid.patch \
16 "
17
18S = "${WORKDIR}/git"
19
20inherit allarch
21
22do_compile() {
23}
24
25do_install() {
26 install -d ${D}${sbindir}
27 install -m 0755 ${S}/update-rc.d ${D}${sbindir}/update-rc.d
28}
29
30BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
new file mode 100644
index 0000000000..b67620bdbd
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -0,0 +1,270 @@
1SUMMARY = "A suite of basic system administration utilities"
2DESCRIPTION = "Util-linux includes a suite of basic system administration utilities \
3commonly found on most Linux systems. Some of the more important utilities include \
4disk partitioning, kernel message management, filesystem creation, and system login."
5
6SECTION = "base"
7
8LICENSE = "GPLv2+ & LGPLv2.1+ & BSD"
9
10LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c \
11 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
12 file://Documentation/licenses/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
13 file://Documentation/licenses/COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \
14 file://Documentation/licenses/COPYING.BSD-3;md5=58dcd8452651fc8b07d1f65ce07ca8af \
15 file://Documentation/licenses/COPYING.UCB;md5=263860f8968d8bafa5392cab74285262 \
16 file://libuuid/COPYING;md5=b442ffb762cf8d3e9df1b99e0bb4af70 \
17 file://libmount/COPYING;md5=fb93f01d4361069c5616327705373b16 \
18 file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16"
19
20inherit autotools gettext pkgconfig systemd ptest
21DEPENDS = "zlib ncurses"
22DEPENDS_append_class-native = " lzo-native"
23DEPENDS_append_class-nativesdk = " lzo-native"
24
25SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz \
26 file://MCONFIG \
27 file://defines.h \
28 file://make_include \
29 file://swapargs.h \
30 file://ptest.patch \
31 file://run-ptest \
32 file://avoid_unsupported_find_opts.patch \
33 file://avoid_unsupported_grep_opts.patch \
34 file://avoid_unsupported_sleep_param.patch \
35 file://display_testname_for_subtest.patch \
36 "
37
38PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \
39 util-linux-swaponoff util-linux-losetup util-linux-umount \
40 util-linux-mount util-linux-readprofile util-linux-libblkid \
41 util-linux-libmount util-linux-libuuid util-linux-uuidd \
42 util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \
43 util-linux-mkfs util-linux-mcookie util-linux-reset \
44 util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \
45 util-linux-partx ${PN}-bash-completion"
46
47SHARED_EXTRA_OECONF = "--disable-use-tty-group \
48 --disable-makeinstall-chown \
49 --enable-kill --enable-last --enable-mesg --enable-partx \
50 --enable-raw --enable-reset --disable-login \
51 --disable-vipw --disable-newgrp --disable-chfn-chsh \
52 --enable-write --enable-mount \
53 --enable-libuuid --enable-libblkid --enable-fsck --without-udev \
54 usrsbin_execdir='${sbindir}' \
55"
56
57EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}"
58
59PACKAGECONFIG_class-target ?= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
60 ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} "
61PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
62
63# Respect the systemd feature for uuidd
64PACKAGECONFIG[systemd] = "--enable-socket-activation --with-systemdsystemunitdir=${systemd_unitdir}/system/, --disable-socket-activation --without-systemdsystemunitdir"
65
66# Build setpriv requires libcap-ng
67PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng,"
68
69FILES_${PN}-bash-completion += "${datadir}/bash-completion"
70FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
71
72FILES_util-linux-agetty = "${base_sbindir}/agetty"
73FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}"
74FILES_util-linux-fstrim = "${base_sbindir}/fstrim"
75FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk"
76FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
77FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${base_sbindir}/swapoff.${BPN}"
78FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}"
79FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
80FILES_util-linux-mcookie = "${bindir}/mcookie"
81FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
82FILES_util-linux-readprofile = "${base_sbindir}/readprofile.${BPN}"
83FILES_util-linux-uuidgen = "${bindir}/uuidgen"
84FILES_util-linux-uuidd = "${sbindir}/uuidd"
85FILES_util-linux-reset = "${base_bindir}/reset"
86FILES_util-linux-partx = "${sbindir}/partx"
87
88FILES_util-linux-libblkid = "${base_libdir}/libblkid.so.*"
89FILES_util-linux-libmount = "${base_libdir}/libmount.so.*"
90FILES_util-linux-libuuid = "${base_libdir}/libuuid.so.*"
91FILES_util-linux-lscpu = "${bindir}/lscpu"
92
93FILES_util-linux-fsck = "${base_sbindir}/fsck*"
94FILES_util-linux-mkfs = "${sbindir}/mkfs"
95
96FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
97FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
98
99
100# Util-linux' blkid replaces the e2fsprogs one
101FILES_util-linux-blkid = "${base_sbindir}/blkid*"
102RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
103RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
104
105# reset calls 'tput'
106RDEPENDS_util-linux-reset += "ncurses"
107
108RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup"
109RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs "
110
111RRECOMMENDS_${PN}_class-native = ""
112RRECOMMENDS_${PN}_class-nativesdk = ""
113RDEPENDS_${PN}_class-native = ""
114RDEPENDS_${PN}_class-nativesdk = ""
115
116RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev"
117
118SYSTEMD_PACKAGES = "${PN}-uuidd"
119SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.service"
120
121do_compile () {
122 set -e
123 install ${WORKDIR}/MCONFIG ${S}/MCONFIG
124 install ${WORKDIR}/make_include ${S}/make_include
125 install ${WORKDIR}/swapargs.h ${S}/mount-deprecated/swapargs.h
126 install ${WORKDIR}/defines.h ${S}/defines.h
127 oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'
128}
129
130do_install () {
131 # with ccache the timestamps on compiled files may
132 # end up earlier than on their inputs, this allows
133 # for the resultant compilation in the install step.
134 oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
135 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
136 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install
137
138 mkdir -p ${D}${base_bindir}
139
140 sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
141 sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk readprofile fsck blkid blockdev fstrim"
142 usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp renice utmpdump wall setsid chrt flock getopt"
143 binprogs_a="dmesg kill more umount mount login reset su"
144
145 if [ "${base_sbindir}" != "${sbindir}" ]; then
146 mkdir -p ${D}${base_sbindir}
147 for p in $sbinprogs $sbinprogs_a; do
148 if [ -f "${D}${sbindir}/$p" ]; then
149 mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p"
150 fi
151 done
152 fi
153
154 if [ "${base_bindir}" != "${bindir}" ]; then
155 mkdir -p ${D}${base_bindir}
156 for p in $binprogs_a; do
157 if [ -f "${D}${bindir}/$p" ]; then
158 mv "${D}${bindir}/$p" "${D}${base_bindir}/$p"
159 fi
160 done
161 fi
162
163 install -d ${D}${sysconfdir}/default/
164 echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
165
166 rm -f ${D}${bindir}/chkdupexe
167}
168
169inherit update-alternatives
170
171ALTERNATIVE_PRIORITY = "100"
172
173ALTERNATIVE_${PN} = "dmesg kill more mkswap blockdev pivot_root"
174ALTERNATIVE_${PN} += "mkfs.minix hexdump last logger mesg renice wall"
175ALTERNATIVE_${PN} += "setsid chrt flock hwclock utmpdump eject getopt"
176
177ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
178ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
179ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more"
180ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap"
181ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
182ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
183ALTERNATIVE_LINK_NAME[mkfs.minix] = "${base_sbindir}/mkfs.minix"
184ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
185ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt"
186ALTERNATIVE_TARGET[getopt] = "${bindir}/getopt"
187
188ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 utmpdump.1 reset.1"
189
190ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
191ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
192ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
193ALTERNATIVE_LINK_NAME[reset.1] = "${mandir}/man1/reset.1"
194ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
195ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
196ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
197
198# There seems to be problem, atleast on nslu2, with these, untill they are
199# fixed the busybox ones have higher priority
200ALTERNATIVE_PRIORITY[hwclock] = "10"
201ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock"
202
203ALTERNATIVE_util-linux-fdisk = "fdisk"
204ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk"
205
206ALTERNATIVE_util-linux-agetty = "getty"
207ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty"
208ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty"
209
210ALTERNATIVE_util-linux-mount = "mount"
211ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount"
212
213ALTERNATIVE_util-linux-umount = "umount"
214ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount"
215
216ALTERNATIVE_util-linux-readprofile = "readprofile"
217ALTERNATIVE_LINK_NAME[readprofile] = "${base_sbindir}/readprofile"
218
219ALTERNATIVE_util-linux-losetup = "losetup"
220ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup"
221
222ALTERNATIVE_util-linux-swaponoff = "swapoff swapon"
223ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff"
224ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon"
225
226ALTERNATIVE_util-linux-fsck = "fsck.minix fsck"
227ALTERNATIVE_LINK_NAME[fsck.minix] = "${base_sbindir}/fsck.minix"
228ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck"
229
230ALTERNATIVE_util-linux-blkid = "blkid"
231ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid"
232
233ALTERNATIVE_util-linux-reset = "reset"
234ALTERNATIVE_LINK_NAME[reset] = "${bindir}/reset"
235ALTERNATIVE_TARGET[reset] = "${base_bindir}/reset"
236
237BBCLASSEXTEND = "native nativesdk"
238
239python do_package_prepend () {
240 if '--enable-su' in d.getVar('EXTRA_OECONF', True).split():
241 alt_name = "su"
242 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, '%s/%s' % (d.getVar('base_bindir', True), alt_name))
243 d.appendVar('ALTERNATIVE_%s' % (d.getVar('PN', True)), ' ' + alt_name)
244}
245
246do_compile_ptest() {
247 oe_runmake buildtest-TESTS
248}
249
250do_install_ptest() {
251 mkdir -p ${D}${PTEST_PATH}/tests/ts
252 find . -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
253 cp ${S}/tests/functions.sh ${D}${PTEST_PATH}/tests/
254 cp ${S}/tests/commands.sh ${D}${PTEST_PATH}/tests/
255 cp ${S}/tests/run.sh ${D}${PTEST_PATH}/tests/
256 cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected
257
258 list="bitops build-sys cal col colrm column dmesg fsck hexdump hwclock ipcs isosize login look lscpu md5 misc more namei paths schedutils script swapon tailf utmpdump"
259 # The following tests are not installed yet:
260 # blkid scsi_debug module dependent
261 # cramfs gcc dependent
262 # eject gcc dependent
263 # fdisk scsi_debug module and gcc dependent
264 # libmount uuidgen dependent
265 # mount gcc dependant
266 # partx blkid dependant
267 for d in $list; do
268 cp -pR ${S}/tests/ts/$d ${D}${PTEST_PATH}/tests/ts/
269 done
270}
diff --git a/meta/recipes-core/util-linux/util-linux/MCONFIG b/meta/recipes-core/util-linux/util-linux/MCONFIG
new file mode 100644
index 0000000000..3fea2c02d7
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/MCONFIG
@@ -0,0 +1,223 @@
1# MCONFIG -- Configuration stuff for util-linux
2# Created: Sat Feb 4 15:50:30 1995
3# Copyright 1995 Rickard E. Faith (faith@cs.unc.edu)
4
5# For a user-mode install, make (at least) three changes:
6# - remove the `-o root' part in INSTALLSUID
7# - set USE_TTY_GROUP=no
8# - define DESTDIR
9
10# Select for ARCH one of intel, alpha, sparc, arm, m68k, mips
11# Select for CPU i386 if the binaries must be able to run on an intel 386
12# (by default i486 code is generated, see below)
13CPU=$(shell uname -m)
14ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/')
15
16# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp
17# will use PAM for authentication. Additionally, passwd will not be
18# installed as it is not PAM aware.
19HAVE_PAM=no
20
21# If HAVE_SHADOW is set to "yes", then login, chfn, chsh, newgrp, passwd,
22# and vipw will not be built or installed from the login-utils
23# subdirectory.
24HAVE_SHADOW=yes
25
26# If HAVE_PASSWD is set to "yes", then passwd will not be built or
27# installed from the login-utils subdirectory (but login, chfn, chsh,
28# newgrp, and vipw *will* be installed).
29HAVE_PASSWD=no
30
31# If you use chfn and chsh from this package, REQUIRE_PASSWORD will require
32# non-root users to enter the account password before updating /etc/passwd.
33REQUIRE_PASSWORD=yes
34#REQUIRE_PASSWORD=no
35
36# If you use chsh from this package, ONLY_LISTED_SHELLS will require that
37# the selected shell be listed in /etc/shells -- otherwise only a warning is
38# printed. This prevents someone from setting their shell to /bin/false.
39ONLY_LISTED_SHELLS=yes
40#ONLY_LISTED_SHELLS=no
41
42
43# If HAVE_SYSVINIT is set to "yes", then simpleinit and shutdown will not
44# be built or installed from the login-utils subdirectory. (The shutdown
45# and halt that come with the SysVinit package should be used with the init
46# found in that package.)
47HAVE_SYSVINIT=no
48
49# If HAVE_SYSVINIT_UTILS is set to "yes", then last, mesg, and wall will
50# not be built or installed from the login-utils subdirectory. (The
51# shutdown and init from the SysVinit package do not depend on the last,
52# mesg, and wall from that package.)
53HAVE_SYSVINIT_UTILS=no
54
55# If HAVE_WRITE is set to "yes", then write will not be built or
56# installed from the misc-utils subdirectory.
57# (There is a network aware write in netwrite from NetKit 0.16 or later.)
58HAVE_WRITE=no
59
60# If HAVE_GETTY is set to "yes", then agetty will not be built or
61# installed from the login-utils subdirectory. Note that agetty can
62# co-exist with other gettys, so this option should never be used.
63HAVE_GETTY=no
64
65# If USE_TTY_GROUP is set to "yes", then wall and write will be installed
66# setgid to the "tty" group, and mesg will only set the group write bit.
67# Note that this is only useful if login/xterm/etc. change the group of the
68# user's tty to "tty" [The login in util-linux does this correctly, and
69# xterm will do it correctly if X is compiled with USE_TTY_GROUP set
70# properly.]
71USE_TTY_GROUP=no
72
73# If HAVE_KILL is set to "yes", then kill will not be built or
74# installed from the misc-utils subdirectory.
75# (There is also a kill in the procps package.)
76HAVE_KILL=no
77
78# If ALLOW_VCS_USE is set to "yes", then login will chown /dev/vcsN
79# to the current user, allowing her to make a screendump and do other
80# nifty things on the console, but also allowing him to keep an open
81# file descriptor after logging out to trick the next user.
82ALLOW_VCS_USE=yes
83
84# If HAVE_RESET is set to "yes", then reset won't be installed. The version
85# of reset that comes with the ncurses package is less aggressive.
86HAVE_RESET=yes
87
88# If HAVE_SLN is set to "yes", then sln won't be installed
89# (but the man page sln.8 will be installed anyway).
90# sln also comes with libc and glibc.
91HAVE_SLN=no
92
93# If HAVE_FDUTILS is set to "yes", then setfdprm won't be installed.
94HAVE_FDUTILS=no
95
96# If SILENT_PG is set to "yes", then pg will not ring the bell
97# when an invalid key is pressed
98SILENT_PG=no
99
100# If configure decides that Native Language Support (NLS) is available,
101# it sets MAY_ENABLE_NLS in defines.h. If you don't want NLS, set
102# DISABLE_NLS to "yes".
103DISABLE_NLS=no
104
105# Different optimizations for different cpus.
106# gcc 3.0 likes options -mcpu=i486 instead of -m486
107ifeq "$(ARCH)" "intel"
108 ifeq "$(HAVE_OLD_GCC)" "yes"
109 CPUHEAD=-m
110 else
111 CPUHEAD=-mcpu=i
112 endif
113 ifeq "$(CPU)" "i386"
114 CPUTAIL=386
115 else
116 CPUTAIL=486
117 endif
118 CPUOPT= $(CPUHEAD)$(CPUTAIL)
119 OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer
120else
121 ifeq "$(ARCH)" "arm"
122 OPT= -pipe -O2 -fsigned-char -fomit-frame-pointer
123 else
124 OPT= -O2 -fomit-frame-pointer
125 endif
126endif
127
128WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes
129
130LIB=../lib
131
132ERR_O=$(LIB)/err.o
133
134# Set HAVE_SLANG to yes if you have slang (and prefer to use that for cfdisk)
135# (If neither HAVE_NCURSES nor HAVE_SLANG is defined, cfdisk is not made.)
136# HAVE_SLANG=yes
137# There is a subdirectory /usr/include/slang containing slcurses.h
138# SLANGFLAGS=-I/usr/include/slang
139# No such subdirectory - slcurses.h lives in /usr/include
140# (no extra definition required).
141LIBSLANG=-lslang
142
143#
144# Paths used for compilation (not all are actually used, see CFLAGS below)
145#
146DEV_DIR= /dev
147ETC_DIR= /etc
148SBIN_DIR= /sbin
149USRSBIN_DIR= /usr/sbin
150USRLIB_DIR= /usr/lib
151USRBIN_DIR= /usr/bin
152USRGAMES_DIR= /usr/games
153USRSHAREMISC_DIR=/usr/share/misc
154LOCALE_DIR= /usr/share/locale
155BIN_DIR= /bin
156VAR_PATH= /var
157LOG_DIR= /var/log
158MAN_DIR= /usr/share/man
159INFO_DIR= /usr/share/info
160
161#
162# Paths used for install
163#
164DEVDIR= $(DESTDIR)$(DEV_DIR)
165ETCDIR= $(DESTDIR)$(ETC_DIR)
166SBINDIR= $(DESTDIR)$(SBIN_DIR)
167USRSBINDIR= $(DESTDIR)$(USRSBIN_DIR)
168USRLIBDIR= $(DESTDIR)$(USRLIB_DIR)
169USRBINDIR= $(DESTDIR)$(USRBIN_DIR)
170USRGAMESDIR= $(DESTDIR)$(USRGAMES_DIR)
171USRSHAREMISCDIR=$(DESTDIR)$(USRSHAREMISC_DIR)
172LOCALEDIR= $(DESTDIR)$(LOCALE_DIR)
173BINDIR= $(DESTDIR)$(BIN_DIR)
174VARPATH= $(DESTDIR)$(VAR_PATH)
175LOGDIR= $(DESTDIR)$(LOG_DIR)
176MANDIR= $(DESTDIR)$(MAN_DIR)
177MAN1DIR= $(MANDIR)/man1
178MAN3DIR= $(MANDIR)/man3
179MAN5DIR= $(MANDIR)/man5
180MAN6DIR= $(MANDIR)/man6
181MAN8DIR= $(MANDIR)/man8
182INFODIR= $(DESTDIR)$(INFO_DIR)
183
184# Directory for shutdown, halt, reboot, etc.
185SHUTDOWNDIR= $(SBINDIR)
186
187# Modes
188DIRMODE= 755
189BINMODE= 755
190MANMODE= 644
191DATMODE= 644
192INFOMODE= 644
193SUIDMODE= 4755
194
195CHMOD= chmod
196INSTALL= install
197INSTALLDIR= $(INSTALL) -d -m $(DIRMODE)
198INSTALLBIN= $(INSTALL) -m $(BINMODE)
199INSTALLMAN= $(INSTALL) -m $(MANMODE)
200INSTALLDAT= $(INSTALL) -m $(DATMODE)
201INSTALLSUID= $(INSTALL) -m $(SUIDMODE)
202
203ifeq "$(DISABLE_NLS)" "yes"
204NLSFLAGS = -DDISABLE_NLS
205endif
206
207CFLAGS := $(OPT) -I$(LIB) $(WARNFLAGS) \
208 $(CURSESFLAGS) $(SLANGFLAGS) $(NLSFLAGS) \
209 -D_FILE_OFFSET_BITS=64 \
210 -DSBINDIR=\"$(SBIN_DIR)\" \
211 -DUSRSBINDIR=\"$(USRSBIN_DIR)\" \
212 -DLOGDIR=\"$(LOG_DIR)\" \
213 -DVARPATH=\"$(VAR_PATH)\" \
214 -DLOCALEDIR=\"$(LOCALE_DIR)\" \
215 $(CFLAGS)
216
217
218%.o: %.c
219 $(CC) -c $(CFLAGS) $< -o $@
220
221%: %.cc
222 $(CXX) $(CFLAGS) $< -o $@
223
diff --git a/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
new file mode 100644
index 0000000000..889ed43978
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
@@ -0,0 +1,18 @@
1ptest needs buildtest-TESTS and runtest-TESTS targets.
2serial-tests is required to generate those targets.
3
4Signed-off-by: Alexandra Safta <alexandra.safta@enea.com>
5Upstream-Status: Pending
6
7diff -ruN a/configure.ac b/configure.ac
8--- a/configure.ac 2014-05-27 12:37:42.119772658 +0200
9+++ b/configure.ac 2014-05-27 12:41:46.225573272 +0200
10@@ -10,7 +10,7 @@
11 dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run
12 dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors.
13 AC_USE_SYSTEM_EXTENSIONS
14-AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects])
15+AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax dist-bzip2 no-dist-gzip dist-xz -Wno-portability subdir-objects serial-tests])
16
17 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
18 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
diff --git a/meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch
new file mode 100644
index 0000000000..13dc7ddaa1
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_find_opts.patch
@@ -0,0 +1,38 @@
1Avoid unsupported find options
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/tests/run.sh b/tests/run.sh
7--- a/tests/run.sh 2013-08-26 23:48:48.868279097 +0200
8+++ b/tests/run.sh 2013-08-27 00:14:35.646730004 +0200
9@@ -91,7 +91,7 @@
10 # selected tests only
11 for s in $SUBTESTS; do
12 if [ -d "$top_srcdir/tests/ts/$s" ]; then
13- co=$(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*" | sort)
14+ co=$(find $top_srcdir/tests/ts/$s -type f -perm -111 -regex ".*/[^\.~]*" | sort)
15 comps="$comps $co"
16 else
17 echo "Unknown test component '$s'"
18@@ -104,7 +104,7 @@
19 exit 1
20 fi
21
22- comps=$(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*" | sort)
23+ comps=$(find $top_srcdir/tests/ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort)
24 fi
25
26
27diff -ruN a/tests/ts/build-sys/config b/tests/ts/build-sys/config
28--- a/tests/ts/build-sys/config 2013-08-26 23:50:26.800131581 +0200
29+++ b/tests/ts/build-sys/config 2013-08-27 00:10:02.806302850 +0200
30@@ -32,7 +32,7 @@
31 ./configure $opts &> /dev/null
32 make -j &> /dev/null
33
34- bins=$(find . -type f -perm /a+x | sort)
35+ bins=$(find . -type f -perm -111 | sort)
36 for b in $bins; do
37 libs=$(readelf --dynamic $b 2> /dev/null | \
38 awk '/NEEDED/ { print $5 }' | \
diff --git a/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch
new file mode 100644
index 0000000000..a0d5efad0f
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_grep_opts.patch
@@ -0,0 +1,57 @@
1Avoid unsupported grep options
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/ts/ipcs/headers b/ts/ipcs/headers
7--- a/tests/ts/ipcs/headers 2013-09-04 11:03:36.118613250 +0200
8+++ b/teste/ts/ipcs/headers 2013-09-04 11:03:27.906958437 +0200
9@@ -22,35 +22,35 @@
10 ts_init "$*"
11
12 ts_log "test: shm headers"
13-$TS_CMD_IPCS -m -t | grep --after-context=1 "^---" >> $TS_OUTPUT
14-$TS_CMD_IPCS -m -p | grep --after-context=1 "^---" >> $TS_OUTPUT
15-$TS_CMD_IPCS -m -c | grep --after-context=1 "^---" >> $TS_OUTPUT
16+$TS_CMD_IPCS -m -t | grep -A 1 "^---" >> $TS_OUTPUT
17+$TS_CMD_IPCS -m -p | grep -A 1 "^---" >> $TS_OUTPUT
18+$TS_CMD_IPCS -m -c | grep -A 1 "^---" >> $TS_OUTPUT
19 $TS_CMD_IPCS -m -l | grep "^---" >> $TS_OUTPUT
20 $TS_CMD_IPCS -m -u | grep "^---" >> $TS_OUTPUT
21 echo >> $TS_OUTPUT
22
23 ts_log "test: mesg headers"
24-$TS_CMD_IPCS -q -t | grep --after-context=1 "^---" >> $TS_OUTPUT
25-$TS_CMD_IPCS -q -p | grep --after-context=1 "^---" >> $TS_OUTPUT
26-$TS_CMD_IPCS -q -c | grep --after-context=1 "^---" >> $TS_OUTPUT
27+$TS_CMD_IPCS -q -t | grep -A 1 "^---" >> $TS_OUTPUT
28+$TS_CMD_IPCS -q -p | grep -A 1 "^---" >> $TS_OUTPUT
29+$TS_CMD_IPCS -q -c | grep -A 1 "^---" >> $TS_OUTPUT
30 $TS_CMD_IPCS -q -l | grep "^---" >> $TS_OUTPUT
31 $TS_CMD_IPCS -q -u | grep "^---" >> $TS_OUTPUT
32 echo >> $TS_OUTPUT
33
34 ts_log "test: sem headers"
35-$TS_CMD_IPCS -s -t | grep --after-context=1 "^---" >> $TS_OUTPUT
36-$TS_CMD_IPCS -s -p | grep --after-context=1 "^---" >> $TS_OUTPUT
37-$TS_CMD_IPCS -s -c | grep --after-context=1 "^---" >> $TS_OUTPUT
38+$TS_CMD_IPCS -s -t | grep -A 1 "^---" >> $TS_OUTPUT
39+$TS_CMD_IPCS -s -p | grep -A 1 "^---" >> $TS_OUTPUT
40+$TS_CMD_IPCS -s -c | grep -A 1 "^---" >> $TS_OUTPUT
41 $TS_CMD_IPCS -s -l | grep "^---" >> $TS_OUTPUT
42 $TS_CMD_IPCS -s -u | grep "^---" >> $TS_OUTPUT
43 echo >> $TS_OUTPUT
44
45 ts_log "test: all headers"
46-$TS_CMD_IPCS -a | grep --after-context=1 "^---" >> $TS_OUTPUT
47+$TS_CMD_IPCS -a | grep -A 1 "^---" >> $TS_OUTPUT
48
49-$TS_CMD_IPCS -a -t | grep --after-context=1 "^---" >> $TS_OUTPUT
50-$TS_CMD_IPCS -a -p | grep --after-context=1 "^---" >> $TS_OUTPUT
51-$TS_CMD_IPCS -a -c | grep --after-context=1 "^---" >> $TS_OUTPUT
52+$TS_CMD_IPCS -a -t | grep -A 1 "^---" >> $TS_OUTPUT
53+$TS_CMD_IPCS -a -p | grep -A 1 "^---" >> $TS_OUTPUT
54+$TS_CMD_IPCS -a -c | grep -A 1 "^---" >> $TS_OUTPUT
55 $TS_CMD_IPCS -a -l | grep "^---" >> $TS_OUTPUT
56 $TS_CMD_IPCS -a -u | grep "^---" >> $TS_OUTPUT
57
diff --git a/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
new file mode 100644
index 0000000000..3a6206704a
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/avoid_unsupported_sleep_param.patch
@@ -0,0 +1,20 @@
1Avoid unsupported sleep parameter
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/simple b/simple
7--- a/tests/ts/tailf/simple 2013-09-04 11:34:49.971817130 +0200
8+++ b/tests/ts/tailf/simple 2013-09-04 11:34:37.876325128 +0200
9@@ -25,9 +25,9 @@
10
11 $TS_CMD_TAILF $INPUT > $TS_OUTPUT 2>&1 &
12
13-sleep 0.1
14+sleep 1
15 echo {0..9} >> $INPUT
16-sleep 0.1
17+sleep 1
18
19 rm -f $INPUT
20
diff --git a/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch b/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch
new file mode 100644
index 0000000000..a5b1ff12e5
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch
@@ -0,0 +1,23 @@
1util-linux: take ${sbindir} from the environment if it is set there
2fix the test, the [ ] syntax was getting eaten by autoconf
3
4Signed-off-by: Phil Blundell <pb@pbcl.net>
5Signed-off-by: Saul Wold <sgw@linux.intel.com
6Upstream-Status: Inappropriate [configuration]
7
8Index: util-linux-2.22.1/configure.ac
9===================================================================
10--- util-linux-2.22.1.orig/configure.ac
11+++ util-linux-2.22.1/configure.ac
12@@ -73,7 +73,10 @@ AC_SUBST([localstatedir])
13 usrbin_execdir='${exec_prefix}/bin'
14 AC_SUBST([usrbin_execdir])
15
16-usrsbin_execdir='${exec_prefix}/sbin'
17+if test -z "$usrsbin_execdir" ;
18+then
19+ usrsbin_execdir='${exec_prefix}/sbin'
20+fi
21 AC_SUBST([usrsbin_execdir])
22
23 case $libdir in
diff --git a/meta/recipes-core/util-linux/util-linux/defines.h b/meta/recipes-core/util-linux/util-linux/defines.h
new file mode 100644
index 0000000000..6ce6b86df5
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/defines.h
@@ -0,0 +1,10 @@
1#define UTIL_LINUX_VERSION "2.12"
2#define util_linux_version "util-linux-2.12"
3
4#define HAVE_blkpg_h
5#define HAVE_kd_h
6#define HAVE_locale_h
7#define HAVE_langinfo_h
8#define HAVE_sys_user_h
9#define HAVE_asm_types_h
10//#define NEED_tqueue_h
diff --git a/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch b/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
new file mode 100644
index 0000000000..64f02d570f
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
@@ -0,0 +1,17 @@
1Display testname for subtest
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/functions.sh b/functions.sh
7--- a/tests/functions.sh 2013-09-04 12:41:07.625488953 +0200
8+++ b/tests/functions.sh 2013-09-04 17:33:02.402802957 +0200
9@@ -209,7 +209,7 @@
10 [ $TS_NSUBTESTS -eq 0 ] && echo
11 TS_NSUBTESTS=$(( $TS_NSUBTESTS + 1 ))
12
13- printf "%16s: %-27s ..." "" "$TS_SUBNAME"
14+ printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME"
15 }
16
17 function ts_init {
diff --git a/meta/recipes-core/util-linux/util-linux/fix-configure.patch b/meta/recipes-core/util-linux/util-linux/fix-configure.patch
new file mode 100644
index 0000000000..cefae97e9c
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/fix-configure.patch
@@ -0,0 +1,20 @@
1The userlib_execdir was not getting set correctly, the quoting
2was wrong as these quoted items were not getting expanded correctly.
3
4Upstream-Status: Pending
5
6Signed-off-by: Saul Wold <sgw@linux.intel.com>
7
8Index: util-linux-2.24.1/configure.ac
9===================================================================
10--- util-linux-2.24.1.orig/configure.ac
11+++ util-linux-2.24.1/configure.ac
12@@ -76,7 +76,7 @@ fi
13 AC_SUBST([usrsbin_execdir])
14
15 AS_CASE([$libdir],
16- ['${exec_prefix}/'* | '${prefix}/'* | /usr/*],
17+ [${exec_prefix}/* | ${prefix}/* | /usr/*],
18 [usrlib_execdir=$libdir],
19 [usrlib_execdir='${exec_prefix}'$libdir]
20 )
diff --git a/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch b/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch
new file mode 100644
index 0000000000..adb271ce0d
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch
@@ -0,0 +1,35 @@
1From 774f55f9dd22c01e4041a183d8dff14811f29114 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Fri, 4 Apr 2014 17:33:04 +0800
4Subject: [PATCH] sys-utils/Makemodule.am: fix parallel build issue
5
6The rule SETARCH_MAN_LINKS is used for the files under the sys-utils
7dir, for example:
8
9echo ".so man8/setarch.8" > sys-utils/linux32.8
10
11but it depends on nothing so that the sys-utils dir may not exist, we
12can create the sys-utils dir to fix problem.
13
14Upstream-Status: Pending
15
16Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
17---
18 sys-utils/Makemodule.am | 1 +
19 1 file changed, 1 insertion(+)
20
21diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am
22index 6265282..62ead37 100644
23--- a/sys-utils/Makemodule.am
24+++ b/sys-utils/Makemodule.am
25@@ -124,6 +124,7 @@ man_MANS += $(SETARCH_MAN_LINKS)
26 CLEANFILES += $(SETARCH_MAN_LINKS)
27
28 $(SETARCH_MAN_LINKS):
29+ $(MKDIR_P) sys-utils
30 $(AM_V_GEN)echo ".so man8/setarch.8" > $@
31
32 install-exec-hook-setarch:
33--
341.8.2.1
35
diff --git a/meta/recipes-core/util-linux/util-linux/make_include b/meta/recipes-core/util-linux/util-linux/make_include
new file mode 100644
index 0000000000..e6abcd91f7
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/make_include
@@ -0,0 +1,17 @@
1VERSION=2.12
2CC=gcc
3CFLAGS=
4LDFLAGS=
5HAVE_OLD_GCC=yes
6HAVE_RAW_H=yes
7HAVE_NCURSES=yes
8CURSESFLAGS=-DNCH=1
9LIBCURSES=-lncurses
10HAVE_TERMCAP=no
11NEED_LIBCRYPT=yes
12FOREIGN = --foreign-user
13HAVE_XGETTEXT=yes
14HAVE_OPENPTY=yes
15HAVE_PIVOT_ROOT=yes
16HAVE_GOOD_RPC=yes
17HAVE_ZLIB=yes
diff --git a/meta/recipes-core/util-linux/util-linux/ptest.patch b/meta/recipes-core/util-linux/util-linux/ptest.patch
new file mode 100644
index 0000000000..e9adc90a21
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/ptest.patch
@@ -0,0 +1,16 @@
1Define TESTS variable
2
3Signed-off-by: Tudor Florea <tudor.florea@enea.com>
4Upstream-Status: Pending
5
6diff -ruN a/Makefile.am b/Makefile.am
7--- a/Makefile.am 2013-08-26 16:29:42.151429221 +0200
8+++ b/Makefile.am 2013-08-26 17:52:31.013898120 +0200
9@@ -43,7 +43,7 @@
10 dist_usrbin_exec_SCRIPTS =
11 systemdsystemunit_DATA =
12 check_PROGRAMS =
13-TESTS =
14+TESTS = $(check_PROGRAMS)
15
16 PATHFILES =
diff --git a/meta/recipes-core/util-linux/util-linux/run-ptest b/meta/recipes-core/util-linux/util-linux/run-ptest
new file mode 100644
index 0000000000..b04f14a835
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/run-ptest
@@ -0,0 +1,10 @@
1#!/bin/sh
2
3cd tests || exit 1
4sh ./run.sh 2>&1 | {
5 sed '{
6 s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/
7 s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/
8 s/^\(.*\):\(.*\) \.\.\. IGNORE \(.*\)$/SKIP: \1:\2 \3/
9 }'
10}
diff --git a/meta/recipes-core/util-linux/util-linux/swapargs.h b/meta/recipes-core/util-linux/util-linux/swapargs.h
new file mode 100644
index 0000000000..e960eef05f
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/swapargs.h
@@ -0,0 +1,3 @@
1#define SWAPON_HAS_TWO_ARGS
2#include <asm/page.h>
3#include <sys/swap.h>
diff --git a/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch b/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch
new file mode 100644
index 0000000000..5031a7313e
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch
@@ -0,0 +1,32 @@
1configure should include errno.h instead of argp.h when
2checking for presence of program_invocation_short_name
3uclibc defines this to be const char* unlike util-linux-ng
4which defines this to be char* so this error goes unnoticed
5on glibc/eglibc systems.
6
7here is the error it fixes
8
9in file included from mountP.h:14:0,
10 from cache.c:29:
11/home/kraj/work/slugos/build/tmp-slugos-uclibc/sysroots/nslu2le/usr/include/errno.h:55:46: error: conflicting types for '__progname'
12../../../include/c.h:118:14: note: previous declaration of '__progname' was here
13make[3]: *** [cache.lo] Error 1
14
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Jonathan Liu <net147@gmail.com>
18
19Upstream-Status: Pending
20Index: util-linux-2.22.1/configure.ac
21===================================================================
22--- util-linux-2.22.1.orig/configure.ac
23+++ util-linux-2.22.1/configure.ac
24@@ -372,7 +372,7 @@ esac
25
26 AC_MSG_CHECKING([whether program_invocation_short_name is defined])
27 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
28- #include <argp.h>
29+ #include <errno.h>
30 ]], [[
31 program_invocation_short_name = "test";
32 ]])], [
diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
new file mode 100644
index 0000000000..1707683a26
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
@@ -0,0 +1,34 @@
1From f220d809be1baa654503bf6ff52f3630b0d7015c Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Wed, 26 Mar 2014 01:30:29 +0000
4Subject: [PATCH] sun.c: use qsort() to instead of qsort_r()
5
6qsort_r() was added to glibc in version 2.8, so there is no qsort_r() on
7the host like CentOS 5.x.
8
9Upstream-Status: Inappropriate [Other]
10
11Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
12---
13 libfdisk/src/sun.c | 5 ++---
14 1 file changed, 2 insertions(+), 3 deletions(-)
15
16diff --git a/libfdisk/src/sun.c b/libfdisk/src/sun.c
17index e73c701..f7899ec 100644
18--- a/libfdisk/src/sun.c
19+++ b/libfdisk/src/sun.c
20@@ -427,9 +427,8 @@ static int sun_verify_disklabel(struct fdisk_context *cxt)
21 else
22 array[i] = -1;
23 }
24- qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
25- (int (*)(const void *,const void *,void *)) verify_sun_cmp,
26- verify_sun_starts);
27+ qsort(array,ARRAY_SIZE(array),sizeof(array[0]),
28+ (int (*)(const void *,const void *)) verify_sun_cmp);
29
30 if (array[0] == -1) {
31 fdisk_info(cxt, _("No partitions defined."));
32--
331.8.2.1
34
diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-native.patch b/meta/recipes-core/util-linux/util-linux/util-linux-native.patch
new file mode 100644
index 0000000000..afe543c6e8
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/util-linux-native.patch
@@ -0,0 +1,73 @@
1Support older hosts with latest util-linux-native
2
3mkostemp is not defined on older machines. So we detect this and
4provide a define that uses mkstemp instead.
5
6O_CLOEXEC is not defined on older machines. It is however defined
7in the 'c.h' header. Fix up the users to include 'c.h'.
8
9fdisks/fdisksunlabel.c was modified to use qsort_r, however
10this is not defined on older hosts. Revert:
11 commit c69bbca9c1f6645097bd20fe3a21f5a99a2a0698
12 fdisk: (sun): use ask API, remove global variable
13
14Upstream-Status: Inappropriate [other]
15Patches revert upstream changes in order to support older
16machines.
17
18Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
19
20Index: util-linux-2.24.1/configure.ac
21===================================================================
22--- util-linux-2.24.1.orig/configure.ac
23+++ util-linux-2.24.1/configure.ac
24@@ -302,6 +302,7 @@ AC_CHECK_FUNCS([ \
25 llseek \
26 lseek64 \
27 mempcpy \
28+ mkostemp \
29 nanosleep \
30 personality \
31 posix_fadvise \
32Index: util-linux-2.24.1/include/c.h
33===================================================================
34--- util-linux-2.24.1.orig/include/c.h
35+++ util-linux-2.24.1/include/c.h
36@@ -236,6 +236,13 @@ static inline int dirfd(DIR *d)
37 #endif
38
39 /*
40+ * mkostemp replacement
41+ */
42+#ifndef HAVE_MKOSTEMP
43+#define mkostemp(template, flags) mkstemp(template)
44+#endif
45+
46+/*
47 * MAXHOSTNAMELEN replacement
48 */
49 static inline size_t get_hostname_max(void)
50Index: util-linux-2.24.1/lib/randutils.c
51===================================================================
52--- util-linux-2.24.1.orig/lib/randutils.c
53+++ util-linux-2.24.1/lib/randutils.c
54@@ -16,6 +16,7 @@
55 #include <sys/syscall.h>
56
57 #include "randutils.h"
58+#include "c.h"
59
60 #ifdef HAVE_TLS
61 #define THREAD_LOCAL static __thread
62Index: util-linux-2.24.1/lib/wholedisk.c
63===================================================================
64--- util-linux-2.24.1.orig/lib/wholedisk.c
65+++ util-linux-2.24.1/lib/wholedisk.c
66@@ -10,6 +10,7 @@
67
68 #include "blkdev.h"
69 #include "wholedisk.h"
70+#include "c.h"
71
72 int is_whole_disk_fd(int fd, const char *name)
73 {
diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch b/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch
new file mode 100644
index 0000000000..5773d7ea1b
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch
@@ -0,0 +1,27 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3The FHS indicates that /etc must be capable of being mounted R/O.
4
5The FHS also indicates that lock files belong in /var/lock, and /var must
6be R/W as soon as possible during boot.
7
8This patch moves the mtab lock file from the potentially R/O /etc, to the
9R/W /var/lock area. This lock file is used when mounting disks and making
10other mount adjustments. The _PATH_MOUNTED_TMP is not adjusted, as failing
11to write to this file does not cause any functional limitations.
12
13(Note, if /etc is R/O, then /etc/mtab should be a symlink to /proc/mounts)
14
15Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
16
17--- util-linux-ng-2.16/include/pathnames.h.orig
18+++ util-linux-ng-2.16/include/pathnames.h
19@@ -90,7 +90,7 @@
20 # endif
21 #endif
22
23-#define _PATH_MOUNTED_LOCK _PATH_MOUNTED "~"
24+#define _PATH_MOUNTED_LOCK "/var/lock/mtab~"
25 #define _PATH_MOUNTED_TMP _PATH_MOUNTED ".tmp"
26
27 #ifndef _PATH_DEV
diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch b/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch
new file mode 100644
index 0000000000..f131b763ca
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch
@@ -0,0 +1,27 @@
1Upstream-Status: Pending
2
3Index: util-linux-2.22.1/login-utils/login.c
4===================================================================
5--- util-linux-2.22.1.orig/login-utils/login.c
6+++ util-linux-2.22.1/login-utils/login.c
7@@ -1239,6 +1239,8 @@ int main(int argc, char **argv)
8 char *buff;
9 int childArgc = 0;
10 int retcode;
11+ struct sigaction act;
12+
13
14 char *pwdbuf = NULL;
15 struct passwd *pwd = NULL, _pwd;
16@@ -1252,7 +1254,10 @@ int main(int argc, char **argv)
17 timeout = (unsigned int)getlogindefs_num("LOGIN_TIMEOUT", LOGIN_TIMEOUT);
18
19 signal(SIGALRM, timedout);
20- siginterrupt(SIGALRM, 1); /* we have to interrupt syscalls like ioclt() */
21+ (void) sigaction(SIGALRM, NULL, &act);
22+ act.sa_flags &= ~SA_RESTART;
23+ sigaction(SIGALRM, &act, NULL);
24+
25 alarm(timeout);
26 signal(SIGQUIT, SIG_IGN);
27 signal(SIGINT, SIG_IGN);
diff --git a/meta/recipes-core/util-linux/util-linux_2.24.1.bb b/meta/recipes-core/util-linux/util-linux_2.24.1.bb
new file mode 100644
index 0000000000..d5356e182b
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux_2.24.1.bb
@@ -0,0 +1,31 @@
1MAJOR_VERSION = "2.24"
2require util-linux.inc
3
4# To support older hosts, we need to patch and/or revert
5# some upstream changes. Only do this for native packages.
6OLDHOST = ""
7OLDHOST_class-native = "file://util-linux-native.patch \
8 file://util-linux-native-qsort.patch \
9 "
10
11SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \
12 file://util-linux-ng-2.16-mount_lock_path.patch \
13 file://uclibc-__progname-conflict.patch \
14 file://configure-sbindir.patch \
15 file://fix-configure.patch \
16 file://fix-parallel-build.patch \
17 file://avoid_parallel_tests.patch \
18 ${OLDHOST} \
19"
20
21SRC_URI[md5sum] = "88d46ae23ca599ac5af9cf96b531590f"
22SRC_URI[sha256sum] = "835eb6232cfab0118ef2e4fd649de0ba9f5bd1b8cbf9a7d4d84594541dec8410"
23
24CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
25
26EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \
27 --disable-fallocate --disable-use-tty-group \
28"
29EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \
30 --disable-fallocate --disable-use-tty-group \
31"
diff --git a/meta/recipes-core/zlib/site_config/headers b/meta/recipes-core/zlib/site_config/headers
new file mode 100644
index 0000000000..50268918aa
--- /dev/null
+++ b/meta/recipes-core/zlib/site_config/headers
@@ -0,0 +1 @@
zlib.h
diff --git a/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch b/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch
new file mode 100644
index 0000000000..61eea8238a
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch
@@ -0,0 +1,38 @@
1Add 'ptest' target to Makefile, to run tests without checking dependencies.
2
3Signed-off-by: Anders Roxell <anders.roxell@enea.com>
4Upstream-Status: Pending
5---
6diff -uNr a/Makefile.in b/Makefile.in
7--- a/Makefile.in 2013-06-10 13:48:14.321959162 +0200
8+++ b/Makefile.in 2013-06-10 13:49:36.686476448 +0200
9@@ -83,6 +83,9 @@
10 test: all teststatic testshared
11
12 teststatic: static
13+ @make runteststatic
14+
15+runteststatic:
16 @TMPST=tmpst_$$; \
17 if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
18 echo ' *** zlib test OK ***'; \
19@@ -92,6 +95,9 @@
20 rm -f $$TMPST
21
22 testshared: shared
23+ @make runtestshared
24+
25+runtestshared:
26 @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
27 LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
28 DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
29@@ -105,6 +111,9 @@
30 rm -f $$TMPSH
31
32 test64: all64
33+ @make runtestall64
34+
35+runtestall64:
36 @TMP64=tmp64_$$; \
37 if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
38 echo ' *** zlib 64-bit test OK ***'; \
diff --git a/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch b/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch
new file mode 100644
index 0000000000..403b4825c9
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch
@@ -0,0 +1,20 @@
1
2When /etc/ld.so.cache is writeable by user running bitbake then it creates invalid cache
3(in my case libstdc++.so cannot be found after building zlib(-native) and I have to call
4touch */libstdc++.so && /sbin/ldconfig to fix it.
5
6So remove ldconfig call from make install-libs
7
8Upstream-Status: Inappropriate [disable feature]
9
10diff -uNr zlib-1.2.6.orig/Makefile.in zlib-1.2.6/Makefile.in
11--- zlib-1.2.6.orig/Makefile.in 2012-01-28 23:48:50.000000000 +0100
12+++ zlib-1.2.6/Makefile.in 2012-02-13 15:38:20.577700723 +0100
13@@ -199,7 +199,6 @@
14 rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
15 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
16 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
17- ($(LDCONFIG) || true) >/dev/null 2>&1; \
18 fi
19 cp zlib.3 $(DESTDIR)$(man3dir)
20 chmod 644 $(DESTDIR)$(man3dir)/zlib.3
diff --git a/meta/recipes-core/zlib/zlib-1.2.8/run-ptest b/meta/recipes-core/zlib/zlib-1.2.8/run-ptest
new file mode 100644
index 0000000000..884d9dc699
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib-1.2.8/run-ptest
@@ -0,0 +1,2 @@
1#!/bin/sh
2make -k runteststatic runtestshared | sed -r -e 's/^(\s+\*+ (.+?) test OK \*+)/\1\nPASS: \2/' -e 's/^(\s+\*+ (.+?) test FAILED \*+)/\1\nFAIL: \2/'
diff --git a/meta/recipes-core/zlib/zlib_1.2.8.bb b/meta/recipes-core/zlib/zlib_1.2.8.bb
new file mode 100644
index 0000000000..bdfa045b7b
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib_1.2.8.bb
@@ -0,0 +1,60 @@
1SUMMARY = "Zlib Compression Library"
2DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \
3library which is used by many different programs."
4HOMEPAGE = "http://zlib.net/"
5SECTION = "libs"
6LICENSE = "Zlib"
7LIC_FILES_CHKSUM = "file://zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd"
8
9
10SRC_URI = "http://www.zlib.net/${BPN}-${PV}.tar.xz \
11 file://remove.ldconfig.call.patch \
12 file://Makefile-runtests.patch \
13 file://run-ptest \
14 "
15
16SRC_URI[md5sum] = "28f1205d8dd2001f26fec1e8c2cebe37"
17SRC_URI[sha256sum] = "831df043236df8e9a7667b9e3bb37e1fcb1220a0f163b6de2626774b9590d057"
18
19RDEPENDS_${PN}-ptest += "make"
20
21inherit ptest
22
23do_configure (){
24 ./configure --prefix=${prefix} --shared --libdir=${libdir}
25}
26
27do_compile (){
28 oe_runmake
29}
30
31do_compile_ptest() {
32 oe_runmake static shared
33}
34
35do_install() {
36 oe_runmake DESTDIR=${D} install
37}
38
39do_install_ptest() {
40 install ${B}/Makefile ${D}${PTEST_PATH}
41 install ${B}/example ${D}${PTEST_PATH}
42 install ${B}/minigzip ${D}${PTEST_PATH}
43 install ${B}/examplesh ${D}${PTEST_PATH}
44 install ${B}/minigzipsh ${D}${PTEST_PATH}
45}
46
47# We move zlib shared libraries for target builds to avoid
48# qa warnings.
49#
50do_install_append_class-target() {
51 if [ ${base_libdir} != ${libdir} ]
52 then
53 mkdir -p ${D}/${base_libdir}
54 mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
55 tmp=`readlink ${D}/${libdir}/libz.so`
56 ln -sf ../../${base_libdir}/$tmp ${D}/${libdir}/libz.so
57 fi
58}
59
60BBCLASSEXTEND = "native nativesdk"