Hi,
I try to build DBusPlugin (www.squeaksource.com/dbus). Unfortunately, compiling the generated C file requires passing "$(pkg-config dbus-1 --cflags)" as additional compiler argument. How can I specify that?
Thanks
On 16 May 2012 16:53, Damien Cassou damien.cassou@gmail.com wrote:
Hi,
I try to build DBusPlugin (www.squeaksource.com/dbus). Unfortunately, compiling the generated C file requires passing "$(pkg-config dbus-1 --cflags)" as additional compiler argument. How can I specify that?
Hi, Damien. If you using CMakeVMMaker, you can do it by implementing
configure<XYZPlugin>: method in a CPlatformConfig (if this option is platform neutral) or in appropriate subclass for target platform.
For example see the implementation of configureFloatMathPlugin:
maker addDefinitions: '..somedefs...'.
is what you need.
But I am not sure what $(pkg-config dbus-1 --cflags) expression means. Looks like stuff between () is invoked by shell and output of it is used instead.
Of course you can force cmake to invoke any command you like.. i just don't remember how exactly.. And there is multiple ways.
See #configureFT2Plugin: , which invokes an external script. And see a generated file (it should be in build/FT2Plugin/CMakeLists.txt)
But i don't like that it takes flags from another package build flags (dbus). This means that such plugin will work only on your machine and nobody else(s), once your build flags is different to others. On your place, i would take this command output and put it literally into extra definitions. Like that, a plugin configuration will be not dependent from some 3rd-party stuff , and won't change randomly depending on system where it built.
Thanks
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
On 17.05.2012, at 01:11, Igor Stasenko wrote:
On 16 May 2012 16:53, Damien Cassou damien.cassou@gmail.com wrote:
Hi,
I try to build DBusPlugin (www.squeaksource.com/dbus). Unfortunately, compiling the generated C file requires passing "$(pkg-config dbus-1 --cflags)" as additional compiler argument. How can I specify that?
In the official sources, there is no such call. It builds DBusPlugin using CMake, and all that's needed is
PLUGIN_REQUIRE_PACKAGE (DBUS1 dbus-1)
which is in
http://squeakvm.org/svn/squeak/trunk/platforms/unix/plugins/DBusPlugin/confi...
After installing libdbus-1-dev (or whatever the dbus devel pkg on your distro is), building DBusPlugin works just fine.
That said, if you just want to build the DBusPlugin independently, then adding `pkg-config dbus-1 --cflags` to your command line should work fine. Pkg-config is just a program that outputs the needed compiler and linker options:
bert@ubuntu12-VirtualBox:~/squeak-svn/bld/DBusPlugin$ pkg-config dbus-1 --cflags -I/usr/include/dbus-1.0 -I/usr/lib/i386-linux-gnu/dbus-1.0/include
bert@ubuntu12-VirtualBox:~/squeak-svn/bld/DBusPlugin$ pkg-config dbus-1 --libs -ldbus-1 -lpthread -lrt
On 17.05.2012, at 01:11, Igor Stasenko wrote:
But I am not sure what $(pkg-config dbus-1 --cflags) expression means. Looks like stuff between () is invoked by shell and output of it is used instead. [...]
But i don't like that it takes flags from another package build flags (dbus). This means that such plugin will work only on your machine and nobody else(s), once your build flags is different to others.
In Linux, by definition, you are only compiling for your own machine.
Packages for use by others are built by the distro's package maintainers, and they will make sure that the version that comes with your system works.
On your place, i would take this command output and put it literally into extra definitions. Like that, a plugin configuration will be not dependent from some 3rd-party stuff , and won't change randomly depending on system where it built.
Unless you use the CMake built-in stuff, pkg-config is precisely the right thing to use (in particular for D-Bus, which is a freedesktop standard, just like pkg-config). It will make sure that this compiles and links correctly on your machine. By hard-coding its output you make it a lot harder for others to use the same source, because they will have to manually change the flags.
- Bert -
On Thu, May 17, 2012 at 1:41 PM, Bert Freudenberg bert@freudenbergs.de wrote:
In the official sources, there is no such call. It builds DBusPlugin using CMake, and all that's needed is
PLUGIN_REQUIRE_PACKAGE (DBUS1 dbus-1)
which is in
http://squeakvm.org/svn/squeak/trunk/platforms/unix/plugins/DBusPlugin/confi...
so, Bert, is there a way to specify necessary options inside the plugin Smalltalk class so that the correct files are generated by VMMaker and the compilation process works fine?
Thanks
On 17.05.2012, at 15:04, Damien Cassou wrote:
On Thu, May 17, 2012 at 1:41 PM, Bert Freudenberg bert@freudenbergs.de wrote:
In the official sources, there is no such call. It builds DBusPlugin using CMake, and all that's needed is
PLUGIN_REQUIRE_PACKAGE (DBUS1 dbus-1)
which is in
http://squeakvm.org/svn/squeak/trunk/platforms/unix/plugins/DBusPlugin/config.cmake
so, Bert, is there a way to specify necessary options inside the plugin Smalltalk class so that the correct files are generated by VMMaker and the compilation process works fine?
Platform-dependent code belongs in the platform/unix/ tree, not in VMMaker.
- Bert -
vm-dev@lists.squeakfoundation.org