logo  xindy
A Flexible Indexing System Powered by sourceforge.net
  About | Documentation | Download | Community  
 
About xindy
Features
Documentation
FAQ
Open Issues
Download
   » Binary Distribution
   » Sources
   » Download Area
   » CVS
Mailing List
SourceForge Project
 
 
 
xindy Build Process
by Roger Kehr
 

Overview

xindy is implemented in CLISP, a Common Lisp implementation that is quite portable and runs on various platforms including Windows32 (i.e. Win95, Win98 and Win NT).

The core Lisp system has been extended by the GNU Rx regular expression library.

Additionally is has been extended with around 500 lines of C-code. The additional parts are only necessary if one uses the keyword-mapping features of xindy, which is one of the central parts of the system. But it should be usable without these features, too.

CLISP is available under the GNU General Public License. An additional requirement is that the CLISP version implements a FFI (foreign function interface) for the target platform.

The GNU rx library is needed to implement the keyword mappings.

Porting xindy to your system

Compiling CLISP

  • Obtain the following files from the CLISP distribution:
      source/clispsrc.tar.gz
      source/clispsrc-readline.tar.gz
    
  • As a first step the CLISP system must be compiled on the target platform. To do this, you need about 48 MB of disk space otherwise you will fail miserably (on a Sparc, SunOS-4.1.1) [Sorry Walter, wasn't aware that this would be a problem].

    The CLISP distribution has improved in the last year and it should be easy to run configure and make on it without any problems. Nonetheless we should check on which platforms CLISP will compile without any problems with the FFI (foreign function interface).

    Choose a directory, then cd to this directory and unpack the two clisp-source archives there. Change directory to the clisp-source directory.

    If you are on a UNIX platform use the following switches for the ./configure script:

      ./configure --with-dynamic-ffi --with-readline

    Consult the CLISP documentation to find out how to build CLISP on operating systems other than UNIX. Make sure you invoke makemake, which creates the CLISP Makefile, with the --with-dynamic-ffi option:

      $CLISP_SRC/src $ ./makemake --with-dynamic-ffi --with-readline >Makefile
    

    The best results on many platforms can be achieved with the GNU gcc compiler. The documentation included with CLISP contains many hints about compiling and getting CLISP up and running.

    The systems should be kept in a linkable form. If you do a `make clean' you must rebuild the CLISP-system from scratch (takes only a few hours on a Sparc-1 ;-( ).

    There is a mailing list on CLISP that also discusses problems with CLISP ports. The address of this list found in of the CLISP documentation. This mailing-list is archived and sometimes problems have already been reported, thus checking this archive is always a good idea if you do encounter a problem.

    If CLISP complains that it can't find the X11 library, just unset the variable X_LIBS = # in the CLISP Makefile. This prevents to search for the X11 libs which are not necessary to build clisp.

  • After you have successfully made CLISP, run the testsuite with the command make testsuite.

  • Do an additional

      make lisp.a

  • Then take the file modules.h from the source and copy this file to the current directory after saving the original modules.h to modules.h.dist:

      mv modules.h modules.h.dist
      cp $TOP/clisp/arch/modules.h .
      rm modules.o; make modules.o
    

    Basically, this compiles the object file modules.o that we need later to link the CLISP with the foreign libraries.

  • The directory in which CLISP is unpacked (usually something like clisp-YYYY-MM-DD) will be called $CLISP_SRC.

Compiling GNU Rx

  • Just compile GNU Rx on the target platform and run the testsuite:

      configure
      make
    
  • The directory where Rx is unpacked (usually something like rx-x.y) will be called $RX_SRC.

Putting it all together

  • Get the current xindy source.

      cd xindy/rx
  • Set the link to the Rx library (the directory where librx.a is located) appropriately. Usually this will be

      rm -f rx
      ln -s $RX_SRC/rx
    

    On Windows and OS/2 which have no symbolic links we must move the rx/ directory over there instead.

  • Create a symbolic link to the clisp.h file in the source directory of the CLISP distribution:

      rm -f clisp.h
      ln -s $CLISP_SRC/src/clisp.h clisp.h
    
  • Type `make' and cross your fingers :) If you haven't installed a CLISP just say

     make CLISP="$CLISP_SRC/src/lisp.run -M $CLISP_SRC/src/lispinit.mem"
    

    instead. This invokes CLISP directly.

    Now you have compiled the C extensions (keyword mapping module) that will later be incorporated into the core CLISP. Actually this is the hardest part, and probably the clisp.h-files directory has to be adjusted for new platforms.

  • Now enter the directory

      cd $TOP/clisp/arch/ARCH

    If you like you can rename ARCH to the name of the platform that you are just about to port to. But it doesn't matter much.

  • Just say

      make

    This does now several things:

    • It sets up several symbolic links.

    • It copies various files from the CLISP distribution such as libraries and other files to that directory. Other files such as librx are also copied there. You can remove these files with make realclean if you need.
      Be sure that you have made the files lisp.a and modules.o as described above. The reason, why these files are copied is just that you can keep these files locally and remove the CLISP distribution if you want. To do this, you must remove the entry setup in the file Makefile.local.

    • Afterwards it links clisp (lisp.run), now with all the foreign libraries added.

    • Finally the Lisp system is dumped into the file clisp.mem.

    It may happen that you need to adjust Makefile.local to the needs of you platform.

  • Basically, you're done.

  • Now take one of the binary distributions (doesn't matter which one) and unpack it.

  • Choose a platform name for your distribution. Then do the following:

      cd ./binaries
      mv <old-platform> <platform>
      cd <platform>
      echo "<platform>" > PLATFORM
      cp $TOP/clisp/arch/ARCH/lisp.run  xindy.run
      cp $TOP/clisp/arch/ARCH/clisp.mem base.mem
    
  • Adjust the Makefile.platform appropriately. Please keep the entries for PERL unchanged.

  • Take a xindy source distribution and check if you newly built binary stuff works as expected. If so, do a make clean and create a new archive with

      gtar -czvf xindy-version-platform.tar.gz ./binaries
    

    and you're done! Congratulations!

 
« Download Source