开发环境ubuntu12.04,x86_64,gcc4.6
arm板子环境armeabi,32bit,gcc5.3
以shell里面经常用到的file程序为例子
从ftp://ftp.astron.com/pub/file/上面下载源代码,因为我的ubuntu使用的是file5.09,不支持编译最新版本的file.5.25,所以我就下载file5.09了。
如果是从源代码编译安装file程序,应该这样做:
./configure
make
sudo make install
没啥好说的
如果我没有root权限,不是sudo组的,或者想把file安装到其他目录,怎么办呢?有两种情况:
第一种,错误的方法
./configure
make
make install DESTDIR=/home/tree/tools
编译完了,使用DESTDIR参数指定了一个安装路径,也没什么难理解的。运行/home/tree/tools/bin/file /home/tree/tools/bin/file:
/home/tree/tools/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linu