diff options
Diffstat (limited to 'meta-oe/classes/waf-samba.bbclass')
-rw-r--r-- | meta-oe/classes/waf-samba.bbclass | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/meta-oe/classes/waf-samba.bbclass b/meta-oe/classes/waf-samba.bbclass index a8b3b9529..45fbcc342 100644 --- a/meta-oe/classes/waf-samba.bbclass +++ b/meta-oe/classes/waf-samba.bbclass | |||
@@ -20,7 +20,38 @@ CONFIGUREOPTS = " --prefix=${prefix} \ | |||
20 | --mandir=${mandir} \ | 20 | --mandir=${mandir} \ |
21 | " | 21 | " |
22 | 22 | ||
23 | # Three methods for waf cross compile: | ||
24 | # 1. answers: | ||
25 | # Only --cross-answers - try the cross-answers file, and if | ||
26 | # there's no corresponding answer, add to the file and mark | ||
27 | # the configure process as unfinished. | ||
28 | # 2. exec: | ||
29 | # Only --cross-execute - get the answer from cross-execute, | ||
30 | # an emulator (qemu) is used to run cross-compiled binaries. | ||
31 | # 3. both: | ||
32 | # (notes: not supported in lower version of some packages, | ||
33 | # please check buildtools/wafsamba/samba_cross.py in the | ||
34 | # package source) | ||
35 | # Try the cross-answers file first, and if there is no | ||
36 | # corresponding answer, use cross-execute to get an answer, | ||
37 | # and add that answer to the file. | ||
38 | # | ||
39 | # The first one is preferred since it may fail with 2 or 3 if | ||
40 | # the target board is not suported by qemu, but we can use 2 or 3 | ||
41 | # to help generate the cross answer when adding new board support. | ||
42 | CROSS_METHOD ?= "answer" | ||
43 | |||
23 | do_configure() { | 44 | do_configure() { |
45 | |||
46 | # Prepare the cross-answers file | ||
47 | CROSS_ANSWERS="${B}/cross-answers-${TARGET_ARCH}.txt" | ||
48 | if [ -e ${CROSS_ANSWERS} ]; then | ||
49 | rm -f ${CROSS_ANSWERS} | ||
50 | fi | ||
51 | echo 'Checking uname machine type: "${TARGET_ARCH}"' >> ${CROSS_ANSWERS} | ||
52 | echo 'Checking uname release type: "${OLDEST_KERNEL}"' >> ${CROSS_ANSWERS} | ||
53 | cat ${WAF_CROSS_ANSWERS_PATH}/cross-answers-${TARGET_ARCH}.txt >> ${CROSS_ANSWERS} | ||
54 | |||
24 | qemu_binary="${@qemu_target_binary(d)}" | 55 | qemu_binary="${@qemu_target_binary(d)}" |
25 | if [ "${qemu_binary}" = "qemu-allarch" ]; then | 56 | if [ "${qemu_binary}" = "qemu-allarch" ]; then |
26 | qemu_binary="qemuwrapper" | 57 | qemu_binary="qemuwrapper" |
@@ -42,7 +73,17 @@ do_configure() { | |||
42 | export STAGING_INCDIR=${STAGING_INCDIR} | 73 | export STAGING_INCDIR=${STAGING_INCDIR} |
43 | export PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} | 74 | export PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} |
44 | 75 | ||
45 | ./configure ${CONFIGUREOPTS} ${EXTRA_OECONF} --cross-compile --cross-execute="${CROSS_EXEC}" | 76 | CONFIG_CMD="./configure ${CONFIGUREOPTS} ${EXTRA_OECONF} --cross-compile" |
77 | if [ "${CROSS_METHOD}" = "answer" ]; then | ||
78 | ${CONFIG_CMD} --cross-answers="${CROSS_ANSWERS}" | ||
79 | elif [ "${CROSS_METHOD}" = "exec" ]; then | ||
80 | ${CONFIG_CMD} --cross-exec="${CROSS_EXEC}" | ||
81 | elif [ "${CROSS_METHOD}" = "both" ]; then | ||
82 | ${CONFIG_CMD} --cross-answers="${CROSS_ANSWERS}" --cross-exec="${CROSS_EXEC}" | ||
83 | else | ||
84 | echo "ERROR: ${CROSS_METHOD} is not valid for cross-compile!" | ||
85 | exit 1 | ||
86 | fi | ||
46 | } | 87 | } |
47 | 88 | ||
48 | do_compile () { | 89 | do_compile () { |