increase dvbapp PR.
[vuplus_openembedded] / recipes / libffi / libffi_2.0+gcc4.3.2.bb
1 require recipes/gcc/gcc-common.inc
2 SECTION = "libs"
3 DESCRIPTION = "Foreign Function Interface library"
4 LICENSE = "libffi"
5 PRIORITY = "optional"
6
7 inherit autotools gettext
8
9 PR = "r1"
10
11 PACKAGES = "${PN}-dbg ${PN} ${PN}-dev"
12
13 FILES_${PN} = "${libdir}/libffi.so.*"
14
15 FILES_${PN}-dev = "${includedir}/${TARGET_SYS}/ffi* \
16                    ${libdir}/libffi.a \
17                    ${libdir}/libffi.la \
18                    ${libdir}/libffi.so"
19
20 GCC_VER = "${@bb.data.getVar('PV',d,1).split('gcc')[1]}"
21
22 SRC_URI = "${GNU_MIRROR}/gcc/gcc-${GCC_VER}/gcc-${GCC_VER}.tar.bz2 \
23            "
24
25 MIRRORS_prepend () {
26 ${GNU_MIRROR}/gcc/      http://gcc.get-software.com/releases/
27 ${GNU_MIRROR}/gcc/      http://mirrors.rcn.net/pub/sourceware/gcc/releases/
28 }
29
30 S = "${WORKDIR}/gcc-${GCC_VER}/libffi"
31 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
32
33 EXTRA_OECONF = "--with-gnu-ld \
34                 --enable-shared \
35                 --enable-target-optspace \
36                 --enable-languages=c,c++,f77 \
37                 --enable-threads=posix \
38                 --enable-multilib \
39                 --enable-c99 \
40                 --enable-long-long \
41                 --enable-symvers=gnu \
42                 --program-prefix=${TARGET_PREFIX} \
43                 ${EXTRA_OECONF_FPU} \
44                 ${EXTRA_OECONF_PATHS}"
45
46 EXTRA_OECONF_PATHS = "--with-local-prefix=${prefix}/local \
47                       --with-gxx-include-dir=${includedir}/c++/${PV}"
48
49 # Build uclibc compilers without cxa_atexit support
50 EXTRA_OECONF_append_linux               = " --enable-__cxa_atexit"
51 EXTRA_OECONF_append_linux-gnueabi       = " --enable-__cxa_atexit"
52 EXTRA_OECONF_append_linux-uclibc        = " --disable-__cxa_atexit"
53 EXTRA_OECONF_append_linux-uclibceabi    = " --disable-__cxa_atexit"
54 EXTRA_OECONF_FPU = "${@get_gcc_fpu_setting(bb, d)}"
55
56 #Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
57 TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
58 TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
59
60
61 do_configure () {
62         (cd ${S}/.. && gnu-configize) || die "failure running gnu-configize"
63         oe_runconf
64 }
65
66 do_install_append() {
67         install_libffi_headers
68 }
69
70 # Separate function which can be disabled in the -native recipe.
71 install_libffi_headers() {
72         # follow Debian and move this to $includedir/${TARGET_SYS}
73         install -d ${D}${includedir}/${TARGET_SYS}
74         mv ${D}${libdir}/gcc/${TARGET_SYS}/${GCC_VER}/include/ffitarget.h ${D}${includedir}/${TARGET_SYS}
75         mv ${D}${libdir}/gcc/${TARGET_SYS}/${GCC_VER}/include/ffi.h ${D}${includedir}/${TARGET_SYS}
76 }
77
78 ffi_include = "ffi.h ffitarget.h"
79
80 do_stage () {
81         oe_libinstall -so -C .libs libffi ${STAGING_LIBDIR}
82
83         mkdir -p ${STAGING_INCDIR}/
84         for i in ${ffi_include}; do
85                 install -m 0644 include/$i ${STAGING_INCDIR}/
86         done
87 }