autoconf

How do I modify the install name of a .dylib at build time

末鹿安然 提交于 2019-11-29 04:31:41
I am building the google-gflags commandline flags library for C++ on Mac OS X (10.7.1). The build process is as such: $ ./configure --prefix=output $ make $ make install I'd like to change the install name of the generated shared library at build time and not use install_name_tool afterwards. By default, the install name of the generated shared library, libgflags.dylib , is the output path: $ otool -L ./output/libgflags.dylib $ ./output/libgflags.dylib: /tmp/gflags-1.5/output/lib/libgflags.0.dylib (compatibility version 2.0.0, current version 2.0.0) /usr/lib/libstdc++.6.dylib (compatibility

Read a version number from a file in configure.ac

杀马特。学长 韩版系。学妹 提交于 2019-11-29 02:50:55
问题 I define my project version number in a plain text file instead of configure.ac for some reasons. I would like to create a statement that would read the version number and store it during compilation time. Right now my configure.ac looks like this: AC_INIT([my program],[999.9.9]) I would like to have something like: AC_INIT([my program],[ $(cat VERSION) ]) This wont work of course. What is the trick here? (I know I am loosing some portability - I don't care at the moment). Thanks! 回答1: Try:

Confused about configure script and Makefile.in

人盡茶涼 提交于 2019-11-28 17:03:39
I'm currently learning how to use the autoconf / automake toolchain. I seem to have a general understanding of the workflow here - basically you have a configure.ac script which generates an executable configure file. The generated configure script is then executed by the end user to generate Makefile s, so the program can be built/installed. So the installation for a typical end-user is basically: ./configure make make install make clean Okay, now here's where I'm confused: As a developer, I've noticed that the auto-generated configure script sometimes won't run, and will error with: config

installed libtool but libtoolize not found

☆樱花仙子☆ 提交于 2019-11-28 16:28:45
问题 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

possibly undefined macro: AC_MSG_ERROR

ぐ巨炮叔叔 提交于 2019-11-28 15:42:31
问题 I have the following in configure.ac: AC_CHECK_PROGS(MAKE,$MAKE make gmake,error) if test "x$MAKE" = "xerror" ;then AC_MSG_ERROR([cannot find a make command]) fi This has been in our project for a long time, but in some set ups, I get this error: configure.ac:45: error: possibly undefined macro: AC_MSG_ERROR If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. The lines that were recently added above this: AC_CONFIG_MACRO_DIR([m4]) LT_INIT Can

GNU autotools: Debug/Release targets?

て烟熏妆下的殇ゞ 提交于 2019-11-28 15:11:30
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 where: ./configure make Would result in the "release" version (default) PS: I've read about the --enable

What is the best way to auto detect library dependencies in a C/C++ project?

两盒软妹~` 提交于 2019-11-28 10:16:02
问题 What is the best way to auto detect library dependencies in a C/C++ project? I have a project where I have all the dependencies on the machine. It builds and runs. Now I want to put together a autotools build system. I am looking for a good way to auto detect all the dependencies needed such as header files used and libraries needed for linking. The library bit seems to be the hardest for me to figure out. I'd like to be able to say, generate AC_CHECK_LIB commands for every function in a list

Autotools check for C++11

喜夏-厌秋 提交于 2019-11-28 08:11:57
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 mode on the autoconf developers, not me. What you're looking for has already been made as AX_CXX_COMPILE

Autotools build fails due to subdir-objects option in AM_INIT_AUTOMAKE

☆樱花仙子☆ 提交于 2019-11-28 01:20:29
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 in configure.ac . However, adding the subdir-objects option seems to break the build process with make

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

主宰稳场 提交于 2019-11-28 00:42:17
问题 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 回答1: 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