Skip to content
This repository was archived by the owner on Jan 27, 2019. It is now read-only.
Closed
24 changes: 24 additions & 0 deletions classes/automate.oeclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

CLASS_DEPENDS += "${DEPENDS_AUTOCONF}"
DEPENDS_AUTOCONF ?= "native:autoconf"

addtask automate after fetch unpack patch stage siteinfo before configure
do_automate[dirs] = "${B}"

export autom4te_perllibdir = "${STAGE_DIR}/native${stage_datadir}/autoconf"
export perllibdir = "${STAGE_DIR}/native${stage_datadir}/automake-1.14"
export AUTOCONF = "${STAGE_DIR}/native${stage_bindir}/autoconf"
export AUTOHEADER = "${STAGE_DIR}/native${stage_bindir}/autoheader"
export AUTOM4TE = "${STAGE_DIR}/native${stage_bindir}/autom4te"
export AUTOM4TE_CFG = "${STAGE_DIR}/native${stage_datadir}/autoconf/autom4te.cfg"

do_automate() {
PP=`echo "${STAGE_DIR}/native" | sed -e 's/[]\/$*.^|[]/\\\\&/g'`
cat ${AUTOM4TE_CFG} | sed "s/include '/include '$PP/g" > ${AUTOM4TE_CFG}.new
rm -rf ${AUTOM4TE_CFG}
mv ${AUTOM4TE_CFG}.new ${AUTOM4TE_CFG}
}

# Local Variables:
# mode: python
# End:
7 changes: 4 additions & 3 deletions classes/autotools-autoreconf.oeclass
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## See the autotools class. If using this class instead of autotools, one
## ensures that the autoreconf command is run before configure.

inherit autotools
inherit autotools automate

CLASS_DEPENDS += "${DEPENDS_AUTORECONF}"
DEPENDS_AUTORECONF ?= "native:glib-dev"
DEPENDS_AUTORECONF ?= "native:glib-utils native:automake"

EXTRA_AUTORECONF ?= ""
AUTORECONF_CMD ?= "autoreconf --verbose --install --force \
Expand All @@ -15,12 +15,13 @@ AUTORECONF_CMD ?= "autoreconf --verbose --install --force \

acpaths = "__default__"

export aclocalprefix = "${STAGE_DIR}/native${stage_prefix}"
pkgltdldir = "${STAGE_DIR}/${HOST_CROSS}${stage_datadir}/libtool"
pkgltdldir:native = "${STAGE_DIR}/native${stage_datadir}/libtool"
pkgltdldir:cross = "${STAGE_DIR}/native${stage_datadir}/libtool"
pkgltdldir:sdk-cross = "${STAGE_DIR}/native${stage_datadir}/libtool"

addtask autoreconf after fetch unpack patch stage siteinfo before configure
addtask autoreconf after fetch unpack patch stage siteinfo automate before configure
do_autoreconf[dirs] = "${S}"

export LIBTOOLIZE = "${HOST_PREFIX}libtoolize"
Expand Down
9 changes: 6 additions & 3 deletions classes/gettext.oeclass
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
##
## @useflag nls Enable nls

CLASS_DEPENDS =+ "${DEPENDS_GETTEXT}"
DEPENDS_GETTEXT = ""
DEPENDS_GETTEXT:USE_nls = "gettext native:gettext-utils libiconv libintl"
CLASS_DEPENDS =+ "${DEPENDS_GETTEXT_NLS} ${DEPENDS_GETTEXT_NATIVE}"
DEPENDS_GETTEXT_NATIVE = ""
DEPENDS_GETTEXT_NATIVE:native = "native:gettext-utils"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if you have USE_nls flag disabled, you need native:gettext-utils for native recipes, but nothing for other recipe types? Why/how is that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some native tools need gettext in order to be compiled

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And gettext is not needed when cross-building the same tools?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure on this point... I have to give a boost on my oe-lite PR :)

DEPENDS_GETTEXT_NLS = ""
DEPENDS_GETTEXT_NLS:USE_nls = "${DEPENDS_GETTEXT}"
DEPENDS_GETTEXT = "host:gettext native:gettext-utils host:libiconv host:libintl"

CLASS_FLAGS += "nls"
DEFAULT_USE_nls = "0"
Expand Down
1 change: 1 addition & 0 deletions classes/stage.oeclass
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
## them.

inherit binconfig-stage
inherit wrapper-stage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have already moved this commit to PR #14, so please drop it from this PR.

inherit libtool-stage
addtask stage

Expand Down
59 changes: 59 additions & 0 deletions classes/wrapper-stage.oeclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
## Class for packages depending on recipes having wrapper files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have already moved this commit to PR #14, so please drop it from this PR.

