惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
量子位
aimingoo的专栏
aimingoo的专栏
V
V2EX
Vercel News
Vercel News
B
Blog
M
MIT News - Artificial intelligence
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
N
News and Events Feed by Topic
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
S
Secure Thoughts
U
Unit 42
博客园 - 叶小钗
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
Help Net Security
Help Net Security
S
Security Affairs
Microsoft Security Blog
Microsoft Security Blog
W
WeLiveSecurity
博客园 - Franky
Forbes - Security
Forbes - Security
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Schneier on Security
Schneier on Security
I
InfoQ
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Webroot Blog
Webroot Blog
AWS News Blog
AWS News Blog
Last Week in AI
Last Week in AI
Security Archives - TechRepublic
Security Archives - TechRepublic
C
CERT Recently Published Vulnerability Notes
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
L
Lohrmann on Cybersecurity
SecWiki News
SecWiki News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
J
Java Code Geeks

博客园 - thh

svm资料收集 向量空间及其他相关数学结构 Linq 中不爽之处 关于UI设计的文章汇总 Window Live Writer LR 剖析器 MVP模式中的P和V关系 Guid、Int、BigInt编号的速度和存储空间的比较 静态构造函数线程安全的几个版本[转载] 区域性 ID 2155 (0x086B)不是受支持的区域性 解决方法 windbg给clr设置断点 python ip和int 互转函数 interface与pojo类之间的关系 关于OpenId Python SOAPpy访问asp.net web service 代码 Python SOAPpy 和 .net WebService Type.GetType 获得本Assembly以外的类型 NHibernate 代码生成工具 NHibernate使用笔记
难题--autoconf、automake、libtool
thh · 2009-07-17 · via 博客园 - thh

 1、./configure 脚本生成 自定义宏(Defining C Preprocessor Symbols):
     在 configure.in,通过 AC_DEFINE([STUDY],[yes],[define test]) 定义。 这个例子中定义个 STUDY的宏,值为 yes。执行 autoreconf ,然后configure后,输入的config.h中,基本就是下面的样子:

/* define test */
#define STUDY yes

     重点: gnu风格的程序,通过 configure & make 编译程序。configure分析系统环境,并保存结果,供源代码使用。AC_DEFINE 是保存结果的方式之一。

2、./configure 使用 --with-package功能: 
     AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given]) 有4个参数,参考官方说明,比较容易理解。但是有点小麻烦,如--with-package=ABC,如果获取 '='后面的值,成为一个问题。看官方例子:

AC_ARG_WITH([readline],
    [AS_HELP_STRING([
--with-readline],
        [support fancy command line editing @
<:@default=check@:>@])],
    []
,
    [with_readline
=check])

LIBREADLINE

=
AS_IF([test 
"x$with_readline" != xno],
    [AC_CHECK_LIB([
readline], [main],
    [AC_SUBST([LIBREADLINE]
, ["-lreadline -lncurses"])
        AC_DEFINE([HAVE_LIBREADLINE]
, [1],
             [Define 
if you have libreadline])
    ]
,
    [
if test "x$with_readline" != xcheck; then
        AC_MSG_FAILURE(
            [
--with-readline was given, but test for readline failed])
    fi
    ]
, -lncurses)])

     其中 with_readline=check  和 [test "x$with_readline" != xno] 两行说明,可以通过 $with_<pakcage> shell变量,来获取命令行中的值(= 后面的部分)。经过实践:
               如果没有指定 --with-<package>,则 $with_<package>为空,
               如果指定 --without-<package>,则 $with_<package>为no
               如果指定 --with-<package>,则 $with_<package>为yes,
               如果指定 --with-<package>=ABC,则 $with_<package>为'ABC',
    重点: 如何通过命令行,对源代码配置进行适当的配置,$with_<package> 之类的参数提供一种沟通方式,让编译者控制源代码的生成。当然这个也需要用到 AC_DEFINE之类的命令。