autotools

config.site for vendor libs on Fedora x86_64

淺唱寂寞╮ 提交于 2019-11-27 08:26:52
问题 I'm having trouble building a few Autotool-based libraries on Fedora 26, x86_64. The 64-bit Fedora puts third party and vendor libraries in /usr/local/lib64 . Ubuntu 17 uses /usr/local/lib so the same projects build OK. I've been using --libdir=/usr/local/lib64 but three libraries resist it. I lack a config.site for /usr/local so I am trying to add one. The Autoconf manual on Site Defaults is a tad bit confusing to me when it discusses usr/local 's config.site . It says: [discussion of /usr

How can I use Google Test with my project that builds via autotools?

吃可爱长大的小学妹 提交于 2019-11-27 05:33:35
问题 It seems like there are a few answers that kind-of, sort-of make sense, but that I don't know how to carry out. And I haven't found a comprehensive answer. The First Problem Google Test should not be an installed library, it should be built with the project. (See the FAQ.) As far as I can tell, this means the Google Test libraries are a dependency of my unit tests, and should be built when I run "make check" within my project for the first time. This should build Google Test libraries in some

How to learn the Joy of Autotools? [closed]

我们两清 提交于 2019-11-27 03:14:29
问题 So a couple years back I took some time to grok make , and it's paid off enormously. Writing little makefiles for building my projects and automating tasks is fun and productive. The downside is, of course, that my makefiles are overspecific, especially when it comes to platforms and library locations. So this is the point at which people tell me "autotools to the rescue!" And they certainly seem to do the trick when other people do them (I love downloading something and running configure &&

Autotools check for C++11

*爱你&永不变心* 提交于 2019-11-27 02:06:51
问题 I use AX_CXX_COMPILE_STDCXX_0X (can look on autoconf-archive) to check for c++11 capabilities of the compiler. It correctly determines that -std=c++0x required, but does not add it to CXXFLAGS . I took a look at the macro source and it actually checks but then restores previous flags. What should I do to get CXXFLAGS set to be able to compile c++11 source? Just adding -std=c++0x to AM_CXXFLAGS is not nice solution, because I'd like to put the burden of making the compiler compile in C++11

PKG_CHECK_MODULES considered harmful?

こ雲淡風輕ζ 提交于 2019-11-27 01:43:32
Various developers discourage the usage of the PKG_CHECK_MODULES (for example, in this answer ) but there is no clear, comprehensive explanation of their reasons as far as I've looked for. So, I ask: Why would PKG_CHECK_MODULES be harmful? What are the alternatives? I, for one, used it for the first time today. I found it invaluably useful, specially for dealing with pretty intricate library sets, such as GTK+, where I have all these dependencies: -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr

Getting started with autotools

江枫思渺然 提交于 2019-11-26 22:30:28
问题 Anyone recommend how a person could get started with autotools in building a C project? 回答1: Follow the autotools tutorial. You can also get the autobook. Chapter 4 covers a minimal GNU autotools project. 回答2: Alexandre Duret-Lutz's tutorial is my resource of choice. There are also: Autotools: a practitioner's guide to Autoconf, Automake and Libtool Autotools Mythbuster To me, the autobook is not up to date anymore and more difficult to read. However it still contains interesting chapters

Autotools build fails due to subdir-objects option in AM_INIT_AUTOMAKE

谁说胖子不能爱 提交于 2019-11-26 21:53:33
问题 I'm currently working on a C++ project which relies on recursive automake for building. I want to build a shared library and the Makefile.am in the src directory of the library looks like # ... # Library name lib_LTLIBRARIES = libadapter-@MY_API_VERSION@.la # Sources libadapter_@MY_API_VERSION@_la_SOURCES = \ $(top_builddir)/src/sourceA.cpp \ $(top_builddir)/src/sourceB.cpp # ... Since version 1.14, automake issues a warning when the subdir-objects option is not specified in AM_INIT_AUTOMAKE

Build 32bit on 64 bit Linux using an automake configure script?

走远了吗. 提交于 2019-11-26 18:51:13
问题 I'm using a 64bit system but want a set of 32bit binaries. What options must I pass to a configure script to generate a 32bit/x86 makefile? 回答1: Passing the following argument to configure script allowed me to build the 32bit library on 64bit Linux ./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" 回答2: Jack's answer is incomplete. You need compiler/libc support for 32-bit compilation. In some distros like Ubuntu, what you need to do is install packages gcc

What are Makefile.am and Makefile.in?

偶尔善良 提交于 2019-11-26 18:41:57
问题 These two files are mostly seen in open source projects. What are they for, and how do they work? 回答1: Makefile.am is a programmer-defined file and is used by automake to generate the Makefile.in file (the .am stands for a uto m ake). The configure script typically seen in source tarballs will use the Makefile.in to generate a Makefile . The configure script itself is generated from a programmer-defined file named either configure.ac or configure.in (deprecated). I prefer .ac (for a uto c onf

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

送分小仙女□ 提交于 2019-11-26 15:12:52
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. If you're using a shell that does simple substitution and the SHELL_VAR variable does not exist (or is blank), then you need to watch out for the edge cases. The following