Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

autoreconf command in Linux with examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

autoreconf is a Autotool which is used to create automatically buildable source code for Unix-like systems. Autotool is a common name for autoconf, automake, etc. These all together are termed as Autotools

Important Points: 


  • Provides Portability of source code packages by automatic buildable capability.
  • Provides common build facilities like make install.
  • Automatic dependency generation for C/C++.



autoreconf [OPTION]... [DIRECTORY]...



  • -h, –help : Print the help message and exit.
  • -V, –version : Used to show the version number, and then exit.
  • -v, –verbose : Verbosely report processing.
  • -d, –debug : Don’t remove temporary files.
  • -f, –force : This option is used to consider all files obsolete.
  • -i, –install : Copy missing auxiliary files.
  • –no-recursive : Don’t rebuild sub-packages.
  • -s, –symlink : With -i option it is used to install symbolic links instead of copies.
  • -m, –make : When applicable, re-run ./configure && make.

Note: Autotools are used to make automatically buildable source code for distribution purpose. 

Important Configuration Files: 


  • : Describes configuration for autoreconf.
  • : Describes sources of program files and compiler flags for automake.
    • Step 1: Make a directory and a C program file. 


  • Hello, World Program 


void main()
   printf("Hello, World");

  • Step 2: Make a file for autoreconf


# initialize the process
AC_INIT([hello], [0.01])
# make config headers
#Auxiliary files go here
# init automake
#configure and create "Makefile"
#find and probe C compiler

  • Step 3: Make a for automake


#list of programs to be installed in bin directory
bin_PROGRAMS = hello
#sources for targets
hello_SOURCES = hello.c

  • Step 4: Run the following commands on terminal. It will give an error because it is for distribution purpose and VCS(Version Control System) should have some standard license files. 



  • Step 5: Lets make license files. 


  • Step 6: Retry 



  • Step 6: Now, Let’s run the program. See, now Hello, World is printed on the screen 


My Personal Notes arrow_drop_up
Last Updated : 03 Jun, 2021
Like Article
Save Article
Similar Reads
Related Tutorials