Starting writing a component quickly :-) (Was: Re: [Gambas-user] Gambas and AX25)
Frank Berg
frankberg at ...390...
Sun Sep 5 22:15:19 CEST 2004
hi,
tnx, i was try this out include step 7.. i can see that the compiler try to
compile my ax25 component (only header).
there are none function written, so the compiler write me: ax25 is disabled.
the next step ist to write the ax25.c
and make the function "ax25_config_load_ports()" accessable..
the function returns an integer with an counter of avaibled ax25
kernal-ports
this function are ready and declared in the ax25libs, in the axconfig.h
file.
an ax25 tool like listen use this function so:
if (ax25_config_load_ports() == 0)
fprintf(stderr,"listen: no AX.25 port data configured\n");
i have includet it #include <axconfig.h> in the ax25.c
my question:
how must i implement this function in gambas so i maybe can ask
if gb_ax25_config_load_ports = 0 then print "listen: no AX.25 port data
configured"
frank
>
> 1) Make a copy of the './src/lib/sdl' 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 ./src/lib/xyz/Makefile.am file, and fills it as needed, as
> explained in the wiki documentation. You will get something like that:
>
> INCLUDES = -I$(top_srcdir)/src/share @XYZ_INC@
> EXTRA_DIST = *.component
>
> pkglib_LTLIBRARIES = lib.gb.xyz.la
>
> lib_gb_xyz_la_LIBADD = @XYZ_LIB@
> lib_gb_xyz_la_LDFLAGS = @LD_FLAGS@
>
> lib_gb_xyz_la_SOURCES = \
> main.h main.c \
> myFirstClass.h myFirstClass.c \
> mySecondClass.h mySecondClass.c \
> ...
>
> install-exec-local:
> @cp -f *.component $(pkglibdir)
>
>
> 4) Rename the './src/lib/xyz/lib.gb.sdl.component' file to
> 'lib.gb.xyz.component' and edit it. Be careful, this must be UTF-8
encoded.
>
> [Component]
> Key=gb.xyz
> Name=The xyz component
> Author=You
> Alpha=1
>
>
> 5) Edit the ./src/lib/Makefile.am file (one directory up) and change the
first
> line to add '@XYZ_DIR@'
>
> SUBDIRS = debug eval db compress @QT_DIR@ @NET_DIR@ @SDL_DIR@ @VB_DIR@
> @XYZ_DIR@
>
>
> 5) Edit the configure.in file in the package root, and add the following
> stuff:
>
> GB_COMPONENT(
> 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])
>
>
> 6) At the end of the configure.in file, change the AC_OUTPUT macro:
>
> dnl ---- Create makefiles
>
> AC_OUTPUT( \
> Makefile \
> src/Makefile \
> src/share/Makefile \
> src/comp/Makefile \
> src/exec/Makefile \
> src/lib/Makefile \
> ...
> src/lib/compress/Makefile \
> src/lib/compress/zlib/Makefile \
> src/lib/compress/bzlib2/Makefile \
> src/lib/xyz/Makefile \
> )
>
>
> 7) 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 :-)
>
>
> 8) To test the component, you must make three symbolic links from
> the ./src/lib/xyz directory to the gambas installation directory. As root,
of
> course:
>
> /usr/lib/gambas/lib.gb.xyz.component ---->
./src/lib/xyz/lib.gb.xyz.component
> /usr/lib/gambas/lib.gb.xyz.so ----> ./src/lib/xyz/.libs/lib.gb.xyz.so
> /usr/lib/gambas/lib.gb.xyz.la ----> ./src/lib/xyz/lib.gb.xyz.la
>
>
> That's all. Tell me if something goes wrong.
>
> If this how-to is useful, I will add it to the wiki.
>
> Regards,
>
> --
> Benoit Minisini
> mailto:gambas at ...1...
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
More information about the User
mailing list