[Gambas-devel] How to pass objects and access their properties
Benoît Minisini
gambas at ...1...
Wed Feb 8 08:14:27 CET 2012
Le 06/02/2012 12:38, Randall Morgan a écrit :
> Hi Benoit,
>
> Thanks for the pointers. I have changed my files to include your
> suggestions. I changed the naming of my classes after spending a lot of
> time looking at the PDF component. I guess that's not the best example
> but does seem to deal with several of the issues I face in the gsl project.
>
> I do have another question. It turns out that not all of the gsl library
> is contained in the libgsl.so. For many functions there are other
> supporting libraries. I need to link to libgslcblas.so so how do I add
> this to the project? Is this something that need to be put into the
> Makefile.am in the source directory?
>
> Thanks,
>
> Randall
>
>
You have to modify 'configure.ac' and 'Makefile.am'.
If the libraries have their own pkg-config configuration, then you can
process the same way as in the gb.qt4 'configure.ac' file:
##----------------------------------------------------------------------
## GB_COMPONENT_PKG_CONFIG
## Component detection macro based on pkg-config
##
## $1 = Component key in lower case (ex: pgsql)
## $2 = Component key in upper case (ex: PGSQL)
## $3 = Component name (ex: PostgreSQL)
## $4 = Sub-directory name
## $5 = pkg-config module(s) name(s) with optional required version(s)
## $6 = Warning message (optional)
##
## => defines HAVE_*_COMPONENT (to know if you can compile the
## component)
## *_INC (for the compiler) and *_LIB / *_LDFLAGS (for the linker)
##-----------------------------------------------------------------------
GB_COMPONENT_PKG_CONFIG(
qt,
QT,
[QT4 toolkit],
[src],
QtCore ">= 4.5.0" QtGui Qt3Support QtSvg
)
If the libraries do not have pkg-config configuration, then you have to
process like gb.sdl:
##-----------------------------------------------------------------------
## GB_COMPONENT_SEARCH
## Component detection macro that uses GB_COMPONENT_PKG_CONFIG first,
## and then GB_COMPONENT.
##
## $1 = Component key in lower case (ex: postgresql)
## $2 = Component key in upper case (ex: POSTGRESQL)
## $3 = Component name (ex: PostgreSQL)
## $4 = Sub-directory name
## $5 = pkg-config module name (optional)
## $6 = How to get include path (must return it in gb_val)
## $7 = How to get library path (must return it in gb_val)
## $8 = Libraries
## $9 = Compiler flags (optional)
## $10 = Warning message (optional)
##
## => defines HAVE_*_COMPONENT (to know if you can compile the
## component)
## *_INC (for the compiler) and *_LIB (for the linker)
##-----------------------------------------------------------------------
GB_COMPONENT_SEARCH(
sdl,
SDL,
[SDL],
[src],
sdl "> 1.2.8" SDL_ttf glew xcursor,
[GB_FIND(GL/glew.h SDL_ttf.h X11/Xcursor/Xcursor.h, /usr /usr/local
`sdl-config --prefix`, include include/SDL)],
[GB_FIND(libSDL_ttf.$SHLIBEXT libGLEW.$SHLIBEXT
libXcursor.$SHLIBEXT, /usr /usr/local `sdl-config --prefix`, lib)],
[$X_LIBS -lSDL_ttf -lGLEW -lXcursor],
[$SDL_CFLAGS]
)
As you can see, it is more complex as you have to specify all
compilation flags explicitely.
Regards,
--
Benoît Minisini
More information about the Devel
mailing list