标签: automake

libtool 不提供要链接的库依赖项

我在 ubuntu lucid 上使用 libtool 2.2.6b,在 ubuntu precision 上使用 libtool 2.4.2。清醒时,我的项目将正确链接。准确地说,它无法链接。这是演示我的问题的示例代码;

配置文件

AC_INIT([ltp], [0.0.1], [someone])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([.m4])
AC_CONFIG_FILES([Makefile foo/Makefile bar/Makefile wah/Makefile])
AC_PROG_CXX
AC_PROG_LIBTOOL
AM_SANITY_CHECK
AC_LANG_CPLUSPLUS
AC_OUTPUT
Run Code Online (Sandbox Code Playgroud)

生成文件

SUBDIRS = foo bar wah
ACLOCAL_AMFLAGS = -I .m4
Run Code Online (Sandbox Code Playgroud)

foo/foo.h

#ifndef FOO_FOO_H_
#define FOO_FOO_H_
namespace Foo
{
  class Foo
  {
  public:
    Foo(long l);
  private:
    long l;
  };
}
#endif
Run Code Online (Sandbox Code Playgroud)

foo/foo.cpp

#include "foo/Foo.h"
namespace Foo
{
  Foo::Foo(long l) : l(l) {}
}
Run Code Online (Sandbox Code Playgroud)

foo/Makefile.am

lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = Foo.cpp
libfoo_la_CPPFLAGS =
libfoo_la_LDFLAGS = …
Run Code Online (Sandbox Code Playgroud)

automake libtool

4
推荐指数
1
解决办法
3508
查看次数

如何使用 automake 启用安静构建?

想象一下 autoconf 生成的以下目标和命令:

.c.lo:
    $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
    $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
Run Code Online (Sandbox Code Playgroud)

我正在 Makefile.am 中寻找一种方法来操作该命令,知道该命令是由 autoconf 生成的,但我不知道它是什么。理论上,是这样的:

if BUILD_QUIETLY
    Q=@
endif

.c.lo:
     $(Q)$(autoconf-command-for-c-lo)
Run Code Online (Sandbox Code Playgroud)

或者类似的东西(这类似于 Linux 内核的构建输出):

quiet_cmd_cc = CC     $@
      cmd_cc = $(autoconf-command-for-c-o)

.c.o:
    $(call cmd,cc)
Run Code Online (Sandbox Code Playgroud)

其中是执行并打印或基于变量的cmd函数。cmd_$1quiet_cmd_$1cmd_$1

我在互联网上查找了此内容,但大多数网站都讨论了 autoconf 的基础知识。这里似乎也没有任何与此相关的问题。

这可能吗?

automake

4
推荐指数
1
解决办法
1968
查看次数

在 unix 上构建 m4、autoconf、automake、libtool

我正在尝试在 HP-UX 服务器上设置 PHP、apache 环境。在安装时,我使用“./configur、make、make install”的常用命令。在这里,当我尝试安装 PCRE 时,出现如下错误。

CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/ubuntu/softwares/m4-1.4.17/build-aux/missing aclocal-1.14 -I m4 /home/ubuntu/softwares/m4-1.4.17/build-aux/missing: line 81: aclocal-1.14: command not found WARNING: 'aclocal-1.14' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/> Makefile:1496: recipe for target …
Run Code Online (Sandbox Code Playgroud)

unix automake autoconf m4

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

autotools 是否有 AC_ARG_ENABLE action-if-given 的缩写

我可能需要添加很多AC_ARG_ENABLE,目前我正在使用下面的语法,这是我唯一工作的语法,但我想知道是否已经有一些m4宏用于我正在使用的简单的action-if-given测试(我做了一些搜索,但什么也没找到)或更好的更清晰的语法。

我见过一些空的例子,[]但无法让它工作,我需要创建一个新的宏吗?

AC_ARG_ENABLE([welcome],
    AS_HELP_STRING([--enable-welcome], [Enable welcome route example @<:@default=yes@:>@]),
    [case "${enableval}" in
        yes) enable_welcome=true ;;
        no)  enable_welcome=false ;;
        *) AC_MSG_ERROR([bad value ${enableval} for --enable-welcome]) ;;
     esac],[enable_welcome=true])
AM_CONDITIONAL([ENABLE_WELCOME], [test x$enable_welcome = xtrue])
Run Code Online (Sandbox Code Playgroud)

