怎样编译安装MCrypt

2017年8月2日 | 分类: 【技术】

编译安装Libmcrypt:

官网:https://sourceforge.net/projects/mcrypt/
下载:https://sourceforge.net/projects/mcrypt/files/Libmcrypt/

wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz && tar -xzvf libmcrypt-2.5.8.tar.gz && cd libmcrypt-2.5.8 && ./configure && make && make install

输出:

...
Libraries have been installed in:
   /usr/local/lib
...

更新系统动态连接库配置:

ldconfig

编译安装完成。

安装libltdl:

/sbin/ldconfig && cd libltdl/ && ./configure --enable-ltdl-install && make && make install

输出:

...
Libraries have been installed in:
   /usr/local/lib
...

编译安装mhash

官网:https://sourceforge.net/projects/mhash/
下载:https://sourceforge.net/projects/mhash/files/mhash/

wget http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz && tar -xzvf mhash-0.9.9.9.tar.gz && cd mhash-0.9.9.9 && ./configure && make && make install

输出:

...
Libraries have been installed in:
   /usr/local/lib
...
echo "/usr/local/lib" >>/etc/ld.so.conf && /sbin/ldconfig

编译安装MCrypt:

官网:https://sourceforge.net/projects/mcrypt/
下载:https://sourceforge.net/projects/mcrypt/files/MCrypt/

wget http://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz && tar -xzvf mcrypt-2.6.8.tar.gz && cd mcrypt-2.6.8 && ./configure --enable-shared --with-libmcrypt=/usr/local/lib && make && make install

如果报错:configure: error: *** libmcrypt was not found

参考:http://blog.sina.com.cn/s/blog_8a0f7d200101257u.html

export LD_LIBRARY_PATH=/usr/local/lib: LD_LIBRARY_PATH

然后重新configure & make & make install:

./configure --enable-shared --with-libmcrypt=/usr/local/lib && make && make install

输出:

...
rors.o bits.o openpgp.o rndwin32.o environ.o getpass.o ufc_crypt.o popen.o class                                                                                                                     ic.o rfc2440.o gaaout.o   -lz  -lmhash -L/usr/local/lib -lmcrypt
libtool: link: gcc -g -O2 -I/usr/local/include -Wall -o mcrypt extra.o mcrypt.o                                                                                                                      keys.o random.o rndunix.o xmalloc.o functions.o errors.o bits.o openpgp.o rndwin                                                                                                                     32.o environ.o getpass.o ufc_crypt.o popen.o classic.o rfc2440.o gaaout.o  -lz /                                                                                                                     usr/local/lib/libmhash.so -L/usr/local/lib /usr/local/lib/libmcrypt.so
...

更新系统动态连接库配置:

ldconfig

编译安装完成。

【以下参考】

第一步:编译安装Libmcrypt

下载:http://sourceforge.net/projects/mcrypt/files/Libmcrypt/

wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz && tar -xzvf libmcrypt-2.5.8.tar.gz && cd libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt
make -j && make install

输出:

...
Libraries have been installed in:
   /usr/local/libmcrypt/lib
...

更新系统动态连接库配置:

echo '/usr/local/libmcrypt/lib' >> /etc/ld.so.conf.d/custom-libs.conf
ldconfig

编译安装完成。

第二步:编译安装MCrypt

下载:http://sourceforge.net/projects/mcrypt/files/MCrypt/

wget http://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz && tar -xzvf mcrypt-2.6.8.tar.gz && cd mcrypt-2.6.8
./configure --prefix=/usr/local/mcrypt --with-libmcrypt=/usr/local/libmcrypt/lib
make -j && make install

输出:

...
rors.o bits.o openpgp.o rndwin32.o environ.o getpass.o ufc_crypt.o popen.o class                                                                                                                     ic.o rfc2440.o gaaout.o   -lz  -lmhash -L/usr/local/lib -lmcrypt
libtool: link: gcc -g -O2 -I/usr/local/include -Wall -o mcrypt extra.o mcrypt.o                                                                                                                      keys.o random.o rndunix.o xmalloc.o functions.o errors.o bits.o openpgp.o rndwin                                                                                                                     32.o environ.o getpass.o ufc_crypt.o popen.o classic.o rfc2440.o gaaout.o  -lz /                                                                                                                     usr/local/lib/libmhash.so -L/usr/local/lib /usr/local/lib/libmcrypt.so
...

更新系统动态连接库配置:

ldconfig

编译安装完成。