diff options
Diffstat (limited to 'meta/recipes-extended/bash/bash.inc')
-rw-r--r-- | meta/recipes-extended/bash/bash.inc | 61 |
1 files changed, 38 insertions, 23 deletions
diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc index db326660ea..634209c911 100644 --- a/meta/recipes-extended/bash/bash.inc +++ b/meta/recipes-extended/bash/bash.inc | |||
@@ -1,12 +1,13 @@ | |||
1 | SUMMARY = "An sh-compatible command language interpreter" | 1 | SUMMARY = "An sh-compatible command language interpreter" |
2 | HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html" | 2 | HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html" |
3 | DESCRIPTION = "Bash is the GNU Project's Bourne Again SHell, a complete implementation of the IEEE POSIX and Open Group shell specification with interactive command line editing, job control on architectures that support it, csh-like features such as history substitution and brace expansion, and a slew of other features." | ||
3 | SECTION = "base/shell" | 4 | SECTION = "base/shell" |
4 | 5 | ||
5 | DEPENDS = "ncurses bison-native virtual/libiconv" | 6 | DEPENDS = "ncurses bison-native virtual/libiconv" |
6 | 7 | ||
7 | inherit autotools gettext texinfo update-alternatives ptest | 8 | inherit autotools gettext texinfo update-alternatives ptest |
8 | 9 | ||
9 | EXTRA_AUTORECONF += "--exclude=autoheader" | 10 | EXTRA_AUTORECONF += "--exclude=autoheader,aclocal" |
10 | EXTRA_OECONF = "--enable-job-control --without-bash-malloc bash_cv_wexitstatus_offset=8" | 11 | EXTRA_OECONF = "--enable-job-control --without-bash-malloc bash_cv_wexitstatus_offset=8" |
11 | 12 | ||
12 | # If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the | 13 | # If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the |
@@ -21,18 +22,18 @@ CFLAGS += "-DHEREDOC_PIPESIZE=65536" | |||
21 | # causes a lot of garbage in non-interactive shells | 22 | # causes a lot of garbage in non-interactive shells |
22 | CFLAGS += "-DBRACKETED_PASTE_DEFAULT=0" | 23 | CFLAGS += "-DBRACKETED_PASTE_DEFAULT=0" |
23 | 24 | ||
24 | ALTERNATIVE_${PN} = "bash sh" | 25 | ALTERNATIVE:${PN} = "bash sh" |
25 | ALTERNATIVE_LINK_NAME[bash] = "${base_bindir}/bash" | 26 | ALTERNATIVE_LINK_NAME[bash] = "${base_bindir}/bash" |
26 | ALTERNATIVE_TARGET[bash] = "${base_bindir}/bash" | 27 | ALTERNATIVE_TARGET[bash] = "${base_bindir}/bash" |
27 | ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh" | 28 | ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh" |
28 | ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash.${BPN}" | 29 | ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash.${BPN}" |
29 | ALTERNATIVE_PRIORITY = "100" | 30 | ALTERNATIVE_PRIORITY = "100" |
30 | 31 | ||
31 | RDEPENDS_${PN} += "base-files" | 32 | RDEPENDS:${PN} += "base-files" |
32 | RDEPENDS_${PN}_class-nativesdk = "" | 33 | RDEPENDS:${PN}:class-nativesdk = "" |
33 | RDEPENDS_${PN}-ptest += "make coreutils perl sed shadow util-linux-setpriv" | 34 | RDEPENDS:${PN}-ptest += "make coreutils perl sed shadow util-linux-setpriv" |
34 | 35 | ||
35 | RDEPENDS_${PN}-ptest_append_libc-glibc = " \ | 36 | RDEPENDS:${PN}-ptest:append:libc-glibc = " \ |
36 | glibc-gconv-big5hkscs \ | 37 | glibc-gconv-big5hkscs \ |
37 | glibc-gconv-iso8859-1 \ | 38 | glibc-gconv-iso8859-1 \ |
38 | glibc-utils \ | 39 | glibc-utils \ |
@@ -45,13 +46,7 @@ RDEPENDS_${PN}-ptest_append_libc-glibc = " \ | |||
45 | 46 | ||
46 | CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}" | 47 | CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}" |
47 | 48 | ||
48 | do_configure_prepend () { | 49 | do_compile:prepend() { |
49 | if [ ! -e ${S}/acinclude.m4 ]; then | ||
50 | cat ${S}/aclocal.m4 > ${S}/acinclude.m4 | ||
51 | fi | ||
52 | } | ||
53 | |||
54 | do_compile_prepend() { | ||
55 | # Remove any leftover .build files. This ensures that bash always has the | 50 | # Remove any leftover .build files. This ensures that bash always has the |
56 | # same version number and keeps builds reproducible | 51 | # same version number and keeps builds reproducible |
57 | rm -f ${B}/.build | 52 | rm -f ${B}/.build |
@@ -61,14 +56,20 @@ do_compile_ptest () { | |||
61 | oe_runmake buildtest | 56 | oe_runmake buildtest |
62 | } | 57 | } |
63 | 58 | ||
64 | do_install_append () { | 59 | do_install:prepend () { |
60 | # Ensure determinism as this counter increases for each make call | ||
61 | rm -f ${B}/.build | ||
62 | } | ||
63 | |||
64 | do_install:append () { | ||
65 | # Move /usr/bin/bash to /bin/bash, if need | 65 | # Move /usr/bin/bash to /bin/bash, if need |
66 | if [ "${base_bindir}" != "${bindir}" ]; then | 66 | if [ "${base_bindir}" != "${bindir}" ]; then |
67 | mkdir -p ${D}${base_bindir} | 67 | mkdir -p ${D}${base_bindir} |
68 | mv ${D}${bindir}/bash ${D}${base_bindir} | 68 | mv ${D}${bindir}/bash ${D}${base_bindir} |
69 | fi | 69 | fi |
70 | } | 70 | } |
71 | do_install_append_class-target () { | 71 | |
72 | fix_absolute_paths () { | ||
72 | # Clean buildhost references in bashbug | 73 | # Clean buildhost references in bashbug |
73 | sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ | 74 | sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ |
74 | -e "s,-I${WORKDIR}/\S* ,,g" \ | 75 | -e "s,-I${WORKDIR}/\S* ,,g" \ |
@@ -87,12 +88,24 @@ do_install_append_class-target () { | |||
87 | ${D}${libdir}/bash/Makefile.inc | 88 | ${D}${libdir}/bash/Makefile.inc |
88 | } | 89 | } |
89 | 90 | ||
91 | do_install:append:class-target () { | ||
92 | fix_absolute_paths | ||
93 | } | ||
94 | |||
95 | do_install:append:class-nativesdk () { | ||
96 | fix_absolute_paths | ||
97 | } | ||
98 | |||
90 | do_install_ptest () { | 99 | do_install_ptest () { |
91 | make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test | 100 | make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test |
92 | cp ${B}/Makefile ${D}${PTEST_PATH} | 101 | cp ${B}/Makefile ${D}${PTEST_PATH} |
93 | install -D ${WORKDIR}/run-bash-ptests ${D}${PTEST_PATH}/run-bash-ptests | 102 | cp ${B}/config.h ${D}${PTEST_PATH} |
103 | cp ${B}/version.h ${D}${PTEST_PATH} | ||
104 | cp ${S}/y.tab.[ch] ${D}${PTEST_PATH} | ||
105 | install -D ${UNPACKDIR}/run-bash-ptests ${D}${PTEST_PATH}/run-bash-ptests | ||
94 | sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ | 106 | sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ |
95 | -e 's|${DEBUG_PREFIX_MAP}||g' \ | 107 | -e 's|${DEBUG_PREFIX_MAP}||g' \ |
108 | -e 's|${BUILD_LDFLAGS}||g' \ | ||
96 | -e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" \ | 109 | -e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" \ |
97 | -e 's:${HOSTTOOLS_DIR}/::g' \ | 110 | -e 's:${HOSTTOOLS_DIR}/::g' \ |
98 | -e 's:${UNINATIVE_LOADER}:${base_bindir}/false:g' \ | 111 | -e 's:${UNINATIVE_LOADER}:${base_bindir}/false:g' \ |
@@ -103,20 +116,22 @@ do_install_ptest () { | |||
103 | # hash | 116 | # hash |
104 | do_install_ptest[vardepsexclude] += "UNINATIVE_LOADER" | 117 | do_install_ptest[vardepsexclude] += "UNINATIVE_LOADER" |
105 | 118 | ||
106 | pkg_postinst_${PN} () { | 119 | pkg_postinst:${PN} () { |
107 | grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells | 120 | grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells |
108 | } | 121 | } |
109 | 122 | ||
110 | pkg_postrm_${PN} () { | 123 | pkg_postrm:${PN} () { |
111 | printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells | 124 | printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells |
112 | } | 125 | } |
113 | 126 | ||
114 | PACKAGES += "${PN}-bashbug" | 127 | PACKAGES += "${PN}-bashbug" |
115 | FILES_${PN} = "${bindir}/bash ${base_bindir}/bash.bash" | 128 | FILES:${PN} = "${bindir}/bash ${base_bindir}/bash.bash" |
116 | FILES_${PN}-bashbug = "${bindir}/bashbug" | 129 | FILES:${PN}-bashbug = "${bindir}/bashbug" |
117 | 130 | ||
118 | PACKAGE_BEFORE_PN += "${PN}-loadable" | 131 | PACKAGE_BEFORE_PN += "${PN}-loadable" |
119 | RDEPENDS_${PN}-loadable += "${PN}" | 132 | RDEPENDS:${PN}-loadable += "${PN}" |
120 | FILES_${PN}-loadable += "${libdir}/bash/*" | 133 | FILES:${PN}-loadable += "${libdir}/bash/*" |
121 | 134 | ||
122 | RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/bash', '', d)}" | 135 | # Limit the RPROVIDES here to class target so that if usrmerge is enabled for nativesdk, it does not |
136 | # include host system paths in /bin/ | ||
137 | RPROVIDES:${PN}:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/bash', '', d)}" | ||