这两个文件主要出现在开源项目中.
它们是什么,它们是如何工作的?
Autotools,Cmake和Scons之间有什么区别?
我想运行'make install'所以我拥有我需要的一切,但是我想把它安装在自己的文件夹中而不是系统的/ usr/bin等可能吗?即使它引用了/ usr/bin等中的工具?
我正在尝试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) 我在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) 我知道CFLAGS(或CXXFLAGS for C++)是针对编译器的,而CPPFLAGS是由预处理器使用的.
但我仍然不明白其中的区别.
我需要为#include包含的头文件指定一个包含路径 - 因为#include是一个预处理器指令,是我唯一关心的预处理器(CPPFLAGS)吗?
在什么情况下我需要给编译器一个额外的包含路径?
通常,如果预处理器找到并包含所需的头文件,为什么需要告知额外的包含目录?CFLAGS有什么用?
(在我的情况下,我实际上发现这两个允许我编译我的程序,这增加了混乱...我可以使用CFLAGS 或 CPPFLAGS来实现我的目标(至少在autoconf上下文中.)给出了什么?)
在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(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)
我认为必须有一些原因让我经常看到这一点,但我无法弄清楚它是什么.
我一直在寻找这个:我目前正在将一个中型程序转换为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