Error: AC_DEFINE() is not found to autoreconf --force --install - configure

Description:
I am doing Customization for tacacs+ server open source code. While packaging
i am tring to run configure to genrate Makefile.
Note: In open source tacacs+ tar is using autoconf 2.63 & on my build machine is having
2.67 autoconf version. Only this the env diff.
But get AC_DEFINE() undefined error as below:
d001:~/srcsvn/workspace_main_7.40_04102013_64bit/NMD2/64bit/os/usr.local/tacplus_merger/src/tacacs+-4.0.4.19.orig$ autoreconf --force --install
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `cfgaux'.
libtoolize: copying file `cfgaux/ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.in:45: error: possibly undefined macro: AC_DEFINE
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

Check the file configure.in in line 45 and above and scan for pkg-config calls.
Then check if you have it installed (just type pkg-config). If this fails, you are missing pkg-config. Apply your distros way of installing software (rpm, apt-get, pacman, bee) and install the missing pkg-config package.

This happens all too often when something unrelated to it is misquoting the usage of the macro.
While it does not help much without knowing what the configure.ac looks like, you should observe the lines around line 45, rather than on that line, to figure out what's going wrong. Sometimes it can be just a misplaced [] quote.

Related

Libtool Version mismatch error while building gcc

I am trying to add some files to GCC source code, but after running
autoreconf --install --force
i get that error
libtool: definition of this LT_INIT comes from libtool 2.2.7a.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6 Debian-2.4.6-14
libtool: and run autoconf again.
even without any source files added if i reconfigure i get the same error.
that's very important as i am adding new functionality to gcc
Using autoreconf --install --force instead of just autoreconf is a bit questionable in this case, but maybe it's for the best. I am surprised that it did not take care of aclocal.m4 for you automatically, but that's a generated file. If everything else is ok then you ought to be able to simply delete the current aclocal.m4 and run autoreconf to generate a new one.
If you have an autom4te.cache subdirectory then it would probably be best to delete that first (it will be regenerated by autoreconf, too).

automake needs makeinfo while texinfo needs aclocal

I am installing packages on a machine without internet access and want to install automake. But I get following error message:
WARNING: 'makeinfo' is missing on your system.
You should only need it if you modified a '.texi' file, or
any other file indirectly affecting the aspect of the manual.
You might want to install the Texinfo package:
<http://www.gnu.org/software/texinfo/>
The spurious makeinfo call might also be the consequence of
using a buggy 'make' (AIX, DU, IRIX), in which case you might
want to install GNU make:
http://www.gnu.org/software/make/
Therefore I try to make texinfo where I get following error:
WARNING: 'aclocal-1.16' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<https://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<https://www.gnu.org/software/autoconf>
<https://www.gnu.org/software/m4/>
<https://www.perl.org/>
Apparently both programs need each other, which I don't understand.
Help is appreciated a lot. Thanks!

Autoconf version error during Octave installation with Homebrew

I am trying to install Octave using Homebrew on MacBook Pro 10.6.8. Here is the installation log:
asz /usr/share/autoconf/autoconf > brew install octave
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading http://ftpmirror.gnu.org/octave/octave-3.6.4.tar.bz2
Already downloaded: /Library/Caches/Homebrew/octave-3.6.4.tar.bz2
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file configure.ac
Hunk #1 succeeded at 1605 (offset 2 lines).
==> autoreconf -ivf
configure.ac:45: error: Autoconf version 2.62 or higher is required
configure.ac:45: the top level
autom4te: /usr/bin/gm4 failed with exit status: 63
aclocal: /usr/bin/autom4te failed with exit status: 63
autoreconf: aclocal failed with exit status: 63
As you can see it complains about the version of autoconf being to low. However I did install the higher version of autoconf with brew
asz ~ > autoconf --version
autoconf (GNU Autoconf) 2.69
(...)
I did update my PATH to point to this new version of autoconf,
Old autoconf was in:
asz ~ > which autoconf
/usr/bin/autoconf
New one is in:
asz ~ > which autoconf
/usr/local/Cellar/autoconf/2.69/bin/autoconf
but Homebrew still does not see it (same error). While searching for solution I found this hint in response to similar problem quoting:
This is coming from the run of aclocal, which is part of automake.
aclocal does not call the autoconf binary, so the path that your
autoconf is in doesn't matter. It does look at m4 macros, though, and
I'm guessing it's finding autoconf macros out of /usr/share, which would
correspond to the system autoconf which would be 2.61 on osx Link to original post outside of Stackoverflow.
I don't understand what I should do with it.
Can you tell me how do I update these macros to point to the new autoconf?
Is there any other way to make autoconf work?
What additional information can I provide you to help diagnose problem?
just had your same problem. What I did was :
cd /usr/share
mv autconf autoconf.old
ln -s /usr/local/share/autoconf .
Now the problem is not the version anymore but some other variable :4/libtool.m4:827: _LT_LANG_DEFAULT_CONFIG is expanded from...
configure.ac:48: error: possibly undefined macro: AM_SILENT_RULES
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
will see what comes out of the next search phase

Autoreconf better way to find Boost::Date-time