##
## Rewrites the paths in the wrapper files so that it contains valid dirs.

require conf/meta.conf

STAGE_FIXUP_FUNCS += "wrapper_stage_fixup"

WRAPPER_STAGE_DIRNAMES = "prefix exec_prefix bindir sbindir libdir \
includedir libexecdir datarootdir datadir sysconfdir sharedstatedir \
localstatedir infodir mandir"

# FIXME: add a method for packages providing wrapper files to specify which
# dirnames to fixup, so that fx. this installbuilddir could be provided by apr
# recipe, so that it does not impact metadata, and thus signature of all
# recipes.
WRAPPER_STAGE_DIRNAMES += "installbuilddir"

def wrapper_stage_fixup(d):
import stat

pkgmetadir = d.get("pkgmetadir").lstrip("/")
metafile_path = os.path.join(pkgmetadir, "wrapper").lstrip("/")
if not os.path.exists(metafile_path):
return
with open(metafile_path, "r") as metafile:
import string
wrapper_files = map(string.strip, metafile.readlines())
stage_dir = os.path.realpath(d.get("STAGE_DIR"))
pkg_type = d.get("STAGE_FIXUP_PKG_TYPE")
sysroot = os.path.join(stage_dir, pkg_type)
if pkg_type in ("native", "cross", "sdk-cross"):
dirname_prefix = "stage_"
elif pkg_type in ("sdk", "canadian-cross"):
dirname_prefix = "sdk_"
else:
dirname_prefix = "machine_"
dirnames = d.get("WRAPPER_STAGE_DIRNAMES").split()
dirpaths = {}
for dirname in dirnames:
dirpaths[dirname] = d.get(dirname_prefix + dirname)
for filename in wrapper_files:
print "fixing up wrapper file", filename
filename = filename.lstrip("/")
with open(filename, "r") as input_file:
wrapper_file = input_file.read()
for dirname in dirnames:
if dirpaths[dirname] is not None:
wrapper_file = re.sub(
re.compile("\$\{%s\}"%(dirname), re.MULTILINE),
r"%s%s"%(sysroot, dirpaths[dirname]),
wrapper_file)
with open(filename, "w") as output_file:
output_file.write(wrapper_file)
os.chmod(filename, stat.S_IRWXU|stat.S_IRWXG|stat.S_IROTH|stat.S_IXOTH)

# Local Variables:
# mode: python
# End:
55 changes: 55 additions & 0 deletions classes/wrapper.oeclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Class for packages having wrapper files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have already moved this commit to PR #14, so please drop it from this PR.

##
## Rewrites the paths in the wrapper files so that it contains valid dirs.

require conf/meta.conf

WRAPPER_FILES ?= "${bindir}/*"

DO_SPLIT_WRAPPER_FIXUP = ""
DO_SPLIT_WRAPPER_FIXUP:native = "do_split_wrapper_fixup"
do_split[postfuncs] += "${DO_SPLIT_WRAPPER_FIXUP}"
def do_split_wrapper_fixup(d):
pkgd = d.get("PKGD")
pkgmetadir = d.get("pkgmetadir").lstrip("/")
wrapper_globs = d.get("WRAPPER_FILES").lstrip("/").split()
os.chdir(pkgd)
for pkg in os.listdir("."):
os.chdir(os.path.join(pkgd, pkg))
wrapper_files = []
for wrapper_glob in wrapper_globs:
for wrapper_file in glob.glob(wrapper_glob.lstrip("/")):
wrapper_dotpath = "%s/.%s"%(os.path.dirname(wrapper_file), os.path.basename(wrapper_file))

wrapper_file_path = os.path.join(d.get("SRCDIR"), wrapper_file)
print wrapper_file_path
if os.path.isfile(wrapper_file_path):
print "wrapper file %s -> %s" % (wrapper_file, wrapper_dotpath)
wrapper_files.append("/" + wrapper_file)
with open(wrapper_file_path, "r") as input_file:
content = input_file.read()

os.rename(wrapper_file, wrapper_dotpath)
content = re.sub(
re.compile('\$\{realfile\}', re.MULTILINE),
r"%s"%("/" + wrapper_dotpath),
content)
content = re.sub(
re.compile('\$\{currentfile\}', re.MULTILINE),
r"%s"%("/" + wrapper_file),
content)

with open(wrapper_file, "w") as metafile:
metafile.write(content)

if not wrapper_files:
continue
print "wrapper files in package", pkg
oelite.util.makedirs(pkgmetadir)
metafile_path = os.path.join(pkgmetadir, "wrapper")
with open(metafile_path, "w") as metafile:
metafile.write("\n".join(wrapper_files) + "\n")

