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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - thh

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