nghttp2 是一个用 C 实现的 HTTP/2 库,支持 h2c。如下是君正平台的交叉编译内容。
1、下载源码:https://github.com/nghttp2/nghttp2
或者:git clone https://github.com/nghttp2/nghttp2.git
2、执行如下结果
cd nghttp2
autoreconf -i
但是报错如下:主要原因是 没有配置正确aclocal的库LIBTOOL.m4的路径
main::scan_file() called too early to check prototype at /usr/local/bin/aclocal line 617.
Useless use of /d modifier in transliteration operator at /usr/local/share/automake-1.11/Automake/Wrap.pm line 58.
configure.ac:37: installing `./config.guess'
configure.ac:37: installing `./config.sub'
configure.ac:41: installing `./install-sh'
configure.ac:41: installing `./missing'
examples/Makefile.am: installing `./depcomp'
lib/Makefile.am:35: Libtool library used but `LIBTOOL' is undefined
lib/Makefile.am:35: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
lib/Makefile.am:35: to `configure.ac' and run `aclocal' and `autoconf' again.
lib/Makefile.am:35: If `AC_PROG_LIBTOOL' is in `configure.ac', make sure
lib/Makefile.am:35: its definition is in aclocal's search path.
src/Makefile.am:156: library used but `RANLIB' is undefined
src/Makefile.am:156: The usual way to define `RANLIB' is to add `AC_PROG_RANLIB'
src/Makefile.am:156: to `configure.ac' and run `autoconf' again.
src/Makefile.am:231: Libtool library used but `LIBTOOL' is undefined
src/Makefile.am:231: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
src/Makefile.am:231: to `configure.ac' and run `aclocal' and `autoconf' again.
src/Makefile.am:231: If `AC_PROG_LIBTOOL' is in `configure.ac', make sure
src/Makefile.am:231: its definition is in aclocal's search path.
third-party/Makefile.am:30: Libtool library used but `LIBTOOL' is undefined
third-party/Makefile.am:30: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
third-party/Makefile.am:30: to `configure.ac' and run `aclocal' and `autoconf' again.
third-party/Makefile.am:30: If `AC_PROG_LIBTOOL' is in `configure.ac', make sure
third-party/Makefile.am:30: its definition is in aclocal's search path.
Makefile.am: installing `./INSTALL'
autoreconf: automake failed with exit status: 1
解决办法:查看aclocal的路径 aclocal --print-ac-dir
显示结果为:
/usr/local/share/aclocal
查看里面的*.m4文件只有:
则我将/usr/share/aclocal中的*.m4文件拷贝到查询到目录
3、执行automake
出现错误:Useless use of /d modifier in transliteration operator at /usr/local/share/automake-1.11/Automake/Wrap.pm line 58.
解决办法:执行yum install automake
(软件包 automake-1.13.4-3.el7.noarch 已安装并且是最新版本)
打开vim /usr/share/automake-1.13/Automake/Wrap.pm
发现该地方已经没有d
于是打开文件 /usr/local/share/automake-1.11/Automake/Wrap.pm 第 58行,删除d
再执行
autoconf
4、执行编译选项
./configure --prefix=$(pwd)/ISVP --host=mips-linux-uclibc --disable-examples --disable-threads CC=/opt/mips-gcc472-glibc216-64bit/bin/mips-linux-uclibc-gnu-gcc CXX=/opt/mips-gcc472-glibc216-64bit/bin/mips-linux-uclibc-gnu-g++
出现错误:
./configure: line 4096: syntax error near unexpected token `2.2.6'
./configure: line 4096: `LT_PREREQ(2.2.6)'
解决办法:
当打开configure文件在4096行看到如下信息:
LT_PREREQ(2.2.6)
LT_INIT()
该含义是
LT_PREREQ 定义libtool工具的版本
LT_INIT 对libtool初始化
【系统中应该安装automake,autoconf,及libtool工具,autoconf功能极大的简化了多源码的工作量系统中除了源码应该存在三个基本的文件autogen.sh configure.ac makefile.am】
解决办法:yum install libtool
(软件包 libtool-2.4.2-22.el7_3.x86_64 已安装并且是最新版本)
5、make && make install