Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
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 place. (Don't have root privileges, system team has a policy of "no deviations" from standard configuration.)

I've worked around the problem by commenting out the references to AM_PATH_CPPUNIT in my configure.ac file, but what I'd really like to do is to install CPPPUNIT in my personal directory and point to it, but I'm not making much progress in figuring out how to tell the autoconf/auotmake system to look for it in a non-standard place. Anybody have any hints on how to do that?

like image 737
Leonard Avatar asked Sep 15 '09 22:09

Leonard


People also ask

How do I set up autoconf?

To create a configure script with Autoconf, you need to write an Autoconf input file configure.ac (or configure.in ) and run autoconf on it. If you write your own feature tests to supplement those that come with Autoconf, you might also write files called aclocal. m4 and acsite. m4 .

How does autoconf work?

The way it works is that you create a configure.ac script in which you define various settings like release name, version, which compiler to use, and where it should output files. Once you've written your script, you run it through autoconf to create your final configure script.

What is Autotools configure?

Autotools configuration This file is used by autoconf to create the configure shell script that users run before building. The file must contain, at the very least, the AC_INIT and AC_OUTPUT M4 macros.

What is a configure AC file?

The configure.ac file is used to create the ./configure script. It consists of a series of macros which are processed and expanded by autoconf . These macros can check for packages and libraries, handle --enable and --with switches, and generate various files.


4 Answers

You want to set the environment variable ACLOCAL_PATH.

ACLOCAL_PATH="/home/YOU/path/to/share/aclocal" autoreconf -if

To figure out what directory you need to point ACLOCAL_PATH at, you'll have to find the directory that contains the .m4 file that defines AM_PATH_CPPUNIT.

like image 156
anthony Avatar answered Sep 30 '22 00:09

anthony


In my case, I got this error because of missing the package cppunit-devel. After install this package on my centos server by yum -y install cppunit-devel, everything work well.

like image 22
Cloude Lee Avatar answered Sep 27 '22 00:09

Cloude Lee


If the path variable cant be added to your profile, or environmen.. or what have you, you can you try to "export" the path prior to running the autoconf. This will set that option, at least for that session...

export ACLOCAL_PATH=/home/YOU/path/to/share/aclocal

Also, if push comes to shove, you can.. (This clears out your Makefiles of any non-working crap that the autoconf/configure commands left you with...)

make clean

And open up your "./configure" script, and it's little friends (anything named "configure.*").. in a text editor. Then, somewhat carefully "Find and Replace" the instances of whatever "Thing" is messing you up. Once you fix the directives iN the coNfigure scriptS, and run them again... with any luck your make files will work in your environment.

Note: This is what I do on my MAC, usually for compiling LINUX SW that is NOT tested or meant to run on a Mac. This may be the wrong way to do it, but when there's not a lot of options, sometimes you just have to get in there and muck with it.

like image 25
Alex Gray Avatar answered Sep 26 '22 00:09

Alex Gray


In case of multiple path, add them with : separator. Like:

export ACLOCAL_PATH="/usr/share/aclocal/:/usr/local/share/aclocal"
like image 32
Franck Kallaway Avatar answered Sep 28 '22 00:09

Franck Kallaway