玩转mini2440开发板之【在Ubuntu 14.04下编译安装tslib 1.4版本】
今天在研究mini2440的QT程序時,發現缺少tslib,于是想辦法安裝。
一開始想直接去tslib官網上下載最新版本的,但是編譯時發現無法通過,于是只好按照大多數網友的做法,取了一個最成熟最穩定的版本(1.4版)來使用。步驟記錄如下:
1、準備工作
首先執行以下命令,確認tslib所需的各個庫都已正常安裝。
# apt-get install autoconf # apt-get install automake # apt-get install libtool2、下載源碼
這里我使用的是CSDN網友上傳的版本,經測試在我本人的開發環境下(64位Ubuntu 14.04)是可用的,大家自行下載即可(https://download.csdn.net/download/devil_box/9544319)。
3、配置編譯
下載完后解壓,進入該目錄,按順序執行以下命令:
./autogen-clean.sh ./autogen.sh ./configure --host=arm-linux ac_cv_func_malloc_0_nonnull=yes --cache-file=arm-linux-.cache --prefix=/usr/local/tslib/ make sudo make install注1:“–host=arm-linux”語句的作用就是指定目標系統的編譯器。因為我使用的是友善之臂官方發布的arm-linux-gcc 4.4.3,安裝在/opt/FiendyARM/toolschain目錄下,且已加入了環境變量,所以這里可以使用這個語句進行定義。
注2、”–prefix=/usr/local/tslib/“語句的作用是為了指定最后tslib的安裝位置。查閱資料的過程中,發現部分網友將這個目錄改成了別的目錄,雖然最后的編譯和安裝都能成功,但是根據部分網絡上的資料顯示,會對后續的使用帶來一些麻煩。因此還是建議大家老老實實的使用推薦的目錄,也就是我這里使用的這個目錄(/usr/local/tslib/)。
注3:這里記錄一下我的配置和編譯過程,以便有需要的同學可以參考:
3.1、清理
leon@Ubuntu:~/tslib$ ./autogen-clean.sh Removing autogenned files... Done.3.2、生成
leon@Ubuntu:~/tslib$ ./autogen.sh libtoolize: putting auxiliary files in `.'. libtoolize: copying file `./ltmain.sh' libtoolize: putting macros in `m4/internal'. libtoolize: copying file `m4/internal/libtool.m4' libtoolize: copying file `m4/internal/ltoptions.m4' libtoolize: copying file `m4/internal/ltsugar.m4' libtoolize: copying file `m4/internal/ltversion.m4' libtoolize: copying file `m4/internal/lt~obsolete.m4' libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree. configure.ac:19: installing './compile' configure.ac:28: installing './config.guess' configure.ac:28: installing './config.sub' configure.ac:7: installing './install-sh' configure.ac:7: installing './missing' plugins/Makefile.am:14: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') plugins/Makefile.am: installing './depcomp' tests/Makefile.am:13: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')3.3、配置
leon@Ubuntu:~/tslib$ ./configure --host=arm-linux ac_cv_func_malloc_0_nonnull=yes --cache-file=arm-linux-.cache --prefix=/usr/local/tslib/ configure: creating cache arm-linux-.cache checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-linux-strip... arm-linux-strip checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for arm-linux-g++... arm-linux-g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... yes checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether arm-linux-g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of arm-linux-g++... gcc3 checking for arm-linux-gcc... arm-linux-gcc checking whether we are using the GNU C compiler... yes checking whether arm-linux-gcc accepts -g... yes checking for arm-linux-gcc option to accept ISO C89... none needed checking whether arm-linux-gcc understands -c and -o together... yes checking dependency style of arm-linux-gcc... gcc3 checking how to run the C preprocessor... arm-linux-gcc -E checking whether the C compiler supports -fvisibility=hidden... yes checking whether to use -fvisibility=hidden... yes checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking build system type... x86_64-unknown-linux-gnu checking host system type... arm-unknown-linux-gnu checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by arm-linux-gcc... /opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin/ld checking if the linker (/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-nm -B checking the name lister (/opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-nm -B) interface... BSD nm checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-unknown-linux-gnu file names to arm-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin/ld option to reload object files... -r checking for arm-linux-objdump... arm-linux-objdump checking how to recognize dependent libraries... pass_all checking for arm-linux-dlltool... no checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for arm-linux-ar... arm-linux-ar checking for archiver @FILE support... @ checking for arm-linux-strip... (cached) arm-linux-strip checking for arm-linux-ranlib... arm-linux-ranlib checking command to parse /opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-nm -B output from arm-linux-gcc object... ok checking for sysroot... no checking for arm-linux-mt... no checking for mt... mt configure: WARNING: using cross tools not prefixed with host triplet checking if mt is a manifest tool... no checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if arm-linux-gcc supports -fno-rtti -fno-exceptions... no checking for arm-linux-gcc option to produce PIC... -fPIC -DPIC checking if arm-linux-gcc PIC flag -fPIC -DPIC works... yes checking if arm-linux-gcc static flag -static works... yes checking if arm-linux-gcc supports -c -o file.o... yes checking if arm-linux-gcc supports -c -o file.o... (cached) yes checking whether the arm-linux-gcc linker (/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for shl_load... no checking for shl_load in -ldld... no checking for dlopen... no checking for dlopen in -ldl... yes checking whether a program can dlopen itself... cross checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking how to run the C++ preprocessor... arm-linux-g++ -E checking for ld used by arm-linux-g++... /opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin/ld checking if the linker (/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes checking whether the arm-linux-g++ linker (/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes checking for arm-linux-g++ option to produce PIC... -fPIC -DPIC checking if arm-linux-g++ PIC flag -fPIC -DPIC works... yes checking if arm-linux-g++ static flag -static works... yes checking if arm-linux-g++ supports -c -o file.o... yes checking if arm-linux-g++ supports -c -o file.o... (cached) yes checking whether the arm-linux-g++ linker (/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for dlopen in -ldl... (cached) yes checking for size_t... yes checking for working alloca.h... yes checking for alloca... yes checking for ANSI C header files... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking for an ANSI C-conforming const... yes checking for inline... inline checking for size_t... (cached) yes checking whether time.h and sys/time.h may both be included... yes checking whether arm-linux-gcc needs -traditional... no checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... (cached) yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for sys/param.h... yes checking for getpagesize... yes checking for working mmap... no checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking types of arguments for select... int,fd_set *,struct timeval * checking return type of signal handlers... void checking whether lstat correctly handles trailing slash... no checking whether stat accepts an empty string... yes checking for vprintf... yes checking for _doprnt... no checking for bzero... yes checking for gettimeofday... yes checking for memmove... yes checking for memset... yes checking for munmap... yes checking for select... yes checking for strcasecmp... yes checking for strchr... yes checking for strdup... yes checking for strtoul... yes checking whether linear modules is requested... yes checking whether dejitter module is requested... yes checking whether linear-h2200 module is requested... yes checking whether variance module is requested... yes checking whether pthres module is requested... yes checking whether ucb1x00 module is requested... yes checking whether corgi module is requested... yes checking whether collie module is requested... yes checking whether h3600 module is requested... yes checking whether mk712 module is requested... yes checking whether arctic2 module is requested... yes checking whether input module is requested... yes checking where to place modules... ${libdir}/ts/ checking whether to enable debugging... no configure: updating cache arm-linux-.cache checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating etc/Makefile config.status: creating plugins/Makefile config.status: creating src/Makefile config.status: creating tests/Makefile config.status: creating tslib-0.0.pc config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands3.4、編譯
leon@Ubuntu:~/tslib$ make > make.log linear.c: In function 'linear_xyswap': linear.c:86: warning: unused parameter 'str' linear.c:86: warning: unused parameter 'data' linear.c: In function 'mod_init': linear.c:101: warning: unused parameter 'dev' dejitter.c: In function 'mod_init': dejitter.c:200: warning: unused parameter 'dev' variance.c: In function 'mod_init': variance.c:164: warning: unused parameter 'dev' pthres.c: In function 'mod_init': pthres.c:134: warning: unused parameter 'dev' ucb1x00-raw.c: In function 'ucb1x00_read': ucb1x00-raw.c:25: warning: unused variable 'nr' ucb1x00-raw.c:21: warning: unused variable 'total' ucb1x00-raw.c: In function 'mod_init': ucb1x00-raw.c:52: warning: unused parameter 'dev' ucb1x00-raw.c:52: warning: unused parameter 'params' corgi-raw.c: In function 'corgi_read': corgi-raw.c:24: warning: unused variable 'nr' corgi-raw.c:20: warning: unused variable 'total' corgi-raw.c: In function 'mod_init': corgi-raw.c:50: warning: unused parameter 'dev' corgi-raw.c:50: warning: unused parameter 'params' collie-raw.c: In function 'collie_read': collie-raw.c:24: warning: unused variable 'nr' collie-raw.c:20: warning: unused variable 'total' collie-raw.c: In function 'mod_init': collie-raw.c:51: warning: unused parameter 'dev' collie-raw.c:51: warning: unused parameter 'params' h3600-raw.c: In function 'h3600_read': h3600-raw.c:24: warning: unused variable 'nr' h3600-raw.c:20: warning: unused variable 'total' h3600-raw.c: In function 'mod_init': h3600-raw.c:50: warning: unused parameter 'dev' h3600-raw.c:50: warning: unused parameter 'params' mk712-raw.c: In function 'mk712_read': mk712-raw.c:24: warning: unused variable 'nr' mk712-raw.c:20: warning: unused variable 'total' mk712-raw.c: In function 'mod_init': mk712-raw.c:53: warning: unused parameter 'dev' mk712-raw.c:53: warning: unused parameter 'params' arctic2-raw.c: In function 'arctic2_read': arctic2-raw.c:25: warning: unused variable 'nr' arctic2-raw.c:21: warning: unused variable 'total' arctic2-raw.c: In function 'mod_init': arctic2-raw.c:51: warning: unused parameter 'dev' arctic2-raw.c:51: warning: unused parameter 'params' linear-h2200.c: In function 'mod_init': linear-h2200.c:109: warning: unused parameter 'dev' linear-h2200.c:109: warning: unused parameter 'params' input-raw.c: In function 'mod_init': input-raw.c:234: warning: unused parameter 'dev' input-raw.c:234: warning: unused parameter 'params' font_8x8.c:2581: warning: pointer targets in initialization differ in signedness font_8x16.c:4629: warning: pointer targets in initialization differ in signedness ts_harvest.c: In function 'main': ts_harvest.c:123: warning: comparison between signed and unsigned integer expressions ts_harvest.c:128: warning: comparison between signed and unsigned integer expressions ts_harvest.c:70: warning: unused variable 'samp'3.5、安裝
leon@Ubuntu:~/tslib$ sudo make install Making install in etc make[1]: 正在進入目錄 `/home/leon/tslib/etc' make[2]: 正在進入目錄 `/home/leon/tslib/etc'/bin/mkdir -p '/usr/local/tslib/etc'/usr/bin/install -c -m 644 ts.conf '/usr/local/tslib/etc' make[2]: 沒有什么可以做的為 `install-data-am'。 make[2]:正在離開目錄 `/home/leon/tslib/etc' make[1]:正在離開目錄 `/home/leon/tslib/etc' Making install in src make[1]: 正在進入目錄 `/home/leon/tslib/src' make[2]: 正在進入目錄 `/home/leon/tslib/src'/bin/mkdir -p '/usr/local/tslib/lib'/bin/sh ../libtool --mode=install /usr/bin/install -c libts.la '/usr/local/tslib/lib' libtool: install: /usr/bin/install -c .libs/libts-0.0.so.0.1.1 /usr/local/tslib/lib/libts-0.0.so.0.1.1 libtool: install: (cd /usr/local/tslib/lib && { ln -s -f libts-0.0.so.0.1.1 libts-0.0.so.0 || { rm -f libts-0.0.so.0 && ln -s libts-0.0.so.0.1.1 libts-0.0.so.0; }; }) libtool: install: (cd /usr/local/tslib/lib && { ln -s -f libts-0.0.so.0.1.1 libts.so || { rm -f libts.so && ln -s libts-0.0.so.0.1.1 libts.so; }; }) libtool: install: /usr/bin/install -c .libs/libts.lai /usr/local/tslib/lib/libts.la libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/tslib/lib ---------------------------------------------------------------------- Libraries have been installed in:/usr/local/tslib/libIf you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:- add LIBDIR to the `LD_LIBRARY_PATH' environment variableduring execution- add LIBDIR to the `LD_RUN_PATH' environment variableduring linking- use the `-Wl,-rpath -Wl,LIBDIR' linker flag- have your system administrator add LIBDIR to `/etc/ld.so.conf'See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ----------------------------------------------------------------------/bin/mkdir -p '/usr/local/tslib/include'/usr/bin/install -c -m 644 tslib.h '/usr/local/tslib/include' make[2]:正在離開目錄 `/home/leon/tslib/src' make[1]:正在離開目錄 `/home/leon/tslib/src' Making install in plugins make[1]: 正在進入目錄 `/home/leon/tslib/plugins' make[2]: 正在進入目錄 `/home/leon/tslib/plugins'/bin/mkdir -p '/usr/local/tslib/lib/ts/'/bin/sh ../libtool --mode=install /usr/bin/install -c linear.la dejitter.la variance.la pthres.la ucb1x00.la corgi.la collie.la h3600.la mk712.la arctic2.la linear_h2200.la input.la '/usr/local/tslib/lib/ts/' libtool: install: /usr/bin/install -c .libs/linear.so /usr/local/tslib/lib/ts/linear.so libtool: install: /usr/bin/install -c .libs/linear.lai /usr/local/tslib/lib/ts/linear.la libtool: install: /usr/bin/install -c .libs/dejitter.so /usr/local/tslib/lib/ts/dejitter.so libtool: install: /usr/bin/install -c .libs/dejitter.lai /usr/local/tslib/lib/ts/dejitter.la libtool: install: /usr/bin/install -c .libs/variance.so /usr/local/tslib/lib/ts/variance.so libtool: install: /usr/bin/install -c .libs/variance.lai /usr/local/tslib/lib/ts/variance.la libtool: install: /usr/bin/install -c .libs/pthres.so /usr/local/tslib/lib/ts/pthres.so libtool: install: /usr/bin/install -c .libs/pthres.lai /usr/local/tslib/lib/ts/pthres.la libtool: install: /usr/bin/install -c .libs/ucb1x00.so /usr/local/tslib/lib/ts/ucb1x00.so libtool: install: /usr/bin/install -c .libs/ucb1x00.lai /usr/local/tslib/lib/ts/ucb1x00.la libtool: install: /usr/bin/install -c .libs/corgi.so /usr/local/tslib/lib/ts/corgi.so libtool: install: /usr/bin/install -c .libs/corgi.lai /usr/local/tslib/lib/ts/corgi.la libtool: install: /usr/bin/install -c .libs/collie.so /usr/local/tslib/lib/ts/collie.so libtool: install: /usr/bin/install -c .libs/collie.lai /usr/local/tslib/lib/ts/collie.la libtool: install: /usr/bin/install -c .libs/h3600.so /usr/local/tslib/lib/ts/h3600.so libtool: install: /usr/bin/install -c .libs/h3600.lai /usr/local/tslib/lib/ts/h3600.la libtool: install: /usr/bin/install -c .libs/mk712.so /usr/local/tslib/lib/ts/mk712.so libtool: install: /usr/bin/install -c .libs/mk712.lai /usr/local/tslib/lib/ts/mk712.la libtool: install: /usr/bin/install -c .libs/arctic2.so /usr/local/tslib/lib/ts/arctic2.so libtool: install: /usr/bin/install -c .libs/arctic2.lai /usr/local/tslib/lib/ts/arctic2.la libtool: install: /usr/bin/install -c .libs/linear_h2200.so /usr/local/tslib/lib/ts/linear_h2200.so libtool: install: /usr/bin/install -c .libs/linear_h2200.lai /usr/local/tslib/lib/ts/linear_h2200.la libtool: install: /usr/bin/install -c .libs/input.so /usr/local/tslib/lib/ts/input.so libtool: install: /usr/bin/install -c .libs/input.lai /usr/local/tslib/lib/ts/input.la libtool: install: warning: remember to run `libtool --finish /usr/local/tslib/lib/ts/' make[2]: 沒有什么可以做的為 `install-data-am'。 make[2]:正在離開目錄 `/home/leon/tslib/plugins' make[1]:正在離開目錄 `/home/leon/tslib/plugins' Making install in tests make[1]: 正在進入目錄 `/home/leon/tslib/tests' make[2]: 正在進入目錄 `/home/leon/tslib/tests'/bin/mkdir -p '/usr/local/tslib/bin'/bin/sh ../libtool --mode=install /usr/bin/install -c ts_test ts_calibrate ts_print ts_print_raw ts_harvest '/usr/local/tslib/bin' libtool: install: /usr/bin/install -c .libs/ts_test /usr/local/tslib/bin/ts_test libtool: install: /usr/bin/install -c .libs/ts_calibrate /usr/local/tslib/bin/ts_calibrate libtool: install: /usr/bin/install -c .libs/ts_print /usr/local/tslib/bin/ts_print libtool: install: /usr/bin/install -c .libs/ts_print_raw /usr/local/tslib/bin/ts_print_raw libtool: install: /usr/bin/install -c .libs/ts_harvest /usr/local/tslib/bin/ts_harvest make[2]: 沒有什么可以做的為 `install-data-am'。 make[2]:正在離開目錄 `/home/leon/tslib/tests' make[1]:正在離開目錄 `/home/leon/tslib/tests' make[1]: 正在進入目錄 `/home/leon/tslib' make[2]: 正在進入目錄 `/home/leon/tslib' make[2]: 沒有什么可以做的為 `install-exec-am'。/bin/mkdir -p '/usr/local/tslib/lib/pkgconfig'/usr/bin/install -c -m 644 tslib-0.0.pc '/usr/local/tslib/lib/pkgconfig' make[2]:正在離開目錄 `/home/leon/tslib' make[1]:正在離開目錄 `/home/leon/tslib'最后進入到/usr/local目錄下查看一下相關文件是否已經安裝成功:
leon@Ubuntu:~$ cd /usr/local/ leon@Ubuntu:/usr/local$ ls bin etc games include lib man sbin share src tslib leon@Ubuntu:/usr/local$ cd tslib/ leon@Ubuntu:/usr/local/tslib$ ll 總用量 24 drwxr-xr-x 6 root root 4096 8月 27 14:56 ./ drwxr-xr-x 11 root root 4096 8月 27 14:56 ../ drwxr-xr-x 2 root root 4096 8月 27 14:56 bin/ drwxr-xr-x 2 root root 4096 8月 27 14:56 etc/ drwxr-xr-x 2 root root 4096 8月 27 14:56 include/ drwxr-xr-x 4 root root 4096 8月 27 14:56 lib/4、拷貝安裝
上面的步驟完成了tslib庫的編譯工作,并且將必要的文件統一拷貝到了指定的目錄下。但是,這些文件最終都不是在PC上運行的,而是要在目標開發板(即此處的mini2440)上運行的,所以,接下來我們就要將他們拷貝安裝到開發板上去。
4.1、修改內容
打開安裝路徑下的/etc/ts.conf文件,修改其內容。
找到“module_raw input”,把行首的注釋符去掉,但要注意行首不要留有空格,即文字是頂格的,不然之后會出現段錯誤 (segmentational fault)。
1 # Uncomment if you wish to use the linux input layer event interface2 module_raw input3 4 # Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d5 # module_raw collie6 7 # Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C8608 # module_raw corgi9 10 # Uncomment if you're using a device with a UCB1200/1300/1400 TS interface11 # module_raw ucb1x0012 13 # Uncomment if you're using an HP iPaq h3600 or similar14 # module_raw h360015 16 # Uncomment if you're using a Hitachi Webpad17 # module_raw mk71218 19 # Uncomment if you're using an IBM Arctic II20 # module_raw arctic2注1:這里指的是安裝目錄(即/usr/local/tslib),不是編譯的目錄,切記!
注2:如果你用的是普通用戶,記得用sudo命令來提升權限,否則可能會無法寫入。
4.2、拷貝安裝
將整個目錄下的文件打包,并原封不動的拷貝安裝到開發板的對應目錄下(我本人放置在/usr/local/tslib目錄下)。
4.3、環境變量
這里要設置一下開發板的環境變量,使得系統能夠調用到tslib庫。
打開環境變量文件/etc/profile,添加如下代碼(該文件內已經存在tslib的環境變量,這里只是稍作修改):
export TSLIB_ROOT=/usr/local/tslib export TSLIB_TSDEVICE=/dev/input/event1 export QWS_MOUSE_PROTO=tslib:/dev/input/event1 export TSLIB_CALIBFILE=/etc/pointercal export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts export TSLIB_FBDEVICE=/dev/fb0 export TSLIB_CONSOLEDEVICE=none export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib注1:這里的修改是針對開發板的,不是針對PC的,切記!
注2:對上文的幾個變量進行一下說明。注意其中部分變量需根據你自己開發板的實際情況修改:
4.4、測試驗證
完成環境變量的設置后,重啟開發板(目的是使系統讀取profile環境變量),然后進入tslib/bin目錄執行下面的程序進行驗證和測試。
./ts_calibrate # 進行觸摸屏的校準測試 ./ts_test # 進行觸摸屏的繪圖測試如果沒有這兩個測試文件,可以到我們編譯安裝的目錄/usr/local/tslib目錄下進行復制,如果測試成功話那tslib的移植就到此結束了。
5、后記
到這里其實還不算完結,后面還有一些事情要做,不過我目前還沒完全搞懂,待我日后慢慢細說。
另外,我也還會再抽空研究一下如何使用最新版的tslib進行編譯,待成功之日再來分享。
總結
以上是生活随笔為你收集整理的玩转mini2440开发板之【在Ubuntu 14.04下编译安装tslib 1.4版本】的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 投资不过山海关对东北伤害狠!老工业基地全
- 下一篇: 消息称《漫威金刚狼》最早将于 2024