Installing m4 which requires autoconf - configure

I downloaded m4 from here. In the INSTALL it is said that I should first ./configure. But to do that, if I understood correctly, I need to generate configure via autoconf from configure.ac. I do not have autoconf so I downloaded it from here. The problem is that I need m4 to build autoconf. Seems like they depend on each other. How can I install m4?

In the INSTALL it is said that I should first ./configure
Yes.
But to do that, if I understood correctly, I need to generate configure via autoconf from configure.ac.
No, there's no need to do that. The configure you need is in the m4 tarball.
How can I install m4?
The old three step: ./configure ; make ; make install;

Related

autoconf: command not found

I'm trying to install ruby 2.8.0-dev through asdf with asdf install ruby 2.8.0-dev but I get the following error:
Cloning https://github.com/ruby/ruby.git...
Installing ruby-master...
BUILD FAILED (Ubuntu 20.04 using ruby-build 20200401)
Inspect or clean up the working tree at /tmp/ruby-build.20200523221649.37283.rxnWxu
Results logged to /tmp/ruby-build.20200523221649.37283.log
Last 10 log lines:
/tmp/ruby-build.20200523221649.37283.rxnWxu ~
Cloning into 'ruby-master'...
/tmp/ruby-build.20200523221649.37283.rxnWxu/ruby-master /tmp/ruby-build.20200523221649.37283.rxnWxu ~
/home/carlos/.asdf/plugins/ruby/ruby-build/bin/ruby-build: line 622: autoconf: command not found
I'm on Ubuntu 20.04
I've googled this but didn't found any useful info.
Best regards.
First, some general advice how you can solve this issue yourself, without having to come to [so] and waiting for someone else to solve your problem:
Computers are very good at searching. So, in 90% of cases, when a computer tells you that it couldn't find something, it is because that thing isn't there.
So, the first thing I would check, if I were in your situation, is whether the thing the computer tells me it can't find is actually there. In particular, I would check whether I have autoconf installed.
In the other 10% of cases, the thing the computer is looking for is there, but it is not somewhere the computer is looking. So, the second thing I would check is whether autoconf is in the $PATH.
Pretty much always, following those two steps solves the problem for me.
Now, on to your particular problem: when you want to compile some piece of software, you need the corresponding tools. Those tools include, but are not limited to, a compiler for the language the software is written in (in this case C), a build tool (in this case Make), the header files for all the libraries the software uses (in this case for example libyaml, zlib, OpenSSL), maybe some configuration tools (in this case autoconf). YARV also uses Bison to generate its parser.
Often, those required tools are listed in the developer or contributor documentation of the software. Although sometimes, it is just assumed that people who install software by compiling directly from source are clever enough to figure out which tools they need on their own. For YARV, there is documentation about the requirements for running the testsuite, which implicitly also requires building the code in the first place.
Debian-based Linux Distributions (Debian, Ubuntu, Mint, etc.) have a handy meta-package called build-essential that depends on some of the most important tools, e.g. gcc and make as well as the dpkg-dev metapackage (which in turn depend on lots of other packages).
The ASDF Ruby plugin actually uses ruby-build under the hood, and the documentation directly links to the system requirements, which list the following:
apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
I ran into a similar issue and this fixed it for me.
In short, run:
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6 libreadline6-dev zlib1g zlib1g-dev

How can I install libtoolize in cygwin?

When I'm trying to build Apache Thrift source in cygwin, I'm getting error saying "Couldn't find libtoolize!". How can I install libtoolize in cygwin?
You will need GNU M4 1.4.6 or later to install LibTool (which includes libtoolize).
Good news is that you can easily do it if you run the Cygwin installer (no worries, it will keep your Cygwin installation and add new packages if you select them). So all you need to do is to click on the following buttons:
GNU M4 installation
LibTool installation
'libtoolize' is a part of libtool. You can dowload latest version of libtool from http://ftp.gnu.org/gnu/libtool/, extract it, then run ./configure and make install from cygwin terminal.
Use this:
python -mpip get-install libtoolize

