automake

Install data directory tree with massive number of files using automake

断了今生、忘了曾经 提交于 2019-12-20 17:41:42
问题 I have a data directory which I would like automake to generate install and uninstall targets for. Essentially, I just want to copy this directory verbatim to the DATA directory, Normally, I might list all the files individually, like dist_whatever_DATA=dir/subdir/filea ... But the problem arises when my directory structure looks like this *root *subdir *~10 files *subdir *~10 files *subdir *~700 files *subdir ... ~20 subdirs I just cannot list all 1000+ files included as part of my Makefile

Cunit安装过程及问题解决

ⅰ亾dé卋堺 提交于 2019-12-20 08:56:35
系统ubuntu 18.04 版本CUnit-2.1-3 1.去下方网址,下载CUnit压缩包 https://sourceforge.net/projects/cunit/ 2. 解压缩 tar jxvf CUnit-2.1-3.tar.bz2 cd CUnit-2.1-3 3. 安装相关工具 sudo apt install libtool 4. aclocal warning : aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'。 解决办法: 可以不用理会,或者将configure.in改名为configure.ac 5. autoconf ( 注:autoconf 是用来生成自动配置软件源代码脚本(configure)的 工具) 6. automake error: required file 'config.h.in' not found 解决办法: 执行autoheader 参考:https://lists.gnu.org/archive/html/bug-gnulib/2012-11/msg00097.html error: required file './compile' not found 解决办法: automake --add-missing

configure/make/make install的作用

╄→尐↘猪︶ㄣ 提交于 2019-12-19 17:52:28
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 这些都是典型的使用GNU的AUTOCONF和AUTOMAKE产生的程序的安装步骤。 ./configure 是用来检测你的安装平台的目标特征的。比如它会检测你是不是有CC或GCC, 并不是需要CC或GCC,它是个shell脚本。 make 是用来编译的,它从Makefile中读取指令,然后编译。 make install 是用来安装的,它也从Makefile中读取指令,安装到指定的位置。 AUTOMAKE和AUTOCONF 是非常有用的用来发布C程序的东西。如果你也写程序想使用AUTOMAKE和AUTOCONF,可以参考CNGNU.ORG上的相关文章。 1、configure ,这一步一般用来生成 Makefile,为下一步的编译做准备,你可以通过在 configure 后加上参数来对安装进行控制,比如 代码: ./configure --prefix=/usr 上面的意思是将该软件安装在 /usr 下面,执行文件就会安装在 /usr/bin (而不是默认的 /usr/local/bin), 资源文件就会安装在 /usr/share(而不是默认的/usr/local/share)。 同时一些软件的配置文件你可以通过指定 --sys-config= 参数进行设定。 有一些软件还可以加上 --with、-

Autobook中文版(七)—9.一个小的GNU Autotools项目

点点圈 提交于 2019-12-19 17:51:16
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 9.一个小的GNU Autotools项目 原文:http://www.sourceware.org/autobook/ 本章介绍一个真实的小例子,演示一些GNU Autotools具有的特性,指明一些GNU Autotools使用上的陷阱。所有的源码能被下载从本书的主页上。这篇文章是我多年使用GNU Autotools的经验,你应该能够很容易地在你的项目里应用这些。首先,我将讲述在项目早期阶段遇到的一些问题。然后举例说明所涉及的问题,继续给你展示一个我的项目所使用的技术的基本结构,接着是可移植命令行shell库的实现细节。然后用一个小的shell库的实例程序结束本章。 后面,在12. A Large GNU Autotools Project and 20. A Complex GNU Autotools Project,这个例子将被逐渐地扩展,介绍一下新的GNU Autotools特性。 9.1 GNU Autotools 实战 这章详细讲述在这个项目开始的时候我遇到的一些具体的问题,是一些典型的,你可能想要在自己的项目中使用的技术,要不是那个正确的解决方案不可能立即明白的。如果你偶然遇到了类似的情况,你总是能够回来参考这章。我将介绍一下项目的架构,以便你做出更好的权衡,你可能有一个相对于我这里的项目

Install arbitrary data files in fixed location with Automake?

