LINUX学生会linux学习

linux编译篇第一章

2017-06-13  本文已影响50人  数据革命

简介

GCC

make

程序包编译

安装包组

[root@localhost ~]# yum list|grep httpd
httpd.x86_64                               2.4.6-45.el7.centos         bash     
httpd-devel.x86_64                         2.4.6-45.el7.centos         bash     
httpd-manual.noarch                        2.4.6-45.el7.centos         bash     
httpd-tools.x86_64                         2.4.6-45.el7.centos         bash     
libmicrohttpd.i686                         0.9.33-2.el7                bash     
libmicrohttpd.x86_64                       0.9.33-2.el7                bash     
libmicrohttpd-devel.i686                   0.9.33-2.el7                bash     
libmicrohttpd-devel.x86_64                 0.9.33-2.el7                bash     
libmicrohttpd-doc.noarch                   0.9.33-2.el7                bash 
[root@localhost ~]# yum grouplist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Available Environment Groups:
   Minimal Install
   Compute Node
   Infrastructure Server
   File and Print Server
   Basic Web Server
   Virtualization Host
   Server with GUI
   GNOME Desktop
   KDE Plasma Workspaces
   Development and Creative Workstation
Installed Groups:
   Development Tools               《《《《《《《《这里就是我们要安装的包组
Available Groups:
   Compatibility Libraries
   Console Internet Tools
   Graphical Administration Tools
   Legacy UNIX Compatibility
   Scientific Support
   Security Tools
   Smart Card Support
   System Administration Tools
   System Management
Done
[root@localhost yum.repos.d]# yum clean all                    
Loaded plugins: fastestmirror, langpacks
Cleaning repos: bash epel
Cleaning up everything
Cleaning up list of fastest mirrors
[root@localhost yum.repos.d]# yum install "Development tools"
Loaded plugins: fastestmirror, langpacks
bash                                                                                                         | 4.3 kB  00:00:00     
epel                                                                                                         | 4.3 kB  00:00:00     
(1/6): bash/updateinfo                                                                                       | 807 kB  00:00:00     
(2/6): bash/primary_db                                                                                       | 4.7 MB  00:00:04     
(3/6): epel/group_gz                                                                                         | 170 kB  00:00:00     
(4/6): epel/updateinfo                                                                                       | 807 kB  00:00:00     
(5/6): epel/primary_db                                                                                       | 4.7 MB  00:00:04     
(6/6): bash/group_gz  
[root@localhost /]# tar -vxf  httpd-2.4.25.tar.bz2 
httpd-2.4.25/support/suexec.h
httpd-2.4.25/support/win32/
httpd-2.4.25/support/win32/apache_header.bmp
httpd-2.4.25/support/win32/ApacheMonitor.c
httpd-2.4.25/support/win32/ApacheMonitor.dep
httpd-2.4.25/support/win32/ApacheMonitor.dsp
httpd-2.4.25/support/win32/ApacheMonitor.h
httpd-2.4.25/support/win32/ApacheMonitor.ico
httpd-2.4.25/support/win32/ApacheMonitor.mak
httpd-2.4.25/support/win32/ApacheMonitor.manifest
httpd-2.4.25/support/win32/ApacheMonitor.rc
httpd-2.4.25/support/win32/aprun.ico
[root@localhost /]# ls
bin   dev  home          httpd-2.4.25.tar.bz2  lib64  mnt  proc  run   srv  tmp  var
boot  etc  httpd-2.4.25  lib                   media  opt  root  sbin  sys  usr
[root@localhost httpd-2.4.25]# ls
ABOUT_APACHE     build           config.layout  httpd.dsp       LAYOUT        Makefile.win   README.cmake      test
acinclude.m4     BuildAll.dsp    configure      httpd.mak       libhttpd.dep  modules        README.platforms  VERSIONING
Apache-apr2.dsw  BuildBin.dsp    configure.in   httpd.spec      libhttpd.dsp  NOTICE         ROADMAP
Apache.dsw       buildconf       docs           include         libhttpd.mak  NWGNUmakefile  server
apache_probes.d  CHANGES         emacs-style    INSTALL         LICENSE       os             srclib
ap.d             CMakeLists.txt  httpd.dep      InstallBin.dsp  Makefile.in   README         support
[root@localhost httpd-2.4.25]# ./configure  --prefix=/app
[root@localhost httpd-2.4.25]# ./configure  --prefix=/app
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... no
configure: error: APR not found.  Please read the documentation.
[root@localhost httpd-2.4.25]# yum  search apr
apr-devel.i686 : APR library development kit   《《《《《《《这个就是我们的APR包
apr-devel.x86_64 : APR library development kit
apr-util-devel.i686 : APR utility library development kit
apr-util-devel.x86_64 : APR utility library development kit
apr-util-ldap.x86_64 : APR utility library LDAP support
apr-util-mysql.x86_64 : APR utility library MySQL DBD driver
apr-util-nss.x86_64 : APR utility library NSS crytpo support
apr-util-odbc.x86_64 : APR utility library ODBC DBD driver
apr-util-openssl.x86_64 : APR utility library OpenSSL crytpo support
apr-util-pgsql.x86_64 : APR utility library PostgreSQL DBD driver
apr-util-sqlite.x86_64 : APR utility library SQLite DBD driver
[root@localhost httpd-2.4.25]# ./configure  --prefix=/app
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to "  -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure: 
configure: Configuring Apache Portable Runtime Utility library...
configure: 
checking for APR-util... no
configure: error: APR-util not found.  Please read the documentation.
[root@localhost httpd-2.4.25]# yum  search APR-util
apr-util.i686 : Apache Portable Runtime Utility library
apr-util.x86_64 : Apache Portable Runtime Utility library
apr-util-devel.i686 : APR utility library development kit      
apr-util-devel.x86_64 : APR utility library development kit 《我的APR-util包
apr-util-ldap.x86_64 : APR utility library LDAP support
apr-util-mysql.x86_64 : APR utility library MySQL DBD driver
apr-util-nss.x86_64 : APR utility library NSS crytpo support
apr-util-odbc.x86_64 : APR utility library ODBC DBD driver
apr-util-openssl.x86_64 : APR utility library OpenSSL crytpo support
apr-util-pgsql.x86_64 : APR utility library PostgreSQL DBD driver
apr-util-sqlite.x86_64 : APR utility library SQLite DBD driver
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

