官网:
Releases · ninja-build/ninja (github.com)
要把数据放在另一台服务器,环境之类的又要重新配一下,重新再写一下吧。
这台服务器没有autoconf,要先安装一下:
1、如果没有安装perl需要先安装
2.安装m4
1.下载安装包wget http://mirrors.kernel.org/gnu/m4/m4-1.4.18.tar.gz
2. 解压安装包tar -xzvf m4-1.4.18.tar.gz
3. 进入安装目录cd m4-1.4.18
4. 配置安装目录./configure --prefix=${PWD}(或者./configure --prefix=/home/zjw/environment/m4)
5. 编译并安装 make -j8 && make installexport PATH=/home/zjw/environment/m4/bin:$PATH(使用 vim ~/.bashrc )
source ~/.bashrc
m4 --version
3.安装autoconf
注意一定要安装在不是解压后的目录(即configure后的路径,一定要是其他文件夹),否则编译会失败。因为解压后的文件和编译生成的文件有重名的,会冲突。
wget http://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.gz
tar -xzvf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=/home/zjw/environment/autoconf
make -j8 && make installexport PATH=/home/zjw/environment/autoconf/bin:$PATH(使用 vim ~/.bashrc )
source ~/.bashrc
autoconf --version
4、安装antomake
wget -c https://ftp.gnu.org/gnu/automake/automake-1.16.1.tar.gz
tar -zxvf automake-1.16.1.tar.gz
cd automake-1.16.1
./configure --prefix=/home/zjw/environment/automake
make -j8 && make install
export PATH=/home/zjw/environment/automake/bin:$PATH(使用 vim ~/.bashrc )
source ~/.bashrc
automake --version
5、安装re2c
re2c — re2c 3.0 documentation 这是官网
左边Home选择Download,然后是
older releases
,下载re2c-3.0.tar.xz
解压之后放进服务器里面
cd re2c-3.0/
autoreconf -i -W all
./configure --prefix=/home/zjw/environment/re2c
make install
# 测试是否安装成功(官网安装目录上有只测试某模块)
make checkexport PATH=/home/zjw/environment/re2c/bin:$PATH(vim ~/.profile)
source ~/.profile
输入re2c -V可查看版本
6、安装ninji
配置ninja还遇到了如下报错:
use ninja themselves should either write a similar script\nor use a meta-build system that supports Ninja output.': command not found
https://github.com/ninja-build/ninja/releases
在官网下载解压之后尝试了各种版本,还是不行,搞了一个多小时,按这种方式下载就没问题,如下:
git clone https://github.com/ninja-build/ninja.git
cd ninja
./configure.py --bootstrap
然后加入环境变量,ninja --version输出:1.11.0.git
大功告成
无关
export LD_LIBRARY_PATH=/home/zjw/environment/ffmpeg/lib/:$LD_LIBRARY_PATH
LD_LIBRARY_PATH用于lib
以下内容为windows下配置ninja:
git clone https://github.com/ninja-build/ninja.git && cd ninja
git checkout release
"D:\software\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
(找到你自己的文件位置在哪里)
python configure.py --bootstrap
然后加入到环境变量即可