No usable M4 in $PATH or /usr5bin

As part of a long, sordid story whose end goal is simply to get GMP installed for use with code::blocks in Windows, I am trying to configure gmp. I do this with the following command:
./configure --prefix=${gmp_install}
Everything starts out well enough. After a few minutes and a bit of progress, everything grinds to a halt and I get this message:
configure: error: No usable M4 in $PATH or /usr5bin
I don't even know what M4 is, but I discover that it is some sort of macro processor. So I download it, and add the folder to my Path variable. Then I start the configure again, but same result.
Is there something that I need to do to M4 to get it working? I'm truly at a loss. Thanks for your help.
If you're using debian based OS, do sudo apt-get install m4. If internet isn't there or you have just the package of m4, copy it in /opt, configure it and later on change the $PATH value to the one you have now.
If you are using cygwin, the setup installer has a working package of m4. Then there's no need to download m4 or change $PATH.
I came up with your same problem, I solved it by running the Mingw package installer, and search for msys-m4 in the list, select all and then Apply Changes, it should let you ./configure just fine :)
Assuming you are on MSYS2 (You seem to have a sh), you can install m4 via pacman -S m4.
Be careful that if you run configure through a shell, that you don't pick WSL's bash accidentally (which is in %System32%/bash.exe). Which is what happened in our build system...

Installing glib in non-standard prefix fails

I'm trying to install glib in a non-standard prefix but I get the following when running make install:
/bin/sh ../libtool --mode=install /usr/bin/install -c libgthread-2.0.la '/root/build/lib'
libtool: install: error: cannot install `libgthread-2.0.la' to a directory not ending in /usr/local/lib
Any reason why I have to install gthread only in a prefix ending with /usr/local/lib?
I also just stumbled over that problem when compiling MonetDB on my Linux machine. Here is the solution/workaround that worked for me: Always make clean after ./configure.
In your example you should be able to do:
./configure --prefix=/root/build && make clean && make && make install
I found the solution in a discussion on an apache httpd bug where Joe Orton shares his knowledge:
A "make clean" is usually necessary after re-running "configure".
Using:
make clean
make distclean
Works for me.
The install path of a library can usually be customized rather than the default one under somewhere /usr/local/.
For some libraries, you should specify it with ./configure like this:
./configure --prefix=/the/new/install/path
make
make install
Others allow you to specify it when make install:
./configure
make
make install prefix=/the/new/install/path
You can try both. At least one should resolve your issue.

Install gcc-c++ on CentOS without yum

Can I install gcc++ on CentOS 6.x without `yum install gcc-c++ ....' ?
Is there any .tar or .rpm package available for download?
Yum will install rpm from it's repository.
So I don't understand why you want to avoid yum, it will solve dependencies and install them as well.
However, here is official RPM repository mirror (one of many):
http://centos.arminco.com/5/os/i386/CentOS/
Here is list of all mirrors : http://www.centos.org/modules/tinycontent/index.php?id=30
You will need at least 3 RPMs:
gcc-4.4.6-3.el6.i686.rpm
gcc-c++-4.4.6-3.el6.i686.rpm
libgcc-4.4.6-3.el6.i686.rpm
For compilation of C/C++ you will also need libstdc++, glibc, etc
When you run
yum install gcc
Everything is done
As you did not specified architecture I assume i386, but URL is very similar for x86_64:
http://centos.arminco.com/6/os/x86_64/Packages/
If you want to install it as a local user (or as a superuser)
GNU GSRC provides an easy way to do so
Link: http://www.gnu.org/software/gsrc/
After installation via bzr, simply do these:
./bootstrap
./configure --prefix=~/local
make -C gnu/gcc
(or make -C gnu/gcc MAKE_ARGS_PARALLEL="-jN" to speed up for a N-core system)
make -C gnu/gcc install

Resources