Makefile: add meta-qt4
[opendreambox.git] / cross-compile.env
1 #!/bin/bash
2
3 oe_set_aliases()
4 {
5         local SCRIPT="${BASH_SOURCE[0]}"
6         if [ -z "${SCRIPT}" ]; then
7                 echo "Could not determine script location! Not using bash?"
8                 return
9         fi
10         while [ -h "${SCRIPT}" ]; do
11                 SCRIPT="$(readlink "${SCRIPT}")"
12         done
13
14         local SCRIPTDIR="$(cd -P `dirname "${SCRIPT}"` && pwd)"
15         local MACHINE="$1"
16         local MACHINE_ENV=".cross-compile-${MACHINE}.env"
17         local MAKE=${MAKE:-make}
18
19         ${MAKE} -C "${SCRIPTDIR}" -s MACHINE=${MACHINE} ${MACHINE_ENV} || return
20         . ${SCRIPTDIR}/${MACHINE_ENV} || return
21
22         PATH="${STAGING_BINDIR_NATIVE}/python-native:${PATH}"
23
24         local OE_ENV=" \
25                 BUILD_SYS=\"${BUILD_SYS}\" \
26                 HOST_SYS=\"${HOST_SYS}\" \
27                 STAGING_LIBDIR=\"${STAGING_LIBDIR}\" \
28                 STAGING_INCDIR=\"${STAGING_INCDIR}\" \
29                 PATH=\"${PATH}\" \
30                 CC=\"${CC}\" \
31                 CXX=\"${CXX}\" \
32                 F77=\"${F77}\" \
33                 CPP=\"${CPP}\" \
34                 LD=\"${LD}\" \
35                 CCLD=\"${CCLD}\" \
36                 AR=\"${AR}\" \
37                 AS=\"${AS}\" \
38                 RANLIB=\"${RANLIB}\" \
39                 STRIP=\"${STRIP}\" \
40                 OBJCOPY=\"${OBJCOPY}\" \
41                 OBJDUMP=\"${OBJDUMP}\" \
42                 NM=\"${NM}\" \
43                 PKG_CONFIG_DIR=\"${PKG_CONFIG_DIR}\" \
44                 PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}\" \
45                 PKG_CONFIG_LIBDIR=\"${PKG_CONFIG_LIBDIR}\" \
46                 PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" \
47                 PKG_CONFIG_DISABLE_UNINSTALLED=\"${PKG_CONFIG_DISABLE_UNINSTALLED}\" \
48         "
49
50         local OE_ENV_KERNEL=" \
51                 PATH=\"${PATH}\" \
52                 CROSS_COMPILE=\"${HOST_PREFIX}\" \
53                 KCFLAGS=--sysroot=${STAGING_DIR_HOST} \
54         "
55
56         echo "Creating shell command aliases:"
57         echo "* oe_autoreconf"
58         alias oe_autoreconf="${OE_ENV} autoreconf -Wcross --verbose --install --force --exclude=autopoint"
59
60         echo "* oe_runconf"
61         alias oe_runconf=" \
62                 ./configure \
63                         --build=${BUILD_SYS} \
64                         --host=${HOST_SYS} \
65                         --target=${TARGET_SYS} \
66                         --prefix=${prefix} \
67                         --exec_prefix=${exec_prefix} \
68                         --bindir=${bindir} \
69                         --sbindir=${sbindir} \
70                         --libexecdir=${libexecdir} \
71                         --datadir=${datadir} \
72                         --sysconfdir=${sysconfdir} \
73                         --sharedstatedir=${sharedstatedir} \
74                         --localstatedir=${localstatedir} \
75                         --libdir=${libdir} \
76                         --includedir=${includedir} \
77                         --oldincludedir=${oldincludedir} \
78                         --infodir=${infodir} \
79                         --mandir=${mandir} \
80                         --with-libtool-sysroot=${STAGING_DIR_HOST} \
81                         ${OE_ENV} \
82         "
83
84         echo "* oe_runmake"
85         alias oe_runmake="${OE_ENV} ${MAKE} ${PARALLEL_MAKE}"
86
87         echo "* oe_runmake_kernel"
88         alias oe_runmake_kernel="${OE_ENV_KERNEL} ${MAKE} ${PARALLEL_MAKE}"
89
90         echo "* oe_env"
91         alias oe_env="${OE_ENV}"
92
93         echo "* oe_env_kernel"
94         alias oe_env_kernel="${OE_ENV_KERNEL}"
95
96         echo "* oe_setenv"
97         alias oe_setenv="export ${OE_ENV}"
98
99         echo "* oe_setenv_kernel"
100         alias oe_setenv_kernel="export ${OE_ENV_KERNEL}"
101 }
102
103 if [ $# -ne 1 ]; then
104         echo "usage: . ${BASH_SOURCE[0]} \${MACHINE}"
105 else
106         oe_set_aliases $1
107 fi