autotools

Correcting the GCC command line ordering using Automake

喜欢而已 提交于 2020-01-01 04:58:06
问题 I have an autotools project that compiles just fine on the Mac, but under Linux (Ubuntu 12.04.1 LTS) the command lines passed to gcc have the libraries out of order relative to the object files. For example, autotools generates the following command to compile my code, a single file named test.c into a binary named test : gcc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -g -O2 -lglib-2.0 -o test test-test.o This command line fails with: /home/user/glib-test/test.c:4:

Where to add a CFLAG, such as -std=gnu99, into an (Eclipse CDT) autotools project

六月ゝ 毕业季﹏ 提交于 2019-12-31 13:55:24
问题 I have a simple Autotools C project (not C++), whose skeleton was created for me by Eclipse CDT (Juno). CFLAGs (by inspection) seem to be -g -O2 . I want all of the generated make files to also have -std=gnu99 appended to the CFLAGs, because I use for (int i = 0; i < MAX; i++) and similar. I can obviously hack the Makefile, but this gets overwritten on ./configure . Where is the correct place to add (or change) CFLAGs which are required by the code (as opposed to those CFLAGs which the user

How to NOT print in the output a comment in a makefile

时间秒杀一切 提交于 2019-12-31 09:12:07
问题 I have a makefile that is like this: install: @somecommand #some explanation for next command @lastcommand What happens is that the comment #some explanation for next command is being printed when I execute make install . How can I make a comment in a makefile that doesn't get printed? Maybe I'm looking for the unix equivalent for the windowsy echo off ? (Effectively, the opposite of this question.) 回答1: Don't indent the comment — when the line starts with a tab, it is a command that is

Unit tests using Automake

谁说我不能喝 提交于 2019-12-30 09:44:08
问题 I am working in a project with other people in the team using GNU autotools. In the project we are using unit test for each non trivial C++ class. I found out that there is support for unit testing. For that I am using this structure: ./ + tests/ + Makefile.am + classA_test.cc .... + classB_test.cc + src/ + lib/ + Makefile.am The problem comes since my main Makefile.am is using subdir-objects options --note that I am not using recursive makefile for the source files--, I cannot export my

Installing GMP on Windows with cygwin

瘦欲@ 提交于 2019-12-30 05:24:08
问题 I am new to C++ and I have to handle large integers, so I have to install GMP through Cygwin. Any documentation I can find on installing this already assumes that you know what you are talking about, and I really don't. Anyway, I got the right .tar or whatever, extracted it properly, and now any website I see says to run ./configure --prefix=${gmp_install} ... What in the world is gmp_install ? And what directory do I run configure from? Huh? I can run it from my little Cygwin terminal, but

Bumping version numbers for new releases in associated files (documentation)

情到浓时终转凉″ 提交于 2019-12-30 03:15:27
问题 I would be interested to in knowing how you out there handle the bumping the version number for new releases issue. How do you handle the version number in associated files like man pages, etc. The software is build with the gnu tool chain so autoconf, automake, etc are available and used for the version number of the application. So that information can be reused. git is used as a vcs. One possibility would be introduce an extra, new target in Makefile.am that does a sed/awk to replace

Cross-compile Autotools-based Libraries for Official iPhone SDK

本小妞迷上赌 提交于 2019-12-29 15:01:12
问题 Background I am writing a program that targets several different phones, including the iPhone. The program depends on several thirdparty libraries. I am having difficulty cross-compiling these thirdparty libraries for the iPhone and iPhone simulator. The libraries include the Apache Portable Runtime and GNUTLS, as well as their dependencies. I would like the built libraries to end up in the prefixes "/opt/iphone-3.1", "/opt/iphone-3.0", "/opt/iphone-2.2.1", "/opt/iphone-simulator-3.1", and "

Which files generated by Autotools should I keep in version control repository?

允我心安 提交于 2019-12-29 10:14:10
问题 I am new to autotools and I am working on a C project. I want to add my project to a git repository. Which files generated by the autotools I need to track in my version control system and which should be ignored? 回答1: You should not keep any files under version control that are not hand-edited. That means any generated file should be ignored by the version control system. I basically put only the following under version control: configure.ac Makefile.am the documentation files such as

GNU autotools: Debug/Release targets?

霸气de小男生 提交于 2019-12-29 02:21:47
问题 I've been looking for this for a while: I'm currently converting a medium-size program to autotools, coming from an Eclipse-based method (with makefiles) I'm always used to having a "debug" build, with all debug symbols and no optimizations, and a "release" build, without debug symbols and best optimizations. Now I'm trying to replicate this in some way with autotools, so I can (perhaps) do something like: ./configure make debug Which would have all debug symbols and no optimizations, and

Why do shell script comparisons often use x$VAR = xyes?

蓝咒 提交于 2019-12-27 10:52:22
问题 I see this often in the build scripts of projects that use autotools (autoconf, automake). When somebody wants to check the value of a shell variable, they frequently use this idiom: if test "x$SHELL_VAR" = "xyes"; then ... What is the advantage to this over simply checking the value like this: if test $SHELL_VAR = "yes"; then ... I figure there must be some reason that I see this so often, but I can't figure out what it is. 回答1: If you're using a shell that does simple substitution and the