Build open source projects without configure script

Some open source projects don’t provide configure script. Take nio-tlsf as an example. You can see there are only Makefile.am and configure.ac. For projects like it, you need to run autoreconf to generate configure script:

$ autoreconf
aclocal: warning: couldn't open directory 'm4': No such file or directory
configure.ac:21: error: required file 'build-aux/compile' not found
configure.ac:21:   'automake --add-missing' can install 'compile'
configure.ac:22: error: required file 'build-aux/config.guess' not found
configure.ac:22:   'automake --add-missing' can install 'config.guess'
configure.ac:22: error: required file 'build-aux/config.sub' not found
configure.ac:22:   'automake --add-missing' can install 'config.sub'
configure.ac:15: error: required file 'build-aux/install-sh' not found
configure.ac:15:   'automake --add-missing' can install 'install-sh'
configure.ac:22: error: required file 'build-aux/ltmain.sh' not found
configure.ac:15: error: required file 'build-aux/missing' not found
configure.ac:15:   'automake --add-missing' can install 'missing'
Makefile.am: error: required file 'build-aux/depcomp' not found
Makefile.am:   'automake --add-missing' can install 'depcomp'
autoreconf: automake failed with exit status: 1

There are so many “... not found” errors, and “autoreconf --install” can fix them:

$ autoreconf --install
aclocal: warning: couldn't open directory 'm4': No such file or directory
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:21: installing 'build-aux/compile'
configure.ac:22: installing 'build-aux/config.guess'
configure.ac:22: installing 'build-aux/config.sub'
configure.ac:15: installing 'build-aux/install-sh'
configure.ac:15: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'

Now configure script is generated successfully, and you can build the whole project.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.