]> code.ossystems Code Review - openembedded-core.git/commitdiff
glibc: Separate out core glibc packaging functionality into a class
authorRichard Purdie <rpurdie@linux.intel.com>
Thu, 19 Nov 2009 22:37:45 +0000 (22:37 +0000)
committerRichard Purdie <rpurdie@linux.intel.com>
Thu, 19 Nov 2009 22:37:45 +0000 (22:37 +0000)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
meta/classes/glibc-package.bbclass [moved from meta/packages/glibc/glibc-package.bbclass with 77% similarity]
meta/packages/glibc/glibc_2.3.5+cvs20050627.bb
meta/packages/glibc/glibc_2.4.bb
meta/packages/glibc/glibc_2.5.bb
meta/packages/glibc/glibc_2.6.1.bb
meta/packages/glibc/glibc_2.9.bb
meta/packages/glibc/glibc_csl-2005q3-2.bb

similarity index 77%
rename from meta/packages/glibc/glibc-package.bbclass
rename to meta/classes/glibc-package.bbclass
index 561805a66e6ac16ac69635b66ea3be77fe18ae58..b16daa47f7ace9752cc64a748343ecffe2d7d583 100644 (file)
@@ -1,37 +1,20 @@
 #
-# For now, we will skip building of a gcc package if it is a uclibc one
-# and our build is not a uclibc one, and we skip a glibc one if our build
-# is a uclibc build.
+# This class knows how to package up glibc. Its shared since prebuild binary toolchains
+# may need packaging and its pointless to duplicate this code.
 #
-# See the note in gcc/gcc_3.4.0.oe
-#
-
-python __anonymous () {
-    import bb, re
-    uc_os = (re.match('.*uclibc*', bb.data.getVar('TARGET_OS', d, 1)) != None)
-    if uc_os:
-        raise bb.parse.SkipPackage("incompatible with target %s" %
-                                   bb.data.getVar('TARGET_OS', d, 1))
-}
-
-
-# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
-# is set. The idea is to avoid running localedef on the target (at first boot)
-# to decrease initial boot time and avoid localedef being killed by the OOM
-# killer which used to effectively break i18n on machines with < 128MB RAM.
+# Caller should set GLIBC_INTERNAL_USE_BINARY_LOCALE to one of:
+#  "compile" - Use QEMU to generate the binary locale files
+#  "precompiled" - The binary locale files are pregenerated and already present
+#  "ondevice" - The device will build the locale files upon first boot through the postinst
 
-# default to disabled until qemu works for everyone
-ENABLE_BINARY_LOCALE_GENERATION ?= "0"
+GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
 
-# BINARY_LOCALE_ARCHES is a space separated list of regular expressions
-BINARY_LOCALE_ARCHES ?= "arm.*"
-
-PACKAGES = "${PN}-dbg ${PN} catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile"
+PACKAGES = "glibc-dbg glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile"
 PACKAGES_DYNAMIC = "glibc-gconv-* glibc-charmap-* glibc-localedata-* locale-base-* glibc-binary-localedata-*"
 
 libc_baselibs = "${base_libdir}/libc* ${base_libdir}/libm* ${base_libdir}/ld* ${base_libdir}/libpthread* ${base_libdir}/libresolv* ${base_libdir}/librt* ${base_libdir}/libutil* ${base_libdir}/libnsl* ${base_libdir}/libnss_files* ${base_libdir}/libnss_compat* ${base_libdir}/libnss_dns* ${base_libdir}/libdl* ${base_libdir}/libanl* ${base_libdir}/libBrokenLocale*"
 
-FILES_${PN} = "${sysconfdir} ${libc_baselibs} ${base_sbindir}/ldconfig ${libexecdir}/* ${datadir}/zoneinfo"
+FILES_glibc = "${sysconfdir} ${libc_baselibs} ${base_sbindir}/ldconfig ${libexecdir}/* ${datadir}/zoneinfo"
 FILES_ldd = "${bindir}/ldd"
 FILES_libsegfault = "${base_libdir}/libSegFault*"
 FILES_glibc-extra-nss = "${base_libdir}/libnss*"
@@ -40,7 +23,9 @@ FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen"
 FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/nscd* ${sysconfdir}/init.d/nscd*"
 FILES_glibc-utils = "${bindir}/* ${sbindir}/*"
 FILES_glibc-gconv = "${libdir}/gconv/*"
-FILES_${PN}-dbg += " ${libdir}/gconv/.debug ${libexecdir}/*/.debug"
+FILES_glibc-dbg = "${bindir}/.debug ${sbindir}/.debug ${libdir}/.debug \
+                  ${base_bindir}/.debug ${base_sbindir}/.debug ${base_libdir}/.debug \
+                  ${libdir}/gconv/.debug ${libexecdir}/*/.debug"
 FILES_catchsegv = "${bindir}/catchsegv"
 RDEPENDS_catchsegv = "libsegfault"
 FILES_glibc-pcprofile = "${base_libdir}/libpcprofile.so"
@@ -55,36 +40,6 @@ DESCRIPTION_ldd = "glibc: print shared library dependencies"
 DESCRIPTION_localedef = "glibc: compile locale definition files"
 DESCRIPTION_glibc-utils = "glibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..."
 
