1. 程式人生 > >linux安裝源碼包未解決

linux安裝源碼包未解決

.gz cat lease read ofo mkdir oca 源碼包安裝 configure

源碼包安裝
約定:源碼包放在 cd/use/local/src

我先把httpd源碼包下載到cd/use/local/src 如下所示
下載源碼包

#cd/usr/local/src/
[root@localhost src]# wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.gz 下載源包

[root@localhost src]# wget http://mirrors.cnnic.cn/aparche/httpd-2.2.32.tar.gz
-bash: wget: 未找到命令 說明沒有安裝wget 命令,執行#yum intall -y wget

2018-01-10 13:54:04 錯誤 404:Not Found。出現這種情況說明下載鏈接是錯誤的,需要更新鏈接
#echo $? 結果是0 表示上一步正確,1表示上一步錯誤
下載完之後查看文件的類型
[root@localhost src]# ls
apr-util-1.6.1.tar.gz 說明是一個tar .gz的壓縮包

解壓壓縮包
[root@localhost src]# tar -zxvf apr-util-1.6.1.tar.gz 解壓源碼包
apr-util-1.6.1/
apr-util-1.6.1/strmatch/
apr-util-1.6.1/strmatch/apr_strmatch.c

apr-util-1.6.1/uri/
apr-util-1.6.1/uri/apr_uri.c
apr-util-1.6.1/apr-util.spec
apr-util-1.6.1/README.FREETDS
....
....
配置相關選項——指定安裝路徑
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apache2 指定安裝路徑
出現如下錯誤
checking for gcc... no 說明沒有安裝gcc
checking for cc... no
checking for cl.exe... no

安裝gcc
#yum install -y gcc

重新執行配置選項
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apache2
安裝gcc之後還出現如下報錯
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apache2
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... no
configure: error: APR could not be located. Please use the --with-apr option.
提示:configure: error: APR could not be located. Please use the --with-apr option. 說明需要指定--with-apr參數
指定參數編譯
#./configure --with-apr=/usr/local/apr

編譯完後結果還報錯結果如下:

[root@localhost apr-util-1.6.1]# ./configure --with-apr=/usr/local/apr
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
[root@localhost apr-util-1.6.1]# echo $?
1
錯誤提示checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file. 說明:配置錯誤:with-apr參數不正確,它必須指定一個安裝前綴,一個構建目錄或是一個配置apr文件。

linux安裝源碼包未解決