[oe] Writing a test program for libserial
Elvis Dowson
elvis.dowson at mac.com
Sun Jun 21 07:57:31 UTC 2009
Hi,
I found out the reason for the linker error. It was quite silly
actually. The lib prefix is automatically pre-pended, so I just had to
specify
LDFLAGS_append += "-lserial"
Thats it!
Here is the full recipe for the test program. Could someone please
comment on this recipe? Am I using the right OE functions, etc?
libserial-test_1.6.0.bb
DESCRIPTION = "Serial port test programs for libserial"
SECTION = "bin"
LICENSE = "GPL"
DEPENDS = "libserial"
LDFLAGS_append += "-lserial"
SRC_URI = " \
file://read_port.cpp \
file://write_port.cpp \
"
S = "${WORKDIR}"
inherit autotools_stage
AUTOTOOLS_STAGE_PKGCONFIG = 1
do_stage() {
autotools_stage_all
}
do_compile () {
# oe_runmake CC="${CC}" CXX="${CXX}" CFLAGS="-O3 ${CFLAGS}"
CXXFLAGS="${CXXFLAGS}" LD="${LD}" LDFLAGS="${LDFLAGS}
${CXX} ${CXXFLAGS} ${LDFLAGS} ${WORKDIR}/read_port.cpp -o libserial-
test-read-port
${CXX} ${CXXFLAGS} ${LDFLAGS} ${WORKDIR}/write_port.cpp -o
libserial-test-write-port
}
do_install () {
install -m 0755 -d ${D}${bindir}
install -m 0644 ${S}/libserial-test-read-port ${D}${bindir}
install -m 0644 ${S}/libserial-test-write-port ${D}${bindir}
}
Best regards,
Elvis
More information about the Openembedded-devel
mailing list