How To Handle Two Versions of autoconf?

Have two versions of autoconf in your system? And you require both frequently? Learn how to handle the situation.

Vaibhav Gupta
Jun 13 · 4 min read

Although I mentioned Autoconf exclusively, but the same steps can be followed for any other program too. For example if you want to manage multiple versions of , , etc.

What is autoconf?

GNU Autoconf is a tool for producing configure scripts for building, installing and packaging software on computer systems where a Bourne shell is available. Autoconf is agnostic about the programming languages used, but it is often used for projects using C, C++, Fortran, Fortran 77, Erlang or Objective-C.

Wikipedia contributors. (2019, June 22). Autoconf. In Wikipedia, The Free Encyclopedia. Retrieved 19:20, June 26, 2019, from https://en.wikipedia.org/w/index.php?title=Autoconf&oldid=903003352


Hello Readers,

For my GSoC project, I need to port some codes in Newlib. As other good projects, Newlib also uses Autoconf tools for producing “Makefile.in” and various other useful scripts.

Newlib can be cloned from its git repository.

The situation is, inside its source tree, uses autoconf tools version 2.64.

Whereas uses .

As I mostly work on terminal, when I run command, it calls the 2.69 version.

Linux Environment Variable “$PATH”

Ever wondered whenever you run a program in a shell, how the shell is able to locate it and run it?

For example, the command, is present inside directory. How your shell identifies to pick this particular program from its specific location?

Well, it doesn’t. To get clear, open your terminal and run the command .

This the path variable of my Linux Environment: .

What happens when you run command?

Linux doesn’t know what is and where it is located. It does everything with the help of its environment variable .

The locations are written in priority order in variable. When you run command:

  • First it checks inside directory for any program with that name.
  • Then it checks inside directory.
  • Then it checks inside directory. Here it found a program name , hence it runs it.
  • As the program is found, it will never check the other mentioned paths.

Since the autoconf version 2.69 is stored inside , whenever I run it, it calls .

Download “autoconf 2.64” source and build it

As I needed autoconf 2.64 , I downloaded it from here. I downloaded the autoconf-2.64.tar.gz file and placed it inside directory.

Extract it.

Move inside extracted folder, and open the terminal in that directory. Run following commands:

You will find your compiled 2.64 version of autoconf tools inside folder.

Screenshot of my Terminal. Just for this blog, I placed the .tar.gz file in ~/Downloads directory, instead of /opt/ . I have already build it inside /opt directory, earlier.

Now the path of your autoconf tools version 2.64 is .

Adding it to the “$PATH”

Now, we know how works. So to run 2.64 version, we what we need to do is, we need to add the path to 2.64 version in the beginning of variable. Hence when we will call , it will first search inside directory, find the program and run it.

To do this, simply run:

Now run , you can see the output will be like: .

Hence the path to 2.64 version tools is prefixed to . Thus it gets the highest priority. Thus, when we will run any of the autoconf tools, it will run the 2.64 version.

(Note if you run instead of , the path will get suffixed, and it will get the least priority.).

Managing the versions.

As now we have figured out the way to run 2.64 version, whenever I need to run (2.64) version, I just run before it.

Screenshot of my Terminal

And when I need to run (2.69) version, I just run before it.

Screenshot of my Terminal.

Let’s get connected

For any queries, ping me on LinkedIn or Facebook.


Follow this Publication for more stories on this subject. If you find this blog helpful, please click the 👏 button and share to help others find it! Feel free to leave a comment 💬 below :).

My GSoC 2019 Journey

Open Source is an entirely different world. I see GSoC as a major step to become a part of it. Through this publication I will be sharing my GSoC journey to help other students who are aspiring for same. I operate under my pseudonym “VARoDeK”.

Vaibhav Gupta

Written by

He is a Curious Learner | Mentor | Teacher | Programmer | Developer | OS/Kernel Enthusiast | Avid-Reader | Blogger | Archer | Painter | Sketch-Artist.

My GSoC 2019 Journey

Open Source is an entirely different world. I see GSoC as a major step to become a part of it. Through this publication I will be sharing my GSoC journey to help other students who are aspiring for same. I operate under my pseudonym “VARoDeK”.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade