Building and Installing the Ada Milter API ========================================== Requirements ------------ These instructions assume a Unix-like system with the GNAT tools and GNU Make. The makefiles may not work with other clones and forks of Make. Use GNU Make if possible; it is sometimes available as "gmake" on non-GNU systems. If you can't use Make you will need to manually preprocess some GNAT project files with Gnatprep. If you have another Ada compiler than GNAT, then the included build system will probably not work and you should do whatever that compiler requires you to do to compile the code. The project files require GPRbuild. Gnatmake won't do because this is a mixed- language library. Basic Installation ------------------ The simplest way to build and install the Ada Milter API is: 1: Go to the directory that contains this file and the makefiles, and run "make" to build the library. 2: Run "make install" to copy the files to the default locations. You will probably need root privileges if you install to the default locations. Testing ------- "make test_milter" will build a test milter that can be used to check that the library works. The testing is not automated. A Mail Transfer Agent will need to be configured to use the test milter, and some email messages will need to be sent through that MTA. Installation Directories ------------------------ By default the files are installed in directories under /usr/local. You can specify other locations by setting variables on the Make command line, or on the Gnatprep command line if you can't use Make. The following Make variables are relevant during the build: dirgpr The filename of the directories project, if your system has one and you want to install to the directories it specifies. A directories project is a GNAT project file that defines directory variables for use by other project files. Multiarch support requires a directories project that can refer to different directories depending on the target architecture. A directories project overrides the default values of some of the directory variables listed below, but if one of those variables is set explicitly, then it overrides the directories project. relocatable_package If relocatable_package is true and no directories project is provided, then the project file that will be installed with the library will be configured with relative pathnames so that the installed directory tree as a whole can be moved to another location in the filesystem without breaking the project file. Default: false prefix A prefix used in the default values of the directory variables listed below. Default: /usr/local exec_prefix A prefix used in the default locations for programs, binary libraries and other architecture-specific files. Default: bindir The directory for programs that can be run from a command prompt; may be provided by a directories project. Default: /bin datarootdir The root of the directory tree for read-only architecture-independent data files. Default: /share includedir The top-level directory for source files to be used in the compilation of software using libraries; may be provided by a directories project. Default: /include libdir The directory for binary libraries to be used by other software, and the top-level directory for other architecture-specific files; may be provided by a directories project. Default: /lib alidir The parent of the library-specific directory for Ada library information files for this library; may be provided by a directories project. Default: gprdir The directory for GNAT project files to be used in the building of software using libraries. If you set this to a directory that GPRbuild and Gnatmake don't search by default, then you will need to add it to the project search path when using this library, for example through the environment variable GPR_PROJECT_PATH. Default: /gpr If you want to install to a staging directory from which the files will later be copied to their final locations, then set DESTDIR to the staging directory. All the other directory variables shall be the final locations. Unlike the variables listed above, DESTDIR is effective in the installation step. The following preprocessor symbols are used when the project files are preprocessed. They are derived from the Make variables above when the makefiles invoke Gnatprep. You may need to define them if you run Gnatprep manually. Directories_GPR The filename of the directories project, if any; corresponding to dirgpr. Directories_Project The name of the directories project, if any. This is supposed to be the filename without a path or a suffix. Prefix Exec_Prefix Bindir Includedir Libdir Alidir These correspond to the like-named Make variables. The same defaults as above will be used if the symbols are undefined. Optional Thread Wrapper ----------------------- The Ada Milter API contains a thread wrapper. It wraps threads that Libmilter starts, and registers and unregisters them in the Ada run-time system. This may be necessary on some platforms and works around a memory leak in some versions of Libgnat, but can also trigger bugs in some older versions of Libgnat. The thread wrapper is disabled by default. To enable it, set the variable wrap_threads to "true" on the Make or Gnatprep command line. Build Tools and Options ----------------------- The following variables, which may be set in the environment or on the Make command line, control which programs are invoked to do the build and which options are passed to them: GNATPREP The command for invoking Gnatprep, in case you want to use a nondefault version of Gnatprep or a wrapper for example. Default: gnatprep GNAT_BUILDER The command for invoking the builder, that is GPRbuild. Default: gprbuild GNATPREPFLAGS A space-separated list of options to be passed to Gnatprep. GNATFLAGS A space-separated list with all of the optional parameters to be passed to the builder, including any options to be forwarded to the compiler, binder and linker. If GNATFLAGS is defined it overrides the options variables listed below. GNAT_BUILDER_FLAGS A space-separated list of options for the builder, used only if GNATFLAGS is undefined. This may include not only options for the builder itself but also command line separators (also called mode switches) followed by options to be forwarded to the compiler, binder or linker. ADAFLAGS A space-separated list of options to be passed to the compiler when compiling Ada code, used only if GNATFLAGS is undefined. CPPFLAGS A space-separated list of options to be passed to the C preprocessor when compiling C or C++ code, used only if GNATFLAGS is undefined. CFLAGS A space-separated list of options to be passed to the compiler when compiling C code, used only if GNATFLAGS is undefined. GNATBINDFLAGS A space-separated list of options to be passed to Gnatbind, used only if GNATFLAGS is undefined and only when binding the test milter. LDFLAGS A space-separated list of options to be passed to the linker, used only if GNATFLAGS is undefined and only when linking the test milter. Copyright of This File ---------------------- Copyright 2013 B. Persson, Bjorn@Rombobeorn.se This material is provided as is, with absolutely no warranty expressed or implied. Any use is at your own risk. Permission is hereby granted to use or copy this documentation file for any purpose, provided the above notices are retained on all copies. Permission to modify the text and to distribute modified text is granted, provided the above notices are retained, and a notice that the text was modified is included with the above copyright notice.