这是我如何使用它的Makefile.am

if ENABLE_WELCOME
...
endif
Run Code Online (Sandbox Code Playgroud)

automake autoconf autotools

4
推荐指数
1
解决办法
3148
查看次数

在 Cygwin 中安装 Make

我正在尝试使用 cygwin 在 windows 7 环境中构建一个 Linux 项目。但是,在配置makecygwin 安装时,我不断遇到以下错误。

-bash: make: command not found
Run Code Online (Sandbox Code Playgroud)

在 inernet 上搜索后,唯一的解决方案是重新运行安装make程序和已安装的包。我已经安装了 automake1.15 但它在noarch文件夹中并且make.exebin 文件夹中没有二进制文件。

windows installation automake cygwin

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

autoreconf 失败并显示“可能未定义的宏:AM_PATH_GLIB_2_0”

在修改此源代码时,我收到此错误autoreconf

$ autoreconf
configure.ac:240: warning: macro 'AM_PATH_GLIB_2_0' not found in library
configure.ac:246: warning: macro 'AM_PATH_GTK_2_0' not found in library
configure.ac:240: error: possibly undefined macro: AM_PATH_GLIB_2_0
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:246: error: possibly undefined macro: AM_PATH_GTK_2_0
autoreconf: /usr/bin/autoconf failed with exit status: 1
Run Code Online (Sandbox Code Playgroud)

中的行configure.ac是:

AM_PATH_GLIB_2_0([2.7.1], [ac_glib_test="yes"], [ac_glib_test="no"], [gthread])
Run Code Online (Sandbox Code Playgroud)

这是我使用的 autoconf/automake 工具版本的问题,还是其他原因?

谢谢。

c automake autoconf autoreconf slurm

4
推荐指数
1
解决办法
3111
查看次数

我该如何编译这个插件?

我正在关注foo解析器示例,但想知道如何编译它.

foo解剖器示例显示在以下链接中:http: //www.wireshark.org/docs/wsdg_html_chunked/ChDissectAdd.html

你会注意到它提到interlink目录包含我可以使用的支持文件的好例子,我需要修改Makefile.am和makefile.com等等.我已经修改了这些以反映foo模块.

但是,现在我想知道如何构建它.我试过运行automake但它抱怨没有configure.in.对不起,我对gnu构建环境并不熟悉.

此外,是否可以独立构建此模块?或者我是否需要所有其他wirehark来源?我当然在ubuntu下安装了wireshark-dev.

automake gnu makefile wireshark wireshark-dissector

3
推荐指数
1
解决办法
4548
查看次数

Automake silent-rules(默认情况下是?)

automake的"静默规则"选项的文档声明默认情况下将关闭静默规则,并且只有在用户在运行configure时明确要求时才会打开静默规则:

http://www.gnu.org/software/automake/manual/html_node/Options.html#index-Option_002c-_0040option_007bsilent_002drules_007d-915

我真的很想知道默认情况下如何启用静默规则,而是通过选项禁用.我可以想到几个方面,但你们可能知道的任何特别官方或干净的方式吗?

automake autoconf autotools

3
推荐指数
1
解决办法
899
查看次数

如何在autotools项目中有条件地编译?

我有一个autotools项目.如果用户在构建期间进行配置,我希望从项目中排除一些文件.例如,如果使用--no-gui配置构建,则与GUI相关的文件不会包含在构建中.

  1. autoconf中这种标志的标准宏是什么?可以用--disable-gui配置的东西吗?

  2. 如何建立此配置选项和automake输入文件之间的链接?

我在这里有Calcote的入门书Autotools.如果你能指出所涉及的宏,我可以在书中或网上查找.

谢谢,

Elan公司.

automake autoconf autotools

3
推荐指数
1
解决办法
3446
查看次数

通过自动工具查询pkg-config变量

要安装目录文件,我想获得Glade(UI设计器)的目录,如下所示:

$ pkg-config --variable=catalogdir gladeui-2.0
/usr/share/glade/catalogs
Run Code Online (Sandbox Code Playgroud)

但是在我的Makefile.am中的变量中。有(便携式)方法可以做到这一点吗?

automake autoconf glade pkg-config autotools

3
推荐指数
1
解决办法
1107
查看次数