So, let's suppose you want to write the gb.xyz component. This component:
1. Make a copy of the $ROOTsrclibsdl directory (with its contents) and name it gb.xyz .
2. Remove the sources files, but keep main.c and main.h. You will write your own main.c and main.h by modifying them.
3. Edit the $ROOTsrclibxyzMakefile.am file, and fills it as needed, as explained there.
You will get something like that:
INCLUDES = -I$(topsrcdir)srcshare @XYZINC@ EXTRADIST = .component
pkglibLTLIBRARIES = lib.gb.xyz.la
libgbxyzlaLIBADD = @XYZLIB@ libgbxyzlaLDFLAGS = @LDFLAGS@
libgbxyzlaSOURCES = main.h main.c myFirstClass.h myFirstClass.c mySecondClass.h mySecondClass.c ...
install-exec-local:
4. Rename the $ROOTsrclibxyzlib.gb.sdl.component file as lib.gb.xyz.component and edit it.
Be careful, this file must be UTF-8 encoded.
/component Keygb.xyz NameThe xyz component AuthorYou Alpha1
5. Edit the $ROOTsrclibMakefile.am file (located one directory up) and change the first line to add a reference to the newly created sub-directory.
SUBDIRS = debug eval db compress @QTDIR@ @NETDIR@ @SDLDIR@ @VBDIR@ @XYZDIR@
6. Edit the $ROOTconfigure.in file and add the following stuff:
...
GBCOMPONENT( xyz, XYZ, /xyz component, /gb_find(xyz.h, /usr/local /usr, include xyz*/include include/xyz*), /gb_find(libxyz.$shlibext, /usr/local /usr, lib xyz*/lib lib/xyz*), /$c_lib $thread_lib -lxyz, /$thread_inc)
...
7. At the end of the $ROOTconfigure.in file, change the ACOUTPUT macro:
...
dnl ---- Create makefiles
ACOUTPUT( Makefile srcMakefile srcshareMakefile srccompMakefile srcexecMakefile srclibMakefile ... srclibcompressMakefile srclibcompresszlibMakefile srclibcompressbzlib2Makefile srclibxyzMakefile )
8. Open a terminal, go to the package root directory, and type:
$ .reconf $ .configure ... $ make ...
Everything should compile... if you didn't make a mistake of course :-)
9. To test the component, you must make three symbolic links from the .srclibxyz directory to the gambas installation directory. As root, of course:
$ su ...
$ gbi -a ...
That's all. You should have a new component now :-)