Sys / fcntl.h: no such file when pcsclite cross-compiled for Android?

everything: I am making an Android application that can commnicate with ccid a smart card reader from android mobile, I chose this path: "pcsc-lite-1.8.5 + ccid-1.4.7 + libusb-1.0.3", which works Ubuntu (Linux OS on PC) is very good. then I tried to transfer them to android, there are a lot of problems when cross-compiling. most of these problems are that the Android Bionic library lacks headers and functions, for example:

  • sys / fcntl.h, mqueue.h: no such file;

  • pthread_cancel: undefined link;

and now when I cross-compile pcsclite to create the pccd executable, I got this error:

sd-daemon.c: 35: 23: fatal error: sys / fcntl.h: no such file or directory

Android.mk:

#=================================================== # ****** pcscd ****** #=================================================== include $(CLEAR_VARS) LOCAL_PRELINK_MODULE:=false LOCAL_SRC_FILES:=atrhandler.c \ debuglog.c \ dyn_hpux.c \ dyn_macosx.c \ dyn_unix.c \ eventhandler.c \ hotplug_generic.c \ ifdwrapper.c \ pcscdaemon.c \ powermgt_generic.c \ prothandler.c \ readerfactory.c \ simclist.c \ strlcat.c \ sys_unix.c \ tokenparser.c \ hotplug_libudev.c \ hotplug_libusb.c \ hotplug_linux.c \ hotplug_macosx.c \ utils.c \ winscard.c \ winscard_msg.c \ winscard_msg_srv.c \ winscard_svc.c \ sd-daemon.c LOCAL_CFLAGS+= -DHAVE_LIBUSB LOCAL_C_INCLUDES+=$(LOCAL_PATH)/ $(LOCAL_PATH)/src/ $(HOME)/android-ndk-r8b/samples/includes-libusb1.0.3/ $(LOCAL_PATH)/PCSC/ LOCAL_LDFLAGS:=-shared LOCAL_MODULE:=pcscd LOCAL_LDLIBS:=-llog $(HOME)/android-ndk-r8b/samples/libs-libusb1.0.3/libusb-1.0.so include $(BUILD_EXECUTABLE) 
+7
source share
1 answer

Many of the Android headers are not in the standard layout. You can use the following command to search for the NDK to locate the missing find . -name fcntl.h files find . -name fcntl.h find . -name fcntl.h . It looks like include <sys/fcntl.h> needs to be changed to include <fcntl.h> .

There is no pthread_cancel Android library pthread see "docs / OVERVIEW.html". It is easy to replace pthread_cancel .

I'm not sure what to do with mqueue .

+8
source

All Articles