autoconf

Autotools : how to set global compilation flag

ε祈祈猫儿з 提交于 2019-11-30 06:25:35
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 adl You can do several things: (1) One solution is to include a common makefile fragment on all your Makefile.am s: include $(top

installed libtool but libtoolize not found

做~自己de王妃 提交于 2019-11-29 20:26:15
im trying to build libxml2 from source on my mac. so i have autoconf libtool and automake installed using mac ports autoconf and automake seem to be working fine as expected. i try running autogen.sh first. libtoolize --version unfortunately gives -bash: libtoolize: command not found i try running (again) sudo port install libtool ---> Cleaning libtool ---> Scanning binaries for linking errors: 100.0% ---> No broken files found. i try locate libtool and it seems to be installed fine /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool /Applications

GNU Autotools: rebuild without version info

对着背影说爱祢 提交于 2019-11-29 18:52:55
问题 I need to build a lib that is configured with autotools. The usual configure && make && make install steps produce versioned shared lib, something like libfoo.so.x.x Is it possible to modify configure.ac or Makefile.am (and of course follow up with autoreconf ) so that un-versioned lib is build. Thank you! 回答1: Yes, assuming that the library is built with libtool , you can remove the version information by adding the -avoid-version flag to the library's LDFLAGS. For example, if before there

How to add include and lib paths to configure/make cycle?

左心房为你撑大大i 提交于 2019-11-29 18:51:18
I need a place to install libraries in a linux box I have no su access to. I'm using ~/local[/bin,/lib,/include], but I don't know how can I tell ./configure to look for libraries there (particularly, I'm trying to compile emacs, which needs libgif, which doesn't come in my distro). I tried adding export PATH=$PATH:~/local/bin export LD_LIBRARY_PATH=~/local/lib export C_INCLUDE_PATH=~/local/include export CPLUS_INCLUDE_PATH=~/local/include to .bashrc but it doesn't seem to work. You want a config.site file. Try: $ mkdir -p ~/local/share $ cat << EOF > ~/local/share/config.site CPPFLAGS=-I$HOME

Injecting mercurial changeset as version information in a C executable

♀尐吖头ヾ 提交于 2019-11-29 08:23:13
问题 I would like the executables for a project I am working on to have the latest mercurial changeset recorded so that when a user complains about buggy behavior, I can track which version they are using. Some of my executables are Python and others are compiled C. Is there a way to automate this, or can you point me to projects that exhibit solutions that I can look at? I am using autoconf in my project... in case that makes the solution easier. Thanks! Setjmp 回答1: Add this to configure.ac : AM

mac下phpize编译提示Cannot find autoconf解决办法

こ雲淡風輕ζ 提交于 2019-11-29 07:28:37
在 mac 下 phpize编译扩展时,出现如下报错: /usr/bin/ phpize Configuring for: PHP Api Version: 20121113 Zend Module Api No: 20121212 Zend Extension Api No: 220121212 Cannot find autoconf . Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. 解决办法也简单,在终端中运行如下命令: $ brew install autoconf 如果 Homebrew 未安装,可先参考: Homebrew 套件管理器使 Mac OS X 更完美 $ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" 来源: oschina 链接: https://my.oschina.net/owenzhang24/blog/3134729

Why do conditionals in autoconf scripts prefix variables with “x”?

笑着哭i 提交于 2019-11-29 07:20:16
Why do conditional statements in autoconf scripts prefix their variables with "x"? For example, the macro provided by GNU to test for Boost has conditionals such as if test "x$want_boost" = "xyes"; then Why is this not defined as: if test "$want_boost" = "yes"; then In some early shells, testing for an empty string variable wasn't as easy as it is now, so the best alternative was to see if "x$variable" was equal to just "x". Also, since that's apparently using test , that's simpler than trying to properly quote/escape sequences like '$x != "y"' without losing sanity and/or portability. 来源:

How to generate a source file when building using autotools

时光总嘲笑我的痴心妄想 提交于 2019-11-29 06:34:37
With Make, I do something like generated.c: input.txt generator ./generator input.txt > generated.c How would I get equivalent functionality out of autotools? (removing generated.c on cleaning would also be a bonus). I'm assuming that input.txt is a source file that is distributed, that you do not want to distribute generated.c (i.e., it must be built by each user), and that generator is a program built by your package too. EXTRA_DIST = input.txt bin_PROGRAMS = prog noinst_PROGRAMS = generator # Source files for the generator generator_SOURCES = generator.c ... # Source files for prog prog

Automake generating binaries to bin/ instead of in src/

醉酒当歌 提交于 2019-11-29 05:12:35
问题 I searched for the answer to this question but couldn't find any good. Maybe they're old and something has changed, so I ask again. I have a directory structure as: my_project src bin I want that, when I do make in the root dir, the binaries are put in ./bin, instead of cluttering ./src. But how? EDIT: I am using C++. My Makefile.am has nothing special. Just the bin_PROGRAM and _SOURCES variables. When I run make, the binaries generated are put into ./src. I simply want them in ./bin. 回答1:

Cross-compile to static lib (libgcrypt) for use on iOS

血红的双手。 提交于 2019-11-29 04:33:21
I have downloaded latest libgcrypt & libgpg-error libraries from https://www.gnupg.org/download/index.html . I have successfully built (command line) both libraries using ./configure --enable-static --disable-shared; make ; make install on my Mac (Mavericks w/OSX 10.10 & latest Xcode 6.1). I can link just fine to these new libs from an OS X client app I am building. So far, so good. Just perfect. BUT, I also need to build an iOS client using same exact source code. Questions: 1) What are the modifications to the command line build sequence for the library I would need to build a universal