天天看點

linux安裝源碼包未解決

源碼包安裝

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

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

下載下傳源碼包

#cd/usr/local/src/

-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之後還出現如下報錯

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 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檔案。

本文轉自 yzllinux部落格,原文連結:    http://blog.51cto.com/12947851/2059262    如需轉載請自行聯系原作者