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

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - 司徒正美
N
News and Events Feed by Topic
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
Help Net Security
Help Net Security
N
News and Events Feed by Topic
O
OpenAI News
L
LangChain Blog
F
Full Disclosure
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
GbyAI
GbyAI
Cloudbric
Cloudbric
W
WeLiveSecurity
Application and Cybersecurity Blog
Application and Cybersecurity Blog
罗磊的独立博客
Attack and Defense Labs
Attack and Defense Labs
PCI Perspectives
PCI Perspectives
TaoSecurity Blog
TaoSecurity Blog
AI
AI
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Apple Machine Learning Research
Apple Machine Learning Research
C
CERT Recently Published Vulnerability Notes
T
The Exploit Database - CXSecurity.com
T
Threatpost
P
Palo Alto Networks Blog
G
GRAHAM CLULEY
Last Week in AI
Last Week in AI
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - 聂微东
P
Proofpoint News Feed
Latest news
Latest news
S
SegmentFault 最新的问题
J
Java Code Geeks
T
Threat Research - Cisco Blogs
H
Help Net Security
P
Privacy International News Feed

博客园 - 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之类的命令。