
This file explains how to separately compile a tool of lcrzoex.

If you want to compile lcrzoex, you're not reading the good file. Read 
../INSTALLUNIX_EN.TXT.

If you want to compile a small program with lcrzo, it's easier than 
what's explained here : read lcrzo-4.xx-src/doc/compilunix_en.txt.


To compile a file lcrzoex_000iii.c, there are two methods :
 - quick, but doesn't allow big changes
 - long, but everything can be rewritten
Tool number 170 is taken as example in both cases. 

--------------
QUICK METHOD :
 - go in the source directory :
     cd ../src
 - copy lcrzoex_000170.c to myprog.c
     cp lcrzoex_000170.c myprog.c
 - edit myprog.c in order to rename
     int lcrzoex_000170_main(int argc, char *argv[]);
   to
     int main(int argc, char *argv[]);
 - compile :
     gcc -Wall -ansi -o myprog myprog.c `lcrzo-config -lc` 
 - you can now modify myprog.c for your needs.

The drawback of this method is that the program compiles only within
source directory. If we want it to compile separately, the second
method has to be used.

-------------
LONG METHOD :
 - go in the working directory :
     cd /data/work
 - copy lcrzoex_000170.c to myprog.c
     cp /src/lcrzoex-4.xx-src/src/lcrzoex_000170.c myprog.c
 - edit myprog.c in order to rename
     int lcrzoex_000170_main(int argc, char *argv[]);
   to
     int main(int argc, char *argv[]);
 - copy lcrzoex.h and lcrzoex_defs.h in /data/work (note the file 
   lcrzoex_defs.h is created by ./genemake)
     cp /src/lcrzoex-4.xx-src/src/lcrzoex.h .
     cp /src/lcrzoex-4.xx-src/src/lcrzoex_defs.h .
 - create directory /data/work/shared
     mkdir /data/work/shared
 - copy shared/shared_*.h in /data/work/shared
     cp /src/lcrzoex-4.xx-src/src/shared/shared_*.h /data/work/shared
 - compile :
     gcc -Wall -ansi -o myprog myprog.c `lcrzo-config -lc` 
 - following errors appear :
     undefined reference to 'shared_lcrzoex_infos_print'
     undefined reference to 'shared_para_ipl_init_dst'
     undefined reference to 'shared_para_port_init_dst'
     undefined reference to 'shared_sock_pipe'
   They mean that myprog needs modules shared_lcrzoex
   shared_para and shared_sock.
 - copy shared_lcrzoex.c, shared_para.c and shared_sock.c in
   /data/work/shared :
     cp /src/lcrzoex-4.xx-src/src/shared/shared_lcrzoex.c /data/work/shared
     cp /src/lcrzoex-4.xx-src/src/shared/shared_para.c /data/work/shared
     cp /src/lcrzoex-4.xx-src/src/shared/shared_sock.c /data/work/shared
 - edit myprog.c to add inclusions for the three modules (right after
   the line #include "lcrzoex.h") :
     #include "shared/shared_lcrzoex.c"
     #include "shared/shared_para.c"
     #include "shared/shared_sock.c"
 - compile :
     gcc -Wall -ansi -o myprog myprog.c `lcrzo-config -lc` 
 - following errors appear :
     undefined reference to 'shared_misc_checkadmin'
     undefined reference to 'shared_misc_userstop3_printmsgtest'
     ...
   They mean that myprog also needs module shared_misc.
 - copy shared_misc.c in /data/work/shared :
     cp /src/lcrzoex-4.xx-src/src/shared/shared_misc.c /data/work/shared
 - edit myprog.c to add inclusion for shared_misc.c :
     #include "shared/shared_misc.c"
 - compile :
     gcc -Wall -ansi -o myprog myprog.c `lcrzo-config -lc` 
 - following errors appear :
     undefined reference to 'shared_md5_init'
     ...
   They mean that myprog also needs module shared_md5.
 - copy shared_md5.c in /data/work/shared :
     cp /src/lcrzoex-4.xx-src/src/shared/shared_md5.c /data/work/shared
 - edit myprog.c to add inclusion for shared_md5.c :
     #include "shared/shared_md5.c"
 - compile :
     gcc -Wall -ansi -o myprog myprog.c `lcrzo-config -lc` 
 - there are no more errors. Depending on tools, errors might be present
   at this step. In this case, just copy missing modules as we've just
   done.
 - execute program :
    ./myprog

Now, myprog.c compiles separately of lcrzoex sources. So, functions
can be easily modified to match one's needs.

