autoconf

How to avoid redefining VERSION, PACKAGE, etc.

I haven't seen any questions relating to GNU autoconf/automake builds, but I'm hoping at least some of you out there are familiar with it. Here goes: I have a project (I'll call it myproject) that includes another project (vendor). The vendor project is a standalone project maintained by someone else. Including a project like this is...

Where to put helper-scripts with GNU autoconf/automake?

I'm working on a project that will be distributed with GNU autoconf/automake, and I have a set of bash scripts which call awk scripts. I would like the bash scripts to end up in the $PATH, but not the awk scripts. How should I insert these into the project? Should they be put in with other binaries? Also, is there a way to determine ...

autoconf using sh, I need SHELL=BASH, how do I force autoconf to use bash?

I'm running autoconf and configure sets SHELL to '/bin/sh'. This creates huge problems. How to force SHELL to be '/bin/bash' for autoconf? I'm trying to get this running on osx, it's working on linux. Linux is using SHELL=/bin/bash. osx defaults to /bin/sh. ...

Autoconf test for JNI include dir

I'm working on a configuration script for a JNI wrapper. One of the configuration parameters is the path to jni.h. What's a good quick-and-dirty Autoconf test for whether this parameter is set correctly for C++ compilation? You can assume you're running on Linux and g++ is available. Alternatively, is there a way to get javah (or a supp...

Autotools : how to set global compilation flag

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

Using rake with a non-ruby project

A workmate floated the idea of using rake as a build system for a non-ruby project. Is it possible to extend rake to compliment other languages where the autoconf toolset would usually be used? ...

Using AutoConf to Find Variably Named Files

I am writing my first project that will use autoconf and teaching it to myself as I go. For the most part, things are going extremely well. I have one last significant hurdle. I am having trouble locating library and header files that may be named differently from one system to the next. For example, I need to compile with Mozilla's Spi...

How to reconfigure a large program for GNU Autotools

I have a fairly large program written in C. It spans several files, and has a bit of retooling in order to attempt to compensate for platform issues. Specifically, I have header files for different OSes, architectures, and compilers that define macros that it uses to handle things. As an example, the -v flag prints version info, includin...

Library resolution with autoconf?

I'm building my first autoconf managed package. However I can't find any simple examples anywhere of how to specify a required library, and find that library where it might be in various different places. I've currently got: AC_CHECK_LIB(['event'], ['event_init']) but: It doesn't find the version installed in /opt/local/lib It doe...

Alternatives to autoconf / autotools?

I'm a very frequent user of the GNU autotools (mostly autoconf, occasionally libtool). I'm working on a project where portability is going to be a sticking point .. yet the rest of the team is just not comfortable working with M4. I got this in my inbox from not one, but four people: Anyway, perhaps someone could recommend something P...

Detecting 32 vs. 64-bit Intel CPU on Mac using Autoconf

I am developing an Autoconf script for a project which should run on Linux and Mac, 32- and 64-bit. On Linux, detecting 64-bit is easy: you get x86_64 instead of i386 for build_cpu. I can't figure out how to do it for the Mac: both 32- and 64-bit machines give i386 for the build_cpu. Is there a way to detect the difference using Autoconf...

Handling Deprecated Includes With Autoconf

I have been using ext::hash_map in a C++ project and notice that in g++ 4.3 it is deprecated in favor of unordered_map. I need to maintain compatibility with old systems that do not have unordered_map available. It occurs to me that this is just the sort of thing that could be handled by autoconf, which I am already using. I have been...

How do I pass through --program-prefix=PREFIX from configure to one of the child makefiles?

Autoconf has gotten me stumped. I have tried modifying the COMPILE in Makefile.in as follows COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -DFINALDIR=\"$(DESTDIR)$(bindir)\" but my use of FINALDIR is undefined. What is the proper way to do it? In my defense the...

Automake and files with the same name

I've a C++ autoconf managed project that I'm adapting to compile on FreeBSD hosts. The original system was Linux so I made one AM_CONDITIONAL to distinguish the host I'm building and separate the code into system specific files. configure.ac AC_CANONICAL_HOST AM_CONDITIONAL([IS_FREEBSD],false) case $host in *free*) ...

What is the normal way of dealing with non-standard library locations in an autoconf script?

I'm trying to use the GNU autoconf/automake toolchain for the first time, so the answer to my question might be trivial. The program needs OpenGL/GLUT where the headers and libraries are installed in a non standard location. I found these macros that should do all the checking for me. I'm simply calling it with *AX_CHECK_GLUT*. How do ...

On GNU/Linux systems, Where should I load application data from?

In this instance I'm using c with autoconf, but the question applies elsewhere. I have a glade xml file that is needed at runtime, and I have to tell the application where it is. I'm using autoconf to define a variable in my code that points to the "specified prefix directory"/app-name/glade. But that only begins to work once the applic...

Refactoring build system to use Autotools

Over the past couple of days I have been reading into using autotools to build my project instead of the Makefiles I have pieced together over the past couple of months. Unfortunately I have not found an example that gave me enough insight towards how my project structure is currently. I have three libraries that are included in the app...

Autoconf compilation of dependency before application

I have been tooling around with autotools for the past couple of days, and finally have made significant progress. One problem I am having is that I have two libraries that need to be compiled before the main application code. I'm not quite sure how to do this. My directory structure is below and a snippet from my configure.ac as well. ...

How to make configure script check the dependencies

Hi I generated a configure script with autoconf to build my project. It works fine unless I don't have some needed library installed. Make returns error when lacking some files, but it should be actually checked by the configure script i think? So my question is: How to modify an autoconf generated script to seek for dependencies and ...

Autotools library and object file output control

My goal is to have all object files built in a .objs directory instead of the root of the Makefile, and to have the binaries (and libraries) copied into the project's bin/ directory. But I have been unable to find any resources to explain how to do this. How would I go about doing this? Here is my configure.ac and src/Makefile.am - I ha...