summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo/pseudo.inc
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2014-06-26 14:36:22 +0200
committerAdrian Dudau <adrian.dudau@enea.com>2014-06-26 15:32:53 +0200
commitf4cf9fe05bb3f32fabea4e54dd92d368967a80da (patch)
tree487180fa9866985ea7b28e625651765d86f515c3 /meta/recipes-devtools/pseudo/pseudo.inc
downloadpoky-f4cf9fe05bb3f32fabea4e54dd92d368967a80da.tar.gz
initial commit for Enea Linux 4.0
Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-devtools/pseudo/pseudo.inc')
-rw-r--r--meta/recipes-devtools/pseudo/pseudo.inc137
1 files changed, 137 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
new file mode 100644
index 0000000000..42738abfc5
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo.inc
@@ -0,0 +1,137 @@
1# Note: Due to the bitbake wrapper script, making changes to pseudo can be
2# difficult. To work around the current version of the wrapper use:
3# BBFETCH2=True PSEUDO_BUILD=1 ../bitbake/bin/bitbake pseudo-native [-c CMD]
4
5SUMMARY = "Pseudo gives fake root capabilities to a normal user"
6HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/pseudo"
7LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad"
8SECTION = "base"
9LICENSE = "LGPL2.1"
10DEPENDS = "sqlite3"
11
12SRC_URI_append_class-nativesdk = " file://symver.patch"
13
14SRC_URI_append_class-native = " file://symver.patch"
15
16FILES_${PN} = "${prefix}/lib/pseudo/lib*/libpseudo.so ${bindir}/* ${localstatedir}/pseudo ${prefix}/var/pseudo"
17FILES_${PN}-dbg += "${prefix}/lib/pseudo/lib*/.debug"
18INSANE_SKIP_${PN} += "libdir"
19INSANE_SKIP_${PN}-dbg += "libdir"
20
21PROVIDES += "virtual/fakeroot"
22
23MAKEOPTS = ""
24
25inherit siteinfo
26
27do_configure () {
28 :
29}
30
31NO32LIBS ??= "1"
32NO32LIBS_class-nativesdk = "1"
33
34# Compile for the local machine arch...
35do_compile () {
36 if [ "${SITEINFO_BITS}" = "64" ]; then
37 ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
38 else
39 ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
40 fi
41 oe_runmake ${MAKEOPTS}
42}
43
44maybe_make32() {
45 # We probably don't need to build 32-bit binaries.
46 make32=false
47 if [ "${SITEINFO_BITS}" = "64" ]; then
48 case "${NO32LIBS}" in
49 0) make32=true
50 ;;
51 1) make32=false
52 ;;
53 *) # If unset, build 32-bit if we think we can.
54 if [ -e "/usr/include/gnu/stubs-32.h" ]; then
55 make32=true
56 fi
57 ;;
58 esac
59 fi
60 if $make32; then
61 if ! [ -e "/usr/include/gnu/stubs-32.h" ]; then
62 warn_32bit_missing
63 else
64 bbnote "Attempting to build 32-bit libpseudo.so for ${PN}."
65 fi
66 else
67 bbnote "Building/installing only 64-bit libpseudo.so for ${PN}."
68 bbnote "If you need to run 32-bit executables, ensure that NO32LIBS is set to 0."
69 fi
70}
71
72warn_32bit_missing() {
73 bbwarn "Can't find stubs-32.h, but usually need it to build 32-bit libpseudo."
74 bbwarn "If the build fails, install 32-bit developer packages."
75 bbwarn "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional."
76}
77
78# Two below are the same
79# If necessary compile for the alternative machine arch. This is only
80# necessary in a native build.
81do_compile_prepend_class-native () {
82 maybe_make32
83 if $make32; then
84 # We need the 32-bit libpseudo on a 64-bit machine...
85 # Note that this is not well-tested outside of x86/x86_64.
86
87 # if we're being rebuilt due to a dependency change, we need to make sure
88 # everything is clean before we configure and build -- if we haven't previously
89 # built this will fail and be ignored.
90 make ${MAKEOPTS} distclean || :
91
92 ./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
93 save_traps=$(trap)
94 trap 'warn_32bit_missing' 0
95 oe_runmake ${MAKEOPTS} libpseudo
96 eval "$save_traps"
97 # prevent it from removing the lib, but remove everything else
98 make 'LIB=foo' ${MAKEOPTS} distclean
99 fi
100}
101
102do_compile_prepend_class-nativesdk () {
103 maybe_make32
104 if $make32; then
105 # We need the 32-bit libpseudo on a 64-bit machine.
106 # Note that this is not well-tested outside of x86/x86_64.
107 ./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
108 oe_runmake ${MAKEOPTS} libpseudo
109 # prevent it from removing the lib, but remove everything else
110 make 'LIB=foo' ${MAKEOPTS} distclean
111 fi
112}
113
114do_install () {
115 oe_runmake 'DESTDIR=${D}' ${MAKEOPTS} 'LIB=lib/pseudo/lib$(MARK64)' install
116}
117
118# Two below are the same
119# If necessary install for the alternative machine arch. This is only
120# necessary in a native build.
121do_install_append_class-native () {
122 maybe_make32
123 if $make32; then
124 mkdir -p ${D}${prefix}/lib/pseudo/lib
125 cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
126 fi
127}
128
129do_install_append_class-nativesdk () {
130 maybe_make32
131 if $make32; then
132 mkdir -p ${D}${prefix}/lib/pseudo/lib
133 cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
134 fi
135}
136
137BBCLASSEXTEND = "native nativesdk"