Adding libtool Support
Libtool handles the different ways of linking against libraries on different platform, especially shared libraries (if possible). Therefore it should be used, whenever an external library is used or whenever a project should build and install libraries. As this simple project so far does non of these, libtool is not necessary here. The next step will add gettext, so libtool might be usefull, as gettext has libraries to link against. But gettext allows the developer to compile the necessary functions directly into the project. So for gettext libtool is not a must. Lateron wxWindows libraries are used and then libtool support does make sence. As adding libtool is a small step often required, it is done here.The drawback should be mentioned as well: the size of the compressed source tarball increases by about 150kB, the number of checks 'configure' performs is much larger (which takes time) and the compilation itself takes more time.
Adding libtool support is quite easy: just run libtoolize.
# libtoolize Remember to add `AC_PROG_LIBTOOL' to `configure.ac'. Using `AC_PROG_RANLIB' is rendered obsolete by `AC_PROG_LIBTOOL' You should update your `aclocal.m4' by running aclocal. |
configure.ac |
... AM_INIT_AUTOMAKE |
# ln -s /usr/local/share/libtool/libltdl/acinclude.m4 acinclude.m4 |
Rebuilding the Project
Afterwards, a new 'configure' can be created. If all environment variables were correctly set during the creation of the current Makefile's (they should be correctly set now, too!), 'make' does the job. It will call all necessary auto tools, and run configure. It will not recompile, as the sources are not changed. To force a recompile, 'make clean' should be run first. # gmake cd . && aclocal19 ... cd . && automake19 --gnu cd . && autoconf259 /bin/sh ./config.status --recheck running /bin/sh ./configure --no-create --no-recursion checking for a BSD-compatible install... /usr/bin/install -c ... config.status: executing depfiles commands cd . && autoheader259 ... |
# cat config.h /* config.h. Generated by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 ... |
createFromCvs.freebsd |
#!/bin/sh libtoolize ln -s /usr/local/share/libtool/libltdl/acinclude.m4 acinclude.m4 ${ACLOCAL} ... |
createFromCvs.gentoo |
#!/bin/sh libtoolize ln -s /usr/share/libtool/libltdl/acinclude.m4 acinclude.m4 aclocal ... |
Next, the internationalization of a project is discussed.