autoconf

Autoconf — including a static library (newbie)

这一生的挚爱 提交于 2019-12-03 05:28:32
I am trying to migrate my application from manual build to autoconf, which is working very nicely so far. But I have one static library that I can't figure out how to integrate. That library will NOT be located in the usual library locations - the location of the binary (.a file) and header (.h file) will be given as a configure argument. (Notably, even if I move the .a file to /usr/lib or anywhere else I can think of, it still won't work.) It is also not named traditionally (it does not start with "lib" or "l"). Manual compilation is working with these (directory is not predictable - this is

Howto add a link to a library in autoconf configure script / makefile

耗尽温柔 提交于 2019-12-03 05:19:17
I am an autotools newb and I have difficulties figuring out howto easily link a specific library into one of the configured targets. I have a source package that I want to build the usual way: ./configure && make && make install Unfortunately one of the cpps has a missing reference to another library. Compiling it by hand (adjusting the commandline) works. But I would rather "patch" the compile script. Where is the standard place to edit linking references? undefined reference to `boost::system::get_system_category() That is my error message btw. You need to add the relevant -l flag to AM

Any difference between configure.ac and configure.in, and Makefile.am and Makefile.in?

不羁的心 提交于 2019-12-03 04:14:24
问题 I have seen both in different things I have configured. What I the difference? Is it notable to use only one? Or does it not matter which one to use? 回答1: configure.ac and configure.in are two possible names for the master Autoconf source file, which is processed by autoconf to generate the configure shell script. configure.ac is preferred for new packages, configure.in is an older name which still works. (The .in suffix is now recommended to be used only for files which will be processed by

How to point autoconf/automake to non-standard packages

一个人想着一个人 提交于 2019-12-03 03:20:46
I'm trying to build ZooKeeper on a RedHat Linux box. (Exactly what ZooKeeper is is probably not important :-) When I follow the package instructions, I get: $ autoreconf -if aclocal:configure.ac:33: warning: macro `AM_PATH_CPPUNIT' not found in library aclocal:configure.ac:33: warning: macro `AM_PATH_CPPUNIT' not found in library configure.ac:33: error: possibly undefined macro: AM_PATH_CPPUNIT If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. autoreconf: /usr/bin/autoconf failed with exit status: 1 I can't install CPPPUNIT in the standard

./configure with a specified version of g++

老子叫甜甜 提交于 2019-12-03 02:37:54
How to tell to a 'configure' file to compile with a specified version of g++ ? Thanks. In a bash shell you can do something like this: CC=gcc-2.95 ./configure There will be similar techniques for other shells but I couldn't help you with the specifics. If your project is C++ the variable you need to define is CXX. 来源: https://stackoverflow.com/questions/2621019/configure-with-a-specified-version-of-g

How to include .m4 files in Autoconf?

霸气de小男生 提交于 2019-12-03 01:19:53
I have downloaded a macro from Autoconf Archive, and I want to use it. What do I have to put in my configure.ac file to make use this macro? You may want to add AC_CONFIG_MACRO_DIR to configure.ac to the directory where the macro is: AC_CONFIG_MACRO_DIR([path/to/macros]) You'll need to invoke the macro somewhere in this file also. and in Makefile.am you'll probably need to set up ACLOCAL_AMFLAGS (if you are using automake): ACLOCAL_AMFLAGS = -I path/to/macros Then invoke autoreconf -fvi and you should be set. I had this exact same question, and it was harder to find an answer than I thought.

autoconf/automake: conditional compilation based on presence of library?

假如想象 提交于 2019-12-03 00:44:29
I need to conditionally compile some code based on the presence of a library. Seems like this should be easy with autoconf/automake but I can't figure it out. For example, if there is a PNG library present, I want to include code to use it. My configure.ac has: AC_CHECK_LIB([png], [png_create_write_struct_2]) and my Makefile.am has: if USE_LIBPNG libdev_la_SOURCES += png.c endif (which adds png.c to the list of sources for libdev so it gets compiled). An automake conditional like USE_LIBPNG requires the conditional be defined in configure.ac, so i need: AM_CONDITIONAL([USE_LIBPNG], [test

Autoconf: How to get installation paths into config.h

旧城冷巷雨未停 提交于 2019-12-02 23:12:40
My program needs to load some files at run time, which will be installed into whatever folder is given to ./configure --datadir=/somewhere As my program needs to know where this folder is at run time, I need to #define a symbol somewhere so the C code can access the path as a string. I am currently doing this by modifying the compiler flags: AM_CPPFLAGS = -DDATA_PATH=\"$(pkgdatadir)\" However as the configure script already produces a config.h file with a bunch of other things in it, I would like to have the symbol appear in there instead. Is that possible? AC_DEFINE_UNQUOTED([DATA_PATH], ["

Incorrect @libdir@ when building *.pc using config.site?

半城伤御伤魂 提交于 2019-12-02 21:59:35
问题 I'm working on Fedora x86_64. It uses /lib64 , /usr/lib64 and friends. I have the following *.pc.in file: $ cat libcryptopp.pc.in prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ ... My config.site has the following. It was copied from Fedora's config.site at /usr/share/config.site . The copy was used because of config.site for vendor libs on Fedora x86_64. $ cat /usr/local/share/config.site ... # Note: This file includes also RHEL/Fedora fix for installing

Tips on how to deploy C++ code to work every where

若如初见. 提交于 2019-12-02 21:44:34
I'm not talking about making portable code. This is more a question of distribution. I have a medium-sized project. It has several dependencies on common libraries (eg openssl, zlib, etc). It compiles fine on my machine and now it's time to give it to the world. Essentially build engineering at its finest. I want to make installers for Windows, Linux, MacOSX, etc. I want to make a downloadable tar ball that will make the code work with a ./configure and a make (probably via autoconf). It would be icing on the cake to have a make option that would build the installers..maybe even cross-compile