106

This is my first time trying to compile and install anything on a linux machine. I got the latest version of https://github.com/processone/exmpp via git and read the instructions which state:

2. Build and install

Exmpp uses the Autotools. Therefore the process is quite common:

$ ./configure
$ make
$ sudo make install

after type ./configure I get the error

Cannot find install-sh, install.sh, or shtool in ac-aux

Google was of little to no help. Not sure at all what I'm supposed to do. Any help would be much appreciated

Josh Pinto
  • 8,089
Micah
  • 1,224

10 Answers10

156

I got it to create the configure script using the following tools:

libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure

I don't have all the dependencies so I can't test it right now, but this is generally how you would create a configure script from an ac file.

Evan Carroll
  • 7,703
sk29910
  • 2,368
57

Well, I tried sebastian_k's answer and it didn't work for me (./configure crashed midway through with an extremely weird error).

What did, however work for me was copying the instructions used in this build log I found

The short version(so you don't have to wade through it yourself) is:

$ autoreconf -vif
$ ./configure --prefix=/usr/lib/erlang/lib
$ make
$ sudo make install
entropy
  • 671
  • 5
  • 4
15

This question, and most of the other answers here, arise from a misunderstanding of how projects using the GNU Build System (a.k.a. Autotools) are distributed. In fact, in the case of the Erlang XMPP library mentioned by the OP, the misunderstanding appears to be on the part of the developers.

Obtaining the software the right way

If all you want to do is compile and install a project released with the GNU Autotools, then you should not check it out from the source control system. You should instead download the packaged source release provided by the developer. These normally take the form of tarballs distributed on the project's website. For projects that are hosted entirely on GitHub, Savannah, or some similar hosting service, these tarballs will usually be found behind some link labelled "Download" or "Releases". You untar the package and utter some variant of the standard ./configure && make && sudo make install incantation. That's all; you don't need to invoke any of the GNU Autotools, and don't even need to have the GNU Autotools installed on your system.

The reason that you, the user, don't need the GNU Autotools to compile an Autotools-packaged project is that the developer has already used the various Autotools programs to generate a "distribution tarball" that can be used to build the software on any Unix-like system. The distribution tarball contains a highly portable configure script that scans the build environment, checks for dependencies, and constructs a Makefile customized to your system.

So when do you need Autotools?

The only reason you should need to install and invoke the GNU Autotools yourself is if you want to do development work on a project built with Autotools. And even then, you probably won't need the Autotools unless you change the project's dependencies. In that case, you would indeed need to check out the original source, make appropriate changes to the Autotools-specific input files (configure.ac, Makefile.am, etc.), and run the Autotools on them to generate a new configure file. If you want to independently publish the revised package, then you would use the Makefile generated by Autotools to generate a new distribution tarball, and then publish that tarball somewhere online.

The problem is that some developers make their source repository publically available but neglect to publish their distribution tarballs (or make it difficult to find where they are published). For example, rather than publishing their distribution tarballs as GitHub Releases, the Erlang XMPP library's GitHub Releases are tarballs of the raw source repository. This makes it impossible to compile the project without the GNU Autotools, defeating the entire purpose of using Autotools in the first place.

TL;DR summary

The GNU Autotools are something that developers use to make portable source code packages for users. Users should download and compile from these source packages, not the original code from the source control system. If the developers don't provide these source packages, then they aren't using Autotools correctly, and should be gently slapped with a wet trout until they see the error of their ways.

9

Please do the following to fix this problem,

sudo apt-get install autogen libtool shtool

Then do the installation

sh autogen.sh --prefix=prefered_install_path
make 
make install 
Evan Carroll
  • 7,703
Ravi Hegde
  • 91
  • 1
  • 2
4

I've had this problem, and found it was due to the following line in configure.ac:

AC_CONFIG_AUX_DIR([build-aux])

The line wasn't bad per se, however it needed to be moved closer to the top of the configure.ac file.

3

When trying to compile GNU Octave from Mercurial repository, you may come across this problem. The fix is to run ./bootstrap while being in the root of the source tree.

Ruslan
  • 1,863
2

I had slightly different error:

configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."

It turns out configure couldn't find build-aux/install-sh. I linked it like so

ln -s build-aux/install-sh .

then it builds.

Hope that helps someone out there!

Barmaley
  • 409
1

sudo apt-get install automake autoconf

its works sucessfully

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407
0

After installing autogen package this error got resolved in wolfSSL build.

sudo apt-get install autogen libtool shtool
rashok
  • 389
0

I had a similar problem when i tried to ./configure a source code and got the same error as posted. Finally resolved my issues by entering the code:

sudo apt-get install autotools-dev