# Local Variables:
# mode: python
# End:
6 changes: 2 additions & 4 deletions conf/provided/minimal.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ native:librt native:libanl native:libBrokenLocale native:libnsl \
native:libmemusage native:libpcprofile native:libSegFault \
native:libnss_files native:libnss_dns native:libnss_compat \
native:libnss_nis native:libnss_nisplus native:libnss_hesiod \
native:m4 \
native:git native:cvs native:svn native:mercurial native:bzr \
native:autoconf native:automake native:gnu-config \
native:gzip native:tar native:xz \
native:gnu-config \
native:gzip native:zip native:unzip native:tar native:xz \
native:patch native:quilt native:diffstat \
native:perl native:perl-runtime \
native:python-runtime \
native:util-linux native:coreutils \
native:shasum \
native:flex native:bison \
native:gawk native:sed native:grep \
"
2 changes: 1 addition & 1 deletion recipes/bc/bc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ SRC_URI = "http://alpha.gnu.org/gnu/bc/bc-${PV}.tar.bz2"

inherit autotools

DEPENDS += "readline"
DEPENDS += "readline native:makeinfo"
EXTRA_OECONF += "--with-readline"
10 changes: 4 additions & 6 deletions recipes/binutils/binutils.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ BUGTRACKER = "http://sourceware.org/bugzilla/"

RECIPE_TYPES = "cross sdk-cross machine canadian-cross"

inherit autotools make-vpath gettext
inherit autotools make-vpath

require conf/fetch/gnu.conf
SRC_URI = "${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2 "

DEPENDS = "native:flex native:bison"
DEPENDS = "native:flex native:bison native:makeinfo native:m4"

C_DEPENDS_TARGET = ""

Expand All @@ -26,7 +26,7 @@ CHRPATH_TYPES = "HOST"

LIBTOOL_DEPENDS = "host-cross:libtool"

EXTRA_OECONF = "--enable-install-libbfd --enable-install-libiberty --enable-shared --enable-static --disable-multilib"
EXTRA_OECONF = "--enable-install-libbfd --enable-install-libiberty --enable-shared --enable-static --disable-multilib --disable-nls"
EXTRA_OECONF:>HOST_CPU_arm = " --disable-werror"

AR = "ar"
Expand Down Expand Up @@ -59,6 +59,7 @@ PACKAGEQA_HOST_LIBDIRS += "/${HOST_ARCH}/${TARGET_ARCH}/lib"

PACKAGES += "${PN}-libiberty ${PN}-libiberty-dev"
FILES_${PN}-libiberty = "${libdir}/libiberty.a"
FILES_${PN}-libiberty += "${libdir}64/libiberty.a"
FILES_${PN}-libiberty-dev = "${includedir}/libiberty.h"

FILES_${PN}-libopcodes-dev = "${AUTO_PACKAGE_LIBS_LIBDIR_PREFIX}${includedir}/dis-asm.h"
Expand Down Expand Up @@ -129,9 +130,6 @@ RDEPENDS_${PN}-strip = "libbfd"
RDEPENDS_${PN}-ar = "libbfd"
RDEPENDS_${PN}-strings = "libbfd"

# The binutils package is used to pull in all provided util features
RDEPENDS_${PN} = "${AUTO_PACKAGE_UTILS_PROVIDES}"

# We need to set a different priority than the highest gcc recipe priority, so
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mentioned earlier that this line was redundant. How is it that? How is all the auto-package-utils packages pulled in by RDEPENDS_${PN} without this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look the last 2 lines of this recipe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. Sorry about that :)

# that we don't get into multiple provider problems with libbfd.
DEFAULT_PREFERENCE = "2"
Expand Down
1 change: 1 addition & 0 deletions recipes/gcc/gcc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ PROVIDES_${PN}[qa] += "allow-missing-provides:liblto-plugin"
# Get rid of gcc-dev package
PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-locale ${PN}"
FILES_${PN} += "${libdir}/*.a"
FILES_${PN} += "${libdir}64/*.a"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this commit to separate commit (together with the similar binutils commit).

We need to investigate what is going on here, but let's avoid blocking the rest of this PR by that.


inherit auto-package-utils
AUTO_PACKAGE_UTILS = "cpp g++ gcov"
Expand Down
2 changes: 1 addition & 1 deletion recipes/gmp/gmp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RECIPE_TYPES = "native machine sdk"
require conf/fetch/gnu.conf
SRC_URI = "${GNU_MIRROR}/gmp/gmp-${PV}.tar.xz"

DEPENDS = "native:gawk libm"
DEPENDS = "native:m4 native:gawk libm"

inherit autotools c++ make-vpath

Expand Down
11 changes: 11 additions & 0 deletions recipes/libtool/libtool-2.4.2.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
LICENSE = "GPL-2.0+"
LICENSE_${PN}-libltdl = "LGPL-2.1+"

require ${PN}.inc

SRC_URI:>native = " file://syslib.patch"
SRC_URI:>cross = " file://syslib.patch file://cross_compile.patch ${SRC_URI_WINDOWS}"
SRC_URI:>sdk-cross = " file://syslib.patch file://cross_compile.patch ${SRC_URI_WINDOWS}"

SRC_URI_WINDOWS = ""
SRC_URI_WINDOWS:TARGET_LIBC_mingw = "file://default-bindir.patch"
43 changes: 43 additions & 0 deletions recipes/libtool/libtool-2.4.2/cross_compile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff -urN a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
--- a/libltdl/config/ltmain.m4sh 2011-10-17 12:17:05.000000000 +0200
+++ b/libltdl/config/ltmain.m4sh 2013-10-22 17:50:24.921016169 +0200
@@ -5731,8 +5731,9 @@
absdir="$abs_ladir"
libdir="$abs_ladir"
else
- dir="$lt_sysroot$libdir"
- absdir="$lt_sysroot$libdir"
+ dir="$abs_ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
@@ -6130,8 +6131,6 @@
add="$libdir/$linklib"
fi
else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -6286,7 +6285,17 @@
fi
;;
*)
- path="-L$absdir/$objdir"
+ # OE sets installed=no in staging. We need to look in $objdir and $absdir,
+ # preferring $objdir. RP 31/04/2008
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ path="-L$absdir/$objdir"
+ elif test -f "$absdir/$depdepl" ; then
+ depdepl="$absdir/$depdepl"
+ path="-L$absdir"
+ else
+ path="-L$absdir/$objdir"
+ fi
;;
esac
else
24 changes: 24 additions & 0 deletions recipes/libtool/libtool-2.4.2/default-bindir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff -urN libtool-2.2.10~orig/libltdl/config/ltmain.m4sh libtool-2.2.10/libltdl/config/ltmain.m4sh
--- libtool-2.2.10~orig/libltdl/config/ltmain.m4sh 2010-06-09 15:06:43.000000000 +0200
+++ libtool-2.2.10/libltdl/config/ltmain.m4sh 2014-01-31 18:35:15.542467485 +0100
@@ -3790,7 +3790,7 @@
new_inherited_linker_flags=

avoid_version=no
- bindir=
+ bindir=$libtool_bindir
dlfiles=
dlprefiles=
dlself=no
diff -urN libtool-2.2.10~orig/libltdl/config/ltmain.sh libtool-2.2.10/libltdl/config/ltmain.sh
--- libtool-2.2.10~orig/libltdl/config/ltmain.sh 2010-06-09 15:08:53.000000000 +0200
+++ libtool-2.2.10/libltdl/config/ltmain.sh 2014-01-31 18:36:05.278466455 +0100
@@ -4386,7 +4386,7 @@
new_inherited_linker_flags=

avoid_version=no
- bindir=
+ bindir=$libtool_bindir
dlfiles=
dlprefiles=
dlself=no
30 changes: 30 additions & 0 deletions recipes/libtool/libtool-2.4.2/syslib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff -urN a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
--- a/libltdl/config/ltmain.m4sh 2011-10-17 12:17:05.000000000 +0200
+++ b/libltdl/config/ltmain.m4sh 2014-04-02 23:19:35.179802667 +0200
@@ -5397,9 +5397,9 @@
func_stripname '-l' '' "$deplib"
name=$func_stripname_result
if test "$linkmode" = lib; then
- searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs"
else
- searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ searchdirs="$newlib_search_path $lib_search_path"
fi
for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
diff -urN a/libltdl/config/ltmain.sh b/libltdl/config/ltmain.sh
--- a/libltdl/config/ltmain.sh 2011-10-17 12:19:35.000000000 +0200
+++ b/libltdl/config/ltmain.sh 2014-04-02 23:19:20.428198693 +0200
@@ -6184,9 +6184,9 @@
func_stripname '-l' '' "$deplib"
name=$func_stripname_result
if test "$linkmode" = lib; then
- searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs"
else
- searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ searchdirs="$newlib_search_path $lib_search_path"
fi
for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
4 changes: 4 additions & 0 deletions recipes/libtool/libtool-initial_2.4.2.oe
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PN = "libtool"
require ${PN}-${PV}.inc

RECIPE_TYPES = "native"
1 change: 1 addition & 0 deletions recipes/libtool/libtool-initial_2.4.2.oe.sig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22b71a8b5ce3ad86e1094e7285981cae10e6ff88 libtool-2.4.2.tar.gz
Loading