标签: autotools

如何使用自动工具为 Windows 生成配置脚本

我正在用 C++ 编写一个应用程序,并使用自动工具制作构建脚本。然后,最终用户将能够./configure && make && make install在源目录中运行。我的问题是:同样的命令可以在 Windows 上使用吗?如果没有,我如何使用 autotools 实现类似的过程?或者 autotools 无法为 Windows 生成构建脚本?如果是这样,哪个构建工具可以用于 Windows?提前致谢 !

windows autotools configure gnu-make

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

autotools可以创建多平台makefile

我有一个插件项目,我已经开发了几年,插件与[主应用程序版本,第三方库版本,32位与64位]的多种组合一起工作.是否有一种(干净的)方法来使用autotools来创建构建插件的所有版本的单个makefile.

从浏览autotools文档我可以看出,与我想要的最接近的是拥有项目的N个独立副本,每个副本都有自己的makefile.这对于测试和开发来说似乎有点不理想,因为(a)我需要在所有不同的副本中不断传播代码更​​改,并且(b)在复制项目时有很多浪费的空间.有没有更好的办法?

编辑:

我已经推出了自己的解决方案一段时间,我有一个花哨的makefile和一些perl脚本来搜索各种第三方库版本等.因此,我对其他非autotools解决方案持开放态度.对于其他构建工具,我希望它们对于最终用户来说非常容易安装.这些工具还需要足够智能,以便在没有大量麻烦的情况下搜索各种第三方库和标题.我主要是在寻找一个Linux解决方案,但也适用于Windows和/或Mac的解决方案.

64-bit 32-bit makefile multiplatform autotools

2
推荐指数
2
解决办法
2230
查看次数

使用Autotools创建新的共享库

我想要做的是创建一个新的共享库,称为libxxx链接另一个被称为libzzz共享库的共享库,这个共享库有一个独立的"pkg-config"式工具,假设它叫做"zzz-config",它提供了所需的cflags在编译阶段使用时libzzz.我想做的是:

  • 创建configure/makefile等..使用autotools,如automake,autoconf等;
  • 它必须使用zzz-config上面引用的脚本;
  • 它必须为源生成自动依赖项;
  • 它必须具有构建调试(没有优化)和发布(带优化)构建的模式;
  • 源代码是C++;
  • 它必须以共享库为目标;
  • 它必须读取src目录的源并将编译的文件放在另一个目录中

我已经阅读了几乎所有可用的autotools教程,但我无法想办法做到这一点,如果你能指出一些例子会非常友善.

谢谢 !

c++ gcc g++ autotools shared-libraries

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

Git diff忽略

是不是可以在git diff中忽略某些文件?我特别感兴趣的是过滤掉Makefile.in,Makefile,configure(以及所有自动生成的垃圾).

git autotools

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

当我的包只用C构建时,如何告诉autoconf不要探测fortran,C++等?

这一直困扰着我多年,但我一直忽视它,就像我怀疑其他人一样.

AM_INIT_AUTOMAKE([dist-bzip2])
AC_PROG_CC
AC_PROG_LIBTOOL
AC_C_INLINE
AM_PROG_CC_C_O
Run Code Online (Sandbox Code Playgroud)

有了上面的configure.ac文件,configure会去找我一个C编译器,但接下来继续:

checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for …
Run Code Online (Sandbox Code Playgroud)

automake autoconf autotools libtool

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

Autoconf和makefile

我正在尝试学习GNU autotools,我正在学习一些教程,我尝试一步一步地从:

http://kern-81.homepage.t-online.de/autotools_tutorial.pdf

但我有一个问题,在第8页有手动编写的Makefile.in和一行:

BINDIR=@bindir@
Run Code Online (Sandbox Code Playgroud)

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

在我生成的makefile中,我得到了

BINDIR=${exec_prefix}/bin
Run Code Online (Sandbox Code Playgroud)

但是当我这样做的时候

@echo $(exec_prefix)
Run Code Online (Sandbox Code Playgroud)

似乎这个变量是空的,所以我想做的一切

make install 
Run Code Online (Sandbox Code Playgroud)

会去/ bin,这有点奇怪,为什么它没有设置为/ usr/bin,我应该向autoconf发出一些参数吗?

同样在这个.pdf文件中写道:

bindir is an output variable of AC INIT which also detects includedir, srcdir, libdir, and others.
Run Code Online (Sandbox Code Playgroud)

是真的吗?因为在这个autoconf.am的例子中它是:

AC_INIT(helloworld, 0.0.1, dev@helloworld.org)
Run Code Online (Sandbox Code Playgroud)

所以这个简单的宏做了所有这些?如果有,怎么样?

autoconf makefile autotools

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

使用automake安装标头

我正在编写一个使用autotools进行编译/安装的库.我的目录树有点像这样

/src/
    file1.cpp
    file2.cpp
/include/
    dir/
        header1.hpp
        header2.hpp
        subdir/
            header.hpp
configure.ac
Makefile.am
Run Code Online (Sandbox Code Playgroud)

我想在安装头include/subdir/*$(includedir)/subdir/.我怎么做?不,递归makefile不是一种选择.递归使得被认为是有害的. http://miller.emu.id.au/pmiller/books/rmch/

c++ automake autotools

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

如何将automake安装头文件放在include的子目录中

我当前的项目在其include/tatoparser目录中有几个文件,我想与我的库一起分发.

qdii@nomada ~/MyProject $ ls include/tatoparser/
dataset.h  interface_lib.h  linkset.h  sentence.h  tagset.h
Run Code Online (Sandbox Code Playgroud)

我创建了一个Makefile.am引用这些文件:

qdii@nomada ~/MyProject $ cat include/Makefile.am 
include_HEADERS = tatoparser/interface_lib.h tatoparser/sentence.h tatoparser/dataset.h tatoparser/tagset.h tatoparser/linkset.h
Run Code Online (Sandbox Code Playgroud)

但是,当我运行make install引用的文件被复制到/usr/include(或$(includedir)设置为)时,我希望它们被复制/usr/include/tatoparser.

我怎样才能做到这一点?

autoconf makefile autotools libtool

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

使autoconf"检查"目标而不运行它

有没有办法编译autoconf项目的"检查"目标而不运行它?

我有Eclipse Juno和"C/C++单元测试"插件.我希望能够制作检查目标,然后在插件的上下文中运行它,以便我可以利用它的便利性.

目前我已经设置了项目配置来构建"make check",然后运行它创建的"test"二进制文件.这有两个问题.

1)它是冗余的并且减慢了过程(测试运行两次)

2)测试失败导致构建失败.Eclipse不知道区别.我必须注意输出,然后在单元测试插件中运行,以获得我想要的东西.

如果没有办法只编译检查目标,是否有其他方法可以设置autoconf/automake以允许我构建测试目标而无需创建一个特殊的配置来构建测试作为"make all"的一部分?基本上,我想在一个配置中拥有所有3个选项:

make unitTest (for development)
make check    (for automated testing)
make all      (for release)
Run Code Online (Sandbox Code Playgroud)

编辑:只是澄清一点,我知道我可以从目标目录运行"make targetName"来编译该目标(project/src/test> make myUnitTests).我正在寻找从项目的基本目录(项目> make check_PROGRAMS)执行此操作的通用方法.

eclipse automake autoconf unit-testing autotools

2
推荐指数
2
解决办法
829
查看次数

我可以使用AC_XXXX_CONFIG语法将宏定义放入config.h吗?

我知道AC_SUBST(VAR)将VAR传递给Makefile.am。

有什么语法可以在configure.ac中将我的#define生成到config.h中吗?

c linux automake autotools

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