php5.4 编译原理第一弹--autoconf && 最小化安装php5.4

12 篇文章 0 订阅
4 篇文章 0 订阅

执行./buildconf --force后,在php5.4目录下会自动生成如下文件

只在 php5.4/ 存在:aclocal.m4
只在 php5.4/ 存在:autom4te.cache
只在 php5.4/ 存在:buildmk.stamp
只在 php5.4/ 存在:configure
只在 php5.4/ 存在:generated_lists
只在 php5.4/ 存在:install-sh
只在 php5.4/main 存在:php_config.h.in
只在 php5.4/ 存在:missing
只在 php5.4/ 存在:mkinstalldirs

 

buildconf文件的内容如下:

#!/bin/sh
# $Id$

eval `grep '^PHP_EXTRA_VERSION=' configure.in`
case "$PHP_EXTRA_VERSION" in
  *-dev)
    dev=1
    ;;
  *)
    dev=0
    ;;
esac

devok=0
debug=no

while test $# -gt 0; do
  if test "$1" = "--force"; then
    devok=1
    echo "Forcing buildconf"
  fi

  if test "$1" = "--debug"; then
    debug=yes
  fi

  shift
done

if test "$dev" = "0" -a "$devok" = "0"; then
  echo "You should not run buildconf in a release package."
  echo "use buildconf --force to override this check."
  exit 1
fi

if test "$devok" = "1"; then
  echo "Removing configure caches"
  rm -rf autom4te.cache config.cache
fi

rm -f generated_lists

if test "$debug" = "yes"; then
  ${MAKE:-make} -s -f build/build.mk SUPPRESS_WARNINGS=""
else
  ${MAKE:-make} -s -f build/build.mk
fi

 build.mk文件内容如下:

#  +----------------------------------------------------------------------+
#  | PHP Version 5                                                        |
#  +----------------------------------------------------------------------+
#  | Copyright (c) 1997-2006 The PHP Group                                |
#  +----------------------------------------------------------------------+
#  | This source file is subject to version 3.01 of the PHP license,      |
#  | that is bundled with this package in the file LICENSE, and is        |
#  | available through the world-wide-web at the following url:           |
#  | http://www.php.net/license/3_01.txt                                  |
#  | If you did not receive a copy of the PHP license and are unable to   |
#  | obtain it through the world-wide-web, please send a note to          |
#  | license@php.net so we can mail you a copy immediately.               |
#  +----------------------------------------------------------------------+
#  | Author: Sascha Schumann <sascha@schumann.cx>                         |
#  +----------------------------------------------------------------------+
#
# $Id$ 
#
#
# Makefile to generate build tools
#

SUBDIRS = Zend TSRM

STAMP = buildmk.stamp

ALWAYS = generated_lists


all: $(STAMP) $(ALWAYS)
	@$(MAKE) -s -f build/build2.mk

generated_lists:
	@echo makefile_am_files = Zend/Makefile.am TSRM/Makefile.am > $@
	@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
		Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@

$(STAMP): build/buildcheck.sh
	@build/buildcheck.sh $(STAMP)

snapshot:
	distname='$(DISTNAME)'; \
	if test -z "$$distname"; then \
		distname='php5-snapshot'; \
	fi; \
	myname=`basename \`pwd\`` ; \
	cd .. && cp -rp $$myname $$distname; \
	cd $$distname; \
	rm -f $(SUBDIRS) 2>/dev/null || true; \
	for i in $(SUBDIRS); do \
		test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \
	done; \
	find . -type l -exec rm {} \; ; \
	$(MAKE) -f build/build.mk; \
	cd ..; \
	tar cf $$distname.tar $$distname; \
	rm -rf $$distname $$distname.tar.*; \
	bzip2 -9 $$distname.tar; \
	md5sum $$distname.tar.bz2; \
	sync; sleep 2; \
	md5sum $$distname.tar.bz2; \
	bzip2 -t $$distname.tar.bz2

cvsclean-work:
	@for i in `find . -name .cvsignore`; do \
		(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice | sed 's/[[:space:]]/ /g'` *.o *.a *.lo *.la *.gcno *.gcda .libs || true); \
	done

svnclean-work:
	@for i in `find . -type d ! -path '*/.svn/*' | grep -v '.svn'`; do \
		(cd $$i 2>/dev/null && rm -rf `svn propget svn:ignore . | grep -v config.nice` *.o *.a *.lo *.la *.gcno *.gcda .libs || true); \
	done

gitclean-work:
	@if (test ! -f '.git/info/exclude' || grep -s "git-ls-files" .git/info/exclude); then \
		(echo "Rebuild .git/info/exclude" && echo '*.o' > .git/info/exclude && git svn propget svn:ignore | grep -v config.nice >> .git/info/exclude); \
	fi; \
	git clean -X -f -d;

.PHONY: $(ALWAYS) snapshot

ubuntu14.04降级bison

sudo apt-get remove bison
wget https://launchpad.net/~rjvbertin/+archive/ubuntu/misc/+build/6247012/+files/bison2_2.7.1.dfsg-1-ppa1_i386.deb

wget https://launchpad.net/~rjvbertin/+archive/ubuntu/misc/+build/6247012/+files/libbison2-dev_2.7.1.dfsg-1-ppa1_i386.deb

sudo dpkg -i libbison2-dev_2.7.1.dfsg-1-ppa1_i386.deb  bison2_2.7.1.dfsg-1-ppa1_i386.deb

 ./configure --prefix=~/software/temp/php  --disable-all

该命令参照:http://www.phpinternalsbook.com/build_system/building_php.html

最终会有如下结果:

creating libtool
appending configuration tag "CXX" to libtool

Generating files
configure: creating ./config.status
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands

使用如上命令编译后的php包含的模块如下:

Core  date  ereg  pcre  Reflection  SPL   standard
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值