comparison man/emodules.texi @ 2972:2b58b7fd831c

[xemacs-hg @ 2005-10-04 17:00:32 by stephent] Document build infra for modules distributed in core <871x31uslr.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Tue, 04 Oct 2005 17:00:33 +0000
parents beddd25fe24a
children 1094d6d400fb
comparison
equal deleted inserted replaced
2971:fb22a4eb2694 2972:2b58b7fd831c
122 module support documentation. 122 module support documentation.
123 @menu 123 @menu
124 * Introduction:: Introducing Emacs Modules 124 * Introduction:: Introducing Emacs Modules
125 * Anatomy of a Module:: Basic module layout and technology 125 * Anatomy of a Module:: Basic module layout and technology
126 * Using ellcc:: How to use the module compiler 126 * Using ellcc:: How to use the module compiler
127 * Distribution with XEmacs:: Adding your module to the distribution
127 * Defining Functions:: Creating new Lisp primitives 128 * Defining Functions:: Creating new Lisp primitives
128 * Defining Variables:: Creating new Lisp variables 129 * Defining Variables:: Creating new Lisp variables
129 * Index:: Concept Index 130 * Index:: Concept Index
130 131
131 --- The Detailed Node Listing --- 132 --- The Detailed Node Listing ---
495 clash. If you really need to share symbols between modules, create a 496 clash. If you really need to share symbols between modules, create a
496 shared library containing those symbols, and link your modules with 497 shared library containing those symbols, and link your modules with
497 that library. Otherwise, interactions between modules must take place 498 that library. Otherwise, interactions between modules must take place
498 via Lisp function calls and Lisp variables accesses. 499 via Lisp function calls and Lisp variables accesses.
499 500
500 @node Using ellcc, Defining Functions, Anatomy of a Module, Top 501 @node Using ellcc, Distribution with XEmacs, Anatomy of a Module, Top
501 @chapter Using @code{ellcc} 502 @chapter Using @code{ellcc}
502 @cindex @code{ellcc} 503 @cindex @code{ellcc}
503 @cindex module compiler 504 @cindex module compiler
504 505
505 Before discussing the anatomy of a module in greater detail, you should 506 Before discussing the anatomy of a module in greater detail, you should
820 @code{ellcc} will use the version that was compiled and installed with 821 @code{ellcc} will use the version that was compiled and installed with
821 @value{emacs}, but this option allows you to specify an alternative path. 822 @value{emacs}, but this option allows you to specify an alternative path.
822 Used during the compile phase of @value{emacs} itself. 823 Used during the compile phase of @value{emacs} itself.
823 @end table 824 @end table
824 825
825 @node Defining Functions, Defining Variables, Using ellcc, Top 826 @node Distribution with XEmacs, Defining Functions, Using ellcc, Top
827 @chapter Adding Modules to the XEmacs Distribution
828 @cindex XEmacs integration
829 @cindex integration, XEmacs
830 @cindex modules and configure.ac
831 @cindex configure.ac, modules and
832 @cindex modules and Makefiles
833 @cindex Makefiles, modules and
834
835 #### This section needs to be filled out.
836
837 @strong{Warning: The procedure described in the section is subject to
838 change, as it is very stylized and thus a good candidate for further
839 automation.}
840
841 Modules distributed with XEmacs are placed in the @file{modules}
842 subdirectory of the root of the source tree. Each module's code is
843 placed in a separate subdirectory. The build infrastructure for a
844 module consists of a @file{Makefile.in.in}, a @file{configure.ac}, and
845 @file{install-sh}. @file{install-sh} is a constant, and may simply be
846 copied from an existing module.
847
848 Most of the job of building a module is encapsulated in
849 @file{modules/common/Makefile.common} and in @file{ellcc}. The module's
850 @file{Makefile.in.in} normally needs only to define module name and
851 version information, and include @file{modules/common/Makefile.common}.
852 The @file{configure.ac} is very module-specific, and little can be said
853 about its contents. However, since no logic that depends on XEmacs
854 itself or other modules needs to be present, it is easier to write and
855 maintain than if it were contained in the XEmacs distribution's
856 @file{configure.ac}.
857
858 Modules can usually be trivially built in to the XEmacs binary. To make
859 this work, you need to duplicate the detection logic for any resources
860 the module requires in the top-level @file{configure.ac}. Since module
861 objects may be linked into modules or into @file{xemacs}, instead of
862 adding library path and library information directly to some
863 @file{@var{subsystem}_libs} variable, you should add them to a
864 @file{@var{module}_libs} variable, which in turn must be added to
865 @code{ld_libs_module} in the section ``Compute SUBST-itutable variables.''
866
867 Furthermore, in @file{src/Makefile.in.in} you add rules to build the
868 object without the module wrapper, and conditionalize these and the
869 addition of the object to @code{objs} on @code{HAVE_SHLIB}. The right
870 way to do this is somewhat indirect. Study the integration of LDAP and
871 PostgreSQL for the details.
872
873
874 @node Defining Functions, Defining Variables, Distribution with XEmacs, Top
826 @chapter Defining Functions 875 @chapter Defining Functions
827 @cindex defining functions 876 @cindex defining functions
828 877
829 One of the main reasons you would ever write a module is to 878 One of the main reasons you would ever write a module is to
830 provide one or more @dfn{functions} for the user or the editor to use. 879 provide one or more @dfn{functions} for the user or the editor to use.