I am trying to compile some code using autotools and am getting stuck when trying to include boost::date-time and boost::regex. I was given an configure.in file that defines that looks for boost::date-time this way
AC_CHECK_LIB(boost_date_time-gcc-mt, main, , [
AC_CHECK_LIB(boost_date_time-mt, main, , [
AC_CHECK_LIB(boost_date_time, main, , [
AC_MSG_ERROR("Linking against boost::date-time library failed.")])
])
])
which appears to be the standard way according to google. But when I run autoreconf:
$ autoreconf -f -s -i
libtoolize: putting auxiliary files in `.'.
libtoolize: linking file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
and ./configure:
$ CXXFLAGS="-g -w" ./configure --prefix=$INSTALL_PATH
...
checking for main in -lboost_date_time-gcc-mt... no
checking for main in -lboost_date_time-mt... no
checking for main in -lboost_date_time... no
configure: error: "Linking against boost::date-time library failed."
It cannot be found. I know they are there cause I compiled boost 1.53 from scratch. What could be an issue here?
Thanks a lot in advance.
There's an excellent boost.m4 macro. You can copy it into a top level ./m4 directory.
AC_CONFIG_MACRO_DIR([m4]) in configure.ac
ACLOCAL_AMFLAGS = -I m4 --install in the top-level Makefile.am
invoke aclocal with aclocal -I m4 --install
It's very easy to use the results in configure.ac, e.g., for Boost.Filesystem:
BOOST_REQUIRE([1.53], [ACTION-IF-NOT-FOUND])
AC_SUBST(BOOST_CPPFLAGS)
MY_PROJECT_CPPFLAGS+="$BOOST_CPPFLAGS"
BOOST_FILESYSTEM([mt])
AC_SUBST(BOOST_FILESYSTEM_LIBS)
AC_SUBST(BOOST_FILESYSTEM_LDFLAGS)
MY_PROJECT_LIBFLAGS+="$BOOST_FILESYSTEM_LDFLAGS $BOOST_FILESYSTEM_LIBS"
It will even add dependencies like Boost.System.
There are macros at the GNU Autoconf Archive for both boost::date-time and boost::regex. Perhaps they would be more suitable.
It cannot be found. I know they are there cause I compiled boost 1.53 from scratch. What could be an issue here?
You'll have to consult config.log to know that for sure. Since you are looking for the main functions in those libs (which aren't in those libs, but that's another issue), the AC_CHECK_LIB tests generate invalid C++ code, and that may be your problem.

configure: error: leptonica library missing (when building tesseract-ocr-3.01 on MinGW)

When running configure it fails with
checking for leptonica... yes
checking for pixCreate in -llept... no
configure: error: leptonica library missing
But I have leptonica 1.69 built (downloaded source and ran ./configure && make install)
Edit
I think configure: error: leptonica library missing is a bit misleading, please note that it first says checking for leptonica... yes, and then fails on checking for pixCreate in -llept... no. So maybe the problem is not that the library is missing, but something else.
I finally managed to make it compile, after reading this and this thread. The proper steps for were:
./autogen.sh
export LIBLEPT_HEADERSDIR=/local/include
./configure --with-extra-libraries=/local/lib
make install
for leptonica 1.69, lib renamed to .libs, so, parameters are
export LIBLEPT_HEADERSDIR=<your_path>/leptonica-1.69/src
./autogen.sh
./configure --prefix= --with-extra-libraries=<your_path>/leptonica-1.69/src/.libs
and so on
Maybe this could solve the issue:
export LIBLEPT_HEADERSDIR=/usr-or-other/local/include
I am working on redhat linux 7.2 . None of the solution worked for me I was getting following errors in config.log. Package lept was not found in the pkg-config search path.
Perhaps you should add the directory containing `lept.pc'
to the PKG_CONFIG_PATH environment variable PKG_CONFIG_PATH
configure script uses pkg-config utility to check for packages . It was not able to find lept package ( although i had installed leptonica seperately ) By setting PKG_CONFIG_PATH pointing to the directory where lept.pc is present , i was able to resolve the issue . export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
The FAQ addresses this issue and worked for me with tesseract 3.02.02 on Mac OSX 10.6.8.
Apart from the Leptonica library, png, jpeg, tiff libraries had to passed to the configure script with CXX and CPP flags.
To run configure as non-root -
1. LIBLEPT_HEADERSDIR=; export LIBLEPT_HEADERSDIR;
2. CXXFLAGS="-ltiff -lpng -ljpeg" CPPFLAGS="-ltiff -lpng -ljpeg" ./configure --prefix= --with-extra-libraries=
In my case, this issue was caused by a missing compiler. Searching config.log revealed the following:
./configure:17287: g++ -o conftest -I/Usr/local/include/leptonica -L/usr/local/lib conftest.cpp -llept >&5
./configure: line 2040: g++ command not found
Running apt-get install g++ solved the problem. There is an issue in the tesseract issue tracker about this.
In my case (for Ubuntu/Debian) I downloaded the latest leptonica version and the error was not fixed.
To fix it I removed the package "leptonica-dev" with sudo apt-get remove libleptonica-dev and then tesseract found the leptonica version installed from the source code.
Hope it helps!
The answer is going to be slightly different for everyone, depending on the state of your system.
At a high level, the pkg-config software needs to know that leptonica is installed. It searches paths for a .pc file that has the definition for the leptonica package. That file will be in different locations for different people.
You can find it using the Linux locate utility at the command line. locate lept.pc. (If you've done some recent installing/uninstalling, you may need to refresh the locate utilities database with the command updatedb.)
Whichever directory locate finds the file in, export PKG_CONFIG_PATH as that directory (export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig for example).
Then you can continue your configure/build.
i had a similar problem with trying to compile from source, but did not experience it with
apt-get to install tesseract
sudo apt-get install tesseract-ocr
export LIBLEPT_HEADERSDIR=$dir/letonica168/include
./autogen.sh
./configure --prefix=$anotherdir --with-extra-libraries=/$dir/letonica168/lib
make
make install

Resources