Ubuntu搭建LAMP环境(jpeg-6b 安装错误 ,找不到libtool命令)

继续安装php开发环境,

jpeg-6b make的时候错误:

./libtool –mode=compile gcc -O2 -I. -c ./jcapimin.c
make: ./libtool: Command not found
make: *** [jcapimin.lo] Error 127

看提示应该是没有安装libtool,由于才拿到手里的服务器,什么都没装,出现这个错误也正常。

解决办法:安装libtool

1 在上面的链接或者网上下载 libtool-2.2.6a.tar.gz,放到/usr/local/src/目录下,解压软件包到当前目录libtool-2.2.6下,并进入libtool-2.2.6目录,命令如下:
$ cd /usr/local/usr/                                      // 进入源码包所在目录
$ sudo tar zxvf libtool-2.2.6a.tar.gz           // 解压缩
$ cd libtool-2.2.6                                         // 进入目录

2 使用“configure”命令检查并配置安装需要的系统环境,并生成安装配置文件,命令行如下:
$ ./configure
安装到默认路径就可以。

3 使用make命令编译源码文件并生成安装文件,命令如下:
$ sudo make                                                    // 编译

4 使用make install命令进行安装,命令如下:
$ sudo make install                                         // 安装

5 复制libtool中的config.sub和config.guess文件至jpeg-6b根目录,命令如下:
$ cd /usr/local/src/jpeg-6b/
$ sudo cp /usr/local/share/libtool/config/config.sub .
$ sudo cp /usr/local/share/libtool/config/config.guess .

6 重新配置并编译、安装jpeg-6b,命令如下:
$ sudo ./configure \
> –prefix=/usr/local/jpeg6/ \                             // 安装时将软件安装到/usr/local/jpeg6目录下
> –enable-shared \                                              // 建立共享库使用的GNU的libtool
> –enable-static                                                   // 建立静态库使用的GNU的libtool
$ sudo make                                                        // 编译
$ sudo make install                                             // 安装

7 Done.
————————————-华丽丽的分割线,下面是英语版———————–

English Version:

Continue to install the PHP environment.
An error occured when make jpeg-6b:

./libtool –mode=compile gcc -O2 -I. -c ./jcapimin.c
make: ./libtool: Command not found
make: *** [jcapimin.lo] Error 127

According the prompt, the libtool isn’t installed. It’s normal to have this error on a bare machine.

Solution: install libtool, of course!

1. Download the file libtool-2.2.6a.tar.gz on the above link or the official site, put it under /usr/local/src/, and extract it into libtool-2.2.6/ and then enter the current directory. The commands as follows:

$ cd /usr/local/usr/            // enter the directory where the source code is
$ sudo tar zxvf libtool-2.2.6a.tar.gz           // extract the file
$ cd libtool-2.2.6                              // enter the current directory

2. Check and configure the installation environment with “configure” command, which will generate installation configuration file.  The command line as follows:
$ ./configure
we can just install it in the default path.

3. use the make command to compile the source file and generate the installation file:
$make                                                      // compile

4. use command make install to install:
$ make install                                              // install

5. copy the config.sub and config.guess of libtool to jpeg-6b/, command as follows:
$ cd /usr/local/src/jpeg-6b/
$ sudo cp /usr/local/share/libtool/config/config.sub
$ sudo cp /usr/local/share/libtool/config/config.guess

6. reconfigure, compile and install jpeg-6b, commands as follows:
$ sudo ./configure \
> –prefix=/usr/local/jpeg6/ \                                   //install the software into /usr/local/jpeg6
> –enable-shared \                                       // GUN’s libtool will be used when creating shared lib
> –enable-static                                           // GUN’s libtool will be used when creating static  lib
$ sudo make                                                        // compile
$ sudo make install                                             // install

7. Done

Leave a Reply

Your email address will not be published.