网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

深入浅析PHP中的config.m4-创新互联

本篇文章为大家展示了深入浅析PHP 中的 config.m4,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

创新互联基于成都重庆香港及美国等地区分布式IDC机房数据中心构建的电信大带宽,联通大带宽,移动大带宽,多线BGP大带宽租用,是为众多客户提供专业德阳机房服务器托管报价,主机托管价格性价比高,为金融证券行业服务器托管,ai人工智能服务器托管提供bgp线路100M独享,G口带宽及机柜租用的专业成都idc公司。

最近在看php扩展相关的东西,虽然来来回回编辑了好多次config.m4,并且也在技术社区看到了 config.m4是什么?什么作用? 类的问题,但是还是觉得有必要在深入的了解下。

.m4后缀的文件一般被当做 通用的宏处理,来看下官方的介绍:

GNU M4 is an implementation of the traditional Unix macro processor. It is mostly SVR4 compatible although it has some extensions (for example, handling more than 9 positional parameters to macros). GNU M4 also has built-in functions for including files, running shell commands, doing arithmetic, etc.

GNU M4 is a macro processor in the sense that it copies its input to the output expanding macros as it goes. Macros are either builtin or user-defined and can take any number of arguments. Besides just doing macro expansion, m4 has builtin functions for including named files, running UNIX commands, doing integer arithmetic, manipulating text in various ways, recursion etc... m4 can be used either as a front-end to a compiler or as a macro processor in its own right.

One of the biggest users of GNU M4 is the GNU Autoconf project.

简单而通俗易懂的翻译下:GNU M4是传统UNIX宏处理器的一种实现方式,它还具有一些内置功能,包括文件,shell,运算等。
作为一个宏处理器,将输入复制到扩展的输出,它要么内置,要么用户定义,且可以接受参数。另外这个还有内置函数,包括命名文件、运行UNIX命令、执行整数运算、以各种方式操作文本、递归等。M4既可以作为编译器的前端使用,也可以作为自己的宏处理器使用。
GNU M4的大用户之一是GNU AutoCOF项目。

到这里大致了解到,它是作为一个宏处理器,然后再想想PHP扩展里面用到它做了什么,先看看 php源码扩展目录ext中 bcmath 中的代码:

dnl
dnl $Id$
dnl

PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions,
[ --enable-bcmath Enable bc style precision math functions])

if test "$PHP_BCMATH" != "no"; then
 PHP_NEW_EXTENSION(bcmath, bcmath.c \
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
libbcmath/src/rmzero.c libbcmath/src/str2num.c,
 $ext_shared,,-I@ext_srcdir@/libbcmath/src)
 PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src)
 AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath])
fi

本文名称:深入浅析PHP中的config.m4-创新互联
URL网址:http://bjjierui.cn/article/geddo.html

其他资讯