Next: , Previous: Structure of a port, Up: Porting GNU lightning


3.2 Automatically recognizing the new platform

Before starting your port, you have to add the ability to recognize the new port during the configure process. You only have to run config.guess, which you'll find in the main distribution directory, and note down the first part of the output (up to the first dash).

Then, in the two files configure.in and lightning.m4, lookup the line

         case "$host_cpu" in

and, right after it, add the line:

         cpu-name)  cpu=file-suffix           ;;

where cpu-name is the cpu as output by config.guess, and file-suffix is the suffix that you are going to use for your files (see An overview of the porting process).

Now create empty files for your new port:

         touch lightning/asm-xxx.h
         touch lightning/fp-xxx.h
         touch lightning/core-xxx.h
         touch lightning/funcs-xxx.h

and run configure, which should create the symlinks that are needed by lightning.h. This is important because it will allow you to use gnu lightning (albeit in a limited way) for testing even before the port is completed.