tslib1.4 compilation process
./autogen.sh
echo "Ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
# set Target model, buffer, installation path
./configure--host=arm-linux--cache-file=arm-linux.cache--prefix=/opt/tslib
Make
# If the target path does not have permissions, add sudo
Make install
Errors that may be encountered
In file included from/usr/include/fcntl.h:252:0,
From/usr/include/sys/fcntl.h:1,
From ts_calibrate.c:20:
In function ' open ',
inlined from ' main ' at Ts_calibrate.c:227:11:
/usr/include/bits/fcntl2.h:51:24:error:call to ' __open_missing_mode ' declared with attribute Error:open with O_CREAT in Second argument needs 3 arguments
In function ' open ',
inlined from ' main ' at Ts_calibrate.c:229:11:
/usr/include/bits/fcntl2.h:51:24:error:call to ' __open_missing_mode ' declared with attribute Error:open with O_CREAT in Second argument needs 3 arguments
MAKE[2]: * * * [TS_CALIBRATE.O] Error 1
MAKE[2]: Leaving directory '/home/ouyang/downloads/tslib/tests '
MAKE[1]: * * * [all-recursive] Error 1
MAKE[1]: Leaving directory '/home/ouyang/downloads/tslib '
Make: * * * [ALL] Error 2
New version of GCC compiler is strict with syntax checking in source files./tests/ts_calibrate.c
source file
if ((Calfile = getenv ("Tslib_calibfile")) = = NULL) {
cal_fd = open (Calfile, O_creat | O_RDWR);
} else {
cal_fd = open ("/etc/pointercal", O_creat | O_RDWR);
// }
Needs to be changed into the following form
if ((Calfile = getenv ("Tslib_calibfile")) = = NULL) {
CAL_FD = open (Calfile, O_creat | O_rdwr, 0777);
} else {
CAL_FD = open ("/etc/pointercal", O_creat | O_rdwr, 0777);
}
Save and recompile
tslib1.4 compilation process ' __open_missing_mode ' ERROR