背景:由于项目需要支持低版本的系统,所以编译的动态库以最低支持的服务器系统为准。
libhttpserver 依赖libmicrohttpd,所以我们要先编译这个
https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.59.tar.gz
下载后并解压
./configure
make && make install
在编译libhttpserver之前需要更新下系统自带的libtool,autoconf,automake
直接yum install libtool的版本太低了
https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
https://ftp.gnu.org/gnu/automake/automake-1.11.1.tar.gz
ftp://ftp.gnu.org/gnu/libtool/libtool-2.2.10.tar.gz
依次下载解压到对应目录下执行以下命令
./configure --prefix=/usr/
make && make install
完成后最后开始编译libhttpserver
https://github.com/etr/libhttpserver/archive/0.17.0.tar.gz
下载解压到对应目录下执行以下命令
./bootstrap
mkdir build
cd build
…/configure
make
make install