automake

Changing *FLAGS in configure.ac vs. caching with subprojects

耗尽温柔 提交于 2019-12-10 18:08:04
问题 Say I wish to add a specific flag to CFLAGS within my configure script, that should propagate to all subprojects' configure scripts: CFLAGS+=" -Dfoobar" export CFLAGS AC_CONFIG_SUBDIRS([sub]) This works when configure is invoked trivially. As soon as one of the following happens: CFLAGS is exported in the environment when configure is invoked CFLAGS is set on configure command-line caching is used ( configure -C ) This approach no longer works. In the first two cases, the exported CFLAGS is

Automake - difficulty with installing version 'automake-1.14.1'

空扰寡人 提交于 2019-12-10 17:15:18
问题 I have problem with installing automake 1.14.1 on Rapbian (2014-09-09-wheezy-raspbian) distro. I wrote sh ./configure and then I wrote make then terminal wrote me that: $ make CDPATH="${ZSH_VERSION+.}:" && cd . && "/home/pi/LIBRARY/automake-1.14./twrap/aclocal-1.14" Can't locate /home/pi/LIBRARY/automake-1.14.1/bin/aclocal in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5usr /share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local

How do I link a shared library with --as-needed with automake?

混江龙づ霸主 提交于 2019-12-10 16:16:59
问题 How do I link a shared library with --as-needed using Automake? When I tried adding the flag to LDFLAGS , I saw libtool called as so: /bin/bash ../../libtool --mode=link ... -Wl,--as-needed ... dependencies Which results in a call to GCC like so: gcc -shared ... dependencies ... -Wl,--as-needed ... But that's the wrong order. Is there a way to do this with Libtool? Or is there a nice way to build shared libraries using Automake but without Libtool? (I've been frustrated at Libtool for various

Autoconf/Automake conditionals and dist rules

為{幸葍}努か 提交于 2019-12-10 15:56:49
问题 I recently started using autoconf and automake for a project I'm working on. The project's documentation is written in LaTeX. Since I don't want to have LaTeX as a dependency I want to check the presence of the pdflatex binary with autoconf and then use that information in the Makefile.am to decide whether to simply copy the .tex file to the documentation directory, or to generate the PDF and copy both. This is the relevant section in configure.ac : # Check for presence of pdfLaTeX AC_CHECK

automake,autoconf使用详解

元气小坏坏 提交于 2019-12-10 14:04:10
作为Linux下的程序开发人员,大家一定都遇到过Makefile,用make命令来编译自己写的程序确实是很方便.一般情况下,大家都是手工写一个简单Makefile,如果要想写出一个符合自由软件惯例的Makefile就不那么容易了. 在本文中,将给大家介绍如何使用autoconf和automake两个工具来帮助我们自动地生成符合自由软件惯例的 Makefile,这样就可以象常见的 GNU程序一样,只要使用”./configure”,”make”,”make instal”就可以把程序安装到Linux系统中去了. 这将特别适合想做开放源代码软件的程序开发人员,又或如果你只是自己写些小的Toy程序,那么这个文章对你也会有很大的帮助.   一.Makefile介绍   Makefile是用于自动编译和链接的 ,一个工程有很多文件组成,每一个文件的改变都会导致工程的重新链接,但是不是 所有的文件都需要重新编译,Makefile中纪录有文件的信息,在 make时会决定在链接的时候需要重新编译哪些文件.     Makefile的宗旨就是 :让编译器知道要编译一个文件需要依赖其他的 哪些文件.当那些依赖文件有了改变,编译器会自动的发现最终的生成文件已经过时,而重新编译相应的 模块.    Makefile的 基本结构不是 很复杂,但当一个程序开发人员开始写Makefile时,经常会怀疑自己写的

Calling SED for a source in Makefile.am

可紊 提交于 2019-12-10 10:03:38
问题 I've got c++ code that needs a sed done to it prior to compilation. How do I place this into Makefile.am ? I tried the typical makefile setup and the target appears to not exist: gentest.cc: $(SED) -i "s|FIND|REPLACE|" gentest.cc If you are interested as to why I want to do this, it's because I wrote my program ( slider3.py ) in python and my partner wrote his in c++ ( gentest.cc ) and his needs to call mine. I'm accomplishing this by editing the argv and then using execv() . ... { char *

What is the best way to set compilation flags for individual source files using GCC and autotools?

做~自己de王妃 提交于 2019-12-10 07:28:03
问题 I need to disable optimization flag for a individual file using autotools. What is the best way to do it? 回答1: Do you mean an individual source file or an individual executable? To disable optimization for an executable is simple: bin_PROGRAMS = myprog myprog_SOURCES = foo.c bar.c myprog_CFLAGS = -O0 If you mean that you want to disable the optimization for a single source file temporarily , say for debugging purposes, you can just remake that file at the prompt: (example from the automake

How to install a directory tree of data with automake

China☆狼群 提交于 2019-12-10 02:54:29
问题 How can I install a directory tree of HTML files, stylesheets and images with automake without having to create Makefiles in each subdirectory? Using the following in the toplevel directory htmldir = $(docdir)/foo/html html_DATA = \ stylesheets/foo.css \ images/foo.jpg \ index.html \ about/index.html \ faq/index.html EXTRA_DIST = $(html_DATA) fails because the subdirectories are not created before install is called. 回答1: You could write foohtmldir = $(htmldir)/foo/html nobase_dist_foohtml

Autotools library and object file output control

大兔子大兔子 提交于 2019-12-09 17:30:08
问题 My goal is to have all object files built in a .objs directory instead of the root of the Makefile, and to have the binaries (and libraries) copied into the project's bin/ directory. But I have been unable to find any resources to explain how to do this. How would I go about doing this? Here is my configure.ac and src/Makefile.am - I have similar Makefile.am files for two shared libraries that are referenced. They compile, and after copying them to the bin/ directory work as they should. I'm

Portably include GLib headers in autoconf/automake

不羁岁月 提交于 2019-12-09 11:22:38
问题 I need to include the GLib headers for a project that is built with an autoconf-based system for portability. How can I safely import the GLib headers in a portable manner? I know about pkg-config, but that is not entirely portable (since some systems don't have it and I would prefer to only rely on autoconf for configuration). 回答1: The GLib 2.22 INSTALL file states that pkg-config is a requirement for installing this library. I am not being GLib (pun intended!); statement of this requirement