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

推荐订阅源

S
Security @ Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
Spread Privacy
Spread Privacy
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
C
Cybersecurity and Infrastructure Security Agency CISA
G
GRAHAM CLULEY
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
I
Intezer
S
Securelist
Google DeepMind News
Google DeepMind News
S
Schneier on Security
T
Troy Hunt's Blog
Help Net Security
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
V
V2EX
Security Archives - TechRepublic
Security Archives - TechRepublic
O
OpenAI News
博客园 - Franky
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
TaoSecurity Blog
TaoSecurity Blog
MyScale Blog
MyScale Blog
P
Privacy International News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Google Online Security Blog
Google Online Security Blog
Latest news
Latest news
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
博客园_首页
S
Security Affairs
PCI Perspectives
PCI Perspectives
WordPress大学
WordPress大学
C
Cisco Blogs
Recent Announcements
Recent Announcements
L
LangChain Blog
GbyAI
GbyAI
F
Fortinet All Blogs
N
News and Events Feed by Topic
T
Tor Project blog
IT之家
IT之家
P
Palo Alto Networks Blog
D
DataBreaches.Net
小众软件
小众软件
宝玉的分享
宝玉的分享
F
Full Disclosure

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