GNU build system / autoconf 和 automake 生成 Makefile 文件

https://www.jianshu.com/p/81916fba741c

 

例解 autoconf 和 automake 生成 Makefile 文件

apt-get install autoconf automake libtool autopoint

sudo apt-get install autopoint bison flex orc 

http://mirrors.kernel.org/gnu/

 

https://www.ibm.com/developerworks/cn/linux/l-makefile/

#安装m4
wget http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz \
&& tar -xzvf m4-1.4.13.tar.gz \
&& cd m4-1.4.13 \
&& ./configure -prefix=/usr/local
sudo make && sudo make install
cd ..

#安装autoconf  2.69
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=/usr/local
sudo make && sudo make install
cd ..

#安装automake 1.14
wget http://mirrors.kernel.org/gnu/automake/automake-1.14.tar.gz \
&& tar xzvf automake-1.14.tar.gz \
&& cd automake-1.14 \
&& ./configure -prefix=/usr/local
sudo make && sudo make install
cd ..

#安装libtool
wget http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz \
&& tar xzvf libtool-2.2.6b.tar.gz \
&& cd libtool-2.2.6b \
&& ./configure -prefix=/usr/local
sudo make && sudo make install
cd ..

 

cmake添加-fPIC

add_compile_options(-fPIC)

configure添加-fPIC

--enable-shared --enable-static CFLAGS=-fPIC

 

posted @ 2019-06-28 11:18  dong1  阅读(201)  评论(0编辑  收藏  举报