时光总嘲笑我的痴心妄想 提交于 2019-12-19 07:24:37
问题 How can I tell automake to install arbitrary data files in places I want? I have some files I need to put in specific places, e.g. " datafile1 ", in my project, needs to be copied to " /usr/MyProduct/flash_memory ". " /usr/MyProduct/flash_memory " is an absolute path that I can't change. " datafile1 " is a binary data file that is not "built" by make , but just needs to be copied by make install . I can't bear on make dist . It needs to be copied by make install (its a long explanation, so,

Autotools : how to set global compilation flag

走远了吗. 提交于 2019-12-18 12:18:24
问题 I have a project with several sources directories : src/A /B /C In each, the Makefile.am contains AM_CXXFLAGS = -fPIC -Wall -Wextra How can avoid repeating this in each source folder ? I tried to modifiy src/Makefile.am and the configure.in, but without success. I thought I could use AC_PROG_CXX to set the compilation flags globally but can't find much documentation on how to use those macro (do you have any pointer to such a documentation ?). Thanks in advance 回答1: You can do several things:

Directory structure for a C++ library

痴心易碎 提交于 2019-12-17 17:21:56
问题 I am working on a C++ library. Ultimately, I would like to make it publicly available for multiple platforms (Linux and Windows at least), along with some examples and Python bindings. Work is progressing nicely, but at the moment the project is quite messy, built solely in and for Visual C++ and not multi-platform at all. Therefore, I feel a cleanup is in order. The first thing I'd like to improve is the project's directory structure. I'd like to create a structure that is suitable for the

GNU Autotools的使用方法

∥☆過路亽.° 提交于 2019-12-15 20:19:52
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 手工写Makefile是一件很有趣的事情,对于比较大型的项目,如果有工具可以代劳,自然是一件好事。在Linux系统开发环境中,GNU Autotools 无疑就充当了这个重要角色。(在Windows系统的开发环境中,IDE工具,诸如Visual Studio,来管理项目也很方便。) 本文以一个简单项目为例子,来讲述GNU Autotools的一列工具及其命令的用法。 autotools是系列工具, 它主要由autoconf、automake、perl语言环境和m4等组成;所包含的命令有五个: (1)aclocal (2)autoscan (3)autoconf (4)autoheader (5)automake 一、准备源代码 (1)目录project包含一个main.c的文件和两个子目录lib与include;lib目录中包含一个test.c,include目录中包含一个test.h。在系统中,显示如下: [root@localhost project]# ls include lib main.c [root@localhost project]# [root@localhost project]# ls include/ test.h [root@localhost project]# ls lib/

绝世秘籍之GNU构建系统与Autotool概念分析

泄露秘密 提交于 2019-12-15 20:18:11
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 为了简化可移植构建的难度,在早期有一套autotools工具帮助程序员构建软件。我们熟知的configure->make->make install三部曲,大多都是基于autotools来构建的。autotools是GNU程序的标准构建系统,所以其实我们经常在使用三部曲。有些程序虽然也是这三部曲,但却不是用autotools实现的,比如nginx的源码就是作者自己编写的构建程序。 用户视角 用户通过configure->make->make install基于源码安装软件。然而大部分用户可能并不知道这个过程究竟做了些什么。 configure脚本是由软件开发者维护并发布给用户使用的shell脚本。这个脚本的作用是检测系统环境,最终目的是生成Makefile和config.h。 make通过读取Makefile文件,开始构建软件。而make install可以将软件安装到需要安装的位置。 如上图,开发者在分发源码包时,除了源代码(.c .h…),还有许多用以支撑软件构建的文件和工具,其中最重要的文件就是Makefile.in和config.h.in。configure脚本执行成功后,将为每一个*.in文件处理成对应的非*.in文件。 大部分情况只生成Makefile和config.h

autoconfig,automake 编译project

南楼画角 提交于 2019-12-15 09:47:59
autoconfig,automake编译project 编辑文件: helloworld.c configure.ac Makefile.am 创建过程: autoscan; aclocal; autocconf; automake --add-missing; ./configure ; make 下面给出helloworld 的例子 $cat helloworld.c #include <stdio.h> int main() { printf("hello world\n"); return 0; } configure.ac 的编写 autoscan ; cp configure.scan configure.ac ; vim configure.ac configure.ac 主要是定义一些宏 其中AC_INIT_AUTOMAKE是需要手动添加的 $cat configure.ac # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS]) AC_CONFIG_SRCDIR([main.c]) AM