-在来找pcre-config包,办法一样

[root@localhost httpd-2.4.25]# yum  search pcre
pcre-devel.i686 : Development files for pcre  《《这个包
pcre-devel.x86_64 : Development files for pcre
pcre-static.i686 : Static library for pcre
pcre-static.x86_64 : Static library for pcre
pcre-tools.x86_64 : Auxiliary utilities for pcre
pcre.i686 : Perl-compatible regular expression library
pcre.x86_64 : Perl-compatible regular expression library
Server Version: 2.4.25
Install prefix: /app
C compiler:     gcc -std=gnu99
CFLAGS:           -pthread
LDFLAGS:         
LIBS:           
CPPFLAGS:        -DLINUX -D_REENTRANT -D_GNU_SOURCE
C preprocessor: gcc -E
[root@localhost httpd-2.4.25]# make
 -avoid-version  mod_rewrite.lo 
make[4]: Leaving directory `/httpd-2.4.25/modules/mappers'
make[3]: Leaving directory `/httpd-2.4.25/modules/mappers'
make[2]: Leaving directory `/httpd-2.4.25/modules'
make[2]: Entering directory `/httpd-2.4.25/support'
make[2]: Leaving directory `/httpd-2.4.25/support'

make[1]: Leaving directory `/httpd-2.4.25'
[root@localhost httpd-2.4.25]# make install
Installing configuration files
mkdir /app/conf
mkdir /app/conf/extra
mkdir /app/conf/original
mkdir /app/conf/original/extra
Installing HTML documents
mkdir /app/htdocs
Installing error documents
mkdir /app/error
Installing icons
mkdir /app/icons
mkdir /app/logs
Installing CGIs
mkdir /app/cgi-bin
Installing header files
mkdir /app/include
Installing build system files
mkdir /app/build
Installing man pages and online manual
mkdir /app/man
mkdir /app/man/man1
mkdir /app/man/man8
mkdir /app/manual
make[1]: Leaving directory `/httpd-2.4.25'
上一篇 下一篇

猜你喜欢

热点阅读