autoconf

Autoconf -- including a static library (newbie)

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

CFLAGS vs CPPFLAGS

I understand that CFLAGS (or CXXFLAGS for C++) are for the compiler, whereas CPPFLAGS is used by the preprocessor. But I still don't understand the difference. I need to specify an include path for a header file that is included with #include -- because #include is a preprocessor directive, is the preprocessor (CPPFLAGS) the only thing...

What is ltmain.sh, and why does automake say it is missing? What is a good auto (make/conf/etc) generator?

I just want to develop a C app in linux with the auto(make/conf/...) stuff automatically generated. I tried generating it with ede and anjuta, but it doesn't seem to generate Makefile.am. So, I tried running automake, and it says "ltmain.sh" isn't found. Is there some easy to generate the basic build files for linux C/C++ apps. What is t...

Autoconf macros for Apache and conf.d install process?

I have a package that is using the autotools to build and install. Part of the package is a website that can be run on the local machine. So in the package there is a .conf file that is meant to be either copied or linked to the /etc/apache2/conf.d directory. What's the standard way that packages would do this? If possible, I'd like f...

configure.in: AM_DISABLE_SHARED doesn't change my Makefile

I'm extremely new to using Makefiles and autoconf. I'm using the Camellia image library and trying to statically link my code against their libraries. When I run "make" on the Camellia image library, I get libCamellia.a, .so, .la, and .so.0.0.0 files inside my /usr/local/lib directory. This is the command I use to compile my code with th...

C undefined reference to `some_foo'

Hello, I have 3 files in my gtk+ app: main.c: #include <gtk/gtk.h> #include <glib/gi18n.h> #include "mainwindow.h" int main(int argc, char** argv) { MainWin* win; GError* err = NULL; int a = 0; a = some_foo(); gtk_main(); return 0; } mainwindo.h #include <gtk/gtk.h> typedef struct _MainWin { Gtk...

How can I escape paths with spaces inside AC_CONFIG_SRCDIR

I need to include some paths in AC_CONFIG_SRCDIR which contain spaces. How should I escape them? For example, if I have "some file.in", how should I declare it in: AC_CONFIG_SRCDIR[some file] ...

How to use autoconf with C++0x features

What are the best practices for using autoconf in conjunction with shared_ptr and other TR1/BOOST C++0x templates so as to maximize portability and maintainability? With autoconf I can determine whether shared_ptr is available as std::tr1::shared_ptr and/or boost::shared_ptr. Given that the same feature has two different names, I have...

How to check Linux version with Autoconf?

My program requires at least Linux 2.6.26 (I use timerfd and some other Linux-specific features). I have an general idea how to write this macro but I don't have enough knowledge about writing test macros for Autoconf. Algorithm: Run "uname --release" and store output Parse output and subtract Linux version number (MAJOR.MINOR.MICRO)...

Why is autoconf ac_python_devel requiring libssl, libcrypto?

I am writing an autoconf script for a library that has some Python-based test programs. I am trying to add a conditional in the script that tests for Python devel stuff and turns these tests off or on. I'm trying to use autoconf archive's AC_PYTHON_DEVEL macro to test for python. I'm calling it like this: AC_PYTHON_DEVEL([>='2.3']) ...

How to create dependencies in automake?

Hello, I have a Makefile.am file right now that looks like this: lib_LIBRARIES = foo.a foo_a_SOURCES = bar.F90 baz.F90 When compiled, bar.F90 gives bar.o. However, bar.F90 depends on several other Fortran files (cat.F90, dog.F90, pig.F90). I want to set up Automake to rebuild bar.o if the source of one of these dependencies change. ...

Boost and Autoconf

I am making a project that uses Autoconf. I have the following in configure.ac: AC_CHECK_HEADERS([boost/foreach.hpp], [], [AC_MSG_ERROR(You need the Boost libraries.)]) When I run configure, it says it cannot find this header file: checking boost/foreach.hpp usability... no checking boost/foreach.hpp presence... no checking for b...

Default compiler flags with Autotools

I want to know how to set default compiler/linker/etc. flags if I use Autoconf/Automake combo. For example, the default compiler flag is "-O2 -g" if I don't set anything. I can just override it with something else, for example if I want to debug: ./configure 'CXXFLAGS=-O0 -g' But I find the default configuration stupid because if I e...

Linking to specific or greater library versions using GCC

I am trying to build the BlueZ bluetooth stack to run on an ARM powered GP2X wiz device. I am cross-compiling for the ARM device on a debian machine. I have built the complete stack and all its dependencies, (libusb0.12, dbus, glib-2.0, etc) but I run into issues when running them on the target, and it appears dbus doesn't want to play....

When converting to libtool automake and autoconf can't find libtool

I'm trying to convert libcsv to use libtool so I can use it on mac os x without mangling the makefile. When I try to run the makefile generated from the tools I get the following error: ~/software/libcsv (gnu_tools) $ make tag=CC --mode=compile gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"...

choosing autoconf and automake versions

Hello guys, I see there are many version of autoconf and automake available in my ubuntu linux. If I want create a new project from scratch, what's best choice, latest versions or older versions? ...

Porting shared library ELF projects in autoconf to OS X

How do I use autoconf macros to conditionally change values in a configure-script or Makefile it ouputs through AC_OUTPUT. The goal is to use AC_CANONICAL_TARGET, or some other way, to identify that I'm on OS X and then allow my Makefiles to adapt the LDFLAGS by removing -shared and replacing -soname with -dylib_install_name. So I ba...

automake ./configure soft-link issue

I have generated my autoconf/automake files for my project. So far eveything works fine when I issue the ./configure && make && make install, however, when I do ./configure on some other machine, I get configure: error: cannot find install-sh or install.sh in "." "./.." "./../.." If I ls -la on the source directory where I generated the...

Make install causes recompiles

I am writing a master makefile to compile and install multiple autoconf based libraries, which depend on each other. All works well for the first go. The issue is: if I am working on one of these libraries individually and do "make && make install" header files in the prefix folder are overwritten (even if they are untouched). This cause...

Find underlying compiler in configure

I have an application which is compiled using compiler wrappers such as h5fc/h5cc (the HDF5 compiler wrappers), or mpif90/mpicc (the MPI compiler wrappers). These are just wrappers, and it is possible using the -show argument to see the real underlying compiler, e.g. $ h5fc -show ifort -fPIC [...] -lz -lm $ mpif90 -show ifort [...] -lmp...