标签: autotools

什么是Makefile.am和Makefile.in?

这两个文件主要出现在开源项目中.

它们是什么,它们是如何工作的?

automake makefile autotools

312
推荐指数
4
解决办法
17万
查看次数

247
推荐指数
5
解决办法
9万
查看次数

安装,但不是默认目录?

我想运行'make install'所以我拥有我需要的一切,但是我想把它安装在自己的文件夹中而不是系统的/ usr/bin等可能吗?即使它引用了/ usr/bin等中的工具?

linux gcc makefile autotools

129
推荐指数
5
解决办法
16万
查看次数

错误:使用了Libtool库,但未定义"LIBTOOL"

我正在尝试automake使用OrientDb C++库,但是遇到了一些错误.

Makefile.am:10: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:10:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:10:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:10:   If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:10:   its definition is in aclocal's search path.
Run Code Online (Sandbox Code Playgroud)

https://github.com/tglman/orientdb-c

https://github.com/tglman/orientdb-c/wiki/Install

我已经定义了configure.ac和Makefile.am.

我运行以下autotools

  • aclocal会

  • 和autoheader

  • automake的:

libtool(GNU libtool)2.4.2

configure.ac

# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([orientdb-c],[0.9])
AC_CONFIG_SRCDIR([src/o_query_internal.h])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE()

# …
Run Code Online (Sandbox Code Playgroud)

c linux autotools orientdb

107
推荐指数
3
解决办法
9万
查看次数

可能是未定义的宏:AC_MSG_ERROR

我在configure.ac中有以下内容:

AC_CHECK_PROGS(MAKE,$MAKE make gmake,error)
if test "x$MAKE" = "xerror" ;then
  AC_MSG_ERROR([cannot find a make command])
fi
Run Code Online (Sandbox Code Playgroud)

这已经在我们的项目中很长一段时间了,但在一些设置中,我得到这个错误:

configure.ac:45: error: possibly undefined macro: AC_MSG_ERROR
  If this token and others are legitimate, please use m4_pattern_allow.
  See the Autoconf documentation.
Run Code Online (Sandbox Code Playgroud)

最近在上面添加的行:

AC_CONFIG_MACRO_DIR([m4])
LT_INIT
Run Code Online (Sandbox Code Playgroud)

任何人都可以解释导致此错误的原因以及如何追踪问题?

编辑:添加有关差异的详细信息.

有效的盒子:

uname -a Linux host1 2.6.38-13-generic #53-Ubuntu SMP Mon Nov 28 19:33:45 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

automake: 1.11.1
autoconf: 2.67
m4: 1.4.14
libtoolize: 2.2.6b
Run Code Online (Sandbox Code Playgroud)

不起作用的盒子:

Linux host2 2.6.32-35-generic-pae #78-Ubuntu SMP Tue Oct 11 17:01:12 UTC …
Run Code Online (Sandbox Code Playgroud)

autoconf autotools

106
推荐指数
8
解决办法
12万
查看次数

CFLAGS与CPPFLAGS

我知道CFLAGS(或CXXFLAGS for C++)是针对编译器的,而CPPFLAGS是由预处理器使用的.

但我仍然不明白其中的区别.

我需要为#include包含的头文件指定一个包含路径 - 因为#include是一个预处理器指令,是我唯一关心的预处理器(CPPFLAGS)吗?

在什么情况下我需要给编译器一个额外的包含路径?

通常,如果预处理器找到并包含所需的头文件,为什么需要告知额外的包含目录?CFLAGS有什么用?

(在我的情况下,我实际上发现这两个允许我编译我的程序,这增加了混乱...我可以使用CFLAGS CPPFLAGS来实现我的目标(至少在autoconf上下文中.)给出了什么?)

autoconf makefile autotools cflags

92
推荐指数
2
解决办法
11万
查看次数

libtool版本不匹配错误

在Ubuntu 10.04上使用kdevelop 3.5构建我的应用程序时,我收到以下错误:

libtool: Version mismatch error. This is libtool 2.2.6 Debian-2.2.6a-4, but the
libtool: definition of this LT_INIT comes from libtool 2.2.6b.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 Debian-2.2.6a-4
libtool: and run autoconf again.
make[2]: *** [wktools4] Error 63
make[2]: Target `all' not remade because of errors.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Exited with status: 2 ***
Run Code Online (Sandbox Code Playgroud)

我在哪里可以获得所需的libtool版本,或者如何重新创建aclocal.m4?

autotools libtool

72
推荐指数
3
解决办法
7万
查看次数

为什么shell脚本比较经常使用x $ VAR = xyes?

我经常在使用autotools(autoconf,automake)的项目的构建脚本中看到这一点.当有人想检查shell变量的值时,他们经常使用这个习惯用法:

if test "x$SHELL_VAR" = "xyes"; then
...
Run Code Online (Sandbox Code Playgroud)

与简单地检查这样的值相比,这有什么好处:

if test $SHELL_VAR = "yes"; then
...
Run Code Online (Sandbox Code Playgroud)

我认为必须有一些原因让我经常看到这一点,但我无法弄清楚它是什么.

unix shell autotools

59
推荐指数
4
解决办法
2万
查看次数

GNU autotools:调试/发布目标?

我一直在寻找这个:我目前正在将一个中型程序转换为autotools,来自基于Eclipse的方法(带有makefile)

我总是习惯于进行"调试"构建,包含所有调试符号和没有优化,以及"发布"构建,没有调试符号和最佳优化.

现在我试图用autotools以某种方式复制它,所以我可以(也许)做类似的事情:

./configure
make debug
Run Code Online (Sandbox Code Playgroud)

哪个会有所有调试符号而没有优化,以及哪里:

./configure
make
Run Code Online (Sandbox Code Playgroud)

会导致"发布"版本(默认)

PS:我已经阅读了关于--enable-debug标志/功能的内容,但在我目前的(简单)设置​​中,使用它无法识别 configure

c++ automake autoconf autotools

58
推荐指数
3
解决办法
4万
查看次数

Autoconf和Autotools的替代品?

我是GNU Autotools的常用用户(主要是Autoconf,偶尔也是Libtool).我正在开展一个可移植性将成为关键点的项目.然而,团队的其他成员只是不习惯使用m4.我得到这个在我的收件箱从不是一个,而是四个人:

m4不是lisp,该死!

无论如何,也许有人可以推荐基于Python或PHP的东西?我正在研究一棵更大的树的C端; 我可以肯定会出现Python或PHP 5,因为它们是先决条件.

c autoconf autotools

54
推荐指数
5
解决办法
2万
查看次数

标签 统计

autotools ×10

autoconf ×4

makefile ×3

automake ×2

c ×2

linux ×2

build ×1

build-system ×1

c++ ×1

cflags ×1

cmake ×1

gcc ×1

libtool ×1

orientdb ×1

scons ×1

shell ×1

unix ×1