Simple project with library using old libtool automake and autoconf.
To understand autoconf properly one need to know that there are actually two source distributions:
- Maintainer source
- End user source
Maintainer is one who develops this project and is commiting new version to repository.
Maintainer needs to have installed additionally libtool
, autoconf
and automake
to
be capable to regenerate target script files (for example configure
script) from
templates (for example configure.in
).
End user is one who just wants to build binary in his Unix environment from source. End user need just to have installed C compiler and make tool.
Tested under:
-
scratchbox environment for ARM in following configuration:
sb-conf show warpcomm Compiler: arm-linux-cs2010q1-202 Devkits: autotools-legacy mtd python-legacy qemu svn git CPU-transparency: /scratchbox/devkits/qemu/bin/qemu-arm-sb
-
Debian 6.0.6/i386
- intentionally - to have good chance that it will work also under abovescratchbox
(which was confirmed) -
Debian 9.8/amd64
- to verify backward compatibility. NOTE: Please ignore warning:autoconf input should be named 'configure.ac', not 'configure.in'
This is our drawback because of full backward compatibility with old Linux versions.
Both end user and maintainer need to install basic development tools:
sudo apt-get install build-essential
Maintainer needs to additionally install:
sudo apt-get install libtool autoconf automake
Here are necessary steps to build from repository - like maintainer.
To prepare all build scripts from this source code issue:
libtoolize
aclocal
automake -a
autoconf
Or just run:
./maintainer-setup.sh
For end-user: download and extract helloac-1.0.tar.gz for example using:
mkdir ~/projects
cd ~/projects
wget https://github.com/hpaluch-pil/hello-ac/archive/helloac-1.0.tar.gz
tar xzf helloac-1.0.tar.gz
cd hello-ac-helloac-1.0
# and continue below:
These steps are used for both end user and maintainer:
Example:
./configure --prefix=/opt/helloac-1.0
make
sudo make install
Issue this command to create source distribution archive:
make dist
And distribute created helloac-1.0.tar.gz
archive.
The end user than just isse ./configure
and make
command
without need to install libtool
, autoconf
or automake
.
If you (as maintainer) modify any of configure.in
, Makefile.am
you should
run this command sequence to refresh generated files:
automake; aclocal; autoconf
To clean all files that are not needed in git repository you can use this command:
./maintainer-clean.sh
WARNING!
It will work only if there is Makefile
(that is the ./configure
script was already run before)
WARNING!
Libtool uses its own versioning system in form
current:revision:age
instead of common linker major:minor:patch
.
Please see for more information:
- http://blog.asleson.org/index.php/2014/07/08/libtool-library-versioning-version-info-currentrevisionage/
- https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info
- calculator: https://www.pakin.org/~scott/ltver.html
- Author's original guide written in late 90's in college