移植tslib到Android

环境变量

export  env
export TSLIB_TSEVENTTYPE=INPUT
export TSLIB_TSDEVICE=/dev/input/event4
export TSLIB_CALIBFILE=/system/etc/pointercal
export TSLIB_CONFFILE=/system/etc/ts.conf
export TSLIB_PLUGINDIR=/system/lib/ts/plugs
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_CONSOLEDEVICE=none
export TSTS_INFO_FILE=/sys/devices/virtual/input/input1/uevent
export QWS_MOUSE_PROTO=tslib:/dev/input/event4

交叉编译过程中的问题

arm-eabi/bin/ld: crt0.o: No such file: No such file or directory
解决:configure加 CFLAGS="-nostdlib"

我的Android.mk ,测试通过

LOCAL_PATH:=$(call my-dir)
include $(CLEAR_VARS)
TSLIB_PLUGINDIR:=/system/lib/ts/plugins
LOCAL_SRC_FILES:=\
        src/ts_attach.c\
        src/ts_close.c \
        src/ts_config.c \
        src/ts_error.c \
        src/ts_fd.c \
        src/ts_load_module.c \
        src/ts_open.c \
        src/ts_parse_vars.c \
        src/ts_read.c \
        src/ts_option.c \
        src/ts_read_raw.c \

LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/ \
        /usr/include/
LOCAL_SHARED_LIBRARIES += libdl
LOCAL_MODULE := libts
include $(BUILD_SHARED_LIBRARY)
#
# plugin: input-raw
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := plugins/input-raw.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts/plugins/input-raw
include $(BUILD_SHARED_LIBRARY)
#
# plugin: pthres
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := plugins/pthres.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts/plugins/pthres
include $(BUILD_SHARED_LIBRARY)
#
# plugin: linear
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := plugins/linear.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts/plugins/linear
include $(BUILD_SHARED_LIBRARY)
#
# plugin: dejitter
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := plugins/dejitter.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts/plugins/dejitter
include $(BUILD_SHARED_LIBRARY)
#
# plugin: variance
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := plugins/variance.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts/plugins/variance
include $(BUILD_SHARED_LIBRARY)
#
# ts_calibrate
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := tests/testutils.c \
        tests/fbutils.c \
        tests/font_8x8.c \
        tests/ts_calibrate.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/ \
        tests/ts_calibrate.h \
        /usr/include/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts_calibrate
include $(BUILD_EXECUTABLE)
#
# ts_test
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := tests/testutils.c \
        tests/fbutils.c \
        tests/font_8x8.c \
        tests/ts_test.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/ \
        /usr/include/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts_test
include $(BUILD_EXECUTABLE)
#
# ts_print
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := tests/testutils.c \
        tests/fbutils.c \
        tests/font_8x8.c \
        tests/ts_print.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/ \
        /usr/include/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts_print
include $(BUILD_EXECUTABLE)
#
# ts_print_raw
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := tests/testutils.c \
        tests/fbutils.c \
        tests/font_8x8.c \
        tests/ts_print_raw.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/ \
        /usr/include/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts_print_raw
include $(BUILD_EXECUTABLE)
#
# ts_harvest
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := tests/testutils.c \
        tests/fbutils.c \
        tests/font_8x8.c \
        tests/ts_harvest.c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src/ \
        /usr/include/
LOCAL_SHARED_LIBRARIES := libdl \
        libts
LOCAL_MODULE := ts_harvest
include $(BUILD_EXECUTABLE)