> <\body> structure of a package> Writing packages which compile on all platforms and can easily be maintained is a complex task. The philosophy is to be as standard and simple as possible, by using the following guidelines: <\enumerate> Systematically use /, even though these tools are very bureaucratic. Keep and the as straightforward as possible. Use a uniform organization for the directory structure. More precisely, the directory structure of a new package should be as follows: <\shell-code> foox \| configure.ac \| Makefile.am \| macros \| \| ac_prefix_config_h.m4 \| \| mmx_module.m4 \| \| >.m4 \| \| ... \| build \| \| Makefile.am \| include \| \| foox \| \| \| header_file1.hpp \| \| \| ... \| src \| \| src_file1.cpp \| \| ... \| glue \| \| glue_file1.cpp \| \| ... \| script \| \| foox-config.in \| bin\ \| \| ... \| test \| \| ... \| > Of course, there may be multiple >>: any external dependency of your package should come with a separate file. Similarly, you also have one >> for each type of functionality of your package. A configuration file should be created automatically using and . The file is very short and mainly refers to the main makefile . > The file should be modeled on the corresponding file of . In particular, you have to start with something like <\shell-code> AC_INIT([foox], [0.2.2], [bugs@mathemagix.org]) AC_CONFIG_AUX_DIR(.) AC_CONFIG_MACRO_DIR([macros]) AM_INIT_AUTOMAKE([nostdinc -Wall -Werror foreign]) AC_CONFIG_HEADER(foox/include/config.hpp) \; AC_PROG_CC AC_PROG_CXX AC_LANG_CPLUSPLUS AC_PROG_INSTALL ... and end with something like <\shell-code> AC_OUTPUT([ \ \ Makefile \ \ build/Makefile \ \ script/foox-config ],[chmod +x script/foox-config]) \; AC_PREFIX_CONFIG_H(FOOX, \ \ [include/foox/config.hpp], \ \ [include/foox-config.hpp]) The file defines a convenient macro . When calling this macro inside your , the following common options for packages will be supported. <\description> >Enable debugging (disabled by default). >Enable optimization (enabled by default). >Support exceptions for high level routines (enabled by default). >Enable security checks for low level routines (disabled by default). >Build the glue libraries for use with the interpreter (enabled by default). >Build suite of test programs (disabled by default). >Build suite of benchmark programs (disabled by default). >Activate the building of the documentation (disabled by default). Additional dependencies should all come with a corresponding file. For instance, tests for in the following way: <\shell-code> AC_WITH_GMP AC_LIB_GMP The macro provides an option to specify the install path for . The macro tests whether it is possible to execute some functionality of the library. Notice that the files of some of the packages provide similar macros , , etc. > Each package should come with a global which should be kept as straightforward as possible and the , which control how to build the package. Let us describe its content. First of all, all include files in should be put into the subdirectory of : <\shell-code> mmxincludedir = $(includedir)/mathemagix \; mmxinclude_HEADERS = \\ \ \ ../include/foox/>.hpp \\ \ \ ../include/foox/>.hpp \\ \ \ ../include/foox/>.hpp \\ \ \ ... One next has to specify the library <\shell-code> lib_LTLIBRARIES = libfoox.la and the corresponding sources to be built: <\shell-code> libfoox_la_CPPFLAGS = \\ \ \ -I../include \\ \ \ ... \\ \ \ @CPPFLAGS@ \; libfoox_la_SOURCES = \\ \ \ ../src/>.cpp \\ \ \ ../src/>.cpp \\ \ \ ... We also have to provide a configuration script and distribute it with our package: <\shell-code> EXTRA_DIST = \ \\ \ \ ../macros/ac_prefix_config_h.m4 \\\ \ \ ../macros/mmx_module.m4 \\ \ \ ... \ \\ \ \ ../specif/foox-autotools.mmx In order to produce a clean distribution of the package, you also have to add: <\shell-code> DISTCLEANFILES = ../include/foox-config.hpp In addition to the above required sources and targets, additional libraries and binaries may have to be built as a function of the configuration options , and . For instance, in order to build the library which has to be glued to the interpreter, one typically adds the following lines: <\shell-code> if GLUE_OPT \ \ mmxinclude_HEADERS += \\ \ \ ../include/foox/>.hpp \\ \ \ ../include/foox/>.hpp \\ \ \ ... \ \ \ \; \ \ lib_LTLIBRARIES += libmmxfoox.la \; \ \ libmmxbasix_la_CPPFLAGS = \\ \ \ \ \ -I../glue \\ \ \ \ \ ... \\ \ \ \ \ $(libfoox_la_CPPFLAGS) \; \ \ libmmxfoox_la_SOURCES = \\ \ \ \ \ ../glue/>.cpp \\ \ \ \ \ ../glue/>.cpp \\ \ \ \ \ ... endif For the other options, and as a more general rule, we recommend to mimick the code in the existing files . project> When your package is finished, according to the above guidelines, then we can include it in the main tree. Prior to this inclusion some modifications are necessary so that the above configuration and installation files could be maintained automatically by the script . . If you don't have this file, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.> <\initial> <\collection>