-def get_glibc_fpu_setting(bb, d):
-    if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
-        return "--without-fp"
-    return ""
-
-EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
-EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
-
-OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
-
-do_install() {
-       oe_runmake install_root=${D} install
-       for r in ${rpcsvc}; do
-               h=`echo $r|sed -e's,\.x$,.h,'`
-               install -m 0644 ${S}/sunrpc/rpcsvc/$h ${D}/${includedir}/rpcsvc/
-       done
-       install -m 0644 ${WORKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/
-       install -d ${D}${libdir}/locale
-       make -f ${WORKDIR}/generate-supported.mk IN="${S}/localedata/SUPPORTED" OUT="${WORKDIR}/SUPPORTED"
-       # get rid of some broken files...
-       for i in ${GLIBC_BROKEN_LOCALES}; do
-               grep -v $i ${WORKDIR}/SUPPORTED > ${WORKDIR}/SUPPORTED.tmp
-               mv ${WORKDIR}/SUPPORTED.tmp ${WORKDIR}/SUPPORTED
-       done
-       rm -f ${D}/etc/rpc
-       rm -f ${D}${includedir}/scsi/sg.h
-       rm -f ${D}${includedir}/scsi/scsi_ioctl.h
-       rm -f ${D}${includedir}/scsi/scsi.h
-}
-
 TMP_LOCALE="/tmp/locale${libdir}/locale"
 
 locale_base_postinst() {
@@ -118,26 +73,6 @@ mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
 rm -rf ${TMP_LOCALE}
 }
 
-python __anonymous () {
-    enabled = bb.data.getVar("ENABLE_BINARY_LOCALE_GENERATION", d, 1)
-
-    if enabled and int(enabled):
-        import re
-
-        target_arch = bb.data.getVar("TARGET_ARCH", d, 1)
-        binary_arches = bb.data.getVar("BINARY_LOCALE_ARCHES", d, 1) or ""
-
-        for regexp in binary_arches.split(" "):
-            r = re.compile(regexp)
-
-            if r.match(target_arch):
-                depends = bb.data.getVar("DEPENDS", d, 1)
-                depends = "%s qemu-native" % depends
-                bb.data.setVar("DEPENDS", depends, d)
-                bb.data.setVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", "1", d)
-                break
-}
-
 do_prep_locale_tree() {
        treedir=${WORKDIR}/locale-tree
        rm -rf $treedir
@@ -276,13 +211,13 @@ python package_do_split_gconvs () {
 
        def output_locale(name, locale, encoding):
                use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1)
-               if use_bin:
+               if use_bin == "compile":
                        output_locale_binary(name, locale, encoding)
                else:
                        output_locale_source(name, locale, encoding)
 
        use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1)
-       if use_bin:
+       if use_bin == "compile":
                bb.note("preparing tree for binary locale generation")
                bb.build.exec_func("do_prep_locale_tree", d)
 
@@ -307,7 +242,7 @@ python package_do_split_gconvs () {
                bb.note("  " + " ".join(non_utf8))
 
        use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1)
-       if use_bin:
+       if use_bin == "compile":
                bb.note("collecting binary locales from locale tree")
                bb.build.exec_func("do_collect_bins_from_locale_tree", d)
                do_split_packages(d, binary_locales_dir, file_regex='(.*)', output_pattern='glibc-binary-localedata-%s', description='binary locale definition for %s', extra_depends='', allow_dirs=True)
index 3111ed35837192b959104c3c11d908e7051e6a34..8c44c21156af81ea52cc93a0f4b529c48a784e84 100644 (file)
@@ -107,4 +107,4 @@ do_compile () {
 
 require glibc-stage.inc
 
-require glibc-package.bbclass
+require glibc-package.inc
index 3f184a6b1330e77d0a167315217065521a37951b..3102c5953cf6230cce5288f65d3031e9453f6546 100644 (file)
@@ -134,4 +134,4 @@ do_compile () {
 
 require glibc-stage.inc
 
-require glibc-package.bbclass
+require glibc-package.inc
index 5f95280584ca4ae4445bc056f88b83d31caf1888..a63b6789493bd49aa60f2fc9ee4645511e72c0ee 100644 (file)
@@ -145,4 +145,4 @@ do_compile () {
 
 require glibc-stage.inc
 
-require glibc-package.bbclass
+require glibc-package.inc
index 3521f66fe307a537a6aae92860866f09a7b88893..790fdde97a9ac5e2fb488971bfb9438d9531ca70 100644 (file)
@@ -151,4 +151,4 @@ do_compile () {
 
 require glibc-stage.inc
 
-require glibc-package.bbclass
+require glibc-package.inc
index 75f56d61465f7489c920ca6d47d4e8bd5bae2bf2..7e3c70e2047a9052bb1a61201a5ea130d77b4a9a 100644 (file)
@@ -155,6 +155,6 @@ do_compile () {
 
 require glibc-stage.inc
 
-require glibc-package.bbclass
+require glibc-package.inc
 
 BBCLASSEXTEND = "nativesdk"
index d2aa11605b8ec1bb66109d3bfb8176de23acd4f8..b1ea27dec5fb1d65a16a81b5fb10a3ac34259e42 100644 (file)
@@ -86,4 +86,4 @@ do_compile () {
 
 require glibc-stage.inc
 
-require glibc-package.bbclass
+require glibc-package.inc