automake

Why would autoconf/automake project link against installed library instead of local development library?

I'm creating a library libgdata that has some tests and non-installed programs. I am running into the problem that once I've installed the library once, the programs seem to be linking to the installed version and not the local version in ../src/libgdata.la any longer. What could cause this? Am I doing something horribly wrong? Here is...

LTLIBRARIES: mv *.Tpo *.Plo, but the former doesn't exist and the latter already does.

I'm doing a pretty straight-forward conversion of an existing library (libtcod) to Autotools (for OS X happiness). Unfortunately, when I switch my Makefile.am's lib_LIBRARIES rule to lib_LTLIBRARIES, the build goes from successful to un. Excerpt from the output below: Making all in . make[1]: Nothing to be done for `all-am'. Making al...

Errors linking libresolv when building PHP 5.2.10 from source on OS X

To begin with, I would normally opt to use a pre-compiled binary of PHP, but am required to build from source for a specific business need. (I'm not the type that compiles open-source apps just for kicks.) I'm building on OS X 10.6 and am running into the following error when I try to make PHP 5.2.10 as an Apache module (--with-apxs2): ...

How do I get autotools to compile with the Intel compiler?

I want my code to compile with the Intel compiler(s) or with gcc/g++ depending on a configure argument. Is this possible? What do I need to put in my configure.ac and Makefile.am files to make this happen? ...

Calling SED for a source in Makefile.am

I've got c++ code that needs a sed done to it prior to compilation. How do I place this into Makefile.am? I tried the typical makefile setup and the target appears to not exist: gentest.cc: $(SED) -i "s|FIND|REPLACE|" gentest.cc If you are interested as to why I want to do this, it's because I wrote my program (slid...

Is it worth learning GNU Make?

I'm lately feeling the need to learn a build tool. I'm looking through StackOverflow for recommendations and Gnu Make gets barely mentioned. Instead I see Ant, Maven, CMake, Scon and many others. However, when I look at the little "rogue sources" (as in not-in-the-repo) that I sometimes have to compile, they all require the make && make ...

Directory structure for C++ library

I am working on a c++ library. Ultimately, I would like to make it publicly available for multiple platforms (linux/windows at least), along with some examples and python bindings. Work is progressing nicely, but at the moment the project is quite messy, built solely in and for VC++ and not multi platform at all. Therefore, I feel a cle...

How to point autoconf/automake to non-standard packages

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 conf...

libtool deleted by 'make distclean'

I've copied libtool into my program's source tree to distribute it with the program. But when I run 'make distclean' libtool is deleted with the rest of the rest of the generated files. How do I stop that from happening? I tried putting EXTRA_DIST = libtool in Makefile.am but that doesn't work. Here is basically what my configure.ac ...

Linking a PHP Extension Written in C

Edit: Revising My Question When building an external PHP module in C, how do I link shared objects? ...

How should I run a prebuilt Makefile from a Makefile.am?

How should I run a prebuilt Makefile from a Makefile.am? I am new to automake/autoconf build system. The package I am implementing autotools for has a couple libraries and test executables for each. Some of the libraries are auto-generated ASN1C code that come with prebuilt makefiles. I am not sure of the best way to say inside of the M...

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

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...

Should I use automake/autoconf for distribution of a small ansi C app?

I have a small ANSI C application which compiles cleanly under different tested compilers and platforms. It doesn't use any preprocessor switches or external dependencies and the makefile is simply something like: myapp: *.c gcc *.c -Wall -o myapp If I want to distribute this project in source form as portable as possible, should ...

How do you set the order of libraries in automake?

How do you set the order of libraries in automake? In my am file I have something like: myprog_DEPENDENCIES = adhoc-target myprog_SOURCES = myprog.c myprog_LDADD = libmine.la myprog_LFLAGS = -static -L/home/user/lib -ladhoc Now, when I compile I get this compile line similar too: gcc -static myprog-myprog.o -o myprog -L/home/user/li...

Debian dropped support for .la files; how do I build now?

Background I recently came across the fuppes UPnP media server and it seemed great. I installed it on my home server and started using it to stream video to my XBox. It worked really really well and I was happy with it. Then I upgraded my servers distribution and fuppes stopped working; I now know that it's because various libraries hav...

How do I stop automake from adding -I. to my compile line?

How do I stop automake from adding -I. to my compile line? It seems automake or libtool objects always have a compile command similar to: g++ -DHAVE_CONFIG_H -I. -I./proj/otherdir -o myprog.o myprog.c The problem is that I have two header files with the same name.... ./proj/otherdir/Header.h ./proj/thisdir/Header.h Each header has...

Portably include GLib headers in autoconf/automake

I need to include the GLib headers for a project that is built with an autoconf-based system for portability. How can I safely import the GLib headers in a portable manner? I know about pkg-config, but that is not entirely portable (since some systems don't have it and I would prefer to only rely on autoconf for configuration). ...

Header dependency in automake

I'd like to create a Makefile.am file which generates one header file mentioned in a xxx.c file. Let's say that xxx.c contains: #include <version.h> ... and that I have a rule to create it at the end of Makefile.am: version.h: echo '#define VERSION "'`hg id`'"' > version.h.tmp cmp version.h.tmp version.h || mv version....

Automake pattern expansion

I'd like to include many files in one Makefile.am file in the xxx_SOURCES = ... part. Is there any way to use a typical shell expansions there? What I'm looking for is a working equivalent for: xxx_SOURCES = xxx.c $(top_builddir)/src/{aaa,bbb,ccc}.c ...

Autoconf - Where does config.h go?

I'm writing my own unit testing library (using autoconf, automake, and libtool) to better fit my needs (I don't need a super large amount of features, just a test runner and assertions). I have gotten to the point where it seems to be usable. Of course, it uses a config.h to figure out what headers to include. The problem is that I am ...