1 Star 4 Fork 1

国密系列 / ext-sm3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.m4 2.66 KB
一键复制 编辑 原始数据 按行查看 历史
15238399426 提交于 2022-12-26 14:32 . PHP国密sm3扩展
dnl config.m4 for extension sm3
dnl Comments in this file start with the string 'dnl'.
dnl Remove where necessary.
dnl If your extension references something external, use with:
dnl PHP_ARG_WITH(sm3, for sm3 support,
dnl Make sure that the comment is aligned:
dnl [ --with-sm3 Include sm3 support])
dnl Otherwise use enable:
PHP_ARG_ENABLE(sm3, whether to enable sm3 support,
dnl Make sure that the comment is aligned:
[ --enable-sm3 Enable sm3 support], no)
if test "$PHP_SM3" != "no"; then
dnl Write more examples of tests here...
dnl # get library FOO build options from pkg-config output
dnl AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
dnl AC_MSG_CHECKING(for libfoo)
dnl if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists foo; then
dnl if $PKG_CONFIG foo --atleast-version 1.2.3; then
dnl LIBFOO_CFLAGS=\`$PKG_CONFIG foo --cflags\`
dnl LIBFOO_LIBDIR=\`$PKG_CONFIG foo --libs\`
dnl LIBFOO_VERSON=\`$PKG_CONFIG foo --modversion\`
dnl AC_MSG_RESULT(from pkgconfig: version $LIBFOO_VERSON)
dnl else
dnl AC_MSG_ERROR(system libfoo is too old: version 1.2.3 required)
dnl fi
dnl else
dnl AC_MSG_ERROR(pkg-config not found)
dnl fi
dnl PHP_EVAL_LIBLINE($LIBFOO_LIBDIR, SM3_SHARED_LIBADD)
dnl PHP_EVAL_INCLINE($LIBFOO_CFLAGS)
dnl # --with-sm3 -> check with-path
dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
dnl SEARCH_FOR="/include/sm3.h" # you most likely want to change this
dnl if test -r $PHP_SM3/$SEARCH_FOR; then # path given as parameter
dnl SM3_DIR=$PHP_SM3
dnl else # search default path list
dnl AC_MSG_CHECKING([for sm3 files in default path])
dnl for i in $SEARCH_PATH ; do
dnl if test -r $i/$SEARCH_FOR; then
dnl SM3_DIR=$i
dnl AC_MSG_RESULT(found in $i)
dnl fi
dnl done
dnl fi
dnl
dnl if test -z "$SM3_DIR"; then
dnl AC_MSG_RESULT([not found])
dnl AC_MSG_ERROR([Please reinstall the sm3 distribution])
dnl fi
dnl # --with-sm3 -> add include path
dnl PHP_ADD_INCLUDE($SM3_DIR/include)
dnl # --with-sm3 -> check for lib and symbol presence
dnl LIBNAME=SM3 # you may want to change this
dnl LIBSYMBOL=SM3 # you most likely want to change this
dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
dnl [
dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SM3_DIR/$PHP_LIBDIR, SM3_SHARED_LIBADD)
dnl AC_DEFINE(HAVE_SM3LIB,1,[ ])
dnl ],[
dnl AC_MSG_ERROR([wrong sm3 lib version or lib not found])
dnl ],[
dnl -L$SM3_DIR/$PHP_LIBDIR -lm
dnl ])
dnl
dnl PHP_SUBST(SM3_SHARED_LIBADD)
dnl # In case of no dependencies
AC_DEFINE(HAVE_SM3, 1, [ Have sm3 support ])
PHP_NEW_EXTENSION(sm3, sm3.c, $ext_shared)
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/state-secret-series/ext-sm3.git
git@gitee.com:state-secret-series/ext-sm3.git
state-secret-series
ext-sm3
ext